:root {
  color-scheme: light;
  --navy: #091827;
  --blue: #0b57a2;
  --orange: #f17850;
  --ink: #112438;
  --muted: #51677c;
  --line: #d6e0e8;
  --ice: #eef4f8;
  --white: #fff;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--ice);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button, .button {
  min-height: 44px; padding: .65rem 1rem; border: 1px solid transparent; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; gap: .8rem;
  background: var(--orange); color: var(--navy); text-decoration: none; font-weight: 750; cursor: pointer;
}
button:hover, .button:hover { filter: brightness(.94); }
:focus-visible { outline: 3px solid #2175bd; outline-offset: 3px; }
.quiet, .secondary { color: var(--blue); background: white; border-color: var(--line); }
.wrap { width: min(100% - 2rem, 1140px); margin-inline: auto; }
.top { background: var(--navy); color: white; }
.top-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: .65rem; color: white; text-decoration: none; font-weight: 900; letter-spacing: .02em; }
.brand > b { background: var(--blue); padding: .25rem .5rem; border-radius: 5px; font-size: 1.45rem; }
.brand small, .account small { display: block; font-size: .65rem; color: #bcd2e6; letter-spacing: .12em; }
.top nav { display: flex; align-items: center; gap: 1rem; }
.top nav a { color: white; text-decoration: none; }
.top nav form { margin: 0; }
.top nav .notifications-link { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; }
.notification-count { border-radius: 999px; background: var(--orange); color: var(--navy); padding: .05rem .45rem; font-weight: 750; font-size: .78rem; }
.role-switch { position: relative; }
.role-switch summary { display: flex; flex-direction: column; justify-content: center; position: relative; min-height: 44px; padding: .2rem 1.15rem .2rem 0; color: white; list-style: none; }
.role-switch summary::-webkit-details-marker { display: none; }
.role-switch summary::after { content: '▾'; position: absolute; right: 0; top: .55rem; color: #bcd2e6; }
.role-switch summary small { color: #bcd2e6; font-weight: 500; }
.top nav .role-switch form { display: grid; min-width: 12rem; position: absolute; top: calc(100% + .25rem); right: 0; z-index: 2; gap: .25rem; padding: .35rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 .25rem .9rem #0003; }
.role-switch button { justify-content: start; }
.role-switch button:disabled { background: var(--ice); color: var(--muted); cursor: default; }
.quiet { min-height: 36px; padding: .35rem .6rem; font-size: .85rem; }
.local { color: #bcd2e6; font-size: .68rem; letter-spacing: .13em; }
main.wrap { padding-block: clamp(24px, 5vw, 56px); }
footer { color: var(--muted); border-top: 1px solid var(--line); padding-block: 1rem; font-size: .8rem; }
footer span { color: var(--blue); }
h1, h2, p { margin: 0 0 .8rem; }
h1 { font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.02; letter-spacing: -.055em; }
h1 span { color: var(--orange); }
h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); letter-spacing: -.03em; }
.eyebrow { color: var(--blue); font-size: .72rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .85rem; }
.entry { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; align-items: stretch; }
.welcome, .banner { background: var(--navy); color: white; border-radius: 14px; position: relative; overflow: hidden; padding: clamp(1.3rem, 4vw, 3rem); }
.welcome .eyebrow, .banner .eyebrow { color: #a9ccec; }
.welcome > p:last-of-type, .banner > div > p:last-child { color: #c2d5e6; }
.welcome { min-height: 410px; isolation: isolate; }
.welcome h1 { font-size: clamp(2.8rem, 7vw, 5rem); }
.welcome p { max-width: 30ch; }
.lanes { position: absolute; display: flex; gap: 13px; transform: rotate(-28deg); inset: auto -4rem -11rem auto; z-index: -1; }
.lanes i { width: 58px; height: 380px; background: linear-gradient(#2968a6, #0b3154); border-left: 3px solid #4382bc; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: clamp(1rem, 2vw, 1.55rem); min-width: 0; }
section.card + section.card { margin-top: 1rem; }
.login { align-self: stretch; padding: clamp(1.25rem, 4vw, 2.5rem); }
.muted { color: var(--muted); }
.demo { margin: 1.2rem 0 0; font-size: .82rem; }
.fields { display: grid; gap: 1rem; margin: 0; }
.fields label { display: grid; gap: .3rem; font-weight: 650; }
.fields label[hidden] { display: none; }
.fields input:not([type=checkbox]), .fields select, .fields textarea {
  min-height: 44px; width: 100%; min-width: 0; background: #fafcfd; color: var(--ink);
  border: 1px solid #aebfcd; border-radius: 6px; padding: .55rem .65rem;
}
.fields .check { display: flex; align-items: start; gap: .6rem; font-size: .9rem; font-weight: 500; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--blue); flex-shrink: 0; }
.archive-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .75rem; align-items: center; padding: .75rem 0; border-top: 1px solid var(--line); }
.notice { background: #fff2dc; color: #693b02; border: 1px solid #efc685; border-radius: 6px; padding: .75rem; margin-bottom: 1rem; }
.address-field { position: relative; display: grid; gap: .35rem; }
.address-suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 3; margin: .2rem 0 0; padding: .25rem;
  max-height: 18rem; overflow: auto; list-style: none; background: #fff; border: 1px solid #a8bdd4;
  border-radius: .5rem; box-shadow: 0 .45rem 1.2rem #11284b26;
}
.address-suggestions li { cursor: pointer; display: grid; gap: .15rem; min-height: 2.75rem; padding: .45rem .65rem; border-radius: .3rem; }
.address-suggestions small { color: #495b6d; }
.address-suggestions li:hover, .address-suggestions li[aria-selected="true"] { background: #e5effb; }
.fields [hidden] { display: none; }
.receipts { margin: 0; min-width: 0; border: 1px solid #a8bdd4; border-radius: .5rem; padding: .75rem; }
.receipts legend { font-weight: 750; padding: 0 .3rem; }
.receipts label { margin-top: .5rem; }
.receipts li { margin: .4rem 0; overflow-wrap: anywhere; }
.receipts li button { padding: .2rem .5rem; }
.receipts ul { padding-inline-start: 1.25rem; }
.receipts ul:empty { display: none; }
.receipts dialog { width: min(28rem, calc(100% - 2rem)); padding: 1.25rem; border: 1px solid #a8bdd4; border-radius: .75rem; color: var(--ink); }
.receipts dialog::backdrop { background: #11284b90; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.deviation { background: #fff7e9; border: 1px solid #efc685; border-left: .35rem solid #a65a04; margin-bottom: 1rem; }
.deviation h3 { margin: .75rem 0 .35rem; }
.banner { display: flex; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.dashboard-actions { display: grid; gap: .55rem; }
.role-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .4rem .8rem; margin: 0; padding: .65rem .8rem .8rem; border: 1px solid var(--line); border-radius: .5rem; }
.role-options legend { padding: 0 .3rem; font-weight: 700; }
.profile-vehicles { list-style: none; padding: 0; }
.profile-vehicles li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.profile-vehicles small { display: block; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.stat b, .amount b { display: block; font-size: clamp(1.4rem, 4vw, 2rem); font-variant-numeric: tabular-nums; }
.stat span, .amount small { font-size: .85rem; }
.amount { white-space: nowrap; }
.trip { display: grid; grid-template-columns: 105px minmax(0, 1fr) auto 112px 18px; gap: .8rem; align-items: center; text-decoration: none; color: var(--ink); padding: .85rem 0; border-top: 1px solid var(--line); }
.trip small { color: var(--muted); display: block; }
.trip strong { text-align: right; white-space: nowrap; }
.trip:hover b, .arrow { color: var(--blue); }
.badge { display: inline-block; width: fit-content; border-radius: 999px; padding: .23rem .6rem; background: #e9edf2; color: #314352; font-size: .8rem; font-weight: 750; }
.badge.accounting, .badge.chair, .badge.awaiting-payment { color: #17477b; background: #dfedff; }
.badge.approved, .badge.paid { color: #175339; background: #d9f2e3; }
.badge.returned { color: #753e03; background: #ffefcf; }
.badge.review { color: #753e03; background: #ffefcf; display: inline-block; margin-top: .25rem; }
.empty { border: 1px dashed #aebfcd; border-radius: 8px; color: var(--muted); padding: 1rem; }
.back { display: inline-block; font-weight: 650; margin-bottom: 1rem; }
.form-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 1rem; }
.form-grid, .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-grid { grid-template-columns: 1.4fr 1fr; }
.controls { display: grid; gap: 1rem; }
.controls h2 { margin: 0; }
details summary { cursor: pointer; color: var(--blue); font-weight: 650; }
details form { padding-top: .8rem; }
dl { margin-block: .6rem; }
dl div { display: grid; grid-template-columns: minmax(7rem, 1fr) 1.4fr; padding: .45rem 0; border-top: 1px solid var(--line); gap: .5rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.formula { background: var(--ice); font-weight: 700; padding: .75rem; border-radius: 6px; }
.timeline { list-style: none; margin: 0; padding-left: .65rem; border-left: 2px solid #8eb8e1; }
.timeline li { padding: .32rem 0; }
.timeline span { display: block; color: var(--muted); font-size: .86rem; }
.paper { background: white; color: black; max-width: 210mm; margin: auto; padding: min(6vw, 12mm); border: 1px solid #b6bdc4; font: 10pt/1.4 Arial, sans-serif; overflow-wrap: anywhere; }
.paper + .paper { margin-top: 1rem; }
.paper-head { display: grid; grid-template-columns: 1fr 1fr .6fr; gap: .8rem; align-items: start; padding: .65rem; border: 1px solid #888; }
.paper h1 { font-size: 17pt; text-transform: uppercase; }
.paper h2 { font-size: 11pt; margin: .85rem 0 .3rem; text-transform: uppercase; }
.paper table { width: 100%; border-collapse: collapse; }
.paper td, .paper th { border: 1px solid #888; text-align: left; padding: .23rem .4rem; }
.paper th { font-weight: bold; background: #eee; }
.paper p { margin-top: .6rem; }
.signatures { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #888; text-align: center; }
.signatures > div { padding: .5rem; }
.signatures > div + div { border-left: 1px solid #888; }
.signature-dialog { box-sizing: border-box; width: min(44rem, calc(100% - 1.25rem)); max-height: calc(100% - 1.25rem); padding: clamp(.85rem, 3vw, 1.6rem); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--white); overflow: auto; }
.signature-dialog::backdrop { background: #071e35b8; }
.signature-dialog h2, .signature-context { margin-bottom: .25rem; }
.signature-context { color: var(--muted); }
.signature-options { display: flex; flex-wrap: wrap; gap: .55rem; }
.signature-options button, .signature-dialog [data-clear-signature] { min-height: 44px; touch-action: manipulation; }
.signature-options button[aria-pressed="true"] { background: var(--ice); box-shadow: inset 0 0 0 1px var(--blue); }
.signature-dialog button:disabled { opacity: .55; cursor: not-allowed; }
.signature-dialog canvas { display: block; width: 100%; height: auto; border: 1px solid #aebfcd; border-radius: 8px; background: #fafcfd; touch-action: none; cursor: crosshair; margin-bottom: .65rem; }
.signature-footer { justify-content: flex-end; }
.signature-graphic { display: block; width: 100%; max-width: 25rem; height: 5rem; margin: .45rem 0; color: #16385a; }
.notification-list { display: grid; gap: .65rem; padding: 0; margin: 0 0 1rem; list-style: none; }
.notification-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.notification-item.unread { border-left: 4px solid var(--blue); }
.notification-item h2, .notification-item p { margin-bottom: .18rem; }
.notification-item small { color: var(--muted); }
.notification-item form { display: flex; flex-wrap: wrap; gap: .4rem; }
.signatures .signature-graphic { height: 2.4rem; }
.watermark { font-size: 8pt; font-weight: 700; }
@media (max-width: 700px) {
  .entry, .form-layout, .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .welcome { min-height: 255px; }
  .banner { align-items: start; flex-direction: column; }
  .top nav > a:not(.notifications-link), .account small { display: none; }
  .top-inner, .top nav { flex-wrap: wrap; }
  .top-inner { padding-block: .45rem; gap: .2rem .65rem; }
  .top nav { gap: .25rem .65rem; }
  .top nav .notifications-link { font-size: .85rem; }
  .role-switch summary { font-size: .8rem; }
  .account { font-size: .76rem; }
  .trip { grid-template-columns: minmax(0, 1fr) auto auto; gap: .35rem .55rem; }
  .trip-date { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
  .trip .arrow { display: none; }
  .trip strong { font-size: .85rem; }
  .archive-row { grid-template-columns: 1fr 1fr; }
  .badge { font-size: .67rem; }
}
@media (max-width: 450px) {
  .top nav { width: 100%; justify-content: space-between; }
  .top nav .role-switch form { left: 50%; right: auto; transform: translateX(-50%); }
}
@media (max-width: 370px) { .account { display: none; } }
@page { size: A4 portrait; margin: 12mm; }
@media print {
  html, body { background: white; }
  .top, footer, .print-toolbar { display: none; }
  main.wrap { width: 100%; padding: 0; }
  .paper { border: 0; padding: 0; max-width: none; }
  .paper + .paper { margin-top: 0; break-before: page; }
  .paper h2, .signatures, tr { break-inside: avoid; }
}
