/* ==========================================================================
   CCTVKU Smart Security — BARDI Smart Home & AI NVR Theme (cctvku.pages.dev)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --bardi-teal: #00C4B4;
    --bardi-teal-dark: #008f83;
    --bardi-cyan: #00E5FF;
    --bardi-blue: #0284C7;
    --bardi-navy: #090E17;
    --bardi-panel: #0E1626;
    --bardi-card: #121C2E;
    --bardi-border: rgba(0, 196, 180, 0.22);
    --bardi-border-hover: rgba(0, 229, 255, 0.5);
    --bardi-border-active: #00C4B4;
    --bardi-glow: rgba(0, 196, 180, 0.45);
    --bardi-rec: #FF4757;
    --bardi-online: #10B981;
    --bardi-warning: #F59E0B;

    --hik-bg-chassis: #090E17;
    --hik-bg-panel: #0E1626;
    --hik-bg-card: #121C2E;
    --hik-bg-tile: #060B12;
    --hik-border: rgba(0, 196, 180, 0.20);
    --hik-border-hover: rgba(0, 229, 255, 0.50);
    --hik-border-active: #00C4B4;
    --hik-red: #FF4757;
    --hik-red-glow: rgba(255, 71, 87, 0.45);
    --hik-red-hover: #ff6b81;
    --hik-cyan: #00E5FF;
    --hik-blue: #00C4B4;
    --hik-green: #10B981;
    --hik-yellow: #F59E0B;
    --hik-text-main: #FFFFFF;
    --hik-text-muted: #CBD5E1;
    --hik-text-dim: #94A3B8;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: var(--bardi-navy) !important;
}

/* BARDI BUTTONS */
.btn-bardi, .btn-danger#btnLoginSubmit {
    background: linear-gradient(135deg, #00C4B4 0%, #008f83 100%) !important;
    border: none !important;
    box-shadow: 0 4px 18px rgba(0, 196, 180, 0.45) !important;
    color: #fff !important;
    border-radius: 10px !important;
    transition: all 0.25s ease !important;
}
.btn-bardi:hover, .btn-danger#btnLoginSubmit:hover {
    background: linear-gradient(135deg, #00E5FF 0%, #00B4D8 100%) !important;
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.6) !important;
    transform: translateY(-1px);
}

/* BARDI BRAND BADGE */
.hik-brand-badge {
    background: linear-gradient(135deg, #00C4B4 0%, #008891 100%) !important;
    color: #fff !important;
    border: 1px solid rgba(0, 229, 255, 0.45) !important;
    box-shadow: 0 2px 14px rgba(0, 196, 180, 0.4) !important;
    border-radius: 8px !important;
}

/* BARDI NAVBAR & TABS */
.hik-navbar {
    background: linear-gradient(180deg, #0E1626 0%, #090E17 100%) !important;
    border-bottom: 1px solid rgba(0, 196, 180, 0.25) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 196, 180, 0.08) !important;
}

.hik-nav-tabs {
    background: rgba(9, 14, 23, 0.85) !important;
    border: 1px solid rgba(0, 196, 180, 0.20) !important;
    border-radius: 10px !important;
}

.hik-nav-tabs .nav-link {
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.hik-nav-tabs .nav-link:hover {
    background-color: rgba(0, 196, 180, 0.12) !important;
    color: #ffffff !important;
}

.hik-nav-tabs .nav-link.active {
    background: linear-gradient(135deg, rgba(0, 196, 180, 0.32) 0%, rgba(0, 196, 180, 0.12) 100%) !important;
    border: 1px solid rgba(0, 196, 180, 0.65) !important;
    box-shadow: 0 0 16px rgba(0, 196, 180, 0.35) !important;
    color: #ffffff !important;
}

/* BARDI SIDEBAR & CHANNEL ITEMS */
.hik-sidebar {
    background-color: #0E1626 !important;
    border: 1px solid rgba(0, 196, 180, 0.22) !important;
    border-radius: 12px !important;
}

.hik-channel-item {
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent !important;
}

.hik-channel-item:hover {
    background-color: rgba(0, 196, 180, 0.10) !important;
    border-color: rgba(0, 196, 180, 0.25) !important;
}

.hik-channel-item.active {
    background: linear-gradient(90deg, rgba(0, 196, 180, 0.24) 0%, rgba(0, 196, 180, 0.05) 100%) !important;
    border-color: #00C4B4 !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(0, 196, 180, 0.3) !important;
}

/* BARDI MATRIX & CAMERA TILES */
.hik-matrix-toolbar {
    background-color: #0E1626 !important;
    border: 1px solid rgba(0, 196, 180, 0.22) !important;
    border-radius: 12px !important;
}

.hik-cam-tile {
    background-color: #060B12 !important;
    border: 1.5px solid rgba(0, 196, 180, 0.22) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
    transition: all 0.25s ease !important;
}

.hik-cam-tile:hover {
    border-color: #00E5FF !important;
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.35) !important;
}

.hik-cam-tile.selected, .hik-cam-tile.active {
    border-color: #00C4B4 !important;
    box-shadow: 0 0 20px rgba(0, 196, 180, 0.5) !important;
}

/* BARDI OSD OVERLAYS */
.hik-osd-badge {
    background: rgba(9, 14, 23, 0.85) !important;
    border: 1px solid rgba(0, 196, 180, 0.25) !important;
    border-radius: 6px !important;
    color: #ffffff !important;
}

.hik-osd-live-tag {
    background: linear-gradient(135deg, #00C4B4 0%, #008891 100%) !important;
    border-radius: 6px !important;
    box-shadow: 0 0 10px rgba(0, 196, 180, 0.4) !important;
}

/* BARDI AUTH CARD */
.hik-auth-overlay {
    background: rgba(8, 13, 22, 0.96) !important;
}

.hik-auth-card {
    background: linear-gradient(145deg, #0E1726 0%, #080D16 100%) !important;
    border: 1.5px solid rgba(0, 196, 180, 0.35) !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 196, 180, 0.25) !important;
    border-radius: 18px !important;
}

.hik-auth-icon-wrap {
    background: linear-gradient(135deg, rgba(0, 196, 180, 0.2) 0%, rgba(0, 196, 180, 0.05) 100%) !important;
    border: 2px solid #00C4B4 !important;
    box-shadow: 0 0 22px rgba(0, 196, 180, 0.4) !important;
    border-radius: 50% !important;
}

/* BARDI PRO TIMELINE */
.hik-timeline-container {
    background-color: #0E1626 !important;
    border: 1px solid rgba(0, 196, 180, 0.22) !important;
    border-radius: 12px !important;
}

.hik-pro-timeline {
    border: 1px solid rgba(0, 196, 180, 0.25) !important;
    border-radius: 10px !important;
    background: #060B12 !important;
}

.hik-timeline-track {
    background: #080D16 !important;
    border-bottom: 1px solid rgba(0, 196, 180, 0.12) !important;
}

.hik-timeline-segment {
    background: linear-gradient(180deg, #00E5FF 0%, #00C4B4 100%) !important;
    box-shadow: 0 0 8px rgba(0, 196, 180, 0.45) !important;
}

.hik-timeline-needle {
    background: #00E5FF !important;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.85) !important;
}

.hik-timeline-needle-badge {
    background: linear-gradient(135deg, #00C4B4 0%, #008891 100%) !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    box-shadow: 0 0 10px rgba(0, 196, 180, 0.6) !important;
}

/* BARDI MOBILE BOTTOM NAV */
.hik-mobile-bottom-nav {
    background: rgba(9, 14, 23, 0.95) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-top: 1px solid rgba(0, 196, 180, 0.25) !important;
}

.hik-bottom-nav-btn.active {
    color: #00E5FF !important;
    border-top: 2px solid #00C4B4 !important;
    text-shadow: 0 0 10px rgba(0, 196, 180, 0.6) !important;
}

/* CARDS & PANELS */
.hik-card {
    background-color: #0E1626 !important;
    border: 1px solid rgba(0, 196, 180, 0.22) !important;
    border-radius: 12px !important;
}

.hik-section-header {
    border-bottom: 1px solid rgba(0, 196, 180, 0.20) !important;
}

/* PROGRESS BARS IN BARDI TEAL */
.progress {
    background-color: #080D16 !important;
    border-radius: 6px !important;
}
.progress-bar.bg-warning, .progress-bar.bg-success, .progress-bar.bg-info {
    background: linear-gradient(90deg, #00C4B4 0%, #00E5FF 100%) !important;
    box-shadow: 0 0 8px rgba(0, 196, 180, 0.5) !important;
}

/* FULLSCREEN MODAL */
.fullscreen-modal {
    background: rgba(6, 11, 18, 0.98) !important;
}
.fullscreen-header {
    background: linear-gradient(180deg, #0E1626 0%, #080D16 100%) !important;
    border-bottom: 1px solid rgba(0, 196, 180, 0.3) !important;
}
.fullscreen-footer {
    background: #0E1626 !important;
    border-top: 1px solid rgba(0, 196, 180, 0.25) !important;
}

/* ==========================================================================
   CCTVKU Cloud NVR — Mobile & Desktop Theme (cctvku.pages.dev)
   ========================================================================== */

:root {
    --hik-bg-chassis: #0a0b0e;
    --hik-bg-panel: #13171f;
    --hik-bg-card: #181d27;
    --hik-bg-tile: #0f1218;
    --hik-border: #2b3345;
    --hik-border-hover: #4b5563;
    --hik-border-active: #00C4B4;
    --hik-red: #FF4757;
    --hik-red-glow: rgba(0, 196, 180, 0.45);
    --hik-red-hover: #f87171;
    --hik-cyan: #38bdf8;
    --hik-blue: #0ea5e9;
    --hik-green: #10b981;
    --hik-yellow: #f59e0b;
    --hik-text-main: #ffffff;
    --hik-text-muted: #cbd5e1;
    --hik-text-dim: #94a3b8;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Global High-Contrast Readability Overrides */
.text-muted {
    color: #cbd5e1 !important;
}

.text-secondary {
    color: #e2e8f0 !important;
}

.small, small {
    color: #e2e8f0;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--hik-bg-chassis);
    color: var(--hik-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    user-select: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: #0d0f14;
}
::-webkit-scrollbar-thumb {
    background: #2a3140;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--hik-red);
}

.tab-pane:not(.active) {
    display: none !important;
}

/* ================= TOP NAVBAR ================= */
.hik-navbar {
    background: linear-gradient(180deg, #151821 0%, #0d1017 100%);
    border-bottom: 1px solid var(--hik-border);
    padding: 6px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 52px;
    white-space: nowrap;
}

.hik-brand-badge {
    background: linear-gradient(135deg, #00C4B4 0%, #008891 100%);
    color: #fff;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(230, 0, 18, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hik-brand-title {
    font-weight: 700;
    font-size: 0.86rem;
    color: #ffffff;
    letter-spacing: 0.6px;
    line-height: 1.2;
}

.hik-brand-sub {
    font-size: 0.65rem;
    color: #8fa0ba;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.2px;
}

/* Desktop Navigation Tabs */
.hik-nav-tabs {
    border-bottom: none;
    gap: 4px;
    background: rgba(13, 16, 23, 0.8);
    padding: 3px 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.hik-nav-tabs .nav-link {
    background: transparent;
    color: var(--hik-text-muted);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 5px 13px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hik-nav-tabs .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.hik-nav-tabs .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(230, 0, 18, 0.25) 0%, rgba(230, 0, 18, 0.1) 100%);
    border: 1px solid rgba(230, 0, 18, 0.45);
    box-shadow: 0 0 10px rgba(230, 0, 18, 0.25);
}

/* Top Stat Pills */
.hik-stat-pill {
    background-color: #121620;
    border: 1px solid var(--hik-border);
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--hik-text-muted);
}

.hik-stat-val {
    font-weight: 700;
    color: #ffffff;
    font-family: monospace;
}

.hik-clock {
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 0.76rem;
    color: var(--hik-cyan);
    background-color: #0b0d13;
    padding: 4px 9px;
    border-radius: 6px;
    border: 1px solid #1a2233;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

@keyframes pulseDot {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.pulse-dot {
    display: inline-block;
    animation: pulseDot 2s infinite ease-in-out;
}

/* ================= PANELS & CARDS ================= */
.hik-sidebar {
    background-color: var(--hik-bg-panel);
    border: 1px solid var(--hik-border);
    border-radius: 6px;
    padding: 10px;
    height: 100%;
}

.hik-card {
    background-color: var(--hik-bg-card);
    border: 1px solid var(--hik-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.hik-section-header {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--hik-text-muted);
    border-bottom: 1px solid var(--hik-border);
    padding-bottom: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ================= CHANNEL LIST ================= */
.hik-channel-item {
    padding: 7px 10px;
    border-radius: 4px;
    margin-bottom: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.hik-channel-item:hover {
    background-color: #1f2533;
}

.hik-channel-item.active {
    background-color: rgba(0, 196, 180, 0.15);
    border-color: var(--hik-red);
    color: #ffffff;
    font-weight: 600;
}

/* ================= SURVEILLANCE MATRIX ================= */
.hik-matrix-toolbar {
    background-color: var(--hik-bg-panel);
    border: 1px solid var(--hik-border);
    border-radius: 6px;
    padding: 6px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.hik-matrix-grid {
    display: grid;
    gap: 8px;
    transition: all 0.3s ease;
}

.hik-matrix-grid.layout-3x2 {
    grid-template-columns: repeat(3, 1fr);
}

.hik-matrix-grid.layout-2x2 {
    grid-template-columns: repeat(2, 1fr);
}

.hik-matrix-grid.layout-1x1 {
    grid-template-columns: 1fr;
}

/* ================= CAMERA TILE ================= */
.hik-cam-tile {
    background-color: var(--hik-bg-tile);
    border: 1.5px solid var(--hik-border);
    border-radius: 6px;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hik-cam-tile:hover {
    border-color: var(--hik-border-hover);
}

.hik-cam-tile.selected {
    border-color: var(--hik-red) !important;
    box-shadow: 0 0 14px var(--hik-red-glow);
}

.hik-tile-media-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #050608;
}

.hik-cam-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background-color: transparent;
    opacity: 0;
    will-change: opacity;
    image-rendering: -webkit-optimize-contrast;
}

.hik-cam-img.active {
    opacity: 1;
}

.hik-cam-img.img-offline,
.hik-cam-tile img.img-offline {
    filter: grayscale(90%) brightness(0.22) contrast(1.1);
    opacity: 0.55;
}

.hik-cam-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background-color: #050608;
    transition: filter 0.2s, opacity 0.25s ease-out;
    image-rendering: -webkit-optimize-contrast;
}

.hik-cam-tile.loading img {
    filter: brightness(0.6);
}

.hik-cam-tile.is-offline {
    border-color: rgba(239, 68, 68, 0.45) !important;
    background-color: #0b0f17;
}

.hik-cam-tile.is-offline:hover {
    border-color: rgba(239, 68, 68, 0.8) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.hik-cam-tile img.img-offline {
    filter: grayscale(90%) brightness(0.22) contrast(1.1);
    opacity: 0.55;
}

.hik-tile-offline-banner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.65) 0%, rgba(10, 15, 26, 0.88) 100%);
    pointer-events: none;
    z-index: 4;
}

.hik-offline-badge-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 18px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(239, 68, 68, 0.15);
}

/* OSD Overlays */
.hik-osd-top {
    position: absolute;
    top: 6px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.hik-osd-bottom {
    position: absolute;
    bottom: 6px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.hik-osd-badge {
    background: rgba(10, 12, 16, 0.78);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-family: "JetBrains Mono", Consolas, monospace;
    color: #e2e8f0;
}

.hik-osd-live-tag {
    background-color: var(--hik-red);
    color: #fff;
    font-weight: 800;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.hik-cam-actions {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.hik-cam-tile:hover .hik-cam-actions,
.hik-cam-tile.selected .hik-cam-actions {
    opacity: 1;
}

.hik-cam-tile:hover .hik-osd-live-tag,
.hik-cam-tile.selected .hik-osd-live-tag {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.hik-btn-cam {
    background: rgba(15, 20, 28, 0.85);
    border: 1px solid var(--hik-border);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hik-btn-cam:hover {
    background-color: var(--hik-red);
    border-color: var(--hik-red);
}

/* ================= 24-HOUR ADVANCED MULTI-CHANNEL TIMELINE ================= */
.hik-timeline-container {
    background-color: var(--hik-bg-panel);
    border: 1px solid var(--hik-border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hik-pro-timeline {
    background-color: #080c14;
    border: 1px solid #1e293b;
    border-radius: 6px;
    overflow: hidden;
}

.hik-pro-timeline-header {
    display: flex;
    background-color: #0f172a;
    border-bottom: 1px solid #334155;
    font-size: 0.72rem;
}

.hik-pro-timeline-col-label {
    width: 145px;
    min-width: 145px;
    padding: 6px 10px;
    font-weight: 700;
    color: #94a3b8;
    border-right: 1px solid #334155;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

.hik-pro-timeline-col-tracks {
    flex: 1;
    position: relative;
    padding: 5px 0 4px 0;
}

.hik-timeline-ruler {
    display: flex;
    justify-content: space-between;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 0.70rem;
    font-weight: 700;
    color: #cbd5e1;
    padding: 0 6px;
    margin: 0;
}

.hik-pro-timeline-body {
    display: flex;
    position: relative;
    min-height: 168px;
    cursor: crosshair;
}

.hik-pro-timeline-labels {
    width: 145px;
    min-width: 145px;
    background-color: #0b1120;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.hik-pro-label-item {
    height: 28px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.72rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

.hik-pro-label-item:hover {
    background-color: rgba(56, 189, 248, 0.15);
}

.hik-pro-label-item.selected {
    background-color: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    font-weight: 700;
}

.hik-pro-timeline-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #090d16;
}

.hik-timeline-tracks {
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 3;
}

.hik-timeline-track {
    position: relative;
    height: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(255, 255, 255, 0.015);
}

.hik-timeline-track:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.hik-timeline-track.hik-track-single {
    height: 60px;
}

.hik-timeline-grid-lines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 1;
}

.hik-timeline-grid-col {
    height: 100%;
    border-right: 1px dashed rgba(255, 255, 255, 0.07);
}

.hik-seg-block {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border-radius: 3px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.hik-seg-block:hover {
    filter: brightness(1.35);
    z-index: 5;
    outline: 1px solid #ffffff;
}

.hik-seg-continuous {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.4);
}

.hik-seg-gdrive {
    background: linear-gradient(180deg, #34d399 0%, #059669 100%);
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.4);
}

/* AI Event Marker on Timeline Track */
.hik-ai-event-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 1px;
    z-index: 6;
    pointer-events: auto;
    cursor: pointer;
}

.hik-ai-marker-person {
    background-color: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.9);
}

.hik-ai-marker-vehicle {
    background-color: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.9);
}

/* Hover guideline & floating tooltip */
.hik-timeline-hover-line {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    z-index: 8;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.hik-timeline-hover-tooltip {
    position: absolute;
    bottom: 8px;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.5);
    backdrop-filter: blur(8px);
    color: #f8fafc;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: "JetBrains Mono", Consolas, monospace;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Live Wall-clock "SEKARANG" line */
.hik-timeline-now-marker {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
    pointer-events: none;
    z-index: 9;
}

.hik-now-tag {
    position: absolute;
    top: 2px;
    right: 4px;
    background-color: #ef4444;
    color: white;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 1px 3px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .hik-pro-timeline-col-label,
    .hik-pro-timeline-labels {
        width: 50px;
        min-width: 50px;
    }
    .hik-pro-track-name {
        display: none;
    }
}

.hik-timeline-needle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--hik-red);
    box-shadow: 0 0 8px var(--hik-red-glow);
    z-index: 10;
    pointer-events: none;
    transition: left 0.1s linear;
}

.hik-timeline-needle-badge {
    position: absolute;
    top: 2px;
    left: 5px;
    background-color: var(--hik-red);
    color: #ffffff;

    font-family: monospace;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 2px;
    white-space: nowrap;
}

/* ================= TABLES ================= */
.hik-table {
    width: 100%;
    font-size: 0.82rem;
    color: #ffffff;
    border-collapse: collapse;
}

.hik-table th {
    background-color: #141923;
    color: #f8fafc !important;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 10px 10px;
    border-bottom: 2px solid #3b4458;
    text-align: left;
}

.hik-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #222938;
    vertical-align: middle;
    color: #f1f5f9;
}

.hik-table tr:hover td {
    background-color: #1a2233;
}

/* ================= MOBILE BOTTOM NAVIGATION ================= */
.hik-mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #181d28 0%, #0d1017 100%);
    border-top: 1px solid var(--hik-border);
    padding: 6px 12px calc(6px + var(--safe-bottom));
    z-index: 2000;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.6);
}

.hik-bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--hik-text-muted);
    padding: 4px 0;
    font-size: 0.68rem;
    font-weight: 600;
    gap: 3px;
    transition: all 0.15s ease;
    cursor: pointer;
    touch-action: manipulation;
}

.hik-bottom-nav-btn i {
    font-size: 1.15rem;
    transition: transform 0.15s ease;
}

.hik-bottom-nav-btn.active {
    color: #ffffff;
}

.hik-bottom-nav-btn.active i {
    color: var(--hik-red);
    transform: translateY(-2px);
}

/* ================= FULLSCREEN MODAL ================= */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.fullscreen-header {
    background: rgba(15, 18, 24, 0.95);
    border-bottom: 1px solid var(--hik-border);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.fullscreen-img-container {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    position: relative;
    overflow: hidden;
}

.fullscreen-img {
    position: absolute;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
    user-select: none;
    opacity: 0;
    background-color: transparent;
    will-change: opacity;
    image-rendering: auto;
}

.fullscreen-img.active {
    opacity: 1;
}

.fullscreen-footer {
    background: rgba(15, 18, 24, 0.95);
    border-top: 1px solid var(--hik-border);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--hik-text-muted);
}

/* ================= PLAYBACK RESPONSIVE STYLES ================= */
.hik-playback-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.hik-playback-selectors {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hik-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hik-select-filter {
    min-width: 190px;
    width: auto;
}

.hik-playback-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hik-player-container {
    width: 100%;
    max-width: calc(72vh * 16 / 9);
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: unset;
    margin: 0 auto;
    background: #000;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: aspect-ratio 0.2s ease, max-width 0.2s ease;
}

/* ================= RESPONSIVE MEDIA QUERIES ================= */

@media (max-width: 991px) {
    .hik-matrix-grid.layout-3x2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px; /* Space for bottom navbar */
    }

    .hik-nav-tabs {
        display: none !important; /* Replaced by bottom nav */
    }

    .hik-mobile-bottom-nav {
        display: flex;
    }

    .hik-matrix-grid.layout-3x2,
    .hik-matrix-grid.layout-2x2 {
        grid-template-columns: 1fr; /* 1 column full width on smartphones */
    }

    .hik-stat-pill {
        font-size: 0.68rem;
        padding: 2px 6px;
    }

    .hik-clock {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .hik-timeline-wrapper {
        height: 55px;
    }

    /* Mobile Playback Enhancements */
    .hik-playback-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .hik-playback-selectors {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
    }

    .hik-filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        width: 100%;
    }

    .hik-filter-group label {
        font-size: 0.68rem !important;
    }

    .hik-select-filter {
        min-width: 0 !important;
        width: 100% !important;
        font-size: 0.74rem !important;
        padding: 4px 6px !important;
    }

    .hik-playback-actions {
        justify-content: space-between;
        width: 100%;
    }

    .hik-player-container {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        max-width: 100% !important;
        aspect-ratio: 16 / 9;
        width: 100%;
    }

    .hik-playback-player-col {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--hik-bg-dark);
        padding-top: 4px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .hik-table th, .hik-table td {
        padding: 6px 6px !important;
        font-size: 0.74rem !important;
    }

    .hik-table td.clip-cam-name {
        max-width: 110px !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hik-table td.clip-size {
        white-space: nowrap !important;
        font-size: 0.72rem !important;
    }
}

@media (max-width: 480px) {
    .hik-brand-sub {
        display: none;
    }

    .hik-brand-badge {
        font-size: 0.78rem;
        padding: 2px 6px;
    }

    .hik-brand-title {
        font-size: 0.88rem;
    }
}

/* ================= AUTHENTICATION OVERLAY ================= */
.hik-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 23, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hik-auth-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hik-auth-card {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(145deg, #182030 0%, #101522 100%);
    border: 1px solid rgba(215, 25, 32, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(215, 25, 32, 0.2);
    border-radius: 12px;
    padding: 28px 24px;
    animation: authCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.hik-auth-icon-wrap {
    width: 60px;
    height: 60px;
    background: rgba(215, 25, 32, 0.15);
    border: 2px solid rgba(215, 25, 32, 0.5);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 0 15px rgba(215, 25, 32, 0.3);
}

.hik-user-nav-badge {
    background: #141924;
    border: 1px solid var(--hik-border);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 0.74rem;
    color: var(--hik-text-main);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.hik-user-nav-badge button {
    transition: transform 0.15s ease, color 0.15s ease;
}

.hik-user-nav-badge button:hover {
    transform: scale(1.15);
}

/* High Contrast Form Elements & Option Visibility */
select.form-select option,
select option {
    background-color: #141923 !important;
    color: #f8fafc !important;
}

.hik-osd-badge {
    color: #ffffff !important;
    font-weight: 600;
}



/* ==========================================================================
   BARDI+ SMART IOT & ADVANCED CONTROLS (CCTVKU)
   ========================================================================== */

/* BARDI Smart Security Top Bar */
.bardi-smart-bar {
    background: linear-gradient(135deg, rgba(14, 22, 38, 0.95) 0%, rgba(18, 28, 46, 0.95) 100%) !important;
    border: 1px solid var(--bardi-border) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), 0 0 12px rgba(0, 196, 180, 0.08);
    backdrop-filter: blur(12px);
}

.bardi-mode-btn {
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    border-color: rgba(0, 196, 180, 0.3) !important;
    color: #cbd5e1 !important;
    transition: all 0.2s ease !important;
}

.bardi-mode-btn:hover {
    background: rgba(0, 196, 180, 0.15) !important;
    color: #00E5FF !important;
    border-color: #00C4B4 !important;
}

.bardi-mode-btn.active {
    background: linear-gradient(135deg, #00C4B4 0%, #008f83 100%) !important;
    color: #ffffff !important;
    border-color: #00E5FF !important;
    box-shadow: 0 0 14px rgba(0, 196, 180, 0.5) !important;
}

.bardi-mode-btn.mode-privacy-active {
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%) !important;
    border-color: #A78BFA !important;
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.5) !important;
}

.bardi-mode-btn.mode-away-active {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    border-color: #FBBF24 !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.5) !important;
}

.bardi-mode-btn.mode-night-active {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%) !important;
    border-color: #60A5FA !important;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.5) !important;
}

/* Siren & Alarm Button */
.bardi-siren-active {
    background: linear-gradient(135deg, #FF4757 0%, #b30018 100%) !important;
    color: #fff !important;
    border-color: #ff6b81 !important;
    box-shadow: 0 0 18px rgba(255, 71, 87, 0.8) !important;
    animation: sirenPulse 0.7s infinite alternate ease-in-out !important;
}

@keyframes sirenPulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 71, 87, 0.5); }
    100% { transform: scale(1.05); box-shadow: 0 0 25px rgba(255, 71, 87, 0.95); }
}

/* Intercom Active Animation */
.bardi-intercom-active {
    background: linear-gradient(135deg, #00E5FF 0%, #008891 100%) !important;
    color: #090E17 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.8) !important;
    animation: intercomRipple 1s infinite ease-out !important;
}

@keyframes intercomRipple {
    0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(0, 229, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

/* Emergency Strobe Overlay for Grid or Fullscreen Player */
.strobe-alert {
    animation: emergencyStrobe 0.4s infinite !important;
}

@keyframes emergencyStrobe {
    0% { box-shadow: inset 0 0 35px rgba(255, 71, 87, 0.85), 0 0 20px rgba(255, 71, 87, 0.85); border-color: #FF4757 !important; }
    50% { box-shadow: inset 0 0 35px rgba(0, 229, 255, 0.85), 0 0 20px rgba(0, 229, 255, 0.85); border-color: #00E5FF !important; }
    100% { box-shadow: inset 0 0 35px rgba(255, 71, 87, 0.85), 0 0 20px rgba(255, 71, 87, 0.85); border-color: #FF4757 !important; }
}

/* Privacy Mask Overlay for Camera Tiles */
.privacy-shield-active img {
    filter: blur(28px) grayscale(80%) brightness(0.4) !important;
    pointer-events: none;
}

.privacy-overlay-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    background: rgba(9, 14, 23, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.7);
    border-radius: 12px;
    padding: 10px 18px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.8), 0 0 20px rgba(139, 92, 246, 0.35);
}

/* Sidebar scrollable sections */
.hik-channel-list {
    max-height: 220px;
    overflow-y: auto;
}


/* ==========================================================================
   MOBILE-FRIENDLY COMPREHENSIVE OVERRIDES (< 768px)
   ========================================================================== */

@media (max-width: 768px) {
    /* Fullscreen Modal Header - Ultra Compact & No Wrap */
    .fullscreen-header {
        height: 46px !important;
        padding: 0 8px !important;
    }
    .fullscreen-header h6 {
        max-width: 110px !important;
        font-size: 0.8rem !important;
    }
    .fullscreen-header .btn {
        padding: 4px 7px !important;
        font-size: 0.72rem !important;
    }
    .fullscreen-footer {
        padding: 4px 8px !important;
        font-size: 0.68rem !important;
        height: 34px !important;
    }

    /* Safe Toast Notifications on Mobile (Never cover navbar) */
    .hik-toast-container {
        top: 55px !important;
        right: 12px !important;
        left: 12px !important;
        bottom: auto !important;
        max-width: unset !important;
        width: auto !important;
    }
    .hik-toast {
        font-size: 0.78rem !important;
        padding: 8px 12px !important;
    }

    /* Mobile Horizontal Channel Strip */
    .mobile-channel-strip {
        white-space: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .mobile-channel-strip::-webkit-scrollbar {
        display: none;
    }
    .mobile-channel-strip .btn {
        font-size: 0.72rem !important;
        font-weight: 600;
        letter-spacing: 0.3px;
        border-color: rgba(0, 196, 180, 0.25);
    }

    /* Top Navbar on Mobile */
    .hik-navbar {
        padding: 6px 10px !important;
    }

    /* Table Responsiveness Touch Padding */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    .hik-table th, .hik-table td {
        font-size: 0.72rem !important;
        padding: 7px 8px !important;
    }
}

/* Make toast container never block clicks */
#toastContainer, .hik-toast-container {
    pointer-events: none !important;
}
#toastContainer .alert, #toastContainer .toast, .hik-toast {
    pointer-events: auto !important;
}

/* HIGH-CONTRAST LOGIN ALERT BADGE */
#loginAlert {
    background: rgba(220, 38, 38, 0.22) !important;
    border: 1.5px solid #ef4444 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
#loginAlert.d-none {
    display: none !important;
}
#loginAlert i {
    color: #ff4d4f !important;
    font-size: 1.15rem !important;
    filter: drop-shadow(0 0 6px rgba(255, 77, 79, 0.6)) !important;
}
#loginAlert #loginAlertText {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    letter-spacing: 0.2px !important;
    line-height: 1.35 !important;
}
