/* ============================================
   KUZATUV PANELI - Zamonaviy Dizayn
   ============================================ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-card-hover: #1f2a40;
    --bg-glass: rgba(17, 24, 39, 0.75);
    --bg-overlay: rgba(0, 0, 0, 0.6);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-soft: rgba(99, 102, 241, 0.12);
    --accent-glow: rgba(99, 102, 241, 0.4);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --success-glow: rgba(16, 185, 129, 0.4);

    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --danger-glow: rgba(239, 68, 68, 0.4);

    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);

    --border: rgba(148, 163, 184, 0.08);
    --border-hover: rgba(148, 163, 184, 0.16);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============ HEADER ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
}

.btn-danger {
    background: transparent;
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.btn-danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.page-header {
    max-width: 1600px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ============ CAMERA GRID ============ */
.cameras-grid {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

/* ============ CAMERA CARD ============ */
.camera-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-normal);
}

.camera-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.status-indicator.offline {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger-glow);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.4); }
}

/* Video Area */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    overflow: hidden;
    cursor: pointer;
}

.video-container img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity var(--transition-fast);
}

.video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.video-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.video-error svg {
    width: 28px;
    height: 28px;
    opacity: 0.8;
}

/* Card Footer */
.card-footer {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--border);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.card-meta svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-refresh:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-refresh svg {
    width: 14px;
    height: 14px;
}

/* ============ MODAL ============ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    padding: 20px;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(16px) scale(0.96);
    transition: transform var(--transition-normal);
    overflow: hidden;
}

.modal-backdrop.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

/* ============ FORM ============ */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 360px;
}

/* ============ STATUS PILL ============ */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-pill.online {
    color: var(--success);
    background: var(--success-soft);
}

.status-pill.offline {
    color: var(--danger);
    background: var(--danger-soft);
}

.status-pill.connecting {
    color: var(--warning);
    background: var(--warning-soft);
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ PAGE CONTROLS ============ */
.page-controls {
    max-width: 1600px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.control-select {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.control-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ============ HERO SECTION (nvr_special) ============ */
.hero-section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 0;
}

.hero-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(99, 102, 241, 0.04));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    width: fit-content;
    margin-bottom: 12px;
}

.hero-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 12px;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stat-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ SPECIAL CARD (nvr_special) ============ */
.special-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
}

.special-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.special-card .card-header {
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.special-card .card-info .card-kicker {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.special-card .card-info .card-name {
    font-size: 1.25rem;
    font-weight: 700;
}

.special-card .card-info .card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.special-card .card-footer {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.meta-block {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.meta-value {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
    }

    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .hero-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }

    .cameras-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .page-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-card {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .special-card .card-footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 12px;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .cameras-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   AFG'ONISTON TA'LIM MARKAZI - YORUG' NANO DESIGN
   ============================================ */

:root {
    --bg-primary: #eef7fb;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.78);
    --bg-overlay: rgba(15, 23, 42, 0.48);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --accent: #0f7fd3;
    --accent-hover: #0965ad;
    --accent-soft: rgba(15, 127, 211, 0.1);
    --accent-glow: rgba(14, 165, 233, 0.22);

    --success: #03966d;
    --success-soft: rgba(3, 150, 109, 0.1);
    --success-glow: rgba(3, 150, 109, 0.28);

    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --danger-glow: rgba(220, 38, 38, 0.24);

    --warning: #c27b00;
    --warning-soft: rgba(194, 123, 0, 0.12);

    --border: rgba(15, 23, 42, 0.1);
    --border-hover: rgba(15, 127, 211, 0.25);

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.16);
    --shadow-glow: 0 16px 34px rgba(14, 165, 233, 0.18);
}

body {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(230,247,255,0.88)),
        #eef7fb;
    color: var(--text-primary);
}

body::before {
    background:
        linear-gradient(90deg, rgba(15,127,211,0.06) 1px, transparent 1px),
        linear-gradient(0deg, rgba(15,127,211,0.05) 1px, transparent 1px),
        linear-gradient(120deg, transparent 0 35%, rgba(3,150,109,0.08) 35% 36%, transparent 36% 64%, rgba(15,127,211,0.08) 64% 65%, transparent 65%),
        radial-gradient(circle at 18% 14%, rgba(14,165,233,0.12), transparent 36%),
        radial-gradient(circle at 88% 26%, rgba(3,150,109,0.1), transparent 32%);
    background-size: 28px 28px, 28px 28px, 240px 240px, auto, auto;
    opacity: 0.92;
}

.header {
    background: rgba(255, 255, 255, 0.82);
    border-bottom-color: rgba(15, 127, 211, 0.12);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.header-inner {
    height: 70px;
}

.logo {
    gap: 10px;
    min-width: 270px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f7fd3, #20c997);
    box-shadow: 0 10px 26px rgba(15, 127, 211, 0.24);
}

.brand-text {
    display: grid;
    gap: 1px;
    line-height: 1.15;
}

.brand-title {
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.nav {
    padding: 4px;
    background: rgba(241, 245, 249, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-full);
}

.nav-link {
    color: #475569;
}

.nav-link:hover {
    color: var(--accent);
    background: #ffffff;
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), #11a779);
    box-shadow: 0 8px 18px rgba(15, 127, 211, 0.2);
}

.nav-link.active::after {
    display: none;
}

.main-content {
    padding-top: 30px;
}

.page-title {
    color: #10233f;
    font-weight: 800;
}

.page-subtitle {
    color: #5f7288;
}

.hero-card,
.special-card,
.camera-card,
.stat-card,
.modal,
.toast,
.login-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,252,255,0.92));
    border-color: rgba(15, 127, 211, 0.13);
    box-shadow: var(--shadow-md);
}

.hero-card,
.special-card,
.camera-card {
    border-radius: 16px;
}

.hero-card {
    position: relative;
    overflow: hidden;
}

.hero-card::before,
.special-card::before,
.camera-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(15,127,211,0.08), transparent 28%),
        linear-gradient(315deg, rgba(3,150,109,0.08), transparent 28%);
    opacity: 0.7;
}

.special-card,
.camera-card {
    position: relative;
}

.special-card > *,
.camera-card > *,
.hero-card > * {
    position: relative;
    z-index: 1;
}

.special-card:hover,
.camera-card:hover {
    background: #ffffff;
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.card-header,
.card-footer {
    border-color: rgba(15, 127, 211, 0.1);
}

.special-card .card-info .card-kicker,
.hero-eyebrow,
.stat-label,
.form-label {
    color: var(--accent);
}

.special-card .card-info .card-name,
.card-name,
.meta-value,
.stat-value {
    color: #10233f;
}

.special-card .card-info .card-subtitle,
.stat-note,
.empty-state p {
    color: var(--text-secondary);
}

.stat-card {
    background:
        linear-gradient(160deg, rgba(255,255,255,0.96), rgba(239,248,255,0.86));
    border-radius: 14px;
}

.stat-card:hover {
    border-color: rgba(15, 127, 211, 0.2);
    box-shadow: 0 14px 34px rgba(15, 127, 211, 0.1);
}

.video-container {
    background:
        linear-gradient(135deg, #d7eaf7, #f8fbff);
}

.video-container img {
    background: #e8f2f8;
}

.video-error {
    background: rgba(255, 255, 255, 0.82);
    color: var(--danger);
}

.form-input,
.control-select {
    background: #ffffff;
    color: var(--text-primary);
    border-color: rgba(15, 23, 42, 0.13);
}

.form-input:focus,
.control-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #11a779);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 127, 211, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 14px 30px rgba(15, 127, 211, 0.28);
}

.btn-ghost {
    color: var(--accent);
    background: rgba(15, 127, 211, 0.08);
}

.btn-ghost:hover {
    color: #ffffff;
    background: var(--accent);
}

.btn-danger {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.08);
}

.status-pill {
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.status-pill.online {
    color: #047857;
    background: rgba(209, 250, 229, 0.82);
}

.status-pill.offline {
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.82);
}

.status-pill.connecting {
    color: #a16207;
    background: rgba(254, 243, 199, 0.9);
}

.meta-block {
    background: rgba(255,255,255,0.76);
    border-color: rgba(15, 127, 211, 0.12);
}

.person-meta {
    display: grid;
    gap: 6px;
    padding: 8px;
    color: var(--text-secondary);
    background: rgba(239, 248, 255, 0.72);
    border: 1px solid rgba(15, 127, 211, 0.1);
    border-radius: 10px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.person-meta span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.person-meta b {
    color: var(--accent);
    font-weight: 700;
}

.camera-warning {
    margin-top: 12px;
    padding: 12px 14px;
    color: #854d0e;
    background: rgba(254, 243, 199, 0.86);
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.camera-warning b,
.camera-warning strong {
    color: #713f12;
}

#cameraSettingsForm {
    grid-template-columns: minmax(260px, 2fr) minmax(130px, 1fr) minmax(150px, 1fr) 110px 110px auto;
}

table {
    background: rgba(255,255,255,0.7);
    border-radius: 12px;
    overflow: hidden;
}

thead tr {
    background: rgba(15, 127, 211, 0.07);
}

tbody tr {
    background: rgba(255, 255, 255, 0.6);
}

tbody tr:hover {
    background: rgba(224, 242, 254, 0.56);
}

.login-card {
    border-color: rgba(15, 127, 211, 0.16);
    box-shadow: 0 28px 80px rgba(15, 127, 211, 0.14);
}

.login-card h1 {
    color: #10233f;
}

.login-card p {
    color: var(--text-secondary) !important;
}

@media (max-width: 1080px) {
    .header-inner {
        align-items: flex-start;
    }

    .logo {
        min-width: 0;
    }

    .nav {
        border-radius: 14px;
    }

    #cameraSettingsForm {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    .brand-title {
        font-size: 0.86rem;
    }

    .brand-subtitle {
        font-size: 0.68rem;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
    }

    #cameraSettingsForm {
        grid-template-columns: 1fr !important;
    }
}

/* Brauzer-agent paneli */
.agent-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.agent-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.agent-hint {
    margin-top: 10px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-dim);
}
.agent-hint ol { margin: 6px 0 0 18px; padding: 0; }
/* "Jonli AI kuzatuv" kartasidagi brauzer-agent ko'rinishi */
/* Karta 16:9 (padding-bottom); rasm va overlay uni to'liq qoplaydi. Kadr <img> qutisidan qirqiladi,
   shuning uchun yuz koordinatalari overlay bilan 1:1 mos keladi. */
.agent-live {
    position: absolute;
    inset: 0;
    background: #000;
}
.video-container .agent-cam {
    background: #000;
}
.agent-overlay {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}
.agent-overlay.standalone {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.agent-live-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
