/* ForeDrive Fleet — dense, desktop-first dispatch layout. Builds on the Sunrise tokens in app.css. */

body.pro { overflow: auto; font-size: 13.5px; }
body.pro #map { position: relative; inset: auto; }

.pro-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.pro-top .brand { text-decoration: none; color: var(--text); box-shadow: none; background: none; padding: 0; }
.pro-top .brand em { font-style: normal; font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--fd-ink); color: var(--fd-ink-inverse); padding: 3px 8px; border-radius: 999px; margin-left: 4px; }
:root[data-resolved-theme="dark"] .pro-top .brand em { background: var(--fd-sev-1); color: #2b1b3d; }
.pro-clock { color: var(--muted); font-weight: 600; font-size: 13px; margin-left: 4px; }
.pro-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pro-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px;
  font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--text);
}
.pro-btn svg { width: 17px; height: 17px; }
.pro-btn.quiet { box-shadow: inset 0 0 0 1.5px var(--line); background: none; }
.pro-btn.primary { background: var(--accent); color: var(--accent-ink); }
.pro-btn:disabled { opacity: .5; cursor: default; }

.pro-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 42%); gap: 16px; padding: 16px; align-items: start; }
@media (max-width: 1100px) { .pro-main { grid-template-columns: 1fr; } .pro-side { order: -1; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 14px; }
.kpi { background: var(--surface); border-radius: 12px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.kpi small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi b { font-size: 22px; font-weight: 900; }
.kpi.lv2 b { color: var(--fd-sev-3); } .kpi.lv3 b { color: var(--fd-sev-4); }
:root[data-resolved-theme="dark"] .kpi.lv3 b { color: #f08fb0; }

.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.board-head h2 { font-size: 17px; font-weight: 800; }
.board-tools { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.board-tools select { border: 0; background: var(--surface-2); border-radius: 8px; height: 30px; padding: 0 8px; font-weight: 700; color: var(--text); }

.board { display: flex; flex-direction: column; gap: 6px; }
.trip {
  display: grid; grid-template-columns: 96px 1fr 150px 130px 40px; gap: 10px; align-items: center;
  background: var(--surface); border-radius: 12px; padding: 10px 12px; text-align: left;
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow .15s;
}
.trip:hover { box-shadow: inset 0 0 0 1.5px var(--faint); }
.trip.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.trip .status { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--fd-ink); }
.status.lv0 { background: var(--fd-sev-1); } .status.lv1 { background: var(--fd-sev-2); } .status.lv2 { background: var(--fd-sev-3); color: #fff; } .status.lv3 { background: var(--fd-sev-4); color: #fff; }
.status.lvx { background: var(--surface-3); color: var(--muted); }
.trip-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trip-main b { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-main .hz { display: block; background: none; padding: 0; font-size: 12.5px; color: var(--fd-sev-3); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-resolved-theme="dark"] .trip-main .hz { color: var(--fd-sev-2); }
.trip-time { display: flex; flex-direction: column; font-size: 12.5px; }
.trip-time b { font-weight: 750; }
.trip-time em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 600; }
.trip-time small { color: var(--muted); }
.trip .strip { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 1px; background: var(--surface-3); }
.trip .strip i { flex: 1; }
.trip .reco { font-size: 11.5px; font-weight: 700; margin-top: 3px; color: var(--accent); }
.trip-del { color: var(--muted); }
.board .empty { padding: 30px; text-align: center; background: var(--surface); border-radius: 12px; color: var(--muted); }
@media (max-width: 700px) { .trip { grid-template-columns: 80px 1fr 40px; } .trip-time, .trip .strip { display: none; } }

.pro-side { position: sticky; top: 66px; display: flex; flex-direction: column; gap: 12px; }
.pro-map { height: 42vh; min-height: 280px; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); background: var(--bg); }
.pro-detail { background: var(--surface); border-radius: 14px; padding: 14px; box-shadow: inset 0 0 0 1px var(--line); max-height: calc(58vh - 110px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.pro-detail h3 { font-size: 16px; font-weight: 800; }
.pro-detail .meta { color: var(--muted); font-size: 12.5px; }
.pro-detail .verdict { padding: 12px 14px; }
.pro-detail .hz-list { gap: 4px; }
.pro-detail .hz { background: var(--surface-2); }
.pro-detail .navlog { font-size: 12.5px; }
.pro-detail .cp { grid-template-columns: 56px 12px 1fr auto; padding: 5px 4px; }
.pro-detail .row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pro-detail .btn-out { height: 38px; font-size: 13px; padding: 0 12px; }
.hos { background: color-mix(in srgb, var(--fd-sev-2) 18%, var(--surface)); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.hos b { display: block; }
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.pro-alerts { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.pro-alerts h2 { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.pro-alerts h2 svg { width: 18px; height: 18px; color: var(--fd-sev-4); }
.pro-alerts .alert { background: var(--surface); }

.trip-form { display: flex; flex-direction: column; gap: 10px; }
.trip-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.trip-form input, .trip-form select { height: 42px; border: 0; border-radius: 10px; background: var(--surface-2); padding: 0 10px; color: var(--text); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.fine-left { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.fine-left code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
#csv-text { width: 100%; border: 0; border-radius: 10px; background: var(--surface-2); padding: 10px; font: 12.5px/1.4 ui-monospace, Menlo, monospace; color: var(--text); resize: vertical; margin-bottom: 10px; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.danger { background: color-mix(in srgb, var(--fd-sev-4) 14%, transparent); color: var(--fd-sev-4); }
.about-p { color: var(--muted); font-size: 13px; padding-top: 10px; }

@media print {
  .pro-top, .pro-side, .board-tools, .trip-del, .disclaimer { display: none !important; }
  .pro-main { display: block; padding: 0; }
  .trip { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; color: #000; }
}

/* Phones: header wraps into two rows, labels collapse to icons, map shrinks. */
@media (max-width: 760px) {
  .pro-top { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .pro-clock { display: none; }
  .pro-actions { margin-left: 0; width: 100%; gap: 6px; }
  .pro-btn { height: 34px; padding: 0 10px; font-size: 12.5px; }
  .pro-btn.quiet span, #btn-import span, #btn-export span { display: none; }
  .pro-main { padding: 10px; gap: 10px; }
  .pro-side { position: static; }
  .pro-map { height: 34vh; min-height: 200px; }
  .pro-detail { max-height: none; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi b { font-size: 18px; }
}

/* ── Team board ── */
body.role-member .admin-only { display: none !important; }
body.in-team #btn-team { box-shadow: inset 0 0 0 1.5px var(--accent); }
.team-intro, .team-note { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.team-note b { color: var(--text); }
.team-form { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.team-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; flex: 1 1 220px; }
.team-form input { font-size: 15px; padding: 9px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); }
.team-card { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; font-size: 14px; }
.team-card small { color: var(--muted); }
.team-card code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: var(--text); letter-spacing: .04em; }
.team-card .sync { white-space: nowrap; font-weight: 700; }
.team-card .sync.offline, .team-card .sync.error { color: var(--lv2); }
.team-card .sync.saving { color: var(--muted); }
#dlg-team .row-btns { margin-bottom: 12px; }
.chip.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text); }
