:root {
    --bg-dark: #090d16;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-hover: rgba(26, 35, 54, 0.85);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-card-hover: rgba(56, 189, 248, 0.3);
    
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.25);
    --emerald: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.25);
    --amber: #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.25);
    --rose: #f43f5e;
    --rose-glow: rgba(244, 63, 94, 0.35);
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.25);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-plate: 'Oswald', 'JetBrains Mono', 'Segoe UI', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient glow blobs */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}
.bg-glow-1 {
    top: -200px;
    left: -100px;
    background: radial-gradient(circle, var(--primary), transparent);
}
.bg-glow-2 {
    bottom: -200px;
    right: -100px;
    background: radial-gradient(circle, var(--purple), transparent);
}

/* Alert Banner */
.alert-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--rose-glow);
    z-index: 1000;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.alert-banner.hidden {
    display: none;
}
.alert-content {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
}
.alert-plate {
    font-family: var(--font-plate);
    letter-spacing: 1px;
    background: #000;
    color: #facc15;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 800;
}
.pulse-icon {
    font-size: 1.3rem;
    animation: pulse 1s infinite alternate;
}
.alert-dismiss {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    margin-left: 12px;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-card);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}
.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.badge-accent {
    font-size: 0.7rem;
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stream Status Pill */
.stream-status-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-card);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.status-dot.online {
    background: var(--emerald);
    box-shadow: 0 0 10px var(--emerald);
    animation: pulseDot 2s infinite;
}
.status-dot.offline {
    background: var(--rose);
    box-shadow: 0 0 10px var(--rose);
}
.status-label {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}
.divider {
    color: rgba(255, 255, 255, 0.15);
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-card);
    color: var(--text-main);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    color: var(--rose);
    background: rgba(244, 63, 94, 0.1);
}
.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Main Layout Grid */
.dashboard-grid {
    position: relative;
    z-index: 1;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1700px;
    margin: 0 auto;
}

/* Stat Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-card-hover);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.icon-blue { background: rgba(56, 189, 248, 0.15); color: var(--primary); }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: var(--purple); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.icon-rose { background: rgba(244, 63, 94, 0.15); color: var(--rose); }

.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-top: 2px;
}

/* Center Content Grid: Video + Detections Stream */
.center-content-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    min-height: 580px;
}

/* Video Card */
.video-container-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.video-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-card);
}
.cam-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.camera-icon {
    font-size: 1.25rem;
    color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
    padding: 10px;
    border-radius: 10px;
}
.cam-info h2 {
    font-size: 1.05rem;
    font-weight: 700;
}
.cam-location {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.video-controls {
    display: flex;
    gap: 8px;
}
.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.video-viewport {
    position: relative;
    background: #000;
    flex: 1;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.video-viewport.hidden {
    display: none !important;
}

/* Camera Tabs Bar */
.camera-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(15, 23, 42, 0.65);
    border-bottom: 1px solid var(--border-card);
}
.cam-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}
.cam-tab-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-main);
    border-color: rgba(56, 189, 248, 0.3);
}
.cam-tab-btn.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}
.status-dot-sm {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot-sm.online {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
.status-dot-sm.offline {
    background-color: #ef4444;
}

/* Dual Camera Grid View */
.dual-video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
    background: #050811;
    flex: 1;
    min-height: 480px;
}
.dual-video-grid.hidden {
    display: none !important;
}
.dual-cam-box {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}
.dual-cam-box:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.dual-cam-box .video-feed-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex: 1;
}
.dual-cam-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}

/* Camera Badge on Detections */
.badge-camera {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-camera-2 {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    background: rgba(168, 85, 247, 0.12);
    color: var(--purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
}
.video-feed-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.video-overlay-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.live-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: blink 1s infinite alternate;
}

.video-footer {
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer-meta {
    display: flex;
    gap: 20px;
}
.footer-meta code {
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.toggle-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

/* Right: Live Detections Card */
.live-detections-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.title-with-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}
.title-with-badge h2 {
    font-size: 1.05rem;
    font-weight: 700;
}
.feed-count-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.detections-stream {
    flex: 1;
    overflow-y: auto;
    max-height: 520px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual Detection Card */
.detection-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.25s ease;
    animation: fadeIn 0.3s ease;
}
.detection-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-card-hover);
    transform: translateX(4px);
}
.detection-item.blacklisted {
    border-color: var(--rose);
    background: rgba(244, 63, 94, 0.08);
}

.item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.vehicle-type-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
}
.detection-time {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.item-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Authentic Number Plate Badge */
.license-plate-badge {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    height: 38px;
}
.plate-ind-strip {
    background: #003399;
    color: #ffffff;
    padding: 0 5px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 900;
    border-right: 1px solid #000;
}
.ind-symbol {
    font-size: 0.45rem;
    color: #ff9933;
}
.plate-chars {
    color: #0f172a;
    font-family: var(--font-plate);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 2.5px;
    padding: 0 12px;
    white-space: nowrap;
    text-transform: uppercase;
}
.detection-item.blacklisted .license-plate-badge {
    border-color: #ef4444;
    background: #fef2f2;
}

.plate-crop-thumb {
    width: 80px;
    height: 38px;
    border-radius: 5px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: transform 0.2s;
}
.plate-crop-thumb:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.confidence-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}
.confidence-track {
    width: 60px;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}
.confidence-fill {
    height: 100%;
    background: var(--emerald);
    border-radius: 3px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-dim);
    text-align: center;
    gap: 10px;
}
.empty-state i {
    font-size: 2.2rem;
    color: var(--primary);
    opacity: 0.7;
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}
.empty-state span {
    font-size: 0.8rem;
    max-width: 250px;
}

/* History & Analytics Table */
.history-section-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.table-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.table-header-row h2 {
    font-size: 1.15rem;
    font-weight: 700;
}
.subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.search-box input {
    background: none;
    border: none;
    outline: none;
    color: #fff;
    width: 220px;
    font-size: 0.85rem;
}
.filter-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
}
.filter-select option {
    background: #0f172a;
    color: #fff;
}

.table-responsive {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border-card);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}
.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal-backdrop.hidden {
    display: none;
}
.modal-card {
    background: #111827;
    border: 1px solid var(--border-card-hover);
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.25s ease;
}
.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}
.modal-close:hover {
    color: #fff;
}
.modal-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.modal-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border-card);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    padding: 10px 14px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
}
.form-group small {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.add-blacklist-form {
    display: flex;
    gap: 10px;
}
.blacklist-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}
.blacklist-chip {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid var(--rose);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--font-plate);
    display: flex;
    align-items: center;
    gap: 8px;
}
.blacklist-chip button {
    background: none;
    border: none;
    color: var(--rose);
    cursor: pointer;
    font-size: 0.85rem;
}

/* Zoom Modal */
.zoom-card {
    background: #000;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-card-hover);
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.zoom-card img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes blink {
    0% { opacity: 1; }
    100% { opacity: 0.2; }
}
@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 1200px) {
    .center-content-grid {
        grid-template-columns: 1fr;
    }
    .detections-stream {
        max-height: 350px;
    }
}

/* Interactive Detection Zone Modal & Calibration Studio */
.modal-card.modal-xl {
    max-width: 960px;
    width: 94vw;
}

.modal-body-tight {
    padding: 16px 20px 18px 20px;
    gap: 12px;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crop-studio-instructions {
    padding: 10px 16px;
    background: rgba(0, 230, 255, 0.08);
    border: 1px solid rgba(0, 230, 255, 0.2);
    border-radius: 8px;
    font-size: 0.88rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.crop-studio-instructions i {
    color: var(--primary);
    font-size: 1.1rem;
}

.crop-canvas-wrapper {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    user-select: none;
}

.crop-canvas-element {
    width: 100%;
    height: auto;
    max-height: 58vh;
    display: block;
    cursor: crosshair;
}

.crop-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    gap: 10px;
    z-index: 10;
}

.crop-loading-overlay.hidden {
    display: none;
}

.crop-studio-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.crop-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 0.78rem;
    border-radius: 6px;
}

.crop-coords {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    color: var(--primary);
    background: rgba(0, 230, 255, 0.08);
    border: 1px solid rgba(0, 230, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-save-crop {
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Interactive Stat Cards */
.stat-card-interactive {
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.stat-card-interactive:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
}

.stat-tap-hint {
    font-size: 0.70rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 230, 255, 0.12);
    border: 1px solid rgba(0, 230, 255, 0.25);
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.stat-card-interactive:hover .stat-tap-hint {
    background: var(--primary);
    color: #0b0f19;
}

/* XXL Modal for Activity / IN-OUT Register */
.modal-card.modal-xxl {
    max-width: 1150px;
    width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-card.modal-xxl .modal-body {
    overflow-y: auto;
    padding: 18px 22px;
    gap: 14px;
}

.activity-stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.activity-stat-pill {
    flex: 1;
    min-width: 160px;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.activity-stat-pill.pill-blue {
    border-color: rgba(0, 230, 255, 0.3);
    background: rgba(0, 230, 255, 0.06);
}
.activity-stat-pill.pill-blue strong { color: #00e6ff; font-size: 1.25rem; }

.activity-stat-pill.pill-green {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.06);
}
.activity-stat-pill.pill-green strong { color: #10b981; font-size: 1.25rem; }

.activity-stat-pill.pill-purple {
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.06);
}
.activity-stat-pill.pill-purple strong { color: #c084fc; font-size: 1.25rem; }

.activity-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.5);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-card);
}

.activity-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 6px 12px;
    min-width: 260px;
}

.activity-search-box input {
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.88rem;
    width: 100%;
}

.activity-filter-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.activity-filter-buttons .filter-btn.active {
    background: rgba(0, 230, 255, 0.2);
    border-color: #00e6ff;
    color: #00e6ff;
}

.activity-table-wrapper {
    overflow-x: auto;
    max-height: 48vh;
    border-radius: 8px;
    border: 1px solid var(--border-card);
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.activity-table th {
    background: rgba(15, 23, 42, 0.95);
    padding: 12px 14px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--border-card);
}

.activity-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.activity-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.status-badge-inside {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 4px 9px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-badge-exited {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
    padding: 4px 9px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}


