/* DREBAR-fleet dashboard preview: the framed window, and the few Bootstrap 5.3 basics the real dashboard relies on
 * (buttons, button groups, tables, badges, forms), written out here and scoped to .dash so they cannot affect the page.
 * Copyright (c) 2026 DREBAR. */

/* ---- the window around the preview ---- */
.dash-frame { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #0b1015; box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .85), 0 0 0 1px rgba(31, 200, 194, .06); }
.dash-chrome { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #0a0f14; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.dash-chrome i { width: 11px; height: 11px; border-radius: 50%; background: #2a3544; display: inline-block; }
.dash-chrome span { margin-left: 8px; }
.dash-chrome em { margin-left: auto; font-style: normal; color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); border-radius: 999px; padding: 1px 12px; font-size: 13px; }

/* ---- the dashboard itself ---- */
.dash { position: relative; display: flex; flex-direction: column; height: 830px; background: var(--ag-bg); color: var(--ag-text); font-family: var(--ag-font); font-size: .9375rem; line-height: 1.5; text-align: left; letter-spacing: normal; -webkit-font-smoothing: antialiased; }
.dash *, .dash *::before, .dash *::after { box-sizing: border-box; }
.dash h1, .dash h2, .dash h3, .dash h4, .dash h5 { font-family: var(--ag-font); font-weight: 500; letter-spacing: normal; line-height: 1.2; margin: 0 0 .5rem; color: var(--ag-text); }
.dash h5 { font-size: 1.25rem; }
.dash h5.mb-0 { margin-bottom: 0; } .dash h5.mb-3 { margin-bottom: 1rem; }
.dash p { margin: 0; } .dash ul, .dash ol { list-style: none; margin: 0; padding: 0; }
.dash a { color: inherit; }
.dash .bi { width: 1em; height: 1em; fill: currentColor; vertical-align: -.125em; flex: none; display: inline-block; }
.dash .ag-topbar { position: relative; flex: none; }
.dash .ag-layout { flex: 1; min-height: 0; display: flex; }
.dash .ag-sidebar { position: static; height: auto; overflow-y: auto; }
.dash .ag-main { overflow-y: auto; overflow-x: hidden; }
.dash .ag-nav-off { cursor: default; }
.dash .ag-nav-off:hover { color: var(--ag-text-soft); }
.dash .ag-brand-word { font-family: "League Spartan", system-ui, sans-serif; font-weight: 700; font-size: 1.7rem; line-height: 1; letter-spacing: -.01em; color: var(--ag-text); text-transform: lowercase; }
.dash .ag-user-name.d-block { display: block; }
.dash .ag-icon-btn { cursor: pointer; }
.dash summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.dash summary::-webkit-details-marker { display: none; }
.dash .ag-footer { margin-top: 28px; font-size: .8rem; color: var(--ag-muted); }

.dash-lang { display: inline-flex; border: 1px solid var(--ag-border-strong); border-radius: var(--ag-radius); overflow: hidden; }
.dash-lang button { font: 600 .72rem var(--ag-font); letter-spacing: .06em; color: var(--ag-text-soft); background: transparent; border: 0; padding: 5px 9px; cursor: pointer; }
.dash-lang button[aria-pressed="true"] { background: var(--ag-accent-soft); color: var(--ag-accent-text); }

.dash-toast { position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 12px); background: var(--ag-surface-3); color: var(--ag-text); border: 1px solid var(--ag-border-strong); border-radius: var(--ag-radius); padding: 8px 16px; font-size: .85rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; box-shadow: var(--ag-shadow-lg); }
.dash-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- layout helpers used by the pages ---- */
.dash .dash-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; align-items: stretch; }
.dash .dash-cols.dash-cols-cmd { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: 0; }
.dash .p-3 { padding: 1rem; } .dash .mb-0 { margin-bottom: 0; } .dash .mb-2 { margin-bottom: .5rem; } .dash .mb-3 { margin-bottom: 1rem; } .dash .mt-2 { margin-top: .5rem; } .dash .mt-3 { margin-top: 1rem; }
.dash .d-flex { display: flex; } .dash .gap-2 { gap: .5rem; } .dash .flex-fill { flex: 1 1 auto; } .dash .w-100 { width: 100%; }
.dash .small { font-size: .875em; } .dash .v2-muted { color: var(--ag-muted); } .dash small.v2-muted, .dash .small.v2-muted { font-size: .8rem; }
.dash .table-responsive { overflow-x: auto; }
.dash .ov-map.dash-map { position: relative; height: 380px; overflow: hidden; }
.dash .ov-feed { max-height: 380px; }
.dash-hr, .dash hr { border: 0; border-top: 1px solid var(--ag-border-strong); margin: 1rem 0; opacity: .6; }

/* ---- map controls drawn like the product's map (zoom and layer switch) ---- */
.dash-map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dash-zoom { position: absolute; left: 10px; top: 10px; display: grid; border: 2px solid rgba(0, 0, 0, .25); border-radius: 5px; background-clip: padding-box; overflow: hidden; z-index: 5; }
.dash-zoom button { width: 30px; height: 30px; border: 0; background: #fff; color: #222; font: 700 18px/1 sans-serif; cursor: pointer; }
.dash-zoom button + button { border-top: 1px solid #ccc; }
.dash-zoom button:hover { background: #f4f4f4; }
.dash-layers { position: absolute; right: 10px; top: 10px; background: #fff; color: #222; border: 2px solid rgba(0, 0, 0, .25); border-radius: 5px; padding: 6px 10px; font-size: .8rem; display: grid; gap: 2px; z-index: 5; }
.dash-layers label { display: flex; align-items: center; gap: 4px; cursor: pointer; margin: 0; }
.dash-attrib { position: absolute; right: 0; bottom: 0; background: rgba(255, 255, 255, .75); color: #333; font-size: 11px; padding: 1px 6px; z-index: 5; }

/* ---- Bootstrap basics ---- */
.dash .btn { --bs-btn-color: var(--ag-text); --bs-btn-bg: transparent; --bs-btn-border-color: transparent; display: inline-block; padding: .375rem .75rem; font: 500 1rem/1.5 var(--ag-font); color: var(--bs-btn-color); background: var(--bs-btn-bg); border: 1px solid var(--bs-btn-border-color); border-radius: var(--ag-radius); text-align: center; text-decoration: none; vertical-align: middle; cursor: pointer; user-select: none; box-shadow: none; transform: none; letter-spacing: normal; transition: color .15s, background-color .15s, border-color .15s; }
.dash .btn:hover { color: var(--bs-btn-hover-color, var(--bs-btn-color)); background: var(--bs-btn-hover-bg, var(--bs-btn-bg)); border-color: var(--bs-btn-hover-border-color, var(--bs-btn-border-color)); transform: none; box-shadow: none; }
.dash .btn-sm { padding: .25rem .5rem; font-size: .875rem; }
.dash .btn-primary, .dash .btn-warning { --bs-btn-bg: var(--ag-btn-bg); --bs-btn-border-color: var(--ag-btn-bg); --bs-btn-color: var(--ag-btn-fg); --bs-btn-hover-bg: var(--ag-btn-hover-bg); --bs-btn-hover-border-color: var(--ag-btn-hover-bg); --bs-btn-hover-color: var(--ag-btn-fg); }
.dash .btn-danger { --bs-btn-bg: var(--ag-danger-bg); --bs-btn-border-color: var(--ag-danger-bg); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--ag-danger-hover-bg); --bs-btn-hover-border-color: var(--ag-danger-hover-bg); --bs-btn-hover-color: #fff; }
.dash .btn-outline-danger { --bs-btn-color: var(--ag-danger-text); --bs-btn-border-color: var(--ag-danger-text); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ag-danger-bg); --bs-btn-hover-border-color: var(--ag-danger-bg); }
.dash .btn-outline-secondary { --bs-btn-color: var(--ag-text-soft); --bs-btn-border-color: var(--ag-border-strong); --bs-btn-hover-color: var(--ag-accent-text); --bs-btn-hover-bg: var(--ag-accent-soft); --bs-btn-hover-border-color: var(--ag-accent); }
.dash .btn-outline-warning { --bs-btn-color: var(--ag-accent-text); --bs-btn-border-color: var(--ag-accent-ring); --bs-btn-hover-bg: var(--ag-accent-soft); --bs-btn-hover-color: var(--ag-accent-text); --bs-btn-hover-border-color: var(--ag-accent); }
.dash .btn-group { display: inline-flex; vertical-align: middle; }
.dash .btn-group > .btn:not(:first-child) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.dash .btn-group > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dash .btn-group .btn.active { background: var(--ag-accent-soft); border-color: var(--ag-accent); color: var(--ag-text); font-weight: 600; position: relative; z-index: 1; }
.dash .form-label { display: inline-block; margin-bottom: .5rem; font-size: .82rem; font-weight: 500; color: var(--ag-text-soft); }
.dash .form-select { display: block; width: 100%; padding: .375rem 2.25rem .375rem .75rem; font: 400 .9375rem/1.5 var(--ag-font); color: var(--ag-text); background: var(--ag-surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%239aa3b0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .75rem center / 16px 12px; border: 1px solid var(--ag-border-strong); border-radius: var(--ag-radius); appearance: none; -webkit-appearance: none; }
.dash .form-select option { background: var(--ag-surface-2); color: var(--ag-text); }
.dash .table { width: 100%; border-collapse: collapse; color: var(--ag-text); font-size: .9375rem; }
.dash .table > :not(caption) > * > * { padding: .5rem .5rem; border-bottom: 1px solid var(--ag-border); background: transparent; text-align: left; }
.dash .table > thead th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--ag-muted); border-bottom-color: var(--ag-border-strong); white-space: nowrap; }
.dash .table > tbody td { vertical-align: middle; }
.dash .table-striped > tbody > tr:nth-of-type(odd) > * { background: var(--ag-stripe); }
.dash .badge { display: inline-block; padding: .35em .65em; font-size: .75em; font-weight: 600; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: var(--ag-radius-sm); letter-spacing: .02em; }
.dash .badge.bg-success { background: #198754; } .dash .badge.bg-danger { background: #dc3545; } .dash .badge.bg-secondary { background: #6c757d; }
.dash .badge.bg-warning { background: #ffc107; } .dash .badge.bg-info { background: #0dcaf0; } .dash .badge.text-dark { color: #212529; }

/* ---- narrow screens: the real dashboard stacks its columns the same way ---- */
@media (max-width: 900px) {
  .dash .dash-cols, .dash .dash-cols.dash-cols-cmd { grid-template-columns: 1fr; }
  .dash { height: 700px; }
  .dash .ag-topbar { padding: 0 12px; gap: 10px; }
  .dash .ag-clock, .dash .ag-user-meta, .dash .ag-nav-toggle { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dash-toast { transition: none; } }

/* ---- small-screen fixes ---- */
.dash img { max-width: none; }
.dash .ag-brand-word { flex: none; }
.dash .ag-brand { flex: none; }
.dash-chrome em { white-space: nowrap; }
@media (max-width: 900px) {
  .dash .dash-lang, .dash .ag-user, .dash .ag-topbar-right > .ag-icon-btn:last-child { display: none; }
  .dash .ag-topbar-right { gap: 8px; }
}
@media (max-width: 600px) {
  .dash-chrome span { display: none; }
  .dash-chrome em { margin-left: auto; font-size: 12px; padding: 1px 10px; }
  .dash .ag-brand-name, .dash .ag-version { display: none; }
}

/* ---- the Cameras page (the product's own camera-wall styles, scoped) ---- */
.dash .ag-main.cw-fit { display: flex; flex-direction: column; padding: 10px 14px; }
.dash .ag-main.cw-fit .ag-page-head, .dash .ag-main.cw-fit .ag-footer { display: none; }
.dash .v2-cam-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.dash .v2-cam-toolbar { flex: 0 0 auto; }
.dash .v2-cam-grid { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; }
.dash .v2-cam-row { display: flex; gap: 8px; flex: 1 1 0; min-height: 0; }
.dash .v2-cam-cell { flex: 1 1 0; min-width: 0; min-height: 0; }
.dash .v2-cam-tile { background: var(--ag-surface); border: 1px solid var(--ag-border); border-radius: var(--ag-radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.dash .v2-cam-head { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-bottom: 1px solid var(--ag-border); flex: 0 0 auto; }
.dash .v2-cam-head .form-select { width: auto; min-width: 0; flex: 1 1 40%; }
.dash .v2-cam-head .v2-cam-fps { flex: 0 0 auto; }
.dash .v2-cam-actions { margin-left: auto; display: flex; gap: 4px; }
.dash .v2-cam-frame { position: relative; flex: 1 1 0; min-height: 0; background: #000; }
.dash .v2-cam-frame canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.dash .v2-cam-live-dot { position: absolute; top: 8px; left: 8px; font-size: .7rem; }
.dash .v2-cam-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; font-size: .78rem; color: var(--ag-muted); flex: 0 0 auto; }
.dash .v2-cam-tile:fullscreen { border-radius: 0; }
.dash .v2-cam-tile:fullscreen .v2-cam-frame { flex: 1; }
.dash .btn-outline-info { --bs-btn-color: var(--ag-text-soft); --bs-btn-border-color: var(--ag-border-strong); --bs-btn-hover-color: var(--ag-accent-text); --bs-btn-hover-bg: var(--ag-accent-soft); --bs-btn-hover-border-color: var(--ag-accent); }
.dash .form-select-sm { padding: .25rem 1.75rem .25rem .5rem; font-size: .875rem; border-radius: var(--ag-radius-sm); }
.dash .p-2 { padding: .5rem; } .dash .p-4 { padding: 1.5rem; } .dash .ms-auto { margin-left: auto; }
.dash .flex-wrap { flex-wrap: wrap; } .dash .align-items-center { align-items: center; } .dash .text-center { text-align: center; }
.dash .d-none { display: none !important; } .dash .text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dash .text-nowrap { white-space: nowrap; }
.dash .badge.bg-info.text-dark { color: #212529; }

/* ---- Live View and Replay ---- */
.dash .lv-cam-canvas { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #000; border-radius: var(--ag-radius); }
.dash .lv-map { height: 460px; }
.dash .rp-3d { perspective: 720px; perspective-origin: 50% 24%; }
.dash .rp-tilt { position: absolute; left: -38%; right: -38%; top: -6%; bottom: -34%; transform-origin: 50% 72%; transform: rotateX(54deg); }
.dash .rp-tilt.flat { inset: 0; transform: none; }
.dash .rp-tilt canvas { display: block; width: 100%; height: 100%; }
.dash .rp-mist { position: absolute; left: 0; right: 0; top: 0; height: 36%; background: linear-gradient(#0e1116, rgba(14, 17, 22, 0)); pointer-events: none; }
.dash .rp-tilt.flat + .rp-mist { display: none; }
.dash .rp-cam-canvas { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.dash .rp-map-wrap { min-height: 360px; }
.dash .rp-cam { background: #000; }
.dash .justify-content-between { justify-content: space-between; } .dash .mb-1 { margin-bottom: .25rem; }
.dash .text-info { color: var(--ag-accent-text) !important; }
.dash .form-check { display: flex; align-items: center; gap: .5rem; margin: 0; }
.dash .form-switch .form-check-input { appearance: none; -webkit-appearance: none; flex: none; width: 2em; height: 1.1em; margin: 0; border-radius: 2em; background: var(--ag-surface-3); border: 1px solid var(--ag-border-strong); position: relative; cursor: pointer; }
.dash .form-switch .form-check-input::after { content: ""; position: absolute; top: 50%; left: 2px; width: .8em; height: .8em; border-radius: 50%; background: var(--ag-muted); transform: translateY(-50%); transition: left .15s; }
.dash .form-switch .form-check-input:checked { background: var(--ag-accent-soft); border-color: var(--ag-accent); }
.dash .form-switch .form-check-input:checked::after { left: calc(100% - .8em - 2px); background: var(--ag-accent); }
.dash .rp-marker svg { width: .8rem; height: .8rem; }
.dash .lv-card-actions .btn { padding: .2rem .45rem; }
.dash .lv-card .bi, .dash .lv-stat .bi { width: 1em; height: 1em; }

/* Live View: robot list beside the map, as in the product */
.dash .ag-main.lv-fit { display: flex; flex-direction: column; padding: 10px 14px; }
.dash .lv-modebar { margin-bottom: 8px; }
@media (min-width: 992px) and (min-height: 560px) {
  .dash #v2-bird.lv-split { display: grid; grid-template-columns: clamp(300px, 34%, 520px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 12px; flex: 1; min-height: 0; }
  .dash .lv-robots { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
  .dash .lv-robots .lv-cards { flex: 1; min-height: 0; overflow-y: auto; }
  .dash .lv-mapbox { min-height: 0; }
  .dash .lv-mapbox .lv-map { flex: 1; height: auto; min-height: 0; }
  .dash .lv-cam-canvas { max-height: 200px; }
}
/* Replay: sky above the horizon of the tilted map */
.dash #rp-map { background: linear-gradient(#141c26, #2a3d50 42%, #2a3d50); }
.dash .rp-mist { background: linear-gradient(#141c26, rgba(20, 28, 38, 0)); }
