/* ============================================================
   FaceID Davomat Tizimi - Asosiy Stillar
   ============================================================ */

:root {
    /* Ranglar palettasi */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-card: rgba(31, 41, 55, 0.6);
    --bg-card-hover: rgba(31, 41, 55, 0.8);
    
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #06b6d4;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    
    --border-color: rgba(99, 102, 241, 0.15);
    --border-hover: rgba(99, 102, 241, 0.35);
    
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

html, body {
    height: 100%;
    font-family: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animatsiyali fon */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* ============== KIRISH SAHIFASI ============== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-glow), var(--shadow-card);
    animation: cardSlideUp 0.6s ease-out;
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    margin-bottom: 16px;
    font-size: 36px;
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
    font-weight: 500;
    border: none;
    background: transparent;
    font-size: 14px;
}

.auth-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-full {
    width: 100%;
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.alert.show { display: block; animation: slideDown 0.3s ease; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #67e8f9;
}

/* ============== ASOSIY LAYOUT ============== */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.sidebar-logo h2 {
    font-size: 18px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    margin-bottom: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-faculty {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-content {
    padding: 32px 40px;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============== KARTOCHKALAR ============== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-hover);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Statistika kartochkalari */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
}

.stat-card:nth-child(2)::before { background: var(--gradient-success); }
.stat-card:nth-child(3)::before { background: var(--gradient-secondary); }
.stat-card:nth-child(4)::before { background: var(--gradient-danger); }

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
}

.stat-change {
    margin-top: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--accent-success); }
.stat-change.down { color: var(--accent-danger); }

/* ============== TABLITSALAR ============== */
.table-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(17, 24, 39, 0.5);
}

th {
    text-align: left;
    padding: 14px 20px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.badge-info {
    background: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.icon-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.icon-btn.danger:hover {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
}

/* ============== MODAL ============== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============== KAMERA / FACEID ============== */
.camera-section {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    margin-top: 0;
}

@media (max-width: 1100px) {
    .camera-section { grid-template-columns: 1fr; }
}

.camera-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.camera-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    overflow: hidden;
}

#videoElement {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#overlayCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform: scaleX(-1);
    pointer-events: none;
}

.camera-status {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-danger);
}

.status-dot.active {
    background: var(--accent-success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.1); }
}

.recognized-list {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.recognized-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    animation: slideIn 0.4s ease;
    border-left: 3px solid var(--accent-success);
}

.recognized-item.late {
    border-left-color: var(--accent-warning);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.recognized-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.recognized-info {
    flex: 1;
    min-width: 0;
}

.recognized-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recognized-time {
    font-size: 11px;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
}

/* ============== TALABA QO'SHISH / YUZ SKANER ============== */
.face-capture-area {
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 280px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    position: relative;
    border: 3px dashed var(--border-color);
}

.face-capture-area video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.face-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.capture-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ============== LOADING / SPINNER ============== */
.loader-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 16px;
}

.loader-overlay.show { display: flex; }

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============== REYTING ============== */
.ranking-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    border-left: 4px solid var(--accent-primary);
    transition: all 0.2s ease;
}

.ranking-card:hover {
    transform: translateX(4px);
    background: var(--bg-card-hover);
}

.ranking-card.top1 { border-left-color: #fbbf24; }
.ranking-card.top2 { border-left-color: #d1d5db; }
.ranking-card.top3 { border-left-color: #f97316; }
.ranking-card.danger { border-left-color: var(--accent-danger); }

.ranking-position {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-muted);
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.top1 .ranking-position { color: #fbbf24; }
.top2 .ranking-position { color: #d1d5db; }
.top3 .ranking-position { color: #f97316; }

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.ranking-detail {
    font-size: 12px;
    color: var(--text-muted);
}

.ranking-score {
    text-align: right;
    flex-shrink: 0;
}

.ranking-percent {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-success);
}

.danger .ranking-percent { color: var(--accent-danger); }

.ranking-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============== CHART KONTEYNERI ============== */
.chart-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    height: 360px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1100px) {
    .charts-grid { grid-template-columns: 1fr; }
}

/* ============== TABS ============== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    width: fit-content;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: white;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============== SEARCH BOX ============== */
.search-box {
    position: relative;
    max-width: 320px;
    flex: 1;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.6;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 0 0 40px rgba(0,0,0,0.5);
    }
    .sidebar.open { left: 0; }
    .main-content { padding: 20px; }
    .mobile-menu-btn { display: inline-flex !important; align-items: center; justify-content: center; }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-actions {
        width: 100%;
    }
    .page-actions .btn {
        flex: 1;
        min-width: 0;
    }
}

@media (min-width: 901px) {
    .mobile-menu-btn { display: none !important; }
}

.mobile-menu-btn {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 18px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
}

/* Empty table */
.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

/* Settings grid responsive */
@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Range input styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Readonly inputs */
input[readonly] {
    background: rgba(31, 41, 55, 0.4) !important;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Date va Time input style fix */
input[type="date"], input[type="time"] {
    color-scheme: dark;
}

/* Notification (toast) */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    min-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--accent-primary);
}

.toast.success { border-left-color: var(--accent-success); }
.toast.error { border-left-color: var(--accent-danger); }
.toast.warning { border-left-color: var(--accent-warning); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
    font-size: 20px;
}

.toast-msg {
    font-size: 13px;
    flex: 1;
}
