* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Login page */
.login-view {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 30px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

header h1 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 8px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
}

main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h2 {
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    border: 1px solid #dfe6ee;
    background: #ffffff;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    color: #2c3e50;
}

.tab-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Overlay card (reused for login page) */
.overlay-card {
    width: min(520px, 92vw);
    background: white;
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.muted {
    color: #7f8c8d;
    margin: 8px 0 16px 0;
}

/* Current Version */
.version-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.info-item label {
    display: block;
    font-size: 0.85em;
    color: #7f8c8d;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    font-size: 1.1em;
    color: #2c3e50;
    font-weight: 500;
}

/* Upload Section */
.upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #3498db;
    background: #e8f4f8;
}

.upload-area.dragover {
    border-color: #3498db;
    background: #d4e9f7;
    transform: scale(1.02);
}

.upload-area svg {
    color: #3498db;
    margin-bottom: 15px;
}

.upload-area p {
    margin: 8px 0;
    color: #2c3e50;
}

.upload-area .sub {
    color: #7f8c8d;
    font-size: 0.95em;
}

.upload-area .file-types {
    font-size: 0.85em;
    color: #95a5a6;
    margin-top: 15px;
}

/* Inputs */
.file-selected {
    padding: 15px;
    background: #e8f4f8;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Progress Bar */
.progress {
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    width: 0%;
    transition: width 0.3s;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Message */
.message {
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 30px;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-block;
}

.status.success {
    background: #d4edda;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.files-table th,
.files-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.files-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

.files-table tr:hover {
    background: #f8f9ff;
}

/* Modal Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    margin: 0;
}

.overlay.show {
    display: flex !important;
}

.overlay .overlay-card {
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10001;
    background: white;
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

/* Small buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.875em;
    white-space: nowrap;
}

/* Table action column */
.files-table td:last-child {
    white-space: nowrap;
    min-width: 150px;
}

.files-table td:last-child > div {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.files-table td:last-child .btn {
    margin: 0;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .card {
        padding: 20px;
    }

    .version-info {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
