:root {
    /* Light Theme Palette */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-main: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Glass Panel / Cards */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.panel:hover {
    box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background-color: #f1f5f9;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    font-size: 1.1rem;
}
.btn-icon:hover {
    background: #f1f5f9;
}
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* Typography */
h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #1e293b;
}

p {
    color: var(--text-muted);
}

/* Inputs */
.input-group {
    margin-bottom: 16px;
    position: relative;
}
.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}
.input-group input, .input-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Form Row */
.form-row {
    display: flex;
    gap: 15px;
}
.flex-1 { flex: 1; }

/* Radio Group */
.radio-group {
    display: flex;
    gap: 10px;
}
.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}
.radio-card input {
    position: absolute;
    opacity: 0;
}
.radio-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-weight: 500;
    color: var(--text-muted);
}
.radio-card input:checked + .card-content {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--primary);
    color: var(--primary);
}

/* Screens */
.screen {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.screen.active {
    display: flex;
    opacity: 1;
    height: 100vh;
}

/* Login Screen */
#loginScreen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}
.login-card {
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    background: white;
}
.login-card h2 { margin: 15px 0 5px; }
.login-card p { margin-bottom: 25px; }
.login-card .input-group i {
    position: absolute;
    left: 14px;
    top: 13px;
    color: var(--text-muted);
}
.login-card .input-group input {
    padding-left: 40px;
}
.logo-container {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

/* Dashboard Layout */
#dashboardScreen {
    background-color: var(--bg-main);
}
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}
.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}
.sidebar-nav {
    padding: 20px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
}
.nav-item.active {
    background: var(--primary);
    color: white;
}
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}
.content-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.content-section.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 1px;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    background: var(--bg-main);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background: #f8fafc;
}
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-primary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* File Drop Area */
.file-drop-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: #f8fafc;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: pointer;
}
.file-drop-area:hover {
    background: rgba(59, 130, 246, 0.02);
    border-color: var(--primary);
    color: var(--primary);
}
.file-drop-area i {
    font-size: 2rem;
    margin-bottom: 10px;
}
.file-drop-area input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    transform: translateY(20px);
    transition: transform 0.3s;
    box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal {
    transform: translateY(0);
}
.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}
.btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}
.btn-close:hover {
    color: var(--danger);
}
.modal-body {
    padding: 25px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: var(--text-main);
    color: white;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast.error {
    background: var(--danger);
}
.toast.success {
    background: var(--success);
}

/* Responsive */
@media (max-width: 768px) {
    #dashboardScreen {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
    }
    .main-content {
        padding: 20px;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .table-container {
        overflow-x: auto;
    }
    .form-row {
        flex-direction: column;
    }
}
