:root { font-family: system-ui, sans-serif; color: #172b4d; background: #f5f7fa; line-height: 1.5; --accent: #174b97; --line: #cad3df; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
header { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; padding: 18px max(20px, calc((100vw - 1160px)/2)); background: white; border-bottom: 1px solid var(--line); }
.brand { font-size: 20px; font-weight: 700; text-decoration: none; color: inherit; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-left: auto; }
nav a[aria-current="page"] { font-weight: 700; }
main { max-width: 1160px; margin: 32px auto; padding: 0 20px; min-height: 60vh; }
.preview-note { padding: 8px 20px; text-align: center; background: #eaf0f8; color: #384d69; font-size: 13px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 26px 0 12px; }
h3 { font-size: 17px; margin: 0 0 10px; }
p { margin: 8px 0 16px; max-width: 72ch; }
.muted, small { color: #506078; }
.panel { background: white; padding: 24px; border: 1px solid var(--line); border-radius: 12px; margin: 18px 0; }
.narrow { max-width: 480px; margin: 48px auto; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
label.check { display: flex; align-items: center; font-weight: 400; }
input, select, textarea, button, .button { font: inherit; border-radius: 6px; }
input:not([type="checkbox"]), select, textarea { min-height: 44px; width: 100%; padding: 10px 12px; color: inherit; background: white; border: 1px solid #9daabe; }
input[type="checkbox"] { width: 20px; height: 20px; }
textarea { min-height: 90px; resize: vertical; }
button, .button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 44px; border: 1px solid var(--action, var(--accent)); padding: 9px 16px; background: var(--action, var(--accent)); color: white; cursor: pointer; text-decoration: none; }
button.secondary, .button.secondary { background: white; color: var(--accent); border-color: var(--line); }
button:hover, .button:hover { background: #123c78; color: white; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #b26300; outline-offset: 3px; }
::selection { background: #c7ddff; }
input, textarea { caret-color: var(--accent); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 24px 0 18px; }
.tabs a { padding: 12px 14px; text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { border-color: var(--accent); font-weight: 700; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 15px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: #506078; background: #f5f7fa; }
td small { display: block; margin-top: 4px; }
.badge { display: inline-block; border-radius: 5px; background: #e9eef7; color: #214675; padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.badge.delivered, .badge.success { background: #e4f2e8; color: #21603b; }
.badge.canceled, .badge.error { background: #fbe9e7; color: #942b22; }
.badge.picked_up { background: #fff1d5; color: #785000; }
.notice { padding: 14px 18px; background: #fff4d9; border-radius: 6px; color: #654500; margin: 16px 0; }
#message:not(:empty) { position: sticky; top: 0; z-index: 10; padding: 14px 24px; background: #e4f2e8; color: #21603b; border-bottom: 1px solid #94b9a0; }
#message.error { background: #fbe9e7; color: #942b22; }
.empty { text-align: center; padding: 40px 20px; color: #506078; }
.history { list-style: none; padding: 0; }
.history li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.diagram, .signature-pad { display: block; width: 100%; border: 1px solid #9daabe; border-radius: 6px; background: #fff; touch-action: none; }
.diagram { aspect-ratio: 400/180; }
.signature-pad { aspect-ratio: 4/1; }
.signature-preview { width: 220px; height: 55px; border-bottom: 1px solid var(--line); }
.logo-preview { max-width: 180px; max-height: 80px; }
.search { flex: 1; max-width: 440px; }
.search label { flex: 1; }
.skip { position: absolute; left: 10px; top: -80px; background: white; padding: 10px; }
.skip:focus { top: 10px; }
footer { text-align: center; padding: 24px; font-size: 13px; color: #506078; }
code { font-size: .95em; overflow-wrap: anywhere; }
@media(max-width: 720px) {
  header { gap: 12px; padding: 16px; }
  nav { width: 100%; margin: 0; gap: 12px; font-size: 14px; }
  main { margin: 24px auto; padding: 0 14px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .panel { padding: 16px; }
  h1 { font-size: 25px; }
  .tabs a { padding: 10px; font-size: 14px; }
  .loads-table thead { display: none; }
  .loads-table tr { display: grid; grid-template-columns: 1fr 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .loads-table td { border: none; padding: 8px; }
  .loads-table td::before { content: attr(data-label); display: block; font-size: 11px; color: #506078; margin-bottom: 4px; }
}
@media(prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
