/* Avario Business, office screens. Same language as the phone app: paper and ink, amber as the only accent. */
:root {
  --paper: #f5f6f4; --surface: #fff; --ink: #14181c; --muted: #5a636d; --line: #dde0dc; --soft: #eceeeb;
  --amber: #f5b301; --amber-soft: #ffefb8; --good: #1f9d55; --bad: #b3261e;
  --radius: 16px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 20px; }
h2 { font-size: 1.2rem; font-weight: 800; margin: 0 0 8px; }
h3 { font-size: 1rem; font-weight: 800; margin: 20px 0 4px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.boot { padding: 40px; color: var(--muted); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 16px; font-weight: 700; }
button:hover:not(:disabled) { border-color: var(--ink); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
button.primary:hover:not(:disabled) { filter: brightness(0.96); border-color: var(--amber); }
button.wide { width: 100%; padding: 16px; font-size: 1.1rem; font-weight: 800; }
button.link { border: 0; background: none; padding: 2px 4px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
button.icon { padding: 6px 10px; border-radius: 10px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 14px; }
label small { font-weight: 500; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 500; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
textarea { resize: vertical; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card.narrow { max-width: 460px; }
.err { color: var(--bad); font-weight: 700; }
.empty { color: var(--muted); padding: 48px 0; text-align: center; font-size: 1.05rem; }

/* sign-in */
.login { min-height: 100vh; display: grid; place-content: center; gap: 20px; padding: 24px; }
.login .card { width: min(420px, 88vw); }
.login h1 { font-size: 1.5rem; margin-bottom: 6px; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand span { color: var(--amber); }
.brand.big { font-size: 2rem; text-align: center; }
.login .brand span { color: var(--ink); background: var(--amber); padding: 0 8px; border-radius: 8px; }
.lang select { width: auto; margin: 0 auto; padding: 8px 12px; }

/* frame */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
nav.side { background: var(--ink); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
nav.side .company { color: #c7ccd1; font-weight: 600; margin: 2px 4px 18px; }
nav.side .company select { background: #20262c; color: #fff; border-color: #2e363e; }
nav.side button { text-align: left; background: none; border: 0; color: #dfe3e6; padding: 12px 14px; border-radius: 12px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
nav.side button:hover:not(:disabled) { background: #20262c; }
nav.side button.on { background: #262d34; color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
nav.side button.primary.new { background: var(--amber); color: var(--ink); justify-content: center; margin-bottom: 14px; padding: 14px; font-weight: 800; }
nav.side :focus-visible { outline-color: var(--amber); }
nav.side .grow { flex: 1; }
nav.side .me { color: #9aa2ab; font-size: 0.9rem; margin: 8px 14px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.side .lang select { background: #20262c; color: #fff; border-color: #2e363e; margin: 0 0 0 10px; }
.badge { background: var(--amber); color: var(--ink); border-radius: 999px; padding: 1px 9px; font-size: 0.85rem; }
.content { padding: 34px 38px 60px; max-width: 1280px; width: 100%; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1 { margin: 0; }
.tabs { display: flex; gap: 6px; background: var(--soft); padding: 5px; border-radius: 14px; }
.tabs button { border: 0; background: none; padding: 9px 16px; border-radius: 10px; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(20 24 28 / 0.12); }

/* trips */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.trip header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.trip header .link { white-space: nowrap; color: var(--muted); }
.trip .ref { flex: 1; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip .meta { color: var(--muted); font-weight: 600; }
.chip { display: inline-block; padding: 5px 11px; border-radius: 999px; font-weight: 800; font-size: 0.86rem; background: var(--amber); color: var(--ink); white-space: nowrap; }
.chip.s-planned, .chip.s-cancelled { background: var(--soft); color: var(--muted); }
.chip.s-sent, .chip.s-seen { background: var(--soft); color: var(--ink); }
.chip.s-accepted { background: var(--ink); color: #fff; }
.chip.s-done { background: var(--good); color: #fff; }
.route { list-style: none; margin: 14px 0 4px; padding: 0; }
.route li { position: relative; padding: 0 0 16px 34px; display: flex; flex-direction: column; }
.route li:last-child { padding-bottom: 0; }
.route li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9aa2ab; background: var(--surface); }
.route li::after { content: ""; position: absolute; left: 10px; top: 27px; bottom: 2px; width: 2px; background: var(--line); }
.route li:last-child::after { display: none; }
.route li.current::before { background: var(--amber); border-color: var(--ink); }
.route li.done::before { background: var(--good); border-color: var(--good); }
.route li.done::after { background: var(--good); }
.route li.done strong { color: var(--muted); }
.route .kind { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.route strong { font-size: 1.05rem; }
.route li.current strong { font-size: 1.25rem; font-weight: 800; }
.route .when { font-weight: 800; }
.route .record { font-size: 0.88rem; color: var(--muted); }
.note { background: var(--paper); border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; font-size: 0.94rem; white-space: pre-line; }
.note.office { background: #fff; border: 1px dashed var(--line); }
.docs { margin: 12px 0 0; font-size: 0.94rem; }

/* new trip */
.newtrip { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 760px); gap: 20px; align-items: start; }
.drop { border-style: dashed; border-width: 2px; position: sticky; top: 24px; }
.filebtn { display: inline-block; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 800; cursor: pointer; margin: 4px 0 0; }
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filebtn:focus-within { outline: 3px solid var(--amber); outline-offset: 2px; }
.pdfnote { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); font-size: 0.94rem; overflow-wrap: anywhere; }
.pdfnote.warn { background: #fde7e5; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.stopgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 14px; }
.stopgrid .w3 { grid-column: span 3; }
.stopgrid .w2 { grid-column: span 2; }
.stopgrid input { min-width: 0; }
fieldset.stop { border: 1px solid var(--line); border-left: 5px solid var(--ink); border-radius: 14px; padding: 14px 16px 2px; margin: 0 0 14px; position: relative; }
fieldset.stop.unload { border-left-color: var(--amber); }
fieldset.stop legend { font-weight: 800; padding: 0 8px; }
fieldset.stop .tools { position: absolute; right: 12px; top: -6px; display: flex; gap: 6px; background: var(--surface); padding: 0 6px; }
.hint { background: var(--amber-soft); border-radius: 10px; padding: 8px 12px; font-size: 0.9rem; font-weight: 600; }
.addrow { display: flex; gap: 10px; margin-bottom: 20px; }
.addrow button { flex: 1; }

/* drivers, activity */
.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.people { list-style: none; margin: 8px 0 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people li > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 800; }
.inline .row { display: flex; gap: 10px; flex-wrap: wrap; }
.inline .row input, .inline .row select { margin: 0; flex: 1 1 160px; width: auto; }
input.code { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; }
.notify { margin-bottom: 20px; }
.notify p:last-child { margin: 8px 0 0; }
.feed { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feed li { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--muted); font-variant-numeric: tabular-nums; }
.feed li.e-loaded, .feed li.e-unloaded { box-shadow: inset 4px 0 0 var(--good); }
.feed li.e-document { box-shadow: inset 4px 0 0 var(--amber); }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 10; max-width: min(420px, 90vw); }
.toast { background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 14px; font-weight: 600; box-shadow: 0 6px 24px rgb(20 24 28 / 0.25); }
.toast.bad { background: var(--bad); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  nav.side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  nav.side .grow, nav.side .me { display: none; }
  nav.side .company { margin: 0 8px; }
  nav.side button.primary.new { margin: 0; }
  .content { padding: 22px 16px 60px; }
  .newtrip, .cols, .two { grid-template-columns: 1fr; }
  .stopgrid .w3, .stopgrid .w2 { grid-column: span 6; }
  .drop { position: static; }
  .grid { grid-template-columns: 1fr; }
  .feed li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: no-preference) { button, input, select, textarea { transition: border-color 0.12s, background-color 0.12s; } }

.okmsg { background: var(--amber-soft); border-radius: 12px; padding: 10px 12px; font-weight: 600; }
button.link.center { display: block; margin: 14px auto 0; }
.login button.primary { width: 100%; }

form h2 { margin-top: 26px; }
fieldset.cargo { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 2px; margin: 0 0 12px; position: relative; }
fieldset.cargo .tools { position: absolute; right: 10px; top: 8px; }
.cargogrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; padding-right: 44px; align-items: end; }
.cargogrid .w2 { grid-column: span 2; }
.cargogrid input, .cargogrid select { min-width: 0; }
label.check { display: flex; align-items: center; gap: 10px; align-self: center; margin-top: 12px; }
label.check input { width: 22px; height: 22px; margin: 0; flex: none; }
@media (max-width: 900px) { .cargogrid { grid-template-columns: 1fr 1fr; padding-right: 0; } .cargogrid .w2 { grid-column: span 2; } }

.lead { max-width: 70ch; margin-top: -6px; }
.bar { display: flex; align-items: end; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.bar label.month { display: grid; gap: 6px; margin: 0; }
.bar .primary { width: auto; padding-inline: 22px; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.report { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.report th { text-align: left; font-weight: 600; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.report td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.report tr:last-child td { border-bottom: 0; }
table.report td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.pill.unload { background: #fff0c4; }
.totals { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.totals div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: grid; gap: 2px; min-width: 170px; }
.totals span, .totals small { color: var(--muted); }
.totals b { font-size: 1.25rem; }
.small { font-size: 0.88rem; margin-top: 12px; }
table.report td:first-child { white-space: nowrap; }

.map { height: min(62vh, 620px); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--soft); margin: 16px 0; }
.map .empty { padding-top: 120px; }
.pin { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font: 700 12px/1 inherit; }
.pin.vehicle { background: #232b33; color: #fff; padding: 6px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgb(20 24 28 / 0.35); border: 2px solid #ffc53d; }
.pin.load, .pin.unload { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid #232b33; }
.pin.unload { border-color: #e0a200; }
.feed.live li { grid-template-columns: 110px 1fr; }
.late { color: var(--bad, #b3261e); font-weight: 600; }
.pill.bad { background: #fde2df; color: #8c1d18; }
.pill.ok { background: #ddf1e2; }
body.track main { max-width: 720px; margin: 0 auto; padding: 28px 18px 48px; }
body.track .brand { font-size: 1.5rem; font-weight: 800; }
body.track .state { display: inline-block; margin: 14px 0 4px; padding: 8px 16px; border-radius: 999px; background: var(--soft); font-weight: 700; }
body.track .state.s-moving { background: var(--amber-soft); }
body.track .state.s-done { background: #ddf1e2; }
body.track .state.s-cancelled { background: #fde2df; }
body.track .eta { font-size: 1.15rem; font-weight: 600; margin: 10px 0 2px; }
body.track .map { height: min(48vh, 420px); }
.stops { list-style: none; margin: 18px 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stops li { padding: 14px 18px; border-bottom: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--line); }
.stops li:last-child { border-bottom: 0; }
.stops li.done { box-shadow: inset 4px 0 0 var(--good); }
.stops li.next { box-shadow: inset 4px 0 0 var(--amber); }
body.legal main { max-width: 760px; margin: 0 auto; padding: 28px 20px 56px; }
body.legal h1 { margin-top: 28px; }
body.legal h2 { margin-top: 28px; font-size: 1.15rem; }
body.legal li { margin: 6px 0; }
body.legal footer, body.legal .back { color: var(--muted); font-size: 0.9rem; margin-top: 40px; }
body.legal .back { margin-top: 0; }
.legalnote { color: var(--muted); font-size: 0.85rem; margin-top: 26px; text-align: center; }
.legalnote a { color: inherit; }
.navlegal { display: block; color: #8b939c; font-size: 0.82rem; padding: 10px 14px 0; text-decoration: none; }
.login .card ul { padding-left: 20px; }
.login .card li { margin: 8px 0; }
