:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f7fa;
}

a {
  color: #116071;
}

.table-action {
  font-weight: 900;
}

.media-open {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.media-dialog {
  width: min(94vw, 1100px);
  max-width: 94vw;
  max-height: 94vh;
  padding: 24px;
  border: 0;
  border-radius: 8px;
  background: #172033;
  color: white;
}

.media-dialog::backdrop { background: rgb(15 23 42 / 78%); }
.media-dialog img, .media-dialog video { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; object-fit: contain; }
.dialog-close { float: right; border: 0; background: transparent; color: white; font-size: 30px; cursor: pointer; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 32px 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.15;
}

h2 {
  font-size: 22px;
  margin-bottom: 18px;
}

.topbar p,
.hint {
  color: #5c6879;
  margin-top: 6px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 0 32px;
  border-bottom: 1px solid #d8e1ea;
}

.tabs a {
  display: block;
  padding: 16px 20px;
  color: #536276;
  text-decoration: none;
  font-weight: 800;
  border-bottom: 4px solid transparent;
}

.tabs a.active {
  color: #116071;
  background: white;
  border-radius: 8px 8px 0 0;
  border-bottom-color: #116071;
}

main {
  padding: 28px 32px 44px;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card,
.panel {
  background: white;
  border: 1px solid #dae3ec;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
}

.login-card p {
  color: #5c6879;
  margin: 8px 0 24px;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid.two {
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  align-items: start;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metrics div {
  background: white;
  border: 1px solid #dae3ec;
  border-radius: 8px;
  padding: 18px;
}

.metrics span {
  color: #687688;
  display: block;
  font-weight: 700;
}

.metrics strong {
  display: block;
  font-size: 34px;
  margin-top: 8px;
}

.toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.actions {
  display: flex;
  gap: 10px;
}

.filters {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 180px 260px auto;
}

.tracking-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 320px;
  margin-bottom: 24px;
}

.tracking-map-card,
.tracking-side {
  background: white;
  border: 1px solid #dae3ec;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
  padding: 18px;
}

.tracking-map-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tracking-map {
  border: 1px solid #cfd9e4;
  border-radius: 8px;
  height: 560px;
  overflow: hidden;
  width: 100%;
}

.driver-card {
  background: #f8fafc;
  border: 1px solid #e5edf4;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 14px;
}

.driver-card span {
  color: #687688;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.driver-card strong {
  overflow-wrap: anywhere;
}

.operator-marker {
  align-items: center;
  background: #116071;
  border: 4px solid white;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgb(15 23 42 / 30%);
  display: flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.operator-marker div {
  background: #7dd3fc;
  border-radius: 999px;
  height: 10px;
  width: 10px;
}

.checkpoint-marker {
  align-items: center;
  background: white;
  border: 2px solid #116071;
  border-radius: 999px;
  color: #116071;
  display: flex;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  color: #394557;
  display: grid;
  font-weight: 800;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd9e4;
  border-radius: 7px;
  color: #172033;
  font: inherit;
  font-weight: 500;
  min-height: 48px;
  padding: 12px 14px;
}

textarea {
  resize: vertical;
}

button,
.button {
  align-items: center;
  background: #116071;
  border: 0;
  border-radius: 7px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 900;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  text-decoration: none;
}

button.secondary,
.button.secondary {
  background: white;
  border: 1px solid #b7c8d5;
  color: #116071;
}

.split {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.detail-list,
.detail-grid {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-grid {
  grid-template-columns: 180px 1fr;
}

.detail-list dt,
.detail-grid dt {
  color: #687688;
  font-weight: 900;
}

.detail-list dd,
.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.json-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 16px;
}

.json-grid div {
  background: #f8fafc;
  border: 1px solid #e5edf4;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.json-grid span {
  color: #687688;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.json-grid strong {
  overflow-wrap: anywhere;
}

.json-pre {
  background: #0f172a;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
  overflow: auto;
  padding: 16px;
}

.wrap {
  overflow-wrap: anywhere;
}

.media-preview-cell {
  min-width: 180px;
}

.media-thumb,
.media-video {
  background: #f8fafc;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
  max-height: 140px;
  max-width: 180px;
}

.notice {
  background: #e1f5ff;
  border: 1px solid #9bd7ee;
  border-radius: 8px;
  color: #075985;
  font-weight: 800;
  margin-bottom: 20px;
  padding: 14px 16px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e5edf4;
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #536276;
  font-size: 14px;
  text-transform: uppercase;
}

.empty {
  color: #687688;
  text-align: center;
}

@media (max-width: 860px) {
  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
  }

  .grid.two,
  .tracking-shell,
  .metrics,
  .detail-grid,
  .split,
  .filters {
    grid-template-columns: 1fr;
  }
}

/* Stitch Nsafe Blue field-operations theme */
:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #dae2fd;
  background: #0b1326;
}

body { background: #0b1326; color: #dae2fd; }
a { color: #93ccff; }
.topbar { padding: 28px 40px 22px; background: #0b1326; }
h1 { color: #dae2fd; letter-spacing: -0.02em; }
.topbar p, .hint { color: #bfc7d2; }
.tabs { padding: 0 40px; gap: 4px; background: #0b1326; border-bottom: 1px solid #3f4850; }
.tabs a { color: #bfc7d2; border-bottom-width: 3px; }
.tabs a.active { color: #ffffff; background: #0284c7; border-bottom-color: #93ccff; border-radius: 4px 4px 0 0; }
main { padding: 28px 40px 48px; }
.panel, .metrics div, .tracking-map-card, .tracking-side, .login-card { background: #131b2e; border-color: #3f4850; box-shadow: none; }
.metrics div { border-radius: 8px; }
.metrics span, th, label, .detail-list dt, .detail-grid dt, .json-grid span, .driver-card span { color: #bfc7d2; }
.metrics strong { color: #dae2fd; font-family: "JetBrains Mono", monospace; }
.driver-card, .json-grid div { background: #171f33; border-color: #3f4850; }
input, select, textarea { background: #0b1326; border-color: #89929b; color: #dae2fd; border-radius: 4px; }
input::placeholder, textarea::placeholder { color: #89929b; }
button, .button { background: #0284c7; border-radius: 4px; }
button.secondary, .button.secondary { background: #222a3d; border-color: #89929b; color: #dae2fd; }
table { background: #131b2e; }
th, td { border-color: #3f4850; }
th { color: #bfc7d2; }
.notice { background: #222a3d; border-color: #ee9800; color: #ffb95f; }
.empty { color: #bfc7d2; }
.tracking-map { border-color: #3f4850; }
.tracking-map-card h2, .tracking-side h2, .panel h2 { color: #dae2fd; }
.media-thumb, .media-video { background: #171f33; border-color: #3f4850; }
.operator-marker { background: #0284c7; }
.checkpoint-marker { border-color: #93ccff; color: #93ccff; }
.media-dialog { background: #131b2e; border: 1px solid #3f4850; }

@media (max-width: 860px) {
  .topbar, main { padding-left: 18px; padding-right: 18px; }
  .tabs { padding: 0 18px; }
}

/* Stitch screen references use a light, high-glare field console surface. */
:root { color-scheme: light; color: #172033; background: #f4f7fa; }
body { background: #f4f7fa; color: #172033; }
.topbar, .tabs { background: #f4f7fa; }
h1, .metrics strong, .tracking-map-card h2, .tracking-side h2, .panel h2 { color: #172033; }
.topbar p, .hint, .metrics span, th, label, .detail-list dt, .detail-grid dt, .json-grid span, .driver-card span { color: #5c6879; }
.tabs { border-color: #d8e1ea; }
.tabs a { color: #536276; }
.tabs a.active { color: #1d6bc3; background: #ffffff; border-bottom-color: #1d6bc3; }
.panel, .metrics div, .tracking-map-card, .tracking-side, .login-card { background: #ffffff; border-color: #dae3ec; box-shadow: 0 1px 2px rgb(15 23 42 / 6%); }
.driver-card, .json-grid div { background: #f8fafc; border-color: #e5edf4; }
input, select, textarea { background: #ffffff; border-color: #cfd9e4; color: #172033; }
input::placeholder, textarea::placeholder { color: #687688; }
button, .button { background: #1d6bc3; }
button.secondary, .button.secondary { background: #ffffff; border-color: #b7c8d5; color: #1d6bc3; }
th, td { border-color: #e5edf4; }
.notice { background: #e1f5ff; border-color: #9bd7ee; color: #075985; }
.tracking-map { border-color: #cfd9e4; }
.media-thumb, .media-video { background: #f8fafc; border-color: #d8e2ec; }
.operator-marker { background: #1d6bc3; }
.checkpoint-marker { border-color: #1d6bc3; color: #1d6bc3; }
.media-dialog { background: #172033; color: #ffffff; }

/* Stitch desktop shell */
.admin-shell { background: #0b1326; color: #dae2fd; }
.sidebar { background: #131b2e; border-right: 1px solid #3f4850; bottom: 0; display: flex; flex-direction: column; justify-content: space-between; left: 0; padding: 0; position: fixed; top: 0; width: 280px; z-index: 10; }
.brand-block { align-items: center; background: #060e20; display: flex; gap: 12px; min-height: 80px; padding: 16px; }
.brand-block strong { color: #93ccff; display: block; font-size: 20px; }
.brand-block span { color: #bfc7d2; display: block; font-size: 11px; margin-top: 3px; }
.brand-mark { align-items: center; background: #0284c7; border-radius: 8px; color: #ffffff; display: flex; font-weight: 800; height: 40px; justify-content: center; width: 40px; }
.telemetry-strip { align-items: center; background: #171f33; color: #bfc7d2; display: flex; font-family: "JetBrains Mono", monospace; font-size: 10px; gap: 8px; padding: 11px 16px; }
.telemetry-strip strong { color: #4edea3; margin-left: auto; }
.status-dot { background: #89929b; border-radius: 50%; display: inline-block; height: 8px; width: 8px; }
.status-dot.live { background: #4edea3; }
.side-nav { display: grid; gap: 4px; padding: 16px 10px; }
.side-nav a { align-items: center; border-radius: 6px; color: #bfc7d2; display: flex; gap: 12px; min-height: 58px; padding: 10px 12px; text-decoration: none; }
.side-nav a > span { font-size: 21px; text-align: center; width: 24px; }
.side-nav a div { font-size: 13px; font-weight: 600; line-height: 18px; }
.side-nav a small { color: #89929b; display: block; font-size: 10px; font-weight: 400; }
.side-nav a.active { background: #0284c7; color: #ffffff; }
.side-nav a.active small { color: #cce5ff; }
.sidebar-logout { padding: 16px; }
.sidebar-logout button { width: 100%; }
.admin-body { margin-left: 280px; min-height: 100vh; }
.admin-header { background: #0b1326; border-bottom: 1px solid #3f4850; position: sticky; top: 0; z-index: 5; }
.online-bar { align-items: center; background: #003824; color: #6ffbbe; display: flex; font-family: "JetBrains Mono", monospace; font-size: 10px; justify-content: space-between; padding: 7px 28px; }
.online-bar .status-dot { margin-right: 6px; }
.admin-header-main { align-items: center; display: flex; gap: 20px; justify-content: space-between; min-height: 64px; padding: 10px 28px; }
.search-placeholder { background: #131b2e; border: 1px solid #3f4850; border-radius: 5px; color: #89929b; max-width: 520px; padding: 11px 14px; width: 100%; }
.admin-user { display: grid; text-align: right; }
.admin-user strong { color: #dae2fd; font-size: 14px; }
.admin-user span { color: #93ccff; font-family: "JetBrains Mono", monospace; font-size: 10px; text-transform: uppercase; }
.admin-body main { background: #0b1326; min-height: calc(100vh - 100px); }
.admin-body .panel, .admin-body .metrics div, .admin-body .tracking-map-card, .admin-body .tracking-side { background: #131b2e; border-color: #3f4850; box-shadow: none; }
.admin-body h1, .admin-body h2, .admin-body .metrics strong { color: #dae2fd; }
.admin-body .topbar, .admin-body .tabs { display: none; }
.admin-body input, .admin-body select, .admin-body textarea { background: #0b1326; border-color: #89929b; color: #dae2fd; }
.admin-body th, .admin-body td { border-color: #3f4850; }
.admin-body th, .admin-body label, .admin-body .hint, .admin-body .metrics span { color: #bfc7d2; }
.admin-body .driver-card, .admin-body .json-grid div { background: #171f33; border-color: #3f4850; }
.admin-body .notice { background: #222a3d; border-color: #ee9800; color: #ffb95f; }

@media (max-width: 860px) {
  .sidebar { position: static; width: 100%; }
  .sidebar-logout { display: none; }
  .side-nav { display: flex; overflow-x: auto; padding: 8px; }
  .side-nav a { flex: 0 0 180px; min-height: 50px; }
  .admin-body { margin-left: 0; }
  .admin-header { position: static; }
  .admin-header-main { padding: 10px 18px; }
  .online-bar { padding-left: 18px; padding-right: 18px; }
  .admin-user { display: none; }
}
