/* ==========================================================================
   Traccer design system — light. Deep blue #04245F and orange #FC8E01,
   sampled from the logo.
   ========================================================================== */
:root{
  --blue-900:#04245F; --blue-700:#0B3C8C; --blue-600:#1565C0; --blue-400:#2E9BE0;
  --blue-100:#E3EEFB; --blue-050:#F2F7FE;
  --orange:#FC8E01; --orange-600:#E07B00; --orange-050:#FFF4E3;

  --bg:#F5F7FA; --surface:#FFFFFF; --surface-2:#FAFBFD;
  --text:#14203A; --muted:#64748B; --line:#E4E9F0;

  /* green = moving, amber = idle, red = stopped, blue = not reporting */
  --running:#12A150; --overspeed:#C026D3; --idle:#F5A623; --stopped:#E5484D;
  --unreachable:#2563EB; --new:#0EA5E9; --inactive:#94A3B8; --all:var(--blue-900);
  --danger:#E5484D;

  --r-sm:9px; --r:13px; --r-lg:18px;
  --shadow:0 1px 2px rgba(4,36,95,.05), 0 4px 14px rgba(4,36,95,.07);
  --shadow-lg:0 12px 34px rgba(4,36,95,.14);
  --font:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:var(--font);background:var(--bg);color:var(--text);
     -webkit-font-smoothing:antialiased}
a{color:var(--blue-600);text-decoration:none}
h1,h2,h3{margin:0;font-weight:800;letter-spacing:-.015em}

/* ---------- app shell (light) ---------- */
.app{display:flex;height:100vh;overflow:hidden}
.side{width:244px;background:var(--surface);border-right:1px solid var(--line);
      display:flex;flex-direction:column;flex-shrink:0}
.side .brand{padding:18px 18px 16px;border-bottom:1px solid var(--line)}
.side .brand img{height:40px;width:auto;display:block}
.side nav{padding:12px 10px;display:flex;flex-direction:column;gap:3px;flex:1;overflow-y:auto}
.side nav a{display:flex;align-items:center;gap:11px;padding:11px 13px;border-radius:var(--r-sm);
            color:var(--muted);font-size:14px;font-weight:600;transition:.13s}
.side nav a:hover{background:var(--blue-050);color:var(--blue-700)}
.side nav a.on{background:var(--blue-900);color:#fff}
.side nav a.on svg{color:var(--orange)}
.side nav a svg{width:18px;height:18px;flex-shrink:0}
.side .foot{padding:14px 18px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.side .foot b{color:var(--text);display:block;font-size:13px}

.main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}
.top{background:var(--surface);border-bottom:1px solid var(--line);padding:15px 24px;
     display:flex;align-items:center;justify-content:space-between;gap:16px;flex-shrink:0}
.top h1{font-size:18px}
.content{flex:1;overflow:auto;padding:22px 24px}
.content.flush{padding:0;display:flex;min-height:0}

/* ---------- cards ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);
      box-shadow:var(--shadow);padding:20px;margin-bottom:20px}
.card h2{font-size:15px;margin-bottom:15px}

/* ---------- forms ---------- */
label{display:block;font-size:13px;font-weight:700;margin-bottom:6px;color:var(--text)}
input,select,textarea{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:var(--r-sm);
      font-size:14px;font-family:var(--font);background:#fff;color:var(--text);outline:none;transition:.13s}
input:focus,select:focus{border-color:var(--blue-400);box-shadow:0 0 0 3px rgba(46,155,224,.18)}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:15px;align-items:end}
.btn{display:inline-block;background:var(--blue-900);color:#fff;border:0;padding:12px 22px;
     border-radius:var(--r-sm);font-size:14px;font-weight:700;cursor:pointer;font-family:var(--font);
     transition:.13s}
.btn:hover{background:var(--blue-700)}
.btn.go{background:linear-gradient(135deg,var(--orange) 0%,#FFA733 100%);color:#fff;
        box-shadow:0 4px 14px rgba(252,142,1,.32)}
.btn.go:hover{background:linear-gradient(135deg,var(--orange-600) 0%,var(--orange) 100%)}
.btn.ghost{background:#fff;color:var(--text);border:1px solid var(--line)}
.btn.ghost:hover{background:var(--surface-2)}
.btn.danger{background:var(--danger)}
.btn.sm{padding:7px 14px;font-size:13px}

/* ---------- tables ---------- */
table{width:100%;border-collapse:collapse;font-size:14px}
th{text-align:left;padding:11px 8px;border-bottom:2px solid var(--line);font-size:11px;
   text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:800}
td{padding:12px 8px;border-bottom:1px solid var(--line);vertical-align:top}
tr:last-child td{border-bottom:0}

/* ---------- bits ---------- */
.msg{padding:12px 15px;border-radius:var(--r-sm);font-size:14px;margin-bottom:16px;font-weight:600}
.msg.ok{background:#E6F7EE;color:#0B6B37;border:1px solid #A8E6C3}
.msg.err{background:#FEECEC;color:#A31A1F;border:1px solid #F7B9BB}
.pill{font-size:11px;font-weight:800;padding:3px 9px;border-radius:999px;display:inline-block}
.pill.on{background:#E6F7EE;color:#0B6B37}
.pill.off{background:#EEF1F6;color:#64748B}
.pill.red{background:#FEECEC;color:#A31A1F}
.pill.amber{background:var(--orange-050);color:#8A5200}
.tag{font-size:10px;font-weight:800;padding:3px 8px;border-radius:5px;color:#fff;white-space:nowrap}
.muted{color:var(--muted);font-size:13px}
.empty{padding:36px 18px;text-align:center;color:var(--muted);font-size:14px;line-height:1.7}

/* ---------- status filter chips ---------- */
.filters{background:var(--surface);border-bottom:1px solid var(--line);padding:12px 16px;
         display:flex;gap:8px;overflow-x:auto;flex-shrink:0}
.chip{display:flex;align-items:center;gap:7px;padding:8px 14px;border-radius:999px;cursor:pointer;
      border:1px solid var(--line);background:#fff;font-size:13px;font-weight:700;white-space:nowrap;
      color:var(--text);font-family:var(--font);transition:.13s}
.chip:hover{border-color:var(--blue-400);background:var(--blue-050)}
.chip .sw{width:9px;height:9px;border-radius:50%;flex-shrink:0}
.chip .ct{background:#EEF1F6;border-radius:999px;padding:1px 8px;font-size:12px;
          font-variant-numeric:tabular-nums}
.chip[aria-pressed="true"]{color:#fff;border-color:transparent;background:var(--blue-600)}
.chip[aria-pressed="true"] .ct{background:rgba(255,255,255,.26)}
.chip[aria-pressed="true"] .sw{background:#fff !important}
.chip.zero{opacity:.45}

@media(max-width:820px){
  .app{flex-direction:column;height:auto;min-height:100vh;overflow:visible}
  .side{width:100%;flex-direction:row;align-items:center;overflow-x:auto}
  .side nav{flex-direction:row;padding:8px;flex:1}
  .side .brand{border-bottom:0;border-right:1px solid var(--line)}
  .side .foot{display:none}
}

/* ---- stat strip (engine log) ------------------------------------------
   Plain numbers on the page's own surface: the point is to be read at a
   glance next to the timeline, not to compete with it for attention. */
.stats{display:grid;gap:10px;margin-top:18px;
  grid-template-columns:repeat(auto-fit,minmax(118px,1fr))}
.stats > div{background:var(--bg);border:1px solid var(--line);border-radius:var(--r);
  padding:11px 13px;display:flex;flex-direction:column;gap:3px}
.stats span{font-size:11.5px;color:var(--muted);letter-spacing:.02em;text-transform:uppercase}
.stats b{font-size:18px;color:var(--text);font-variant-numeric:tabular-nums;line-height:1.15}

/* ---- replay bar -------------------------------------------------------- */
.player{display:flex;align-items:center;gap:12px;padding:11px 14px;
  border-top:1px solid var(--line);background:var(--surface);flex-wrap:wrap}
.player #scrub{flex:1;min-width:160px;accent-color:var(--orange);height:4px}
.player .rate{display:inline-flex;gap:2px;background:var(--bg);border:1px solid var(--line);
  border-radius:999px;padding:2px}
.player .rate button{border:0;background:none;cursor:pointer;font:inherit;font-size:12px;
  font-weight:700;color:var(--muted);padding:4px 9px;border-radius:999px}
.player .rate button.on{background:var(--blue-900);color:#fff}
.player .readout{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums;min-width:112px}
.player .readout b{color:var(--text)}
/* The replay marker is a top-down vehicle, rotated to the heading by MapLibre
   itself (rotationAlignment: map), so it turns with the road like the thing it
   represents. No disc, no pin -- it should read as a vehicle on the tarmac. */
.play-veh{position:relative;line-height:0;filter:drop-shadow(0 4px 7px rgba(4,36,95,.42))}
.play-veh svg{display:block;position:relative;z-index:1}
/* A halo, because a 36px vehicle on a city map is easy to lose. It sits under
   the sprite and does not rotate with it. */
.play-veh::before{content:'';position:absolute;left:50%;top:50%;width:62px;height:62px;
  margin:-31px 0 0 -31px;border-radius:50%;
  background:radial-gradient(circle,rgba(252,142,1,.42) 0%,rgba(252,142,1,.16) 45%,rgba(252,142,1,0) 72%)}
/* Parked: a slow pulse, so a still vehicle reads as resting rather than stuck. */
.play-veh.parked::before{animation:parkPulse 2.2s ease-in-out infinite;
  background:radial-gradient(circle,rgba(90,107,132,.42) 0%,rgba(90,107,132,.16) 45%,rgba(90,107,132,0) 72%)}
@keyframes parkPulse{0%,100%{transform:scale(.8);opacity:.75}50%{transform:scale(1.15);opacity:1}}
@media(prefers-reduced-motion:reduce){.play-veh.parked::before{animation:none}}

/* legend for the time colouring */
.tl{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted)}
.tl i{width:56px;height:6px;border-radius:3px;display:inline-block}
.tl i.ramp-time{background:linear-gradient(90deg,#04245F,#1565C0 35%,#FC8E01 65%,#E5484D)}
.tl i.ramp-speed{background:linear-gradient(90deg,#8FA3BC,#2E9BE0 14%,#12A150 36%,#F5A623 64%,#E5484D)}

/* Parking markers. Violet on purpose: nothing on the route or in the status
   palette uses it, so a stop can never be mistaken for a stretch of driving. */
.stop-pin{display:flex;flex-direction:column;align-items:center;cursor:pointer;line-height:1}
.stop-pin span{width:22px;height:22px;border-radius:50% 50% 50% 2px;transform:rotate(45deg);
  background:#7C3AED;border:2.5px solid #fff;box-shadow:0 3px 9px rgba(4,36,95,.4);
  display:grid;place-items:center}
/* the teardrop is rotated, so the letter inside is turned back upright */
.stop-pin span b{transform:rotate(-45deg);font-size:10.5px;font-weight:800;color:#fff}
.stop-pin i{margin-top:3px;font-style:normal;font-size:10px;font-weight:800;color:#5B21B6;
  background:rgba(255,255,255,.92);border-radius:4px;padding:1px 4px;white-space:nowrap}

/* ---- date + time picker ------------------------------------------------ */
.dt-wrap{position:relative}
input.dt-input{cursor:pointer;font-variant-numeric:tabular-nums}
.dtp{position:absolute;z-index:60;top:100%;left:0;margin-top:6px;width:286px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--shadow-lg);padding:12px}
.dtp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.dtp-head span{font-weight:700;font-size:13.5px}
.dtp-head button{border:1px solid var(--line);background:var(--bg);border-radius:8px;
  width:28px;height:28px;cursor:pointer;font-size:16px;line-height:1;color:var(--text)}
.dtp-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.dtp-grid .dtp-dow{font-size:10.5px;color:var(--muted);text-align:center;padding:4px 0;
  text-transform:uppercase;letter-spacing:.04em}
.dtp-grid button{border:0;background:none;cursor:pointer;font:inherit;font-size:12.5px;
  padding:6px 0;border-radius:8px;color:var(--text)}
.dtp-grid button:hover{background:var(--bg)}
.dtp-grid button.sel{background:var(--blue-900);color:#fff;font-weight:700}
.dtp-time{display:flex;align-items:center;gap:7px;margin:11px 0 3px;padding-top:11px;
  border-top:1px solid var(--line)}
.dtp-time label{font-size:11.5px;color:var(--muted);margin:0;flex:1}
.dtp-time select{padding:6px 8px;font-size:13px;width:auto}
.dtp-act{display:flex;justify-content:flex-end;gap:8px;margin-top:11px}
/* [hidden] loses to .player's display:flex on specificity, so say it again */
.player[hidden]{display:none}

/* ---- report ------------------------------------------------------------
   The same markup serves the screen and the printer: an operator scans it in
   the browser, and Print -> Save as PDF produces the thing that gets emailed
   to the customer, so the controls and chrome drop out on paper. */
.rep-head{display:flex;align-items:center;gap:16px;padding-bottom:16px;margin-bottom:6px;
  border-bottom:2px solid var(--blue-900)}
.rep-head img{height:46px;width:auto}
.rep-head h2{margin:0 0 2px}
.rep-veh{margin:24px 0 10px;font-size:16px;display:flex;align-items:baseline;gap:8px}
.rep-veh .muted{font-size:13px;font-weight:500}
.rep-total td{background:var(--bg);font-weight:700;border-top:2px solid var(--line)}
.rep-foot{margin-top:22px;padding-top:12px;border-top:1px solid var(--line);
  font-size:11.5px;text-align:center}

@media print{
  .side, .topbar, .no-print, .player{display:none !important}
  body{background:#fff}
  .main, .content{margin:0 !important;padding:0 !important}
  .card{box-shadow:none;border:0;padding:0;margin:0}
  .rep-veh{break-after:avoid}
  table{break-inside:auto}
  tr{break-inside:avoid}
}

/* ---- view chooser -----------------------------------------------------
   Cards, not a menu: each one carries the number that makes it worth
   opening, so the first screen after signing in is also a fleet health
   check rather than a list of links. */
.picker-grid{display:grid;gap:14px;margin-top:16px;
  grid-template-columns:repeat(auto-fit,minmax(232px,1fr))}
.pick{display:flex;flex-direction:column;gap:5px;text-decoration:none;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  padding:18px 18px 16px;box-shadow:var(--shadow);transition:transform .12s,box-shadow .12s,border-color .12s}
.pick:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg);border-color:var(--blue-400)}
.pick-ic{width:38px;height:38px;border-radius:11px;background:var(--blue-900);color:#fff;
  display:grid;place-items:center;margin-bottom:6px}
.pick-ic svg{width:21px;height:21px}
.pick-t{font-weight:800;font-size:15.5px;color:var(--text)}
.pick-d{font-size:12.5px;color:var(--muted);line-height:1.45}
.pick-n{margin-top:7px;font-size:12px;font-weight:700;color:var(--blue-600)}
.player .hold{color:var(--orange);font-weight:700}
.player .chip{padding:5px 11px;font-size:12px}

/* ---- subscription notice ---------------------------------------------- */
.sub-note{border-left:4px solid var(--idle)}
.sub-note.bad{border-left-color:var(--danger)}
.sub-note .sub-veh{display:inline-block;margin:3px 14px 3px 0;
  font-variant-numeric:tabular-nums;color:var(--text);font-weight:600;font-size:13px}

/* ---- transfer control on the vehicles table ---- */
.xfer{display:inline-block;position:relative}
.xfer>summary{list-style:none;cursor:pointer;display:inline-block}
.xfer>summary::-webkit-details-marker{display:none}
.xfer[open]>summary{background:var(--navy);color:#fff;border-color:var(--navy)}
.xfer form{position:absolute;right:0;top:calc(100% + 6px);z-index:20;width:260px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-sm);
  padding:12px;box-shadow:var(--shadow-lg);text-align:left}
.xfer form label{display:block;font-size:11px;font-weight:700;color:var(--muted);
  margin:8px 0 3px;text-transform:uppercase;letter-spacing:.03em}
.xfer form select,.xfer form input{width:100%;font-size:13px}
.xfer form p.muted{font-size:11px;line-height:1.5;margin:10px 0}

/* ---- vehicle address on the live map list ---- */
.veh .addr{font-size:12px;color:var(--navy);margin-top:6px;line-height:1.45;
  display:flex;gap:5px;align-items:flex-start}
.veh .addr::before{content:"";flex:0 0 auto;width:11px;height:11px;margin-top:3px;
  background:currentColor;opacity:.65;
  -webkit-mask:center/contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s7-6.2 7-11a7 7 0 1 0-14 0c0 4.8 7 11 7 11Z' fill='black'/><circle cx='12' cy='10' r='2.6' fill='white'/></svg>");
  mask:center/contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s7-6.2 7-11a7 7 0 1 0-14 0c0 4.8 7 11 7 11Z' fill='black'/><circle cx='12' cy='10' r='2.6' fill='white'/></svg>")}


/* ==========================================================================
   TEMPLATE THEME (web1, Oct 2026) -- the same look as the Traccer Pro phone
   app: blue bars, rounded cards with a tinted head, blue buttons.
   Everything from here down only restyles what is above; no page depends
   on it. To go back, delete from this comment to the end of the file.
   ========================================================================== */
:root{
  --blue-900:#0A3A8F; --blue-700:#0B4FB8; --blue-600:#0B5ED7; --blue-400:#2B86EE;
  --blue-100:#DCE9FF; --blue-050:#EEF4FF;
  --navy:#0A3A8F;
  --bg:#F3F6FB; --surface-2:#F8FAFE;
  --text:#0B2545; --muted:#5E6B85; --line:#DFE7F3;
  --grad:linear-gradient(90deg,#0A3A8F 0%,#1173E6 100%);
  --r-sm:10px; --r:16px; --r-lg:20px;
  --shadow:0 1px 2px rgba(10,58,143,.05), 0 6px 18px rgba(10,58,143,.08);
  --shadow-lg:0 14px 38px rgba(10,58,143,.18);
}

/* ---- side menu: the logo in white on the bar's own blue ---- */
.side .brand{position:relative;height:64px;padding:12px 18px;background:#0A3A8F;border-bottom:0}
.side .brand img{opacity:0}
.side .brand::after{content:'';position:absolute;inset:7px 16px;
  background:url(logo-white.webp) left center/contain no-repeat}
.side nav a{border-radius:12px;color:#44506A}
.side nav a:hover{background:var(--blue-050);color:var(--blue-700)}
.side nav a.on{background:var(--grad);color:#fff;box-shadow:0 4px 12px rgba(11,94,215,.28)}
.side nav a.on svg{color:#fff}

/* ---- top bar ---- */
.top{background:var(--grad);border-bottom:0;min-height:64px;color:#fff;
  box-shadow:0 2px 10px rgba(10,58,143,.18)}
.top h1{color:#fff}

/* ---- cards: a tinted band for the heading, as on the app's settings ---- */
.card:not(.m-greet) > h2:first-child{margin:-20px -20px 16px;padding:14px 20px;
  background:var(--blue-050);border-bottom:1px solid var(--line);
  border-radius:15px 15px 0 0;color:var(--blue-900)}

/* ---- buttons and fields ---- */
.btn{background:var(--blue-600);border-radius:12px}
.btn:hover{background:var(--blue-700)}
.btn.go{background:var(--grad);box-shadow:0 6px 16px rgba(11,94,215,.30)}
.btn.go:hover{background:linear-gradient(90deg,#083173 0%,#0B5ED7 100%)}
.btn.ghost{background:#fff;color:var(--blue-700);border:1px solid var(--blue-100)}
.btn.ghost:hover{background:var(--blue-050)}
.btn.danger{background:var(--danger)}
.btn.danger:hover{background:#C93338}
input:focus,select:focus,textarea:focus{border-color:var(--blue-600);
  box-shadow:0 0 0 3px rgba(11,94,215,.16)}

/* ---- Home: the counts in colour, the choices with round icons ---- */
.m-greet .stats > div{border-color:transparent;background:var(--blue-050)}
.m-greet .stats > div:nth-child(1) b{color:#0B5ED7}
.m-greet .stats > div:nth-child(2){background:#E7F7EE}
.m-greet .stats > div:nth-child(2) b{color:#0E8A45}
.m-greet .stats > div:nth-child(3){background:#FFF4E0}
.m-greet .stats > div:nth-child(3) b{color:#B26A00}
.m-greet .stats > div:nth-child(4){background:#FDECEC}
.m-greet .stats > div:nth-child(4) b{color:#C5343A}
.m-greet .stats > div:nth-child(5){background:#EDF1F7}
.m-greet .stats > div:nth-child(5) b{color:#44506A}
.pick-ic{width:44px;height:44px;border-radius:50%;background:var(--grad);
  box-shadow:0 4px 10px rgba(11,94,215,.28)}
.contact-row .ic{border-radius:50%}

/* ---- on paper the bar and the bands are plain again ---- */
@media print{
  .top{background:none;box-shadow:none;min-height:0}
  .top h1{color:var(--text)}
  .card:not(.m-greet) > h2:first-child{margin:0 0 12px;padding:0;background:none;border:0}
}
