/*
# ======================================
# STYLE.CSS
# ======================================

# ======================================
# PURPOSE
# ======================================
Explain:
- This stylesheet gives the dashboard an enterprise dark-theme control-room appearance.
- It solves the UI requirement for responsive layouts, cards, live feeds, event panels, and data tables.
- Keeping custom styling in one file makes the frontend easy to brand for different clients.
*/
:root {
  --bg: #0b1020;
  --panel: #11182b;
  --panel-2: #151f36;
  --text: #e8edf7;
  --muted: #95a1b8;
  --accent: #4f8cff;
  --danger: #ff4d5e;
  --success: #29d391;
  --border: rgba(255,255,255,0.08);
}
body { background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: #070b15; border-right: 1px solid var(--border); padding: 24px 18px; position: fixed; height: 100vh; overflow-y: auto; }
.brand { font-size: 24px; font-weight: 800; margin-bottom: 24px; letter-spacing: -0.03em; }
.nav-link { color: var(--muted); border-radius: 12px; padding: 10px 12px; margin-bottom: 4px; }
.nav-link:hover { background: var(--panel-2); color: var(--text); }
.content { margin-left: 260px; padding: 28px; width: calc(100% - 260px); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.topbar h1 { font-weight: 700; font-size: 40px; letter-spacing: -0.04em; margin: 0; }
.muted { color: var(--muted); }
.status-pill { padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--panel-2); }
.status-pill.success { color: var(--success); }
.status-pill.danger { color: var(--danger); }
.grid { display: grid; gap: 18px; }
.cards-grid { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.two-col { grid-template-columns: 1.4fr 1fr; }
.card { background: linear-gradient(180deg, var(--panel), #0e1526); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.kpi { padding: 20px; }
.kpi span { color: var(--muted); font-size: 14px; }
.kpi strong { display: block; font-size: 32px; margin-top: 8px; }
.panel { padding: 20px; }
.panel h2 { font-size: 20px; font-weight: 600; margin-bottom: 16px; }
.panel h3 { font-size: 16px; font-weight: 600; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.camera-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.camera-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 18px; padding: 14px; }
.camera-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; }
.live-feed { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; border-radius: 14px; border: 1px solid var(--border); }
.camera-actions { margin-top: 10px; display: flex; gap: 8px; }
.event-list { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.event-item { padding: 12px; background: rgba(255, 77, 94, 0.10); border: 1px solid rgba(255, 77, 94, 0.28); border-radius: 14px; }
.event-item strong { display: block; }
.small-link { color: var(--accent); text-decoration: none; }
.narrow { max-width: 760px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.result-image, .video-result { width: 100%; border-radius: 16px; border: 1px solid var(--border); background: #000; }
.json-box { background: #050915; border: 1px solid var(--border); color: #d8e2ff; padding: 16px; border-radius: 16px; max-height: 550px; overflow: auto; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(100px, 1fr)); gap: 8px; color: var(--muted); }
.table { --bs-table-bg: transparent; }
@media (max-width: 980px) {
  .sidebar { position: static; width: 100%; height: auto; }
  .app-shell { display: block; }
  .content { margin-left: 0; width: 100%; padding: 18px; }
  .cards-grid, .two-col, .result-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; gap: 12px; flex-direction: column; }
}


/* =========================================================
   VISOGUARD BRAND SYSTEM — shared styles for every page
   Palette: charcoal / warm white / safety orange
   ========================================================= */
:root {
  --bg: #0b0b0d;
  --panel: #141416;
  --panel-2: #1c1b1a;
  --text: #f7f4ef;
  --muted: #a7a19a;
  --accent: #ff7900;
  --danger: #ff493d;
  --success: #13c66b;
  --border: rgba(255, 255, 255, .09);
  --vg-orange: #ff7900;
  --vg-orange-light: #ff9a24;
  --vg-white: #fffaf4;
  --vg-charcoal: #0a0a0b;
  --vg-surface: #151516;
}
html, body { min-height: 100%; }
body { background: var(--vg-charcoal); color: var(--vg-white); font-family: Inter, "Segoe UI", Arial, sans-serif; }
.app-shell { background: var(--vg-charcoal); }
.sidebar {
  width: 246px; padding: 18px 14px; background: #080809;
  border-right: 1px solid rgba(255,255,255,.08); z-index: 20;
}
.brand { display: block; width: 100%; height: 90px; margin: 0 0 22px; overflow: hidden; border-radius: 10px; background: #090909; }
.brand img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sidebar .nav-link { color: #b7b0a7; border-radius: 10px; padding: 11px 13px; margin-bottom: 3px; font-size: 16px; transition: background .18s, color .18s, border-color .18s; border-left: 3px solid transparent; }
.sidebar .nav-link:hover, .sidebar .nav-link:focus { background: rgba(255,121,0,.10); color: #fff; border-left-color: var(--vg-orange); }
.content { margin-left: 246px; width: calc(100% - 246px); min-width: 0; padding: 24px 28px 36px; }
.topbar { padding: 0 0 20px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.07); gap: 18px; }
.topbar h1 { color: #fffaf4; font-size: clamp(25px, 2vw, 34px); letter-spacing: -.045em; }
.topbar .muted { color: #aaa198; font-size: 13px; margin-top: 5px; }
.status-pill { background: #211811; border: 1px solid rgba(255,121,0,.18); }
.status-pill.success { color: #35d783; background: rgba(19,198,107,.10); }
.status-pill.danger { color: #ff6259; background: rgba(255,73,61,.10); }
.card, .panel { background: #141416; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 14px 38px rgba(0,0,0,.18); }
.btn-primary { --bs-btn-bg: #ff7900; --bs-btn-border-color: #ff7900; --bs-btn-hover-bg: #e96d00; --bs-btn-hover-border-color: #e96d00; --bs-btn-color: #111; --bs-btn-hover-color: #111; font-weight: 700; }
.btn-success { --bs-btn-bg: #13a960; --bs-btn-border-color: #13a960; }
.btn-outline-danger { --bs-btn-color: #ff665d; --bs-btn-border-color: rgba(255,102,93,.5); }
.table { --bs-table-color: #f3eee8; --bs-table-bg: transparent; --bs-table-hover-color: #fff; --bs-table-hover-bg: rgba(255,121,0,.06); --bs-border-color: rgba(255,255,255,.08); }
.form-control, .form-select { background-color: #101012; color: #f7f4ef; border-color: #38312b; }
.form-control:focus, .form-select:focus { background-color: #111; color: #fff; border-color: var(--vg-orange); box-shadow: 0 0 0 .2rem rgba(255,121,0,.15); }
a { color: #ff9a24; }
a:hover { color: #ffc078; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Dashboard composition */
.vg-dashboard { display: grid; gap: 22px; min-width: 0; }
.vg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.vg-kpi { min-width: 0; padding: 15px 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 17px; background: linear-gradient(145deg,#19191b,#111113); }
.vg-kpi span { display: block; color: #dac6ad; font-size: 17px; }
.vg-kpi strong { display: block; margin: 9px 0 7px; color: #fff; font-size: clamp(27px,2.3vw,38px); line-height: 1.05; font-weight: 650; letter-spacing: -.04em; overflow-wrap: anywhere; }
.vg-kpi small { color: #b8a996; font-size: 15px; }
.vg-monitor-layout { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(290px,.82fr); gap: 18px; align-items: start; }
.vg-panel { min-width: 0; padding: 20px; border: 1px solid rgba(255,255,255,.08); border-radius: 19px; background: #141416; }
.vg-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.vg-panel-header h2, .vg-alerts-toolbar h2 { margin: 3px 0 0; font-size: 21px; font-weight: 700; letter-spacing: -.035em; color: #fffaf4; }
.vg-eyebrow { display: block; color: #ff922e; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.vg-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-size: 12px; font-weight: 750; cursor: pointer; }
.vg-button-primary { color: #17100a; background: linear-gradient(135deg,#ff9a24,#ff7000); }
.vg-button-primary:hover { color: #111; filter: brightness(1.06); }
.vg-button-outline { color: #f0e9e1; background: #202022; border-color: #38383a; }
.vg-button-dark { color: #f4eee7; background: #222123; border-color: #383438; }
.vg-full-button { width: 100%; margin-top: 14px; }
.vg-camera-workspace { display: grid; grid-template-columns: minmax(0,1fr) 190px; gap: 13px; }
.vg-featured-camera { min-width: 0; }
.vg-camera-card { min-width: 0; overflow: hidden; border: 1px solid #33302d; border-radius: 13px; background: #1a1919; }
.vg-camera-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 13px; }
.vg-camera-heading > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vg-camera-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.vg-live-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #16d36f; box-shadow: 0 0 8px rgba(22,211,111,.35); }
.vg-live-label { color: #24d67c; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.vg-source-badge { padding: 4px 7px; border-radius: 5px; background: #30251b; color: #ffad58; font-size: 9px; text-transform: uppercase; }
.vg-video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.vg-video-frame .live-feed { display: block; width: 100%; height: 100%; object-fit: contain; border: 0; border-radius: 0; background: #000; }
.vg-video-overlay { position: absolute; inset: 0 0 auto; display: flex; justify-content: space-between; gap: 8px; padding: 10px; background: linear-gradient(rgba(0,0,0,.6),transparent); color: #f9f5ef; font-size: 10px; pointer-events: none; }
.vg-feed-state { color: #d0c8bf; }
.vg-camera-controls { display: flex; align-items: center; gap: 7px; padding: 10px 12px; }
.vg-control-spacer { flex: 1; }
.vg-footnote { color: #8c857e; font-size: 9px; }
.vg-camera-rail { min-width: 0; }
.vg-rail-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 0 10px; }
.vg-rail-heading h3 { margin: 0; font-size: 13px; font-weight: 800; }
.vg-rail-heading span { color: #9b938a; font-size: 9px; }
.vg-camera-thumbnails { display: grid; gap: 9px; max-height: 590px; overflow-y: auto; padding-right: 2px; }
.vg-camera-thumb { cursor: pointer; transition: border-color .15s, transform .15s; }
.vg-camera-thumb:hover, .vg-camera-thumb:focus, .vg-camera-thumb.is-selected { border-color: var(--vg-orange); outline: none; }
.vg-thumb-video { aspect-ratio: 16 / 9; background: #000; }
.vg-thumb-video .live-feed { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; }
.vg-thumb-info { display: flex; justify-content: space-between; gap: 5px; padding: 7px 8px 3px; }
.vg-thumb-info strong { max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.vg-thumb-info span { color: #a49b91; font-size: 8px; white-space: nowrap; }
.vg-thumb-info .vg-live-dot { width: 5px; height: 5px; }
.vg-thumb-actions { display: flex; gap: 5px; padding: 5px 7px 8px; }
.vg-mini-button { padding: 3px 7px; border: 1px solid #39332d; border-radius: 5px; background: #242220; color: #d9d0c7; font-size: 9px; }
.vg-mini-button:hover { border-color: var(--vg-orange); color: #fff; }
.vg-empty-state { padding: 50px 20px; border: 1px dashed #494038; border-radius: 14px; text-align: center; }
.vg-empty-icon { margin-bottom: 10px; color: var(--vg-orange); font-size: 36px; }
.vg-empty-state h3 { font-size: 18px; font-weight: 800; }
.vg-empty-state p { color: #a9a097; font-size: 13px; }
.vg-events-panel .event-list { max-height: 520px; overflow-y: auto; }
.event-item { padding: 13px; border: 1px solid rgba(255,91,65,.30); border-radius: 11px; background: linear-gradient(130deg,rgba(255,121,0,.10),rgba(255,73,61,.06)); color: #f4eee7; font-size: 12px; overflow-wrap: anywhere; }
.event-item strong { display: block; margin-bottom: 6px; color: #fff4e9; font-size: 12px; }
.event-item span { display: inline-block; margin-bottom: 6px; color: #bcb2a7; font-size: 11px; }
.event-item a { color: #ff9a35; font-weight: 700; }
.vg-text-link { color: #ff9a35; text-decoration: none; font-size: 11px; font-weight: 750; white-space: nowrap; }
.vg-text-link:hover { color: #ffc078; }
.vg-analytics-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.vg-chart-wrap { position: relative; height: 250px; }

/* Alerts center */
.vg-alerts-page { display: grid; gap: 18px; }
.vg-alerts-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: linear-gradient(110deg,#171617,#111112); }
.vg-alerts-toolbar p { margin: 7px 0 0; font-size: 12px; }
.vg-alert-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.vg-filter-button { padding: 8px 13px; border: 1px solid #39332d; border-radius: 7px; background: #1d1c1b; color: #cfc5ba; font-size: 11px; font-weight: 750; }
.vg-filter-button.is-active { border-color: #ff9a24; background: #ff9a24; color: #16110c; }
.vg-events-table thead th { padding: 13px 11px; color: #a9a096; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.vg-events-table tbody td { padding: 13px 11px; font-size: 11px; white-space: nowrap; }
.vg-event-id { color: #ffb15d !important; font-weight: 800; }
.vg-violation-tag { display: inline-block; padding: 4px 7px; border: 1px solid rgba(255,121,0,.22); border-radius: 5px; background: rgba(255,121,0,.09); color: #ffb15d; }
.vg-state-tag { display: inline-block; padding: 4px 7px; border-radius: 5px; background: rgba(255,73,61,.12); color: #ff8076; font-size: 10px; font-weight: 800; }

/* Consistent form, upload, and table styling on all other pages */
.panel h2, .card h2 { color: #fff6ec; }
label, .form-label { color: #d5ccc2; }
.alert { border-radius: 10px; }
pre, .json-box { background: #090909; border-color: #38312b; color: #ffe1c3; }
.badge.text-bg-secondary { background: #34302c !important; color: #f3b777 !important; }

@media (max-width: 1280px) {
  .vg-monitor-layout { grid-template-columns: minmax(0,1fr); }
  .vg-camera-workspace { grid-template-columns: minmax(0,1fr) 220px; }
  .vg-events-panel .event-list { max-height: 320px; }
}
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; height: auto; }
  .brand { width: 230px; height: 72px; margin-bottom: 12px; }
  .app-shell { display: block; }
  .sidebar .nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
  .sidebar .nav-link { margin: 0; }
  .content { margin-left: 0; width: 100%; padding: 18px; }
  .vg-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .vg-camera-workspace { grid-template-columns: minmax(0,1fr); }
  .vg-camera-thumbnails { grid-template-columns: repeat(2,minmax(0,1fr)); max-height: none; }
  .vg-analytics-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .vg-kpi { padding: 15px; }
  .vg-kpi strong { font-size: 27px; }
  .vg-panel { padding: 13px; }
  .vg-panel-header, .vg-alerts-toolbar { align-items: flex-start; flex-direction: column; }
  .vg-camera-thumbnails { grid-template-columns: minmax(0,1fr); }
  .vg-camera-controls { flex-wrap: wrap; }
  .vg-control-spacer { display: none; }
}


/* VisoGuard multi-camera command wall */
.vg-camera-wall-panel { min-width: 0; }
.vg-wall-header { align-items: center; }
.vg-wall-subtitle { margin: 6px 0 0; color: #a9a096; font-size: 12px; }
.vg-wall-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.vg-camera-count { color: #f4b45f; font-size: 11px; font-weight: 800; white-space: nowrap; }
.vg-camera-wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.vg-wall-camera { min-width: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: #111112; }
.vg-wall-camera-heading { min-height: 54px; display: flex; align-items: center; gap: 8px; padding: 10px; }
.vg-wall-camera-title { flex: 1; min-width: 0; }
.vg-wall-camera-title strong { display: block; overflow: hidden; color: #fff2e4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.vg-wall-camera-title small { display: block; margin-top: 3px; overflow: hidden; color: #93877b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.vg-camera-status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #d6a348; box-shadow: 0 0 7px currentColor; }
.vg-camera-status-dot[data-state="running"] { background: #39cf83; }
.vg-camera-status-dot[data-state="disconnected"] { background: #f45b52; }
.vg-camera-status-dot[data-state="stopped"] { background: #817a72; }
.vg-status-pill { flex: 0 0 auto; padding: 4px 6px; border-radius: 5px; background: #352a19; color: #f5bd67; font-size: 8px; font-weight: 800; }
.vg-status-pill[data-state="running"] { background: rgba(35,170,99,.15); color: #55db91; }
.vg-status-pill[data-state="disconnected"] { background: rgba(239,74,65,.14); color: #ff837a; }
.vg-status-pill[data-state="stopped"] { background: #292725; color: #aaa098; }
.vg-wall-video { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #070707; }
.vg-wall-feed { display: block; width: 100%; height: 100%; object-fit: cover; }
.vg-wall-offline { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; background: rgba(5,5,5,.72); color: #e6d8c9; text-align: center; font-size: 11px; }
.vg-wall-offline[hidden] { display: none; }
.vg-wall-camera-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; color: #968a7e; font-size: 9px; }
.vg-wall-camera-footer > div { display: flex; gap: 5px; }
.vg-wall-camera-footer .vg-mini-button { padding: 5px 8px; }
.vg-wall-events { margin-top: 18px; }
@media (min-width: 1600px) { .vg-camera-wall { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .vg-camera-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .vg-camera-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vg-wall-header { align-items: flex-start; flex-direction: column; } .vg-wall-actions { justify-content: flex-start; } }
@media (max-width: 520px) { .vg-camera-wall { grid-template-columns: minmax(0, 1fr); } }

/* VisoGuard control-room layout: 80% live monitor / 20% context panel */
.nav-section-label { display:block; color:#706a63; font-size:10px; font-weight:800; letter-spacing:.16em; padding:17px 13px 7px; }
.sidebar .nav-link { display:flex; align-items:center; gap:11px; }
.nav-symbol { width:20px; flex:0 0 20px; text-align:center; color:#b8afa4; font-size:17px; }
.nav-alert-symbol { color:#ff6259; }
.sidebar .nav-link-primary { color:#ffb04b; background:rgba(255,121,0,.11); border-left-color:var(--vg-orange); }
.sidebar .nav-link-primary .nav-symbol { color:#ffb04b; }
.vg-control-header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:4px 0 18px; }
.vg-control-header p { color:#aaa198; margin:5px 0 0; font-size:13px; }
.vg-monitor-layout-80-20 { display:grid; grid-template-columns:minmax(0,4fr) minmax(250px,1fr); gap:14px; align-items:start; }
.vg-main-monitor,.vg-monitor-sidebar { min-width:0; display:flex; flex-direction:column; gap:14px; }
.vg-monitor-sidebar { max-height:calc(100vh - 160px); overflow-y:auto; padding-right:2px; }
.vg-monitor-layout-80-20 .vg-camera-card { min-width:0; overflow:hidden; border:1px solid rgba(255,121,0,.22); border-radius:14px; background:#111112; }
.vg-monitor-layout-80-20 .vg-camera-heading { min-height:48px; padding:12px 14px; }
.vg-monitor-layout-80-20 .vg-video-frame { position:relative; width:100%; height:clamp(330px,54vh,760px); min-height:260px; background:#050505; overflow:hidden; }
.vg-monitor-layout-80-20 .vg-video-frame .live-feed { display:block; width:100%; height:100%; aspect-ratio:auto; object-fit:contain; border:0; border-radius:0; background:#050505; }
.vg-video-corner-label { position:absolute; top:12px; right:12px; background:rgba(0,0,0,.68); color:#ffb04b; border:1px solid rgba(255,121,0,.35); padding:5px 8px; border-radius:5px; font-size:9px; letter-spacing:.12em; font-weight:800; }
.vg-monitor-layout-80-20 .vg-camera-controls { padding:10px 12px; }
.vg-remaining-cameras,.vg-camera-details,.vg-redflag-panel { padding:13px; border:1px solid rgba(255,255,255,.08); border-radius:13px; background:#131314; }
.vg-remaining-cameras .vg-panel-header,.vg-monitor-sidebar .vg-panel-header { margin-bottom:11px; }
.vg-remaining-cameras h2,.vg-monitor-sidebar h2 { font-size:15px; margin:3px 0 0; }
.vg-small-count { color:#a7a19a; font-size:11px; white-space:nowrap; }
.vg-camera-tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.vg-camera-thumb { min-width:0; overflow:hidden; cursor:pointer; background:#0d0d0e; border:1px solid rgba(255,255,255,.1); border-radius:9px; transition:border-color .16s, transform .16s; }
.vg-camera-thumb:hover,.vg-camera-thumb:focus,.vg-camera-thumb.is-selected { border-color:#ff9a24; outline:none; transform:translateY(-1px); }
.vg-thumb-video { height:90px; position:relative; background:#030303; }
.vg-thumb-video .live-feed { display:block; width:100%; height:100%; object-fit:cover; border:0; border-radius:0; aspect-ratio:auto; }
.vg-thumb-status { position:absolute; left:6px; top:6px; background:rgba(0,0,0,.76); color:#ffb04b; font-size:8px; font-weight:800; padding:3px 5px; border-radius:4px; }
.vg-thumb-status[data-state="running"] { color:#43e18c; }
.vg-thumb-status[data-state="disconnected"],.vg-thumb-status[data-state="error"] { color:#ff655c; }
.vg-thumb-info { padding:8px; display:flex; flex-direction:column; gap:4px; }
.vg-thumb-info strong { font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.vg-thumb-info span { color:#928a80; font-size:9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.vg-detail-status { font-size:9px; font-weight:800; color:#ffb04b; background:rgba(255,121,0,.1); border-radius:5px; padding:5px 6px; }
.vg-detail-status[data-state="running"] { color:#43e18c; background:rgba(19,198,107,.1); }
.vg-detail-status[data-state="disconnected"],.vg-detail-status[data-state="error"] { color:#ff655c; background:rgba(255,73,61,.1); }
.vg-detail-list { margin:0; }
.vg-detail-list div { display:flex; flex-direction:column; gap:3px; padding:9px 0; border-bottom:1px solid rgba(255,255,255,.06); }
.vg-detail-list div:last-child { border-bottom:0; }
.vg-detail-list dt { color:#817970; text-transform:uppercase; letter-spacing:.08em; font-size:9px; }
.vg-detail-list dd { margin:0; color:#f3eee8; font-size:12px; overflow-wrap:anywhere; }
.vg-redflag-icon { color:#ff4d45; }
.vg-redflag-list { display:flex; flex-direction:column; gap:9px; }
.vg-redflag-item { display:grid; grid-template-columns:76px minmax(0,1fr); gap:9px; padding:7px; border:1px solid rgba(255,73,61,.18); border-radius:8px; background:rgba(255,73,61,.045); min-width:0; }
.vg-redflag-image { display:block; width:76px; height:62px; object-fit:cover; background:#080808; border-radius:5px; }
.vg-redflag-placeholder { width:76px; height:62px; display:grid; place-items:center; border-radius:5px; background:#241514; color:#ff6259; font-size:22px; }
.vg-redflag-copy { min-width:0; display:flex; flex-direction:column; gap:4px; }
.vg-redflag-copy strong { font-size:10px; color:#ff8a80; line-height:1.35; }
.vg-redflag-copy span { color:#a7a19a; font-size:9px; overflow-wrap:anywhere; }
.vg-redflag-copy a { color:#ffb04b; font-size:10px; text-decoration:none; font-weight:700; }
.vg-redflag-empty { color:#a7a19a; font-size:11px; margin:0; }
.vg-control-kpis { margin-top:16px; }
@media (min-width:1500px) { .vg-monitor-layout-80-20 { grid-template-columns:minmax(0,4fr) minmax(270px,1fr); } }
@media (max-width:1150px) { .vg-monitor-layout-80-20 { grid-template-columns:minmax(0,1fr); } .vg-monitor-sidebar { max-height:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible; } .vg-monitor-layout-80-20 .vg-video-frame { height:clamp(300px,52vh,600px); } }
@media (max-width:700px) { .vg-control-header { align-items:flex-start; flex-direction:column; } .vg-monitor-sidebar { grid-template-columns:minmax(0,1fr); } .vg-camera-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); } .vg-monitor-layout-80-20 .vg-video-frame { height:300px; min-height:220px; } }


/* All Cameras command center: keep the selected feed dominant and the right rail compact. */
.vg-monitor-layout-80-20 { grid-template-columns: minmax(0, 4fr) minmax(255px, 1fr); gap: 14px; }
.vg-monitor-sidebar { max-height: calc(100vh - 150px); overflow-y: auto; overscroll-behavior: contain; }
.vg-monitor-sidebar .vg-remaining-cameras { min-height: 0; }
.vg-monitor-sidebar .vg-camera-tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-height: 34vh; overflow-y: auto; padding-right: 3px; }
.vg-monitor-sidebar .vg-camera-thumb { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; }
.vg-monitor-sidebar .vg-thumb-video { height: 62px; min-width: 0; }
.vg-monitor-sidebar .vg-thumb-info { min-width: 0; padding: 7px; }
.vg-monitor-sidebar .vg-thumb-info strong { font-size: 10px; }
.vg-monitor-sidebar .vg-thumb-info span { font-size: 8px; }
.vg-monitor-sidebar .vg-redflag-list { max-height: 30vh; overflow-y: auto; }
.vg-camera-count strong { color: #fff; font-size: 16px; }
@media (max-width: 1150px) { .vg-monitor-layout-80-20 { grid-template-columns: minmax(0, 1fr); } .vg-monitor-sidebar { max-height: none; overflow: visible; } .vg-monitor-sidebar .vg-camera-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; } .vg-monitor-sidebar .vg-camera-thumb { grid-template-columns: minmax(0, 1fr); } .vg-monitor-sidebar .vg-thumb-video { height: auto; aspect-ratio: 16/9; } .vg-monitor-sidebar .vg-redflag-list { max-height: none; } }


/* VisoGuard UI repair v3: tighter control-room shell and consistent camera manager forms */
.sidebar { z-index: 20; box-shadow: 8px 0 30px rgba(0,0,0,.18); }
.brand { display:flex; align-items:center; min-height:66px; padding:8px 10px 18px; }
.brand img { display:block; max-width:100%; max-height:56px; object-fit:contain; object-position:left center; }
.nav-link { display:flex; align-items:center; gap:12px; min-height:44px; transition:background .18s ease,color .18s ease,border-color .18s ease; }
.nav-link.active, .nav-link-primary { background:linear-gradient(100deg,rgba(255,121,0,.20),rgba(255,121,0,.06)); color:#fffaf4; border:1px solid rgba(255,121,0,.25); }
.nav-symbol { display:inline-flex; width:24px; height:24px; align-items:center; justify-content:center; flex:0 0 24px; border-radius:7px; background:rgba(255,255,255,.06); color:var(--vg-orange-light,#ff9a24); font-size:16px; }
.topbar { border-bottom:1px solid var(--border); padding-bottom:20px; }
.topbar h1 { font-size:clamp(25px,2.3vw,36px); }
.content { max-width:1900px; }
#cameraDiscoveryPanel, .panel, .camera-card { box-shadow:0 12px 36px rgba(0,0,0,.16); }
.form-control,.form-select { min-height:43px; background-color:#101012; color:var(--text); border-color:rgba(255,255,255,.15); }
.form-control:focus,.form-select:focus { background-color:#101012; color:var(--text); border-color:var(--vg-orange); box-shadow:0 0 0 .2rem rgba(255,121,0,.14); }
.btn-primary { background:var(--vg-orange); border-color:var(--vg-orange); color:#16110b; font-weight:700; }
.btn-primary:hover { background:#ff9633; border-color:#ff9633; color:#16110b; }
.table thead th { color:#ffbf80; white-space:nowrap; font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; }
.vg-dashboard { min-width:0; }
.vg-monitor-layout-80-20 { grid-template-columns:minmax(0,4fr) minmax(280px,1fr); }
.vg-video-frame { min-height:360px; }
.vg-camera-thumb:focus-visible,.nav-link:focus-visible,button:focus-visible,a:focus-visible { outline:2px solid var(--vg-orange-light); outline-offset:2px; }
@media(max-width:1100px) { .sidebar { width:220px; } .content { margin-left:220px; width:calc(100% - 220px); padding:22px; } .vg-monitor-layout-80-20 { grid-template-columns:minmax(0,1fr); } }
@media(max-width:980px) { .sidebar { width:auto; } .content { margin-left:0; width:100%; } .brand img { max-height:46px; } }


/* =========================================================
   VISOGUARD PREMIUM CONTROL CENTER — v4
   Palette: cool slate, cloud white, teal and indigo.
   Replaces the former black/orange brand across every page.
   ========================================================= */
:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --text: #182538;
  --muted: #68788d;
  --accent: #087f8c;
  --danger: #d9485f;
  --success: #168568;
  --border: #e1e8f0;
  --vg-orange: #087f8c;
  --vg-orange-light: #20a6a6;
  --vg-white: #182538;
  --vg-charcoal: #f3f6fb;
  --vg-surface: #ffffff;
}
html, body { background: var(--bg) !important; color: var(--text) !important; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app-shell { background: var(--bg); }
.sidebar {
  background: #fff !important; border-right: 1px solid #e1e8f0 !important;
  box-shadow: 8px 0 30px rgba(27, 48, 77, .035) !important;
}
.brand { background: #fff !important; border-radius: 14px; }
.sidebar .nav-link { color: #63748a !important; border-left-color: transparent; border-radius: 11px; font-size: 14px; font-weight: 650; }
.sidebar .nav-link:hover, .sidebar .nav-link:focus { background: #eaf7f7 !important; color: #087f8c !important; border-left-color: #087f8c !important; }
.sidebar .nav-link.active, .sidebar .nav-link-primary {
  color: #087f8c !important; background: linear-gradient(100deg,#e2f5f4,#f0fafa) !important;
  border: 1px solid #ccebea !important; box-shadow: inset 3px 0 #087f8c;
}
.nav-symbol { color: #087f8c !important; background: #e7f5f5 !important; border-radius: 8px; }
.content { background: var(--bg); }
.topbar { border-bottom: 1px solid #e1e8f0 !important; }
.topbar h1 { color: #17283e !important; font-weight: 780; letter-spacing: -.045em; }
.topbar .muted { color: #748399 !important; }
.status-pill { color: #52657b; background: #edf2f7 !important; border: 1px solid #dfe7ef !important; }
.status-pill.success { color: #13795b !important; background: #e7f7f0 !important; border-color: #c5ebdc !important; }
.status-pill.danger { color: #b9344a !important; background: #fff0f2 !important; border-color: #f7d4da !important; }
.card, .panel, .vg-panel, .vg-kpi, .vg-camera-card, .camera-card, .vg-wall-camera, .vg-alerts-toolbar {
  color: #1b2a40 !important; background: #fff !important; border: 1px solid #e2e9f1 !important;
  box-shadow: 0 8px 26px rgba(31, 53, 82, .055) !important;
}
.vg-kpi { border-radius: 16px; }
.vg-kpi span, .vg-kpi small { color: #687b91 !important; }
.vg-kpi strong { color: #162940 !important; }
.vg-panel-header h2, .vg-alerts-toolbar h2, .panel h2, .card h2 { color: #182a40 !important; }
.vg-eyebrow { color: #087f8c !important; }
.vg-button-primary, .btn-primary {
  color: #fff !important; background: linear-gradient(135deg,#0b929b,#087f8c) !important;
  border-color: #087f8c !important; box-shadow: 0 4px 12px rgba(8,127,140,.16);
}
.vg-button-primary:hover, .btn-primary:hover { background: #066b76 !important; border-color: #066b76 !important; }
.vg-button-outline, .vg-button-dark { color: #40546b !important; background: #f6f9fc !important; border-color: #dbe5ef !important; }
.vg-button-outline:hover, .vg-button-dark:hover { color: #087f8c !important; background: #eaf7f7 !important; border-color: #b9e2e1 !important; }
.btn-success { color: #fff !important; background: #168568 !important; border-color: #168568 !important; }
.btn-outline-danger { color: #c43c50 !important; border-color: #e9bfc7 !important; }
a, .small-link, .vg-text-link { color: #087f8c; }
a:hover, .vg-text-link:hover { color: #075e68; }
label, .form-label { color: #42566e !important; font-weight: 650; }
.form-control, .form-select, input, select, textarea {
  color: #1c2d43 !important; background-color: #fff !important; border-color: #d7e1ec !important; border-radius: 9px;
}
.form-control::placeholder, input::placeholder, textarea::placeholder { color: #98a6b7 !important; }
.form-control:focus, .form-select:focus, input:focus, textarea:focus {
  background: #fff !important; color: #1c2d43 !important; border-color: #55b8ba !important;
  box-shadow: 0 0 0 .2rem rgba(8,127,140,.12) !important;
}
.table { --bs-table-color: #26384e; --bs-table-bg: transparent; --bs-table-hover-color: #152c43; --bs-table-hover-bg: #eff8f8; --bs-border-color: #e3eaf2; }
.table thead th { color: #5b6f85 !important; background: #f4f7fb; font-size: .74rem; letter-spacing: .065em; border-bottom-color: #dce5ee !important; }
.table tbody td { color: #33465d; border-color: #e7edf4; }
.table-responsive { border: 1px solid #e2e9f1; border-radius: 12px; background: #fff; }
.vg-camera-heading { background: #f7f9fc; }
.vg-camera-heading strong, .vg-wall-camera-title strong { color: #20334a !important; }
.vg-source-badge { background: #e8f6f5 !important; color: #087f8c !important; }
.vg-video-frame, .vg-wall-video, .live-feed, .thumb-video { background: #101b2a; }
.vg-camera-controls, .vg-wall-camera-footer { background: #f8fafc; color: #718197; }
.vg-camera-status-dot[data-state="running"] { background: #15966e; }
.vg-status-pill { background: #fff6df !important; color: #96630a !important; }
.vg-status-pill[data-state="running"] { background: #e7f7ef !important; color: #147a58 !important; }
.vg-status-pill[data-state="disconnected"] { background: #fff0f2 !important; color: #bd3348 !important; }
.vg-status-pill[data-state="stopped"] { background: #eef2f6 !important; color: #6b7a8d !important; }
.vg-camera-thumb:hover, .vg-camera-thumb:focus, .vg-camera-thumb.is-selected { border-color: #36a8aa !important; box-shadow: 0 0 0 2px rgba(8,127,140,.10); }
.vg-mini-button { background: #fff !important; border-color: #dce5ee !important; color: #53677e !important; }
.vg-mini-button:hover { color: #087f8c !important; border-color: #7ac9c8 !important; }
.vg-empty-state { border-color: #cddde7 !important; background: #f8fbfd !important; }
.vg-empty-icon { color: #087f8c !important; }
.vg-empty-state h3 { color: #23364d; }
.vg-empty-state p { color: #708198; }
.event-item { background: #fff5f6 !important; border-color: #f2d4d9 !important; color: #4a3040 !important; }
.event-item strong { color: #a92f46 !important; }
.event-item span { color: #7d6b77 !important; }
.event-item a { color: #b8324a !important; }
.vg-violation-tag { background: #fff4e7 !important; border-color: #f4dfc3 !important; color: #976018 !important; }
.vg-state-tag { background: #fff0f2 !important; color: #b9344a !important; }
.vg-filter-button { color: #5a6c82 !important; background: #fff !important; border-color: #dce5ee !important; }
.vg-filter-button.is-active { color: #fff !important; border-color: #087f8c !important; background: #087f8c !important; }
pre, .json-box { background: #f4f7fb !important; border-color: #dce5ee !important; color: #344c66 !important; }
.badge.text-bg-secondary { background: #e7f2f5 !important; color: #236c7a !important; }
.alert { border-radius: 11px; }
.progress { background: #e8eef5; }
.dropdown-menu { border: 1px solid #e1e8f0; box-shadow: 0 12px 28px rgba(30,50,80,.12); }
.dropdown-item { color: #34485f; }
.dropdown-item:hover { color: #087f8c; background: #eaf7f7; }
.vg-camera-count, .vg-camera-count strong { color: #087f8c !important; }
.vg-wall-subtitle { color: #728197 !important; }
.vg-footnote { color: #8492a5 !important; }
#cameraDiscoveryPanel, .panel, .camera-card { box-shadow: 0 8px 26px rgba(31,53,82,.055) !important; }
button:focus-visible, a:focus-visible, .vg-camera-thumb:focus-visible { outline: 2px solid #20a6a6 !important; outline-offset: 2px; }
@media (max-width: 980px) { .sidebar { border-bottom: 1px solid #e1e8f0 !important; } }
/* v5 test */

/* VisoGuard Control Room UI v5 — page-level cleanup across all templates */
:root { --vg-bg:#f3f6fb; --vg-card:#fff; --vg-ink:#182a40; --vg-muted:#687b91; --vg-line:#e0e8f1; --vg-teal:#087f8c; }
body,.app-shell,.content { background:var(--vg-bg)!important; color:var(--vg-ink)!important; }
.content { min-height:100vh; }
.topbar { align-items:center; min-height:76px; margin-bottom:18px; }
.topbar h1 { font-size:clamp(25px,2vw,34px); line-height:1.12; }
.topbar .muted { font-size:14px; }
.card,.panel,.vg-panel,.vg-kpi,.vg-camera-card,.camera-card,.vg-wall-camera,.vg-alerts-toolbar,.vg-alerts-page>section { border-radius:18px; background:#fff!important; color:#23364d!important; border:1px solid #e0e8f1!important; box-shadow:0 8px 28px rgba(27,48,77,.055)!important; }
.panel h2,.panel h3,.card h2,.card h3,.vg-panel h2,.vg-panel h3 { color:#1b3049!important; }
p,.muted,.text-muted { color:#6d7f94; }
pre,code,.json-box { max-width:100%; white-space:pre; overflow:auto; overflow-wrap:normal; }
.json-box { border-radius:14px; }
.table-responsive { max-width:100%; overflow-x:auto; }
.table { min-width:680px; }
.table thead th { position:sticky; top:0; z-index:1; }
.vg-events-table { min-width:1000px; }
.vg-events-table thead th { background:#f2f6fa!important; color:#52677e!important; }
.vg-events-table tbody tr:nth-child(even) { background:#f8fafc; }
.vg-events-table tbody td { color:#344a62!important; border-color:#e5ebf2!important; }
.vg-event-id { color:#087f8c!important; }
.vg-state-tag { border-radius:999px; }
.vg-alerts-toolbar { background:#fff!important; }
.vg-alerts-toolbar p { color:#728198!important; }
.vg-wall-camera { overflow:hidden; }
.vg-wall-camera-heading { background:#f7f9fc; }
.vg-wall-camera-title strong { color:#1b3049!important; }
.vg-wall-video,.vg-video-frame,.live-feed,.result-image,.video-result { background:#111d2d!important; }
.vg-wall-offline { background:rgba(12,26,43,.88)!important; color:#eef5fb!important; }
.event-item { background:#fff6f6!important; border:1px solid #f2d8dc!important; color:#4a3040!important; }
.event-item strong { color:#a52d43!important; }
.event-item span { color:#758397!important; }
.event-item a { color:#087f8c!important; }
.vg-analytics-grid .vg-panel { min-width:0; }
canvas { max-width:100%; }
.form-control,.form-select,input,select,textarea { min-height:42px; }
textarea { min-height:110px; }
.btn,.vg-button { transition:transform .12s ease,box-shadow .12s ease; }
.btn-primary,.vg-button-primary { border-radius:9px!important; }
.btn-primary:hover,.vg-button-primary:hover { transform:translateY(-1px); box-shadow:0 7px 16px rgba(8,127,140,.18); }
img { max-width:100%; }
.evidence-unavailable { display:grid; place-items:center; min-height:110px; padding:16px; border:1px dashed #cbd7e4; border-radius:10px; background:#f7f9fc; color:#718197; text-align:center; font-size:12px; }
@media(max-width:980px) { .sidebar { position:static; width:100%; height:auto; } .content { margin-left:0; width:100%; } }
@media(max-width:700px) { .content { padding:16px!important; } .topbar h1 { font-size:25px; } .vg-kpis,.cards-grid,.two-col,.result-grid { grid-template-columns:1fr!important; } .vg-alerts-toolbar { align-items:stretch; flex-direction:column; } }



/* VisoGuard v6 — applied after page-level styles to unify every route */
:root {
  --bg: #f2f5fa !important;
  --panel: #ffffff !important;
  --panel-2: #f7f9fc !important;
  --text: #1b2b42 !important;
  --muted: #718198 !important;
  --accent: #087f8c !important;
  --danger: #dc4256 !important;
  --success: #0c9a70 !important;
  --border: #dfe7f0 !important;
  --vg-orange: #087f8c !important;
  --vg-orange-light: #16a3a6 !important;
  --vg-white: #1b2b42 !important;
  --vg-charcoal: #f2f5fa !important;
  --vg-surface: #ffffff !important;
}
html, body { background:#f2f5fa !important; color:#1b2b42 !important; }
body { font-family: Inter, "Segoe UI", Arial, sans-serif !important; }
.app-shell { background:#f2f5fa !important; }
.sidebar {
  background:#132238 !important; border-right:1px solid #20334c !important;
  box-shadow: 8px 0 28px rgba(22,42,67,.07) !important;
}
.brand { background:transparent !important; }
.sidebar .nav-link, .sidebar .nav-link:not(.active) { color:#b9c7d9 !important; }
.sidebar .nav-link:hover, .sidebar .nav-link:focus {
  color:#fff !important; background:rgba(35,190,185,.13) !important;
  border-left-color:#24b8b1 !important;
}
.sidebar .nav-link.active, .sidebar .nav-link.nav-link-primary.active {
  color:#fff !important; background:linear-gradient(90deg,rgba(8,127,140,.34),rgba(8,127,140,.10)) !important;
  border-left-color:#28c4bd !important;
}
.content { background:#f2f5fa !important; color:#1b2b42 !important; }
.topbar { border-bottom:1px solid #dce5ef !important; }
.topbar h1 { color:#172b44 !important; font-weight:760 !important; }
.topbar .muted, .muted { color:#718198 !important; }
.status-pill { background:#fff !important; border:1px solid #dce5ef !important; }
.status-pill.success { color:#087f68 !important; background:#e7f8f2 !important; border-color:#bcebdd !important; }
.status-pill.danger { color:#a83245 !important; background:#fff0f1 !important; border-color:#f3c8ce !important; }

.card, .panel, .vg-panel, .vg-kpi, .camera-card, .vg-camera-card, .vg-wall-camera,
.history-card, .upload-panel, .live-panel, .person-card, .alert-card, .json-card {
  background:#fff !important; color:#263951 !important; border:1px solid #dfe7f0 !important;
  border-radius:18px !important; box-shadow:0 8px 28px rgba(26,48,76,.055) !important;
}
.card h2, .card h3, .panel h2, .panel h3, .vg-panel h2, .vg-panel h3,
.history-card h2, .upload-title, .live-title { color:#1b3049 !important; }
.panel, .vg-panel { padding:22px !important; }
.vg-kpi { background:#fff !important; }
.vg-kpi span, .vg-kpi small { color:#6d8097 !important; }
.vg-kpi strong { color:#172b44 !important; }
.vg-eyebrow { color:#087f8c !important; }
.vg-panel-header h2, .vg-alerts-toolbar h2 { color:#1b3049 !important; }
.vg-button-primary, .btn-primary {
  background:#087f8c !important; border-color:#087f8c !important; color:#fff !important;
  box-shadow:0 5px 13px rgba(8,127,140,.15) !important;
}
.vg-button-primary:hover, .btn-primary:hover { background:#066c77 !important; border-color:#066c77 !important; color:#fff !important; }
.vg-button-outline, .vg-button-dark { background:#f6f9fc !important; border-color:#d5e0eb !important; color:#31475f !important; }
.btn-outline-danger, .delete-all-btn { color:#c83c4c !important; border-color:#e7aab2 !important; }
.delete-selected-btn { background:#d94353 !important; color:#fff !important; }
.form-control, .form-select, input, select, textarea {
  background:#fff !important; color:#243850 !important; border-color:#d3deea !important;
}
.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
  border-color:#159ba0 !important; box-shadow:0 0 0 .2rem rgba(8,127,140,.12) !important;
}
.form-control::placeholder, input::placeholder, textarea::placeholder { color:#91a0b2 !important; }
a, .small-link, .vg-text-link { color:#087f8c !important; }
a:hover, .vg-text-link:hover { color:#055d66 !important; }
.table { --bs-table-color:#2d4058 !important; --bs-table-bg:#fff !important; --bs-table-hover-color:#1b3049 !important; --bs-table-hover-bg:#f1f8f9 !important; --bs-border-color:#e1e8f0 !important; }
.table thead th { color:#60748b !important; background:#f3f6fa !important; border-color:#e1e8f0 !important; }
.table tbody td { color:#344a62 !important; border-color:#e8edf3 !important; }
.history-card { overflow-x:auto !important; }
.history-card table { min-width:950px; }
.history-header { gap:14px; flex-wrap:wrap; }
.json-box, pre.json-box {
  background:#f3f7fb !important; color:#284766 !important; border:1px solid #d9e4ef !important;
  border-radius:14px !important; white-space:pre !important; overflow:auto !important;
}
.vg-camera-card, .camera-card { background:#fff !important; }
.vg-camera-heading, .vg-wall-camera-heading, .camera-title, .camera-header { color:#263951 !important; }
.vg-live-video, .vg-wall-video, .live-feed, .result-image, .video-result, .live-video {
  background:#101c2d !important; border:1px solid #26384e !important; border-radius:12px !important;
}
.vg-wall-offline { background:rgba(14,29,48,.9) !important; color:#eef5fb !important; }
.event-item, .alert-item, .violation-card {
  background:#fff5f6 !important; color:#4d3440 !important; border:1px solid #f0d5da !important;
}
.event-item strong { color:#a93248 !important; }
.event-item span { color:#6f8095 !important; }
.event-item a { color:#087f8c !important; }
.alerts-panel, .live-alerts, .alert-sidebar { background:#f7f9fc !important; color:#243850 !important; }
.alert-image { border-color:#d6e0eb !important; }
.upload-panel, .live-panel { color:#263951 !important; }
.upload-panel p, .live-panel p { color:#63758b !important; }
.upload-dropzone, .drop-zone, .file-drop-area { background:#f6f9fc !important; border-color:#cbd9e7 !important; }
.evidence-unavailable {
  display:grid; place-items:center; min-height:110px; padding:16px;
  border:1px dashed #cbd7e4; border-radius:10px; background:#f7f9fc;
  color:#718197; text-align:center; font-size:12px;
}
img { max-width:100%; }
.table-responsive { max-width:100%; overflow-x:auto; }
pre, code { max-width:100%; }
@media(max-width:980px) {
  .sidebar { position:static !important; width:100% !important; height:auto !important; }
  .app-shell { display:block !important; }
  .content { margin-left:0 !important; width:100% !important; padding:18px !important; }
}
@media(max-width:700px) {
  .content { padding:14px !important; }
  .topbar h1 { font-size:25px !important; }
  .cards-grid, .two-col, .result-grid, .vg-kpis, .vg-monitor-layout, .video-layout, .live-layout, .monitor-layout {
    grid-template-columns:1fr !important;
  }
  .history-header { align-items:flex-start !important; }
}



/* Route-specific classes used by the actual upload, CCTV and alert templates */
.alert-sidebar {
  background:#f7f9fc !important; color:#263951 !important;
  border:1px solid #dfe7f0 !important; border-radius:18px !important;
  padding:18px !important; box-shadow:0 8px 28px rgba(26,48,76,.055) !important;
}
.alert-card {
  background:#fff5f6 !important; color:#34465c !important;
  border:1px solid #f0d5da !important; border-left:4px solid #dc4256 !important;
  border-radius:14px !important; padding:14px !important;
}
.alert-card .alert-title, .alert-card .alert-person { color:#a83245 !important; }
.alert-card .alert-time { color:#77869a !important; }
.upload-box {
  background:#f7fafc !important; color:#263951 !important;
  border:1px dashed #c7d6e5 !important; border-radius:16px !important;
}
.upload-box .upload-text, .upload-box .upload-description { color:#6c7e94 !important; }
.upload-box .upload-icon { color:#087f8c !important; }
.no-alerts, .no-events {
  color:#728399 !important; background:#f7f9fc !important;
  border:1px dashed #d4dfeb !important; border-radius:12px !important; padding:18px !important;
}
.camera-status { border-radius:999px !important; }
.camera-header { background:#f6f9fc !important; color:#233850 !important; }
.camera-info { color:#657890 !important; }
.history-table { background:#fff !important; }
.history-table th { background:#f1f5f9 !important; color:#5b7088 !important; }
.history-table td { color:#344a62 !important; border-color:#e4ebf2 !important; }
.delete-btn { background:#fff !important; color:#b9384b !important; border:1px solid #e7b8c0 !important; }
.person-card { background:#fff !important; color:#2b4058 !important; }


/* =========================================================
   SITE WATCH / MOBILE CONTROL-ROOM LAYER
   ========================================================= */
.vg-site-watch { display:grid; gap:18px; min-width:0; }
.vg-site-watch-header { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; }
.vg-site-watch-header h2 { margin:4px 0 5px; font-size:clamp(22px,2.3vw,32px); color:var(--vg-text,#182538); }
.vg-site-watch-header p { max-width:760px; margin:0; }
.vg-site-watch-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:flex-end; }
.vg-site-camera-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; min-width:0; }
.vg-site-camera-card { min-width:0; overflow:hidden; border:1px solid var(--border); border-radius:16px; background:#fff; box-shadow:0 10px 28px rgba(28,44,67,.08); cursor:pointer; transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.vg-site-camera-card:hover,.vg-site-camera-card:focus-visible { transform:translateY(-2px); border-color:rgba(8,127,140,.45); box-shadow:0 16px 36px rgba(28,44,67,.13); outline:none; }
.vg-site-camera-media { position:relative; aspect-ratio:16/9; background:#091018; overflow:hidden; }
.vg-site-camera-media .live-feed { width:100%; height:100%; object-fit:cover; border:0; border-radius:0; display:block; }
.vg-site-camera-topline { position:absolute; top:10px; left:10px; right:10px; display:flex; align-items:center; gap:7px; color:#fff; font-size:10px; font-weight:800; letter-spacing:.06em; text-shadow:0 1px 2px #000; }
.vg-site-camera-topline .vg-source-badge { margin-left:auto; }
.vg-site-camera-overlay { position:absolute; left:0; right:0; bottom:0; display:flex; justify-content:space-between; gap:10px; padding:28px 12px 10px; background:linear-gradient(transparent,rgba(0,0,0,.82)); color:#fff; font-size:12px; font-weight:800; }
.vg-site-camera-overlay span:last-child { font-size:10px; opacity:.82; font-weight:600; }
.vg-site-camera-body { padding:13px; }
.vg-site-camera-title { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.vg-site-camera-title strong { display:block; font-size:14px; color:#182538; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vg-site-camera-title small { display:block; color:#75859a; font-size:10px; margin-top:3px; }
.vg-open-camera { color:#087f8c; font-size:10px; font-weight:800; white-space:nowrap; }
.vg-site-camera-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:12px; }
.vg-watch-stat { padding:8px; border-radius:9px; background:#f4f7fa; text-align:center; }
.vg-watch-stat b { display:block; color:#182538; font-size:15px; }
.vg-watch-stat small { color:#75859a; font-size:9px; text-transform:uppercase; letter-spacing:.06em; }
.vg-camera-status-dot { width:7px; height:7px; border-radius:50%; background:#9aa7b5; box-shadow:0 0 0 3px rgba(255,255,255,.15); }
.vg-camera-status-dot[data-state="running"] { background:#168568; }
.vg-camera-status-dot[data-state="starting"] { background:#d4a32b; }
.vg-camera-status-dot[data-state="disconnected"],.vg-camera-status-dot[data-state="error"] { background:#d9485f; }
.vg-camera-modal[hidden] { display:none; }
.vg-camera-modal { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:18px; }
.vg-camera-modal-backdrop { position:absolute; inset:0; background:rgba(10,18,30,.68); backdrop-filter:blur(5px); }
.vg-camera-modal-dialog { position:relative; width:min(1400px,100%); max-height:min(94vh,980px); overflow:auto; background:#f3f6fb; border:1px solid rgba(255,255,255,.35); border-radius:20px; box-shadow:0 30px 90px rgba(0,0,0,.35); }
.vg-camera-modal-header { display:flex; justify-content:space-between; gap:20px; padding:18px 20px; border-bottom:1px solid #e1e8f0; background:#fff; position:sticky; top:0; z-index:2; }
.vg-camera-modal-header h2 { margin:3px 0 2px; font-size:22px; color:#182538; }
.vg-modal-close { width:38px; height:38px; border:1px solid #dbe3eb; background:#fff; color:#33445a; border-radius:10px; font-size:25px; line-height:1; cursor:pointer; }
.vg-camera-modal-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(300px,.75fr); gap:14px; padding:14px; }
.vg-camera-modal-main,.vg-camera-modal-side { min-width:0; display:flex; flex-direction:column; gap:14px; }
.vg-modal-feed-wrap { position:relative; background:#05090d; border-radius:14px; overflow:hidden; aspect-ratio:16/9; min-height:300px; }
.vg-modal-feed { display:block; width:100%; height:100%; object-fit:contain; background:#05090d; }
.vg-modal-feed-overlay { position:absolute; left:0; right:0; bottom:0; display:flex; justify-content:space-between; padding:25px 12px 10px; color:#fff; font-size:10px; font-weight:800; letter-spacing:.08em; background:linear-gradient(transparent,rgba(0,0,0,.75)); }
.vg-modal-actions { display:flex; gap:8px; flex-wrap:wrap; }
.vg-modal-panel,.vg-modal-section { background:#fff; border:1px solid #e1e8f0; border-radius:13px; padding:13px; }
.vg-modal-section-title { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.vg-modal-section-title h3 { margin:0; font-size:13px; color:#182538; }
.vg-modal-section-title > span { color:#087f8c; font-size:10px; font-weight:800; }
.vg-modal-details div { padding:7px 0; }
.vg-track-list { display:grid; gap:7px; max-height:290px; overflow:auto; }
.vg-track-item { padding:9px; border:1px solid #e3e9ef; border-radius:9px; background:#f7f9fc; }
.vg-track-item > div { display:flex; justify-content:space-between; gap:8px; }
.vg-track-item strong { font-size:11px; color:#182538; }
.vg-track-item span,.vg-track-item small { font-size:9px; color:#68788d; overflow-wrap:anywhere; }
.vg-track-item > div + div { margin-top:4px; }
.vg-watch-events { display:grid; gap:7px; }
.vg-watch-event { display:flex; justify-content:space-between; gap:10px; padding:9px 10px; border-radius:8px; background:#fff4f5; border:1px solid #f3d5db; }
.vg-watch-event strong { color:#b62f49; font-size:10px; }
.vg-watch-event span { color:#68788d; font-size:9px; text-align:right; }
body.vg-modal-open { overflow:hidden; }
@media (max-width:1200px) { .vg-site-camera-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .vg-camera-modal-grid { grid-template-columns:minmax(0,1fr); } }
@media (max-width:760px) { .vg-site-watch-header { align-items:flex-start; flex-direction:column; } .vg-site-watch-actions { width:100%; justify-content:space-between; } .vg-site-camera-grid { grid-template-columns:minmax(0,1fr); } .vg-camera-modal { padding:0; align-items:stretch; } .vg-camera-modal-dialog { max-height:100vh; height:100%; border-radius:0; } .vg-camera-modal-header { padding:14px; } .vg-camera-modal-grid { padding:10px; } .vg-modal-feed-wrap { min-height:220px; } .vg-site-camera-stats { gap:5px; } .vg-watch-stat { padding:7px 4px; } }
@media (max-width:480px) { .content { padding:12px !important; } .vg-site-watch-actions .vg-button { flex:1 1 100%; text-align:center; } .vg-camera-modal-header h2 { font-size:18px; } .vg-modal-actions > * { flex:1 1 100%; text-align:center; } .vg-watch-event { flex-direction:column; } .vg-watch-event span { text-align:left; } }
.vg-watch-violation > div { min-width:0; display:flex; flex-direction:column; gap:4px; }
.vg-evidence-thumb-link { width:58px; height:42px; flex:0 0 58px; border-radius:6px; overflow:hidden; border:1px solid #e2c8ce; background:#fff; }
.vg-evidence-thumb-link img { width:100%; height:100%; object-fit:cover; display:block; }
.vg-modal-details dd { overflow-wrap:anywhere; }

/* VisoGuard professional application shell */
:root {
  --vg-ink: #17263a;
  --vg-muted: #708096;
  --vg-line: #e2e9f1;
  --vg-teal: #087f8c;
  --vg-navy: #13243a;
  --vg-orange: #f28a24;
  --bs-body-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { color:var(--vg-ink) !important; background:#f4f7fb !important; }
.app-shell { min-height:100vh; background:#f4f7fb; }
.sidebar {
  width:264px !important; padding:20px 15px 14px !important; display:flex; flex-direction:column;
  background:linear-gradient(180deg,#13243a 0%,#101d30 100%) !important; border-right:0 !important;
  box-shadow:5px 0 24px rgba(19,36,58,.10) !important;
}
.brand { height:94px; min-height:94px !important; padding:7px 8px !important; margin:0 0 7px !important; background:rgba(255,255,255,.04) !important; border:1px solid rgba(255,255,255,.08); border-radius:12px !important; }
.brand img { max-height:100% !important; object-position:center; }
.sidebar-caption { padding:7px 9px 17px; color:#7890a9; font-size:9px; font-weight:800; letter-spacing:.17em; }
.sidebar .nav { flex:1; }
.sidebar .nav-section-label { padding:17px 11px 7px; color:#7890a9; font-size:9px; letter-spacing:.14em; }
.sidebar .nav-link { min-height:42px; margin:2px 0; padding:9px 10px; color:#bdc9d7 !important; font-size:12px; font-weight:600; border:1px solid transparent !important; border-radius:9px; }
.sidebar .nav-link:hover, .sidebar .nav-link:focus { color:#fff !important; background:rgba(255,255,255,.07) !important; }
.sidebar .nav-link.active, .sidebar .nav-link-primary { color:#fff !important; background:rgba(20,166,168,.16) !important; border-color:rgba(72,203,199,.22) !important; box-shadow:inset 3px 0 #2ac0bc; }
.sidebar .nav-symbol { width:22px; height:22px; flex:0 0 22px; color:#9bb2c8 !important; background:rgba(255,255,255,.07) !important; font-size:14px; }
.sidebar .nav-link.active .nav-symbol, .sidebar .nav-link-primary .nav-symbol { color:#72ddda !important; background:rgba(42,192,188,.13) !important; }
.sidebar-footer { display:flex; align-items:center; gap:10px; padding:14px 9px 5px; border-top:1px solid rgba(255,255,255,.09); }
.sidebar-footer-mark { width:30px; height:30px; border-radius:9px; background:linear-gradient(145deg,#ffad50,#f07822); box-shadow:0 4px 12px rgba(242,138,36,.24); }
.sidebar-footer-mark:after { content:"V"; display:grid; height:100%; place-items:center; color:#fff; font-size:15px; font-weight:850; }
.sidebar-footer strong, .sidebar-footer small { display:block; }
.sidebar-footer strong { color:#eef4fa; font-size:11px; }
.sidebar-footer small { margin-top:2px; color:#869bb0; font-size:9px; }
.content { margin-left:264px !important; width:calc(100% - 264px) !important; max-width:none !important; padding:27px clamp(22px,3vw,46px) 42px !important; }
.topbar { min-height:78px; margin-bottom:20px !important; padding-bottom:18px !important; border-bottom:1px solid #e3eaf2 !important; }
.topbar h1 { color:#17263a !important; font-size:clamp(24px,2vw,31px) !important; font-weight:750 !important; letter-spacing:-.04em !important; }
.topbar .muted { margin-top:5px; color:#7a899c !important; font-size:12px !important; }
.topbar-separator { padding:0 5px; color:#c0cbd6; }
.status-pill { min-height:34px; display:inline-flex; align-items:center; padding:7px 11px !important; font-size:10px !important; font-weight:750 !important; }
.status-pill:before { content:""; width:7px; height:7px; margin-right:7px; border-radius:50%; background:currentColor; }
.vg-site-watch-header { margin:2px 0 2px; }
.vg-site-watch-header h2 { color:#17263a !important; font-size:25px !important; letter-spacing:-.035em; }
.vg-site-watch-header p { color:#708096 !important; font-size:12px; }
.vg-eyebrow { font-size:9px !important; letter-spacing:.14em !important; }
.vg-kpis { gap:13px !important; }
.vg-kpi { padding:17px 18px !important; border-radius:13px !important; box-shadow:0 3px 12px rgba(30,55,83,.035) !important; }
.vg-kpi span { color:#718198 !important; font-size:11px !important; font-weight:650; }
.vg-kpi strong { margin:8px 0 5px !important; color:#172b43 !important; font-size:30px !important; }
.vg-kpi small { color:#8492a4 !important; font-size:10px !important; }
.vg-panel, .panel, .card, .vg-alerts-toolbar { border-color:#e1e8f0 !important; border-radius:14px !important; box-shadow:0 5px 18px rgba(30,55,83,.045) !important; }
.vg-panel { padding:17px !important; }
.vg-panel-header h2, .vg-alerts-toolbar h2 { color:#17263a !important; font-size:17px !important; }
.vg-site-camera-card { border-radius:13px !important; box-shadow:0 4px 15px rgba(30,55,83,.06) !important; }
.vg-site-camera-card:hover { box-shadow:0 12px 28px rgba(30,55,83,.13) !important; }
.vg-site-camera-body { padding:13px 14px !important; }
.vg-watch-stat { background:#f3f6fa !important; }
.vg-watch-stat b { color:#1c3048 !important; }
.vg-button, .btn { border-radius:8px !important; transition:transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.vg-button-primary, .btn-primary { background:#087f8c !important; border-color:#087f8c !important; box-shadow:0 3px 9px rgba(8,127,140,.12) !important; }
.vg-button-primary:hover, .btn-primary:hover { background:#066b76 !important; transform:translateY(-1px); }
.vg-button-outline, .vg-button-dark { color:#31445b !important; background:#fff !important; border-color:#d7e0e9 !important; }
.vg-button-outline:hover, .vg-button-dark:hover { background:#f2f7f9 !important; border-color:#a9cdd0 !important; }
.vg-alerts-toolbar { padding:18px 20px !important; }
.vg-filter-button { border-color:#dce4ec !important; background:#fff !important; color:#65758a !important; border-radius:7px !important; }
.vg-filter-button.is-active { border-color:#087f8c !important; background:#087f8c !important; color:#fff !important; }
.vg-events-table thead th { color:#708096 !important; border-bottom-color:#e3eaf1 !important; }
.vg-events-table tbody td { color:#31445b; border-bottom-color:#edf1f5 !important; }
.vg-violation-tag { border-color:#f4dfc5 !important; background:#fff8ef !important; color:#a85b0b !important; }
.table-responsive { border-radius:10px; }
.form-label, label { color:#34485e !important; font-size:12px; font-weight:650; }
.form-control, .form-select { min-height:42px; border-radius:8px !important; border-color:#d8e1ea !important; background-color:#fff !important; color:#1b2c42 !important; font-size:13px; }
.form-control::placeholder { color:#9aa7b6; }
.form-text, .muted { color:#74849a; }
.alert { border:0; box-shadow:0 3px 12px rgba(30,55,83,.05); }
.vg-camera-modal-dialog { border-radius:16px !important; }
.vg-analytics-page { display:grid; gap:15px; }
.vg-analytics-intro { align-items:center; }
.vg-analytics-intro h2 { margin:3px 0 0; color:#17263a; font-size:19px; letter-spacing:-.03em; }
.vg-analytics-intro p { margin:5px 0 0; font-size:11px; }
.vg-period-label { padding:8px 11px; border:1px solid #dfe7ef; border-radius:8px; background:#fff; color:#607188; font-size:10px; font-weight:700; white-space:nowrap; }
.vg-analytics-kpis { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
.vg-analytics-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.vg-chart-panel { min-width:0; }
.vg-chart-panel .vg-panel-header { margin-bottom:8px; }
.vg-chart-panel .vg-panel-header h2 { margin:4px 0 0; color:#17263a; font-size:15px; }
.vg-chart-wrap { height:280px; }
.vg-chart-empty { padding:80px 12px; color:#8795a7; text-align:center; font-size:12px; }
@media(max-width:760px) { .vg-analytics-grid { grid-template-columns:minmax(0,1fr); } .vg-analytics-kpis { grid-template-columns:minmax(0,1fr) !important; } }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline:3px solid rgba(8,127,140,.32) !important; outline-offset:2px; }
@media (max-width:980px) { .sidebar { width:auto !important; } .sidebar-footer { display:none; } .content { width:100% !important; margin:0 !important; } }
@media (max-width:560px) { .content { padding:15px !important; } .sidebar .nav-section-label { grid-column:1/-1; } .topbar { gap:12px; } .status-pill { align-self:flex-start; } }
