/* Design system — single source of truth for every screen.
   Tokens first; components below. Modules add NO CSS of their own. */
:root {
  --ink: #1B2432;        /* text, navigation */
  --ink-soft: #5B6775;   /* secondary text */
  --steam: #F3F6F8;      /* page background */
  --surface: #FFFFFF;
  --rule: #D8DFE6;
  --linen: #2457D6;      /* primary action */
  --linen-soft: #E6ECFB;
  --amber: #D9861C;      /* needs attention */
  --amber-soft: #FBEEDC;
  --mint: #1E9E6A;       /* done / ok */
  --mint-soft: #DDF3EA;
  --red: #C8373B;
  --red-soft: #F9E1E2;

  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 6px;
  --sidebar: 224px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font-body); color: var(--ink); background: var(--steam); }
a { color: var(--linen); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-soft); }
:focus-visible { outline: 2px solid var(--linen); outline-offset: 2px; }

/* App shell — top bar with dropdown menus (full-width content) */
.topbar { display: flex; align-items: center; gap: clamp(8px, 1.4vw, 22px); background: var(--linen); color: #fff; padding: 0 22px; height: 54px; position: sticky; top: 0; z-index: 40; }
.topbar .brand { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: #fff; display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.topbar .brand .plate { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; background: #fff; color: var(--linen); padding: 2px 8px; border-radius: 3px; }
.topnav { display: flex; align-items: stretch; height: 100%; flex: 1; min-width: 0; flex-wrap: nowrap; }
.top-item { display: flex; align-items: center; gap: 5px; padding: 0 clamp(6px, 1vw, 14px); color: #D8E2FB; font: 600 14px var(--font-body); background: none; border: 0; cursor: pointer; white-space: nowrap; text-decoration: none; height: 100%; border-bottom: 2px solid transparent; }
.top-item:hover { color: #fff; background: rgba(255,255,255,.12); text-decoration: none; }
.top-item.active, .menu.active .menu-btn { color: #fff; border-bottom-color: #fff; }
.caret { font-size: 10px; opacity: .7; }
.menu { position: relative; display: flex; }
.menu.open .menu-btn { background: rgba(255,255,255,.16); color: #fff; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--rule); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 10px 24px rgba(20,25,35,.16); padding: 6px; z-index: 50; }
.menu.open .dropdown { display: block; }
.dropdown a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 4px; color: var(--ink); font-weight: 500; font-size: 14px; }
.dropdown a:hover { background: var(--linen-soft); text-decoration: none; }
.dropdown a.active { background: var(--linen-soft); color: var(--linen); }
.dropdown a.soon { color: var(--ink-soft); }
.dropdown a .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rule); margin-left: auto; }
.topuser { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topuser .who { font-size: 13px; color: #D8E2FB; }
.topuser .who .muted { color: #AFC3F4; }
.topuser .btn { background: transparent; color: #EAF0FD; border-color: rgba(255,255,255,.4); }
.topuser .btn:hover { background: rgba(255,255,255,.15); }
.main { padding: 26px 32px; }
.main-wide { max-width: 1600px; margin: 0 auto; }
@media (max-width: 1100px) {
  .caret { display: none; }
  .top-item { font-size: 13px; }
}
@media (max-width: 800px) {
  .topbar { padding: 0 10px; gap: 10px; flex-wrap: wrap; height: auto; min-height: 54px; }
  .topnav { order: 3; flex-basis: 100%; flex-wrap: wrap; }
  .top-item { padding: 10px 10px; }
  .topuser .who { display: none; }
  .main { padding: 16px 12px; }
}

/* Components */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: 600 14px var(--font-body); padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn:hover { background: var(--steam); text-decoration: none; }
.btn.primary { background: var(--linen); border-color: var(--linen); color: #fff; }
.btn.primary:hover { background: #1D48B5; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--linen); padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
input, select { font: 15px var(--font-body); padding: 9px 11px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; color: var(--ink); }
input:focus, select:focus { border-color: var(--linen); outline: none; box-shadow: 0 0 0 3px var(--linen-soft); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding: 8px 10px; border-bottom: 1px solid var(--rule); }
table.list td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
.chip { display: inline-block; font: 500 12px var(--font-mono); padding: 2px 8px; border-radius: 999px; }
.chip.ok { background: var(--mint-soft); color: var(--mint); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.off { background: var(--steam); color: var(--ink-soft); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.plant-pin { background: #fff; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.plant-pin img { width: 90%; height: 90%; object-fit: contain; }
.seq-pin.plant { background: var(--ink, #1a1f2b); }
.seq-pin.done { background: #8a9099; }
.seq-pin.multi { border-radius: 13px; padding: 0 4px; white-space: nowrap; }
td.eta.done { color: #14603F; }
.seq-pin { background: var(--accent, #2457D6); color: #fff; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; font: 700 12px var(--font-mono); }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--mint-soft); color: #14603F; }
.flash.error { background: var(--red-soft); color: var(--red); }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 20px; }

/* Sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth .brand { color: var(--ink); margin-bottom: 20px; }
.auth .brand .plate { background: var(--ink); color: #fff; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav .group, .sidebar .foot { display: none; }
  .main { padding: 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a { transition: background .12s ease; }
}

/* List pattern: filter bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input { min-width: 260px; }
/* Detail pattern */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }
.cardhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0 0; }
dl.props dt { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
dl.props dd { margin: 0; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.row-actions form { display: inline; }
/* Form pattern */
.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.actions form { display: inline; }
.checks { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; color: var(--ink); }
.check input { width: 16px; height: 16px; }
/* Logistics */
.route-card { display: block; color: var(--ink); margin-bottom: 12px; }
.route-card:hover { text-decoration: none; border-color: var(--linen); }
.progress { height: 6px; background: var(--steam); border-radius: 999px; margin: 12px 0 6px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--linen); border-radius: 999px; }
.token-card { border-color: var(--amber); background: var(--amber-soft); }
.token { font-size: 15px; padding: 10px 12px; background: #fff; border: 1px dashed var(--amber); border-radius: var(--radius); margin-top: 10px; word-break: break-all; user-select: all; }
.dimmed { opacity: .45; transition: opacity .15s ease; }

/* Driver mobile app */
.drv { max-width: 560px; margin: 0 auto; padding: 12px 12px 40px; }
.drv-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 14px; }
.drv-top .brand { color: var(--ink); }
.drv-top .brand .plate { background: var(--ink); color: #fff; }
.drv-top .btn.ghost { color: var(--ink); border-color: var(--rule); }
.drv .card { padding: 14px; }
.drv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.drv-vehicle select { font-size: 15px; }
.drv-stop { margin-top: 12px; }
.drv-stop.done { opacity: .55; }
.drv-stop-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.drv-stop-head .grow { flex: 1; }
.seq { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.drv-instr { background: var(--amber-soft); color: #7A4A0B; border-radius: 4px; padding: 4px 8px; margin-top: 6px; font-size: 14px; }
.btn.big { width: 100%; justify-content: center; padding: 13px; font-size: 16px; margin-top: 8px; }
.btn.camera { cursor: pointer; }
.drv-done { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
.drv-done input { font-size: 15px; }
.drv-photo { margin-top: 8px; }

/* Dashboard: area tiles that open dropdowns (no direct navigation) */
.areas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 6px; }
.area-tile { position: relative; }
.area-btn { width: 100%; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 14px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 18px; cursor: pointer; text-align: left; font-family: var(--font-body); }
.area-btn:hover { border-color: var(--linen); box-shadow: 0 2px 10px rgba(27,36,50,.06); }
.area-tile.open .area-btn { border-color: var(--linen); border-radius: var(--radius) var(--radius) 0 0; }
.area-ico { grid-row: span 2; width: 42px; height: 42px; border-radius: 8px; background: var(--linen-soft); color: var(--linen);
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 19px; }
.area-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); }
.area-sub { grid-column: 2; font-size: 12px; }
.area-btn .caret { grid-row: span 2; color: var(--ink-soft); font-size: 12px; transition: transform .15s ease; }
.area-tile.open .caret { transform: rotate(180deg); }
.area-drop { display: none; position: absolute; left: 0; right: 0; top: 100%; border-top: 0; border-radius: 0 0 var(--radius) var(--radius); z-index: 30; }
.area-tile.open .area-drop { display: block; }

/* Rentals */
.stats3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat3 .n { font-size: 28px; font-weight: 500; }
.stat3 .l { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

/* Customer portal — mobile-first shell (bottom tabs on phones, top tabs on desktop); installable as a PWA */
.portal-body { background: var(--steam); padding-bottom: 76px; }
.ptop { display: flex; align-items: center; gap: 18px; background: var(--surface); border-bottom: 1px solid var(--rule); padding: 0 18px; height: 58px; position: sticky; top: 0; z-index: 40; }
.pbrand { display: flex; align-items: center; gap: 10px; font: 800 16px var(--font-display); color: var(--ink); text-decoration: none; white-space: nowrap; }
.pbrand:hover { text-decoration: none; }
.pmark { width: 32px; height: 32px; border-radius: 8px; background: var(--linen); color: #fff; display: grid; place-items: center; font: 800 16px var(--font-display); }
.ptabs-top { display: flex; gap: 4px; flex: 1; }
.ptabs-top a { padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.ptabs-top a:hover { background: var(--steam); text-decoration: none; color: var(--ink); }
.ptabs-top a.active { background: var(--linen-soft); color: var(--linen); }
.pwho { display: flex; align-items: center; gap: 12px; font-size: 13px; margin-left: auto; }
.pmain { max-width: 960px; margin: 0 auto; padding: 22px 18px; }
.phead { margin-bottom: 18px; }
.phead h1 { font-size: 24px; }
.phead .sub { color: var(--ink-soft); font-size: 14px; }
.ptiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.ptile { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.ptile:hover { border-color: var(--linen); text-decoration: none; }
.ptile .k { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.ptile .v { font: 700 28px var(--font-display); margin: 4px 0 2px; }
.ptile .s { font-size: 12px; color: var(--ink-soft); }
.pcta { display: flex; justify-content: center; background: var(--linen); color: #fff; font-weight: 700; padding: 14px; border-radius: 10px; margin-bottom: 16px; }
.pcta:hover { background: #1D48B5; text-decoration: none; }
.pcard { border-radius: 10px; }
.pcard h2 { margin-bottom: 10px; }
.pcard-head { display: flex; justify-content: space-between; align-items: baseline; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.plist li:first-child { border-top: 0; }
.plist .grow { flex: 1; min-width: 160px; }
.small { font-size: 12px; }
tr.dt-row-link { cursor: pointer; }
tr.dt-row-link:hover td { background: var(--linen-soft); }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); padding: 8px 0; border-bottom: 1px solid var(--rule); }
.ptable td { padding: 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable .num { text-align: right; }
.ptable .big { font-size: 20px; font-weight: 600; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.pgrid .card + .card { margin-top: 0; }
.pdl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
.pdl dt { color: var(--ink-soft); font-size: 13px; }
.pdl dd { margin: 0; }
.pform .field select, .pform .field input { min-height: 44px; font-size: 16px; }
.ptabs-bottom { display: none; }
@media (max-width: 720px) {
  .ptabs-top, .pwho .muted { display: none; }
  .pmain { padding: 16px 14px; }
  .ptiles { grid-template-columns: 1fr 1fr; }
  .ptiles .ptile:first-child { grid-column: span 2; }
  .pgrid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .ptabs-bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--rule); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .ptabs-bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink-soft); }
  .ptabs-bottom a .ico { font-size: 20px; line-height: 1; }
  .ptabs-bottom a.active { color: var(--linen); }
  .ptabs-bottom a:hover { text-decoration: none; }
}

/* Bell — shared staff bell in the top bar, personal bell in the portal */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: #D8E2FB; }
.bell:hover { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }
.bell.dark { color: var(--ink-soft); }
.bell.dark:hover { background: var(--steam); color: var(--ink); }
.bell .badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font: 700 11px/18px var(--font-mono); text-align: center; box-shadow: 0 0 0 2px var(--linen); }
.bell.dark .badge { box-shadow: 0 0 0 2px var(--surface); }
.nlist { list-style: none; margin: 0; padding: 0; }
.nlist li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--rule); }
.nlist li:first-child { border-top: 0; }
.nlist li.cleared { opacity: .55; }
.nlist .ndot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); margin-top: 7px; flex-shrink: 0; }
.nlist li.cleared .ndot { background: var(--rule); }
.nlist .nbody { flex: 1; }
.nlist .ntime { font: 500 12px var(--font-mono); color: var(--ink-soft); white-space: nowrap; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-actions .propose { display: inline-flex; gap: 4px; align-items: center; border-left: 1px solid var(--rule); padding-left: 8px; }
.row-actions .propose input { padding: 4px 6px; font-size: 13px; }
.plist li.pending { background: var(--amber-soft); margin: 0 -20px; padding: 12px 20px; border-radius: 8px; }
.propose-box { margin-top: 8px; }
.pform.inline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pform.inline input { flex: 1; min-width: 180px; }
.pcta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.pcta-row .pcta { margin-bottom: 0; }
.pcta.alt { background: var(--surface); color: var(--linen); border: 1px solid var(--linen); }
.pcta.alt:hover { background: var(--linen-soft); }
.send-table td { vertical-align: middle; }
.send-table input { width: 90px; }
@media (max-width: 720px) { .pcta-row { grid-template-columns: 1fr; } .send-table input { width: 70px; } }

/* Customer tiles — the default Customers view: one disc per customer, red count when they're waiting on us */
.segmented { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; background: var(--surface); }
.segmented a { padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.segmented a.active { background: var(--linen); color: #fff; }
.segmented a:hover { text-decoration: none; }
#tile-filter { padding: 7px 12px; border: 1px solid var(--rule); border-radius: 999px; min-width: 200px; font: inherit; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 12px; }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 12px 6px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.tile:hover { background: var(--surface); text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.tile .disc { position: relative; width: 84px; height: 84px; border-radius: 50%; background: var(--linen-soft); color: var(--linen); display: grid; place-items: center; border: 2px solid transparent; transition: transform .12s; }
.tile:hover .disc { transform: scale(1.05); }
.tile.hot .disc { border-color: var(--red); background: #fff; }
.tile .initials { font: 800 26px var(--font-display); }
.tile.inactive .disc { background: var(--steam); color: var(--ink-soft); }
.tile.inactive .tname, .tile.inactive .tsub { color: var(--ink-soft); }
.tile.inactive { opacity: .7; }
.check.inline { display: inline-flex; align-items: center; gap: 4px; font-size: inherit; }
.tile .badge { position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--red); color: #fff; font: 700 13px/24px var(--font-mono); text-align: center; box-shadow: 0 0 0 3px var(--steam); }
.tile .tname { font-weight: 600; font-size: 14px; line-height: 1.25; }
.tile .tsub { font-size: 12px; }
@media (max-width: 720px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } .tile .disc { width: 68px; height: 68px; } .tile .initials { font-size: 22px; } }
.tiles-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 16px; }
.kpi .k { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.kpi .v { font: 700 26px var(--font-display); }

/* Brand band — the laundry's own logo above the bar, on every page. Small and quiet: the bar below stays the workspace. */
.brandband { background: var(--surface); border-bottom: 1px solid var(--rule); height: 62px; display: flex; align-items: center; padding: 0 22px; position: sticky; top: 0; z-index: 41; }
.brandband img { height: 46px; width: auto; max-width: 260px; object-fit: contain; display: block; }
.topbar.under-band, .ptop.under-band { top: 62px; }
@media (max-width: 720px) { .brandband { height: 52px; padding: 0 14px; } .brandband img { height: 38px; } .topbar.under-band, .ptop.under-band { top: 52px; } }
.langswitch { display: inline-flex; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; }
.langswitch button { background: transparent; border: 0; color: #D8E2FB; font: 600 11px/1 var(--font-mono); letter-spacing: .06em; padding: 6px 9px; cursor: pointer; }
.langswitch button.active { background: #fff; color: var(--linen); }
.langswitch.dark { border-color: var(--rule); }
.langswitch.dark button { color: var(--ink-soft); }
.langswitch.dark button.active { background: var(--linen); color: #fff; }

/* Production board — one column per step, cards are batches; red column = bottleneck */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 10px; min-height: 200px; }
.kcol.bottleneck { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.khead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.kseq { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--linen); color: #fff; font: 700 12px var(--font-mono); }
.kseq.big { width: 34px; height: 34px; font-size: 16px; vertical-align: middle; }
.kstats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.kstats .red { color: var(--red); font-weight: 700; }
.kalert { background: var(--red-soft); color: var(--red); font-weight: 700; font-size: 12px; padding: 6px 8px; border-radius: 6px; margin-bottom: 8px; }
.kcard { background: var(--steam); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; border-left: 3px solid var(--linen); }
.kcard.old { border-left-color: var(--amber); }
.kcard-top { display: flex; justify-content: space-between; font-size: 12px; }
.kmove { display: flex; gap: 6px; margin-top: 6px; }
.kmove select { flex: 1; min-width: 0; padding: 4px 6px; font-size: 12px; }
.kempty { padding: 20px 0; text-align: center; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.scard { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px; border-top: 4px solid var(--linen); }
.scard.old { border-top-color: var(--amber); }
.scard-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.sname { font: 700 20px var(--font-display); margin-bottom: 4px; }
.sbig { width: 100%; padding: 16px; font-size: 17px; margin-top: 12px; }
.flow { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.flow-step { background: var(--steam); border-radius: 999px; padding: 4px 12px 4px 6px; display: inline-flex; gap: 8px; align-items: center; }
.flow-arrow { color: var(--ink-soft); }
.rowbtns { white-space: nowrap; }
.rowbtns .btn { padding: 2px 8px; }

/* Media — photos / short videos on routes, stops, customer locations and orders */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.media { margin: 0; background: var(--steam); border-radius: 8px; overflow: hidden; border-top: 3px solid var(--rule); }
.media.accident { border-top-color: var(--red); }
.media img, .media video { width: 100%; height: 140px; object-fit: cover; display: block; background: #000; }
.media figcaption { padding: 6px 8px; font-size: 12px; }
.media-strip { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0; }
.media-strip a { position: relative; flex: 0 0 auto; width: 96px; border-radius: 6px; overflow: hidden; background: #000; }
.media-strip a.accident { outline: 2px solid var(--red); }
.media-strip img, .media-strip video { width: 96px; height: 72px; object-fit: cover; display: block; }
.media-strip span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; padding: 2px 4px; text-align: center; }
.drv-media-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); cursor: pointer; }
.pmedia { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pmedia a { position: relative; width: 110px; border-radius: 8px; overflow: hidden; background: #000; }
.pmedia img, .pmedia video { width: 110px; height: 82px; object-fit: cover; display: block; }
.pmedia form { position: absolute; top: 2px; right: 2px; }
.pmedia form button { background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.pupload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pupload input[type=file] { max-width: 220px; }
.scanbox video { width: 100%; max-height: 60vh; background: #000; border-radius: 10px; }
.drv-lot { margin-top: 8px; }
.drv-lot summary { list-style: none; cursor: pointer; display: block; text-align: center; }
.drv-lot-form { display: grid; gap: 8px; margin-top: 8px; }
.drv-lot-form input { padding: 12px; font-size: 16px; }

/* complaints */
.bell.cbtn .cletter { font: 800 15px var(--font-display); line-height: 20px; }
.tile .tbadges { display: flex; gap: 6px; margin-top: -4px; }
.tile .tbadge { display: inline-flex; align-items: center; gap: 4px; font: 700 12px var(--font-mono); color: var(--red); }
.tile .tbadge i { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 50%; background: var(--red); color: #fff; font: 800 10px var(--font-display); font-style: normal; }
.thread { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.thread li { padding: 10px 12px; border-radius: 12px; background: var(--steam); max-width: 92%; }
.thread li.customer { background: var(--linen-soft); align-self: flex-start; }
.thread li.staff { background: var(--mint-soft); align-self: flex-end; }
.thread li.system { background: transparent; border: 1px dashed var(--rule); align-self: center; font-size: 13px; color: var(--ink-soft); }
.thread .who { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.thread .msg { white-space: pre-wrap; }
.stars { display: flex; gap: 14px; }
.pcard.highlight { border-color: var(--mint); }

/* production split */
.ksplit summary { list-style: none; cursor: pointer; display: inline-block; }
.ksplit summary::-webkit-details-marker { display: none; }
.ksplit form { margin-top: 8px; display: grid; gap: 6px; }
.ksplit-row { display: flex; align-items: center; gap: 8px; }
.ksplit-row span { flex: 1; }

/* production tree editor */
.pchain { display: grid; gap: 6px; }
.prow { display: flex; align-items: center; gap: 8px; }
.prow .pname { flex: 2; min-width: 160px; }
.prow .pcap { width: 90px; }
.prow .pnotes { flex: 1; min-width: 100px; }
.pbranches { display: grid; gap: 10px; margin: 6px 0 6px 34px; border-left: 3px solid var(--wave, #2457D6); padding-left: 14px; }
.pbranch-head { font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--wave, #2457D6); margin-bottom: 4px; }
.pend { margin: 2px 0 4px 34px; }

/* ---- Hover feel (2026-09-11): menus grow a touch, tiles/tabs/cards lift and tint slightly. Subtle on purpose. ---- */
.top-item, .dropdown a, .segmented a, .ptabs-top a, .tile, .area-btn, .kpi, .ptile, .route-card, .scard, .kcard, .card.clickable, tr.dt-row-link td, .btn {
  transition: transform .14s ease, background-color .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease; }
.top-item:hover { transform: scale(1.06); }
.dropdown a:hover { transform: translateX(3px) scale(1.02); background: var(--linen-soft); color: var(--linen); }
.segmented a:hover:not(.active) { background: var(--linen-soft); color: var(--linen); }
.segmented a:hover { transform: scale(1.04); }
.ptabs-top a:hover { transform: scale(1.05); background: var(--linen-soft); color: var(--linen); }
.tile:hover { transform: translateY(-2px) scale(1.03); background: var(--linen-soft); box-shadow: 0 6px 16px rgba(27,36,50,.10); }
.tile:hover .disc { transform: scale(1.08); background: #fff; }
.area-btn:hover { transform: translateY(-2px) scale(1.015); background: var(--linen-soft); box-shadow: 0 8px 20px rgba(27,36,50,.10); }
.area-tile.open .area-btn:hover { transform: none; }
.kpi:hover, .ptile:hover { transform: translateY(-2px) scale(1.02); border-color: var(--linen); background: var(--linen-soft); box-shadow: 0 6px 16px rgba(27,36,50,.08); }
.route-card:hover, .scard:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 8px 20px rgba(27,36,50,.10); border-color: var(--linen); }
.kcard:hover { transform: translateX(3px); background: var(--linen-soft); }
tr.dt-row-link:hover td { background: var(--linen-soft); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(27,36,50,.10); }
.btn.primary:hover { box-shadow: 0 4px 14px rgba(45,86,199,.30); }
@media (prefers-reduced-motion: reduce) { .top-item, .dropdown a, .segmented a, .ptabs-top a, .tile, .area-btn, .kpi, .ptile, .route-card, .scard, .kcard, .btn { transition: none; }
  .top-item:hover, .dropdown a:hover, .segmented a:hover, .ptabs-top a:hover, .tile:hover, .tile:hover .disc, .area-btn:hover, .kpi:hover, .ptile:hover, .route-card:hover, .scard:hover, .kcard:hover, .btn:hover { transform: none; } }
