/* Raxivo Logistics — shared styles
   Tokens (from the logo): black #000 · red #E3131C · yellow #FFD21F · white · grey #F2F2F2 · line #DADADA · muted #666 */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@75..125,400;75..125,500;75..125,700&display=swap');

:root {
  --red: #E3131C;
  --red-dark: #B80E16;
  --ink: #111111;
  --black: #000000;
  --yellow: #FFD21F;
  --paper: #F2F2F2;
  --white: #FFFFFF;
  --line: #DADADA;
  --muted: #666666;
  --green: #1E7F4F;
  --amber: #B7791F;
  --radius: 3px;
  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--red); }
button, input, select, textarea { font: inherit; color: inherit; }

/* Top bar — black, carrying the logo */
.bar { background: var(--black); border-bottom: 3px solid var(--red); }
.bar-inner {
  max-width: 1040px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { height: 40px; display: block; }
.brand-sub { font-size: 12px; color: #bbb; border-left: 1px solid #444; padding-left: 12px; }
.bar nav { display: flex; align-items: center; }
.bar nav a { color: #fff; text-decoration: none; font-weight: 500; margin-left: 18px; font-size: 15px; }
.bar nav a:hover { color: var(--yellow); }
.bar nav .muted { color: #bbb; }
@media (max-width: 520px) { .bar nav a { margin-left: 12px; font-size: 14px; } .bar nav a.muted { display: none; } .brand img { height: 34px; } }

.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 20px 64px; }
.narrow { max-width: 640px; }

h1 { font-size: 34px; line-height: 1.1; font-weight: 700; font-style: italic; letter-spacing: -0.02em; margin: 0 0 8px; font-stretch: 110%; text-transform: uppercase; }
h2 { font-size: 20px; margin: 28px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 18px 0 8px; }
p.lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; max-width: 56ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Forms */
label { display: block; font-size: 14px; font-weight: 500; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--white); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(35,35,35,.12); }
textarea { min-height: 80px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 620px) { .row, .row3 { grid-template-columns: 1fr; } }

.btn {
  display: inline-block; padding: 11px 18px; border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: #000; }
.btn.red { background: var(--red); border-color: var(--red); }
.btn.red:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--white); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-width: 1.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* Panels */
.panel { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.panel.tight { padding: 14px 16px; }
.notice { padding: 12px 14px; border-left: 4px solid var(--red); background: #FBE9EA; margin: 12px 0; }
.notice.ok { border-color: var(--green); background: #E6F3EC; }
.notice.warn { border-color: var(--amber); background: #FBF1DF; }

/* Tracking number display */
.tn {
  font-variant-numeric: tabular-nums; letter-spacing: 0.12em; font-weight: 700;
}
.tn-big { font-size: 28px; }

/* Status badges: colour encodes the stage, not decoration */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 2px; font-size: 13px; font-weight: 700;
  background: #E7E5DF; color: var(--ink); white-space: nowrap;
}
.badge.s-booked, .badge.s-collected, .badge.s-at-depot, .badge.s-in-transit { background: #E7E5DF; }
.badge.s-out-for-delivery { background: var(--ink); color: #fff; }
.badge.s-delivered { background: var(--green); color: #fff; }
.badge.s-attempted-delivery, .badge.s-held-at-depot { background: #FBF1DF; color: #7A4F0C; }
.badge.s-returned-to-sender, .badge.s-cancelled, .badge.s-exception { background: var(--red); color: #fff; }

/* Route strip timeline — the memorable element */
.route { list-style: none; margin: 8px 0 0; padding: 0 0 0 26px; position: relative; }
.route::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.route li { position: relative; padding: 0 0 22px; }
.route li::before {
  content: ''; position: absolute; left: -26px; top: 5px; width: 12px; height: 12px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 1px;
}
.route li:first-child::before { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 4px #FBE9EA; }
.route li.delivered:first-child::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 4px #E6F3EC; }
.route .when { font-size: 13px; color: var(--muted); }
.route .what { font-weight: 700; }
.route .where { color: var(--muted); }

/* Tables */
table.list { width: 100%; border-collapse: collapse; background: var(--white); border: 1.5px solid var(--line); font-size: 14px; }
table.list th { text-align: left; padding: 10px 10px; border-bottom: 2px solid var(--ink); font-weight: 700; }
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:hover td { background: #FAF9F6; }
.table-scroll { overflow-x: auto; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--white); border: 1.5px solid var(--line); padding: 14px 16px; }
.stat b { display: block; font-size: 28px; letter-spacing: -0.02em; line-height: 1; }
.stat span { font-size: 13px; color: var(--muted); }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 12px 0; }
.toolbar > * { margin: 0; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(35,35,35,.55); display: none; align-items: flex-start; justify-content: center; padding: 30px 12px; overflow: auto; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: var(--paper); width: 100%; max-width: 720px; border-top: 4px solid var(--red); padding: 22px; }
.modal h2 { margin-top: 0; }

.hidden { display: none !important; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, input, select { transition: background .12s, border-color .12s, box-shadow .12s; }
}

/* Delivery slot — yellow like the tagline; the one loud element */
.slot { display: inline-block; background: var(--yellow); color: var(--black); font-weight: 700; padding: 8px 12px; border-radius: 2px; font-size: 18px; }
.route li.slot-event::before { background: var(--yellow); border-color: var(--yellow); }
.badge.s-time-slot-confirmed { background: var(--yellow); color: var(--black); }

/* Proof of delivery */
.pod { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; }
.pod img { width: 140px; max-height: 120px; object-fit: contain; background: #fff; border: 1.5px solid var(--line); }
.pod-thumb { margin-top: 6px; }
.pod-thumb img { max-width: 160px; max-height: 110px; border: 1.5px solid var(--line); background: #fff; }

/* Footer */
.foot { background: var(--black); color: #bbb; padding: 28px 20px; font-size: 13px; }
.foot .bar-inner { padding: 0; flex-wrap: wrap; }
.foot b { color: var(--yellow); font-style: italic; }
