:root {
  --bg: #08111f;
  --panel: #101b2c;
  --panel-2: #0d1727;
  --line: #1e2d43;
  --text: #edf4ff;
  --muted: #8798ae;
  --blue: #3c91ff;
  --cyan: #41d7ff;
  --green: #31d892;
  --amber: #f7bd56;
  --red: #ff687a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; }
button, input { font: inherit; }
.app-shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: linear-gradient(180deg, #091424 0%, #07101d 100%); padding: 26px 18px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 22px; color: white; background: linear-gradient(145deg, var(--blue), var(--cyan)); box-shadow: 0 10px 30px rgba(60,145,255,.25); }
.brand-name { font-size: 15px; letter-spacing: .13em; font-weight: 850; }
.brand-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item { position: relative; width: 100%; border: 0; background: transparent; color: #9eacc0; text-align: left; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-weight: 650; }
.nav-item span { display: inline-block; width: 25px; color: #7589a6; }
.nav-item:hover { background: rgba(255,255,255,.035); color: white; }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(60,145,255,.18), rgba(60,145,255,.06)); box-shadow: inset 3px 0 0 var(--blue); }
.nav-item.active span { color: var(--cyan); }
.nav-item.disabled { opacity: .5; cursor: default; }
.nav-item em { float: right; font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; border: 1px solid #33445e; color: #8596ac; border-radius: 999px; padding: 3px 6px; }
.nav-label { margin: 24px 12px 7px; color: #52647e; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; padding: 16px 11px 4px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.connection-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(247,189,86,.08); }
.connection-dot.ok { background: var(--green); box-shadow: 0 0 0 5px rgba(49,216,146,.08); }
.connection-dot.bad { background: var(--red); box-shadow: 0 0 0 5px rgba(255,104,122,.08); }
.sidebar-footer strong { display: block; font-size: 11px; }
.sidebar-footer small { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.main { padding: 34px 38px 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.eyebrow { color: var(--blue); letter-spacing: .14em; font-size: 10px; font-weight: 850; }
h1 { margin: 6px 0 4px; font-size: 29px; line-height: 1.15; }
h2 { margin: 5px 0 0; font-size: 19px; }
.topbar p { margin: 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.last-update { text-align: right; padding-right: 4px; }
.last-update span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.last-update strong { display: block; margin-top: 3px; font-size: 11px; }
.refresh-button { border: 1px solid #2a3b54; background: #101d30; color: #dbe8f8; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.refresh-button:hover { border-color: var(--blue); }
.refresh-button:disabled { opacity: .55; cursor: wait; }
.avatar { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid #31445f; background: #142239; border-radius: 50%; font-size: 11px; font-weight: 800; }
.status-strip { min-height: 44px; padding: 0 15px; border: 1px solid rgba(49,216,146,.22); background: rgba(49,216,146,.055); border-radius: 11px; display: flex; align-items: center; gap: 9px; margin-bottom: 18px; font-size: 11px; }
.status-strip.error { border-color: rgba(255,104,122,.28); background: rgba(255,104,122,.06); }
.status-strip span { color: var(--muted); margin-left: 4px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(49,216,146,.08); }
.status-strip.error .pulse { background: var(--red); box-shadow: 0 0 0 5px rgba(255,104,122,.08); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 136px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(17,29,47,.96), rgba(12,23,39,.96)); border-radius: 14px; padding: 18px; box-shadow: 0 14px 40px rgba(0,0,0,.11); }
.metric-head { display: flex; justify-content: space-between; color: #9bacbf; font-size: 11px; font-weight: 700; }
.metric-icon { color: var(--blue); }
.metric-icon.online { color: var(--green); }
.metric-icon.moving { color: var(--cyan); }
.metric-icon.stopped { color: var(--amber); }
.metric-value { font-size: 34px; font-weight: 850; margin-top: 13px; letter-spacing: -.03em; }
.metric-foot { color: #667a95; font-size: 10px; margin-top: 7px; }
.panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(15,27,45,.98), rgba(10,20,35,.98)); border-radius: 14px; overflow: hidden; }
.panel-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.search-wrap input { width: 270px; max-width: 35vw; outline: none; border: 1px solid #263852; background: #0b1626; color: white; border-radius: 9px; padding: 9px 12px; font-size: 11px; }
.search-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,145,255,.08); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { text-align: left; padding: 13px 19px; border-bottom: 1px solid rgba(30,45,67,.72); font-size: 11px; }
th { color: #687c97; background: rgba(7,16,29,.42); text-transform: uppercase; letter-spacing: .08em; font-size: 9px; }
tbody tr:hover { background: rgba(255,255,255,.018); }
tbody tr:last-child td { border-bottom: none; }
.asset-name { font-weight: 750; }
.asset-meta { color: #697d98; font-size: 9px; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 8px; font-size: 9px; font-weight: 750; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.badge.moving { color: #a9f1ff; background: rgba(65,215,255,.08); }
.badge.moving::before { background: var(--cyan); }
.badge.stopped { color: #f5d99d; background: rgba(247,189,86,.08); }
.badge.stopped::before { background: var(--amber); }
.badge.offline { color: #9aa9bb; background: rgba(135,152,174,.08); }
.badge.offline::before { background: #66788f; }
.loading-cell { text-align: center; color: var(--muted); padding: 50px; }
.error-cell { text-align: center; color: #ffabb5; padding: 50px; }
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .brand-name, .brand-subtitle, .nav-item:not(.active) em, .sidebar-footer div:last-child, .nav-label { display: none; }
  .brand { padding-left: 7px; }
  .nav-item { text-align: center; font-size: 0; }
  .nav-item span { width: auto; font-size: 17px; }
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 22px 16px 40px; }
  .topbar { align-items: flex-start; }
  .last-update { display: none; }
  .cards { grid-template-columns: 1fr 1fr; }
  .search-wrap input { width: 180px; max-width: 45vw; }
}

/* Firstwatch V1.1 — Live Map */
.view { display: none; }
.view.active-view { display: block; }
.muted-nav { opacity: .7; }
.map-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.compact-stat { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(17,29,47,.96), rgba(12,23,39,.96)); border-radius: 12px; padding: 14px 16px; min-height: 90px; }
.compact-stat span { display: block; color: #8fa1b8; font-size: 10px; font-weight: 750; }
.compact-stat strong { display: block; margin-top: 5px; font-size: 24px; letter-spacing: -.02em; }
.compact-stat small { display: block; color: #617590; margin-top: 3px; font-size: 9px; }
.map-panel { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: 650px; height: calc(100vh - 250px); max-height: 820px; border: 1px solid var(--line); background: #0c1727; border-radius: 14px; overflow: hidden; }
.map-assets-panel { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: linear-gradient(180deg, #0e192a 0%, #091422 100%); }
.map-assets-head { min-height: 74px; padding: 16px 17px 13px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.count-pill { min-width: 29px; height: 26px; display: grid; place-items: center; padding: 0 8px; border: 1px solid #2a3c56; background: #122037; border-radius: 999px; color: #b9c9dd; font-size: 10px; font-weight: 800; }
.map-tools { padding: 12px 13px; border-bottom: 1px solid var(--line); }
.map-tools input { width: 100%; outline: none; border: 1px solid #263852; background: #081320; color: white; border-radius: 9px; padding: 9px 10px; font-size: 10px; }
.map-tools input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,145,255,.08); }
.map-filters { display: flex; gap: 6px; margin-top: 9px; }
.map-filter { flex: 1; border: 1px solid #23344b; background: #0b1625; color: #8092aa; border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 9px; font-weight: 750; }
.map-filter:hover { color: white; border-color: #39516f; }
.map-filter.active { color: #cce8ff; border-color: rgba(60,145,255,.55); background: rgba(60,145,255,.12); }
.map-asset-list { overflow-y: auto; flex: 1; }
.map-asset-row { width: 100%; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 10px; align-items: center; border: 0; border-bottom: 1px solid rgba(30,45,67,.62); background: transparent; color: var(--text); text-align: left; padding: 13px 14px; cursor: pointer; }
.map-asset-row:hover { background: rgba(60,145,255,.055); }
.asset-list-state { width: 7px; height: 7px; border-radius: 50%; background: #65768a; box-shadow: 0 0 0 4px rgba(101,118,138,.07); }
.asset-list-state.moving { background: var(--cyan); box-shadow: 0 0 0 4px rgba(65,215,255,.08); }
.asset-list-state.stopped { background: var(--amber); box-shadow: 0 0 0 4px rgba(247,189,86,.08); }
.asset-list-state.offline { background: #6f8197; }
.map-asset-copy { min-width: 0; }
.map-asset-copy strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.map-asset-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #6d819b; font-size: 8.5px; margin-top: 3px; }
.map-asset-battery { color: #8fa1b8; font-size: 9px; font-weight: 700; }
.map-empty { color: var(--muted); text-align: center; font-size: 10px; padding: 30px 18px; }
.error-text { color: #ffabb5; }
.map-stage { position: relative; min-width: 0; background: #07111c; }
#fleetMap { position: absolute; inset: 0; background: #0a1523; }
.leaflet-container { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.leaflet-bar a { background: #101d30; color: #dbe8f8; border-color: #263852; }
.leaflet-bar a:hover { background: #162842; color: white; }
.leaflet-control-attribution { background: rgba(7,16,29,.82) !important; color: #73859b !important; }
.leaflet-control-attribution a { color: #96b4d6 !important; }
.firstwatch-div-icon { background: transparent !important; border: 0 !important; }
.asset-map-marker { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.8); box-shadow: 0 4px 14px rgba(0,0,0,.38); }
.asset-map-marker.moving { background: var(--cyan); border-color: #d8faff; color: #062431; }
.asset-map-marker.stopped { background: var(--amber); border-color: #fff2cf; }
.asset-map-marker.offline { background: #52667d; border-color: #a7b4c3; }
.marker-core { width: 7px; height: 7px; border-radius: 50%; background: #fff; opacity: .94; }
.direction-arrow { font-size: 13px; line-height: 1; transform-origin: center; }
.map-legend { position: absolute; z-index: 500; left: 13px; bottom: 13px; display: flex; gap: 11px; align-items: center; padding: 8px 10px; background: rgba(7,16,29,.91); border: 1px solid rgba(39,57,80,.85); border-radius: 9px; backdrop-filter: blur(10px); color: #9cadc2; font-size: 8px; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-dot.moving { background: var(--cyan); }
.legend-dot.stopped { background: var(--amber); }
.legend-dot.offline { background: #70839a; }
.map-notice { position: absolute; z-index: 500; top: 12px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 180px); padding: 7px 10px; background: rgba(7,16,29,.9); border: 1px solid rgba(39,57,80,.85); border-radius: 9px; backdrop-filter: blur(10px); color: #9caec3; font-size: 8.5px; text-align: center; pointer-events: none; }
.map-notice.error { color: #ffb0ba; border-color: rgba(255,104,122,.4); }
.firstwatch-popup .leaflet-popup-content-wrapper { background: #0d1929; color: var(--text); border: 1px solid #263a54; border-radius: 12px; box-shadow: 0 15px 40px rgba(0,0,0,.35); }
.firstwatch-popup .leaflet-popup-tip { background: #0d1929; }
.firstwatch-popup .leaflet-popup-content { margin: 14px; min-width: 240px; }
.popup-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid #203149; }
.popup-name { font-weight: 800; font-size: 12px; }
.popup-meta { color: #7388a2; font-size: 8.5px; margin-top: 3px; }
.popup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding-top: 11px; }
.popup-grid div span { display: block; color: #657a94; text-transform: uppercase; letter-spacing: .06em; font-size: 7.5px; }
.popup-grid div strong { display: block; margin-top: 3px; color: #dbe8f7; font-size: 9px; font-weight: 700; }
.popup-coords { margin-top: 11px; padding-top: 9px; border-top: 1px solid #203149; color: #60758f; font-size: 8px; }
@media (max-width: 1050px) {
  .map-panel { grid-template-columns: 285px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .map-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .map-panel { display: block; height: auto; max-height: none; }
  .map-assets-panel { height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
  .map-stage { height: 520px; }
}
@media (max-width: 720px) {
  .map-stats { grid-template-columns: 1fr 1fr; }
  .map-legend { display: none; }
  .map-notice { left: 10px; right: 10px; transform: none; max-width: none; }
}

/* Firstwatch V1.2 — Asset Profiles & Location Age */
.asset-row-clickable { cursor: pointer; }
.asset-row-clickable:hover { background: rgba(60,145,255,.045); }
.asset-row-clickable td:first-child { position: relative; }
.row-chevron { color: #4e739d; font-size: 15px; margin-left: 5px; opacity: 0; transition: opacity .15s ease, transform .15s ease; }
.asset-row-clickable:hover .row-chevron { opacity: 1; transform: translateX(2px); }

.age-mini { display: inline-flex; margin-top: 4px; border-radius: 999px; padding: 2px 6px; border: 1px solid transparent; font-size: 7.5px; font-weight: 800; line-height: 1.25; }
.age-pill { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 999px; padding: 5px 9px; font-size: 8px; font-weight: 850; letter-spacing: .02em; white-space: nowrap; }
.age-pill.compact { padding: 4px 7px; font-size: 7.5px; }
.age-current { color: #9ff2d0; background: rgba(49,216,146,.09); border-color: rgba(49,216,146,.22); }
.age-recent { color: #9de8ff; background: rgba(65,215,255,.08); border-color: rgba(65,215,255,.2); }
.age-old { color: #ffd995; background: rgba(247,189,86,.08); border-color: rgba(247,189,86,.22); }
.age-veryold { color: #9aaabd; background: rgba(120,140,164,.08); border-color: rgba(120,140,164,.18); }
.age-unknown { color: #7d8ea4; background: rgba(100,120,145,.06); border-color: rgba(100,120,145,.15); }

.map-asset-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.popup-age-row { display: flex; align-items: center; gap: 8px; padding: 10px 0 0; }
.popup-age-row strong { color: #93a7bf; font-size: 8.5px; font-weight: 650; }
.popup-detail-link { display: flex; align-items: center; justify-content: center; margin-top: 11px; border: 1px solid #2b4463; background: rgba(60,145,255,.09); color: #bfe2ff !important; text-decoration: none; border-radius: 8px; padding: 8px 10px; font-size: 9px; font-weight: 800; }
.popup-detail-link:hover { background: rgba(60,145,255,.16); border-color: #3c91ff; }

.asset-directory-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 16px; }
.asset-directory-head h2 { margin-top: 5px; }
.asset-directory-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.directory-count { min-width: 90px; border: 1px solid var(--line); background: #0e1a2b; border-radius: 12px; padding: 11px 14px; text-align: right; }
.directory-count span { display: block; color: #6f829d; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.directory-count strong { display: block; margin-top: 2px; font-size: 22px; }
.asset-directory-table { min-width: 930px; }

.asset-detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.detail-actions { display: flex; gap: 8px; }
.secondary-button { border: 1px solid #2a3b54; background: #101d30; color: #cbd9e9; padding: 8px 11px; border-radius: 9px; cursor: pointer; font-size: 10px; font-weight: 700; }
.secondary-button:hover:not(:disabled) { border-color: var(--blue); color: white; }
.secondary-button:disabled { opacity: .4; cursor: not-allowed; }
.button-soon { margin-left: 5px; border: 1px solid #354a66; color: #8598b0; border-radius: 999px; padding: 2px 5px; font-size: 7px; text-transform: uppercase; letter-spacing: .05em; }

.asset-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(18,31,50,.98), rgba(9,20,35,.98)); border-radius: 15px; padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 16px 44px rgba(0,0,0,.12); }
.asset-hero-copy { display: flex; align-items: center; gap: 14px; min-width: 0; }
.asset-type-mark { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; font-size: 18px; font-weight: 900; color: #d7ecff; border: 1px solid rgba(60,145,255,.3); background: linear-gradient(145deg, rgba(60,145,255,.2), rgba(65,215,255,.07)); }
.asset-type-mark.camera { border-color: rgba(65,215,255,.35); background: linear-gradient(145deg, rgba(65,215,255,.18), rgba(49,216,146,.06)); color: #c5f7ff; }
.asset-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.asset-title-row h2 { margin: 3px 0 0; font-size: 22px; }
.asset-hero-meta { color: #778ba6; font-size: 10px; margin-top: 5px; }
.age-hero { flex: 0 0 auto; border: 1px solid transparent; border-radius: 10px; padding: 9px 11px; font-size: 9px; font-weight: 750; }

.detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.detail-metric { min-height: 105px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(16,28,46,.98), rgba(10,21,36,.98)); border-radius: 12px; padding: 14px 16px; }
.detail-metric > span { display: block; color: #7b8ea8; font-size: 9px; font-weight: 750; }
.detail-metric > strong { display: block; margin-top: 7px; color: #edf5ff; font-size: 20px; letter-spacing: -.02em; }
.detail-metric > small { display: block; margin-top: 5px; color: #667b95; font-size: 8.5px; line-height: 1.45; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 14px; margin-bottom: 14px; }
.detail-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(15,27,45,.98), rgba(9,19,33,.98)); border-radius: 14px; overflow: hidden; }
.detail-card-head { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.detail-card-head h2 { font-size: 16px; }
.detail-map-wrap { position: relative; min-height: 420px; background: #07111c; }
#assetDetailMap { position: absolute; inset: 0; }
.detail-no-position { position: absolute; inset: 0; z-index: 500; display: grid; place-items: center; padding: 30px; text-align: center; color: #7488a1; background: radial-gradient(circle at 50% 45%, rgba(60,145,255,.05), transparent 45%), #091421; font-size: 10px; }
.asset-map-marker.detail-pin { width: 34px; height: 34px; }

.device-info-grid { margin: 0; padding: 7px 17px 14px; }
.device-info-grid > div { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(30,45,67,.62); }
.device-info-grid > div:last-child { border-bottom: 0; }
.device-info-grid dt { color: #657a95; font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.device-info-grid dd { margin: 0; color: #d8e5f4; font-size: 9px; font-weight: 700; text-align: right; word-break: break-word; }

.capability-card { margin-bottom: 4px; }
.capability-type { border: 1px solid #2e455f; background: rgba(60,145,255,.08); color: #a9d8ff; border-radius: 999px; padding: 5px 8px; font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.capability-type.camera { color: #aef3ff; border-color: rgba(65,215,255,.28); background: rgba(65,215,255,.07); }
.capability-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 9px; padding: 14px; }
.capability-item { min-width: 0; display: grid; grid-template-columns: 31px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 7px; align-items: center; border: 1px solid #24364e; background: #0b1726; color: #c9d8e9; text-align: left; border-radius: 11px; padding: 11px; cursor: pointer; }
.capability-item:hover { border-color: #365576; background: #0e1c2e; }
.capability-item.active { border-color: rgba(60,145,255,.32); background: rgba(60,145,255,.055); }
.capability-icon { grid-row: 1 / 3; width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #2c4260; border-radius: 9px; color: #8cc8ff; background: #102037; font-size: 13px; }
.capability-copy { min-width: 0; }
.capability-copy strong { display: block; font-size: 9.5px; }
.capability-copy small { display: block; margin-top: 3px; color: #6d819b; font-size: 7.5px; line-height: 1.35; }
.capability-state { grid-column: 2; justify-self: start; border: 1px solid #31455f; color: #778ba3; border-radius: 999px; padding: 2px 6px; font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.capability-item.active .capability-state { color: #9eeacb; border-color: rgba(49,216,146,.25); background: rgba(49,216,146,.06); }
.capability-item.next .capability-state { color: #acd9ff; border-color: rgba(60,145,255,.25); background: rgba(60,145,255,.06); }

.firstwatch-toast { position: fixed; z-index: 5000; right: 24px; bottom: 24px; max-width: 360px; transform: translateY(16px); opacity: 0; pointer-events: none; border: 1px solid #304964; background: rgba(9,20,35,.96); color: #dbe8f6; border-radius: 10px; box-shadow: 0 16px 45px rgba(0,0,0,.38); padding: 11px 13px; font-size: 10px; transition: opacity .2s ease, transform .2s ease; backdrop-filter: blur(12px); }
.firstwatch-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1250px) {
  .capability-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1050px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-map-wrap { min-height: 380px; }
}
@media (max-width: 820px) {
  .capability-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .asset-hero { align-items: flex-start; }
  .age-hero { display: none; }
}
@media (max-width: 720px) {
  .asset-detail-toolbar { align-items: flex-start; }
  .detail-actions { flex-direction: column; }
  .detail-metrics { grid-template-columns: 1fr 1fr; }
  .asset-hero { padding: 15px; }
  .asset-title-row h2 { font-size: 18px; }
  .capability-grid { grid-template-columns: 1fr; }
  .device-info-grid > div { grid-template-columns: 90px minmax(0,1fr); }
}

/* Firstwatch V1.3 — Trips, Alerts & Reports */
button, input, select { font: inherit; }
.module-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 14px; }
.module-toolbar h2 { margin-top: 5px; }
.module-toolbar p { margin: 5px 0 0; max-width: 620px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.module-filters { display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.module-filters label { display: grid; gap: 5px; color: #6f839d; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.module-filters select, .module-filters input { min-height: 35px; outline: none; border: 1px solid #263852; background: #0b1626; color: #dce8f7; border-radius: 8px; padding: 7px 9px; font-size: 9px; text-transform: none; letter-spacing: 0; }
.module-filters select { min-width: 190px; max-width: 250px; }
.module-filters input[type="date"] { width: 132px; color-scheme: dark; }
.module-filters select:focus, .module-filters input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,145,255,.08); }
.module-stats { margin-bottom: 14px; }
.compact-stat strong.small-metric { font-size: 14px; line-height: 1.25; min-height: 34px; display: flex; align-items: center; }
.report-split { display: grid; grid-template-columns: minmax(260px, .55fr) minmax(0, 1.45fr); gap: 14px; }
.report-table-panel { min-width: 0; }
.rank-list { padding: 8px 16px 14px; }
.rank-row { display: grid; grid-template-columns: 25px minmax(0,1fr) 34px; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid rgba(30,45,67,.62); }
.rank-row:last-child { border-bottom: 0; }
.rank-number { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #2a3e58; border-radius: 7px; background: #0d1a2c; color: #7388a3; font-size: 8px; font-weight: 850; }
.rank-copy { min-width: 0; }
.rank-copy strong { display: block; color: #cbd9e9; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-track { height: 3px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: #17263a; }
.rank-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.rank-count { color: #a9bbd0; font-size: 10px; font-weight: 850; text-align: right; }
.module-empty { padding: 28px 4px; color: #6f839d; font-size: 9px; text-align: center; }
.alert-chip { display: inline-flex; max-width: 260px; border: 1px solid rgba(247,189,86,.2); background: rgba(247,189,86,.06); color: #efcf91; border-radius: 999px; padding: 4px 7px; font-size: 8px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-copy { display: grid; grid-template-columns: minmax(0,1fr) 14px minmax(0,1fr); align-items: center; gap: 4px; min-width: 230px; color: #7d91aa; font-size: 8px; }
.route-copy b { color: var(--blue); text-align: center; }
.route-copy span { white-space: nowrap; }
#tripTable strong, #reportTable strong { color: #cfe6ff; }
#reportCsvButton:disabled { opacity: .42; }

@media (max-width: 1200px) {
  .module-toolbar { align-items: flex-start; flex-direction: column; }
  .module-filters { justify-content: flex-start; width: 100%; }
  .report-split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .module-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .module-filters label:first-child { grid-column: 1 / -1; }
  .module-filters select { max-width: none; width: 100%; }
  .module-filters input[type="date"] { width: 100%; }
  .module-filters button { width: 100%; }
}


/* Firstwatch V2 — Multi-Customer Admin */
.cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.customer-scope-control { display: grid; gap: 4px; min-width: 230px; }
.customer-scope-control > span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.customer-scope-control select { width: 100%; min-height: 37px; outline: none; border: 1px solid #2a3b54; background: #101d30; color: #dbe8f8; border-radius: 9px; padding: 8px 30px 8px 10px; font-size: 10px; }
.customer-scope-control select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,145,255,.08); }
.customer-cell { color: #c4d7ec; font-size: 10px; font-weight: 750; max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup-customer { margin-top: 4px; color: #62baff; font-size: 9px; font-weight: 750; }

@media (max-width: 1350px) {
  .cards { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .customer-scope-control { min-width: 190px; }
}
@media (max-width: 1050px) {
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 720px) {
  .customer-scope-control { width: 100%; min-width: 0; }
  .top-actions { width: 100%; }
  .cards { grid-template-columns: 1fr 1fr; }
}


/* Firstwatch V2.1 — Historical Trip Route Viewer */
.trip-route-panel { margin-bottom: 14px; overflow: hidden; border: 1px solid #263c57; border-radius: 14px; background: linear-gradient(145deg, rgba(13,27,46,.99), rgba(8,18,31,.99)); box-shadow: 0 16px 44px rgba(0,0,0,.18); }
.trip-route-panel.is-hidden { display: none; }
.trip-route-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.trip-route-head h2 { margin-top: 4px; font-size: 17px; }
.trip-route-head p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.trip-route-summary { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 1px; border-bottom: 1px solid var(--line); background: var(--line); }
.trip-route-summary > div { min-width: 0; padding: 12px 14px; background: #0c192a; }
.trip-route-summary span { display: block; color: #657b96; font-size: 7.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.trip-route-summary strong { display: block; margin-top: 6px; color: #dbe9f8; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-route-map-wrap { position: relative; min-height: 480px; background: #08131f; }
#tripRouteMap { position: absolute; inset: 0; z-index: 1; }
.trip-route-notice { position: absolute; z-index: 500; left: 50%; top: 18px; transform: translateX(-50%); max-width: 520px; border: 1px solid #2b425f; background: rgba(9,20,35,.94); color: #b9cce1; border-radius: 9px; box-shadow: 0 12px 30px rgba(0,0,0,.25); padding: 9px 12px; font-size: 9px; text-align: center; backdrop-filter: blur(10px); }
.trip-route-notice.error { border-color: rgba(255,104,122,.35); color: #ffc0c9; background: rgba(48,17,26,.94); }
.trip-route-notice.is-hidden { display: none; }
.trip-route-foot { min-height: 42px; display: flex; align-items: center; gap: 16px; padding: 0 16px; color: #6f849e; font-size: 8px; }
.trip-route-foot span { display: inline-flex; align-items: center; gap: 6px; }
.trip-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.trip-dot.start { background: #31d892; box-shadow: 0 0 0 4px rgba(49,216,146,.08); }
.trip-dot.end { background: #ff687a; box-shadow: 0 0 0 4px rgba(255,104,122,.08); }
.trip-route-cell { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-width: 310px; }
.trip-route-cell .route-copy { min-width: 210px; }
.trip-route-button { flex: 0 0 auto; min-height: 30px; border: 1px solid rgba(60,145,255,.3); background: rgba(60,145,255,.07); color: #9ed0ff; border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 8px; font-weight: 800; white-space: nowrap; }
.trip-route-button:hover, .trip-route-button.active { border-color: #4da4ff; background: rgba(60,145,255,.16); color: #e1f2ff; }
.trip-endpoint-icon { background: transparent; border: 0; }
.trip-endpoint-marker { width: 34px; height: 34px; display: grid; place-items: center; border: 3px solid #e6f1ff; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 900; box-shadow: 0 7px 18px rgba(0,0,0,.36); }
.trip-endpoint-marker.start { background: #1ebd7d; }
.trip-endpoint-marker.end { background: #ef5468; }
.route-popup, .route-tooltip { display: grid; gap: 3px; min-width: 120px; }
.route-popup strong, .route-tooltip strong { color: #172438; font-size: 10px; }
.route-popup span, .route-tooltip span { color: #485d76; font-size: 9px; }

@media (max-width: 1250px) {
  .trip-route-summary { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .trip-route-head { align-items: flex-start; flex-direction: column; }
  .trip-route-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .trip-route-map-wrap { min-height: 390px; }
}


/* Firstwatch V2.2 — Cameras + Live View */
.is-hidden { display: none !important; }
.camera-toolbar .camera-filters input[type="search"] { min-width: 260px; width: 300px; }
.camera-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.camera-panel { overflow: hidden; }
.camera-table td:last-child, .camera-table th:last-child { text-align: right; }
.camera-name-button { appearance: none; display: grid; gap: 3px; width: 100%; border: 0; background: transparent; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.camera-name-button span { color: #d7e8fa; font-size: 10px; font-weight: 820; }
.camera-name-button small { color: #687f9a; font-size: 8px; }
.camera-name-button:hover span { color: #74bdff; }
.camera-model-chip { display: inline-flex; align-items: center; min-height: 24px; border: 1px solid rgba(60,145,255,.22); background: rgba(60,145,255,.07); color: #9fcfff; border-radius: 999px; padding: 4px 8px; font-size: 8px; font-weight: 800; }
.camera-live-button { min-height: 31px; border: 1px solid rgba(49,216,146,.34); background: rgba(49,216,146,.08); color: #8cf0c4; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 8px; font-weight: 850; white-space: nowrap; }
.camera-live-button:hover { border-color: #31d892; background: rgba(49,216,146,.16); color: #d5fff0; }
.camera-live-detail { border-color: rgba(49,216,146,.28) !important; color: #8cf0c4 !important; }

body.camera-modal-open { overflow: hidden; }
.camera-live-modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 24px; }
.camera-live-backdrop { position: absolute; inset: 0; background: rgba(2,8,16,.82); backdrop-filter: blur(8px); }
.camera-live-dialog { position: relative; z-index: 1; width: min(1180px, 96vw); max-height: 94vh; overflow: hidden; border: 1px solid #2a405d; border-radius: 16px; background: #07111e; box-shadow: 0 28px 90px rgba(0,0,0,.58); }
.camera-live-head { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid #1d3048; background: linear-gradient(145deg, #0d1d31, #091522); }
.camera-live-head h2 { margin: 4px 0 0; color: #e0edfb; font-size: 18px; }
.camera-live-head p { margin: 5px 0 0; color: #7188a4; font-size: 9px; }
.camera-live-actions { display: flex; gap: 8px; align-items: center; }
.camera-live-stage { position: relative; height: min(68vh, 720px); min-height: 440px; background: #02070d; }
#cameraLiveFrame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #02070d; opacity: 0; transition: opacity .2s ease; }
#cameraLiveFrame.ready { opacity: 1; }
.camera-live-loading, .camera-live-error { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 28px; text-align: center; }
.camera-live-loading strong { color: #d9e9fa; font-size: 12px; }
.camera-live-loading span { max-width: 480px; color: #7087a2; font-size: 9px; }
.camera-live-spinner { width: 34px; height: 34px; border: 3px solid #1f334b; border-top-color: #4ca5ff; border-radius: 50%; animation: firstwatch-spin .8s linear infinite; }
@keyframes firstwatch-spin { to { transform: rotate(360deg); } }
.camera-live-error { color: #ffc3cc; background: radial-gradient(circle at center, rgba(97,23,38,.22), transparent 50%); font-size: 11px; line-height: 1.6; }
.camera-live-foot { min-height: 44px; display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 0 18px; border-top: 1px solid #1a2b40; color: #617791; font-size: 8px; }

@media (max-width: 900px) {
  .camera-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .camera-live-modal { padding: 8px; }
  .camera-live-dialog { width: 100%; max-height: 98vh; }
  .camera-live-head { align-items: flex-start; flex-direction: column; }
  .camera-live-stage { min-height: 360px; height: 62vh; }
  .camera-live-foot { align-items: flex-start; flex-direction: column; justify-content: center; padding-top: 10px; padding-bottom: 10px; }
}


/* Firstwatch V2.3 — Camera Assignments + Health */
.camera-filters { max-width: 760px; }
.camera-filters label:first-child { min-width: 260px; }
.camera-filters input[type="search"] { min-width: 260px; width: 280px; }
.camera-filters select { min-width: 135px; max-width: 180px; }
.camera-assignment-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; border: 1px solid rgba(60,145,255,.18); background: linear-gradient(135deg, rgba(60,145,255,.07), rgba(49,216,146,.025)); border-radius: 12px; padding: 12px 14px; }
.camera-assignment-strip strong { display: block; color: #cfe4fb; font-size: 9px; }
.camera-assignment-strip span { display: block; margin-top: 4px; color: #6f849e; font-size: 8px; }
.camera-assignment-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.camera-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.camera-customer-select { width: min(220px, 100%); min-height: 31px; outline: none; border: 1px solid #29415e; background: #0a1727; color: #cfe0f2; border-radius: 8px; padding: 5px 27px 5px 8px; font-size: 8px; }
.camera-customer-select:focus { border-color: #4ca5ff; box-shadow: 0 0 0 3px rgba(60,145,255,.08); }
.camera-tracksolid-meta { max-width: 230px; margin-top: 5px; color: #60758f; font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camera-health { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 8px; font-size: 8px; font-weight: 850; }
.camera-health > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.camera-health-online { color: #76e8b5; background: rgba(49,216,146,.075); border: 1px solid rgba(49,216,146,.2); }
.camera-health-recent { color: #8fc9ff; background: rgba(60,145,255,.075); border: 1px solid rgba(60,145,255,.2); }
.camera-health-offline { color: #f3c574; background: rgba(247,189,86,.07); border: 1px solid rgba(247,189,86,.18); }
.camera-health-stale { color: #ff8b99; background: rgba(255,104,122,.07); border: 1px solid rgba(255,104,122,.18); }
.camera-health-nodata { color: #8497ae; background: rgba(132,151,174,.06); border: 1px solid rgba(132,151,174,.15); }
.camera-health-detail { margin-top: 5px; color: #667b95; font-size: 7px; white-space: nowrap; }
@media (max-width: 1250px) { .camera-stats { grid-template-columns: repeat(3, minmax(0,1fr)); } .camera-assignment-strip { align-items: flex-start; flex-direction: column; } }
@media (max-width: 900px) { .camera-stats { grid-template-columns: repeat(2, minmax(0,1fr)); } .camera-assignment-actions { width: 100%; flex-wrap: wrap; } .camera-assignment-actions button { flex: 1 1 180px; } .camera-filters { display: grid; grid-template-columns: 1fr 1fr; } .camera-filters label:first-child { grid-column: 1 / -1; min-width: 0; } .camera-filters input[type="search"], .camera-filters select { width: 100%; min-width: 0; max-width: none; } }


/* Firstwatch V2.4 — Video History, Media & Safety Events */
.camera-row-actions, .event-media-actions, .video-action-buttons, .media-card-actions { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.camera-history-button, .event-history-button, .event-media-button { border:1px solid #2b405c; background:#0d1a2d; color:#bcd1e8; border-radius:8px; padding:6px 8px; cursor:pointer; font-size:8.5px; font-weight:800; white-space:nowrap; }
.camera-history-button:hover, .event-history-button:hover, .event-media-button:hover { border-color:#3c91ff; color:white; background:rgba(60,145,255,.11); }
.event-media-button { border-color:rgba(65,215,255,.32); color:#aeeeff; background:rgba(65,215,255,.07); }
.safety-toolbar { align-items:flex-end; }
.safety-event-filters { grid-template-columns:minmax(170px,1.2fr) repeat(2,minmax(120px,.7fr)) minmax(150px,.9fr) auto; }
.video-filters { grid-template-columns:minmax(190px,1.2fr) repeat(2,minmax(118px,.65fr)) minmax(120px,.7fr) minmax(140px,.8fr); }
.compact-text-stat { font-size:13px !important; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.safety-event-layout { grid-template-columns:minmax(0,1fr) 290px; }
.event-table { min-width:1120px; }
.safety-event-chip { display:inline-flex; border:1px solid rgba(247,189,86,.25); background:rgba(247,189,86,.07); color:#ffd995; border-radius:999px; padding:4px 7px; font-size:8px; font-weight:800; }
.compact-camera-link { text-align:left; }
.video-actions-strip { margin:0 0 14px; padding:12px 14px; display:flex; align-items:center; justify-content:space-between; gap:16px; border:1px solid #243750; background:linear-gradient(90deg,rgba(60,145,255,.08),rgba(65,215,255,.035)); border-radius:12px; }
.video-actions-strip strong { display:block; font-size:10px; }
.video-actions-strip span { display:block; margin-top:3px; color:#71859f; font-size:8.5px; }
.media-library-panel { min-height:300px; }
.media-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; padding:14px; }
.media-card { overflow:hidden; border:1px solid #22344c; background:#0b1626; border-radius:12px; }
.media-thumb { position:relative; aspect-ratio:16/9; display:grid; place-items:center; overflow:hidden; background:#07111d; }
.media-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.media-placeholder { font-size:30px; color:#4f769f; }
.media-type-badge { position:absolute; right:7px; top:7px; border:1px solid rgba(255,255,255,.15); background:rgba(7,16,29,.8); border-radius:999px; padding:3px 6px; color:#c7d6e8; font-size:7px; font-weight:800; text-transform:uppercase; }
.media-card-copy { padding:10px 10px 5px; }
.media-card-copy strong, .media-card-copy span, .media-card-copy small { display:block; }
.media-card-copy strong { font-size:9.5px; color:#dce8f6; }
.media-card-copy span { margin-top:4px; color:#71849e; font-size:8px; }
.media-card-copy small { margin-top:4px; color:#f3bd60; font-size:7.5px; }
.media-card-actions { padding:7px 10px 10px; }
.media-preview-modal { position:fixed; inset:0; z-index:2200; display:grid; place-items:center; padding:24px; }
.media-preview-dialog { position:relative; z-index:2; width:min(1080px,96vw); max-height:92vh; display:flex; flex-direction:column; overflow:hidden; border:1px solid #2a3d57; background:#081321; border-radius:14px; box-shadow:0 25px 80px rgba(0,0,0,.55); }
.media-preview-stage { min-height:420px; display:grid; place-items:center; background:#02070d; overflow:auto; }
.media-preview-stage video { max-width:100%; max-height:74vh; width:100%; background:#000; }
.media-preview-stage img { max-width:100%; max-height:74vh; object-fit:contain; }
@media (max-width:1100px) { .media-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } .safety-event-layout { grid-template-columns:1fr; } }
@media (max-width:820px) { .media-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .video-actions-strip { align-items:flex-start; flex-direction:column; } .safety-event-filters,.video-filters { grid-template-columns:1fr 1fr; } }
@media (max-width:560px) { .media-grid { grid-template-columns:1fr; } .safety-event-filters,.video-filters { grid-template-columns:1fr; } }

/* === FIRSTWATCH LIGHTER SLATE V3 START ===
   Visual-only theme override.
   Firstwatch functionality, Tracksolid logic, maps, cameras and video logic
   are untouched.
   ================================================================ */

:root {
  --bg: #172536 !important;
  --panel: #25394f !important;
  --panel-2: #203349 !important;
  --line: #405873 !important;
  --text: #f3f7fc !important;
  --muted: #afbdcd !important;
}

html,
body {
  background: #172536 !important;
  color: #f3f7fc !important;
}

/* Main page / navigation */
.sidebar {
  background: linear-gradient(180deg, #1f3247 0%, #18293a 100%) !important;
  border-right-color: #405873 !important;
}

.nav-item {
  color: #c0ccda !important;
}

.nav-item span {
  color: #91a5bd !important;
}

.nav-item:hover {
  background: rgba(255,255,255,.06) !important;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(60,145,255,.24), rgba(60,145,255,.10)) !important;
}

.nav-label {
  color: #8194ac !important;
}

.sidebar-footer small,
.topbar p,
.status-strip span,
.asset-directory-head p,
.module-toolbar p,
.trip-route-head p {
  color: #afbdcd !important;
}

/* Main cards and panels */
.metric-card,
.compact-stat {
  background: linear-gradient(145deg, #293d54, #22364b) !important;
  border-color: #405873 !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.12) !important;
}

.panel,
.detail-card {
  background: linear-gradient(145deg, #263b52, #203349) !important;
  border-color: #405873 !important;
}

.asset-hero {
  background: linear-gradient(145deg, #2a4058, #20344a) !important;
  border-color: #405873 !important;
}

.detail-metric {
  background: linear-gradient(145deg, #293e55, #22364b) !important;
  border-color: #405873 !important;
}

.trip-route-panel {
  background: linear-gradient(145deg, #253b52, #1e3247) !important;
  border-color: #405873 !important;
}

.trip-route-summary {
  background: #405873 !important;
}

.trip-route-summary > div {
  background: #263b52 !important;
}

/* Forms and controls */
.refresh-button,
.secondary-button,
.customer-scope-control select {
  background: #2a4058 !important;
  border-color: #48627e !important;
  color: #e8f0f8 !important;
}

.avatar {
  background: #2b425b !important;
  border-color: #4b6682 !important;
}

.search-wrap input,
.module-filters select,
.module-filters input,
.map-tools input,
.map-filter,
.camera-customer-select {
  background: #21364b !important;
  border-color: #405873 !important;
  color: #eef4fb !important;
}

.directory-count,
.count-pill {
  background: #293e55 !important;
  border-color: #405873 !important;
}

/* Tables */
th {
  background: rgba(24,41,58,.78) !important;
  color: #98abc1 !important;
}

tbody tr:hover {
  background: rgba(255,255,255,.04) !important;
}

.asset-meta,
.metric-foot,
.compact-stat small,
.asset-hero-meta,
.detail-metric > small,
.camera-name-button small,
.camera-tracksolid-meta,
.camera-health-detail,
.media-card-copy span,
.popup-meta,
.popup-coords {
  color: #8fa2b9 !important;
}

.metric-head,
.compact-stat span,
.detail-metric > span,
.camera-assignment-strip span,
.module-filters label {
  color: #b0bfd0 !important;
}

/* Live map surrounding UI only â€” actual map tiles are unchanged */
.map-panel {
  background: #22364b !important;
  border-color: #405873 !important;
}

.map-assets-panel {
  background: linear-gradient(180deg, #263b52 0%, #1d3044 100%) !important;
  border-right-color: #405873 !important;
}

.map-asset-row {
  border-bottom-color: rgba(64,88,115,.68) !important;
}

.map-asset-row:hover {
  background: rgba(60,145,255,.09) !important;
}

/* Camera / video library cards.
   Video playback stages intentionally stay black/dark for viewing quality. */
.camera-assignment-strip {
  border-color: rgba(60,145,255,.28) !important;
  background: linear-gradient(135deg, rgba(60,145,255,.12), rgba(49,216,146,.05)) !important;
}

.media-card {
  background: #21364b !important;
  border-color: #405873 !important;
}

.video-actions-strip {
  border-color: #405873 !important;
  background: linear-gradient(90deg, rgba(60,145,255,.13), rgba(65,215,255,.06)) !important;
}

.camera-history-button,
.event-history-button,
.event-media-button {
  background: #263b52 !important;
  border-color: #405873 !important;
}

/* Toasts and popup shells */
.firstwatch-toast {
  background: rgba(30,50,71,.97) !important;
  border-color: #4a6683 !important;
}

/* Keep Firstwatch blue/cyan accents and all green/amber/red status colours. */
/* === FIRSTWATCH LIGHTER SLATE V3 END === */
