:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #64707d;
  --line: #e2e6ea;
  --line-strong: #cfd5db;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e6f4f2;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff7e0;
  --nav: #16212c;
  --nav-ink: #c9d2db;
  --nav-active: #243241;
  --field: #ffffff;            /* inputs, chips, pickers */
  --subtle: #fafbfc;           /* table heads, inset boxes */
  --hover: #f5f8fb;
  --disabled-bg: #f3f4f6;
  --disabled-ink: #4b5563;
  --chip-ink: #0b4f49;
  --danger-line: #f1b8b3;
  --danger-ink: #7a1a12;
  --warn-line: #f5d98b;
  --warn-ink: #7a5a00;
  --info-line: #b4dcd6;
  --btn-hover-line: #aeb7c0;
  --toast-bg: #1f2933;
  --spec-bg: #ede9fe; --spec-ink: #5b21b6;
  --draft-bg: #fef3c7; --draft-ink: #92400e;
  --tick-off: #c3cad1;
  /* Section colors (tint = card background, bar = left edge). Each part of an order has its own color. */
  --sec-customer: #f2f7ff;  --bar-customer: #3b82f6;
  --sec-schedule: #f1faf4;  --bar-schedule: #16a34a;
  --sec-bonus: #effaf8;     --bar-bonus: #0d9488;
  --sec-package: #f6f3ff;   --bar-package: #7c3aed;
  --sec-instr: #fffaeb;     --bar-instr: #d97706;
  --sec-billing: #f3f5fc;   --bar-billing: #4f46e5;
  --sec-ntr: #fff5ee;       --bar-ntr: #ea580c;
  --sec-digital: #fdf2f8;   --bar-digital: #db2777;
  --sec-copy: #f7f6ff;      --bar-copy: #6d5bd0;
  --sec-workflow: #f2f7f7;  --bar-workflow: #0f766e;
  --sec-actions: #f8fafb;   --bar-actions: #64748b;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: 56px 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 12px; flex: none; text-decoration: none; color: var(--ink); }
.brand-logo { height: 34px; width: auto; max-width: 240px; object-fit: contain; display: block; }
.brand-label { font-size: 11px; line-height: 1.15; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-left: 1px solid var(--line-strong); padding-left: 12px; white-space: nowrap; }
.login-brand { display: grid; justify-items: center; gap: 12px; margin: 4px 0 22px; text-align: center; }
.login-logo { width: 100%; max-width: 320px; max-height: 90px; object-fit: contain; }
.login-title { font-weight: 700; font-size: 15px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.branding-panel { padding: 18px; max-width: 760px; }
.logo-preview { display: grid; gap: 4px; margin-bottom: 12px; }
.lp-box { border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--field); display: flex; align-items: center; gap: 12px; }
.lp-login { justify-content: center; padding: 22px; }
.lp-login img { max-width: 320px; max-height: 90px; width: 100%; object-fit: contain; }
.lp-bar { padding: 10px 14px; }
.lp-bar img { height: 34px; max-width: 240px; object-fit: contain; }
.brand .logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.search { flex: 1 1 360px; min-width: 140px; max-width: 520px; }
.search input { width: 100%; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); }
.topbar .spacer { flex: 1 1 0; min-width: 0; }
.usermenu { display: flex; align-items: center; gap: 10px; color: var(--muted); white-space: nowrap; flex: none; }
@media (max-width: 1400px) { .usermenu .role { display: none; } }
/* Narrower windows: drop the secondary labels so the top bar never pushes the page sideways (Spanish labels are longer). */
@media (max-width: 1200px) { .brand-label { display: none; } .topbar { gap: 12px; } .usermenu { gap: 8px; } }
@media (max-width: 1100px) { .usermenu .who { display: none; } }
.usermenu strong { color: var(--ink); font-weight: 600; }
.lang-switch { font-weight: 600; }
.login .lang-switch { justify-self: center; }

.sidenav { background: var(--nav); color: var(--nav-ink); padding: 14px 10px 40px; overflow-y: auto; position: sticky; top: 56px; height: calc(100vh - 56px); }
.sidenav h4 { margin: 18px 10px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #7f8c99; font-weight: 600; }
.sidenav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--nav-ink); text-decoration: none; }
.sidenav a:hover { background: var(--nav-active); color: #fff; }
.sidenav a.active { background: var(--nav-active); color: #fff; font-weight: 600; }
.sidenav .dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); flex: none; }
.sidenav .count { margin-left: auto; background: #34495e; color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; line-height: 18px; }
.sidenav .count.hot { background: #d97706; }

main { padding: 20px 24px 60px; min-width: 0; }
.pagehead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pagehead h1 { font-size: 20px; margin: 0; }
.pagehead .sub { color: var(--muted); }
.pagehead .spacer { flex: 1; }

/* ---------- controls ---------- */
.btn { border: 1px solid var(--line-strong); background: var(--panel); padding: 7px 14px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--btn-hover-line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.link { border: none; background: none; color: var(--accent); padding: 4px 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input:not([type]), select, textarea {
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 9px; background: var(--field); color: var(--ink); width: 100%;
}
input:disabled, select:disabled, textarea:disabled { background: var(--disabled-bg); color: var(--disabled-ink); }
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
textarea.script { min-height: 140px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; }
label.f { display: block; }
label.f > span, div.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.req > span::after { content: " *"; color: var(--danger); }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; background: var(--field); }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--chip-ink); font-weight: 600; }
.chip input { accent-color: var(--accent); }

/* ---------- status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; border: 1px solid rgba(0,0,0,.15); font-size: 12px; font-weight: 600; white-space: nowrap; color: #1f2933; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.badge.spec { background: var(--spec-bg); color: var(--spec-ink); }
.badge.draft { background: var(--draft-bg); color: var(--draft-ink); }
.tick { color: var(--accent); font-weight: 700; }
.tick.no { color: var(--tick-off); font-weight: 400; }

/* ---------- list ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar select, .pagehead select { width: auto; }
.spot-row1 { display: grid; gap: 12px; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 110px 140px; }
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--subtle); position: sticky; top: 0; }
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr { cursor: pointer; }
table.list tbody tr { border-left: 5px solid transparent; }
table.list tbody tr:hover td { background: var(--hover); }
table.list .client { font-weight: 600; }
table.list .title { color: var(--muted); font-size: 13px; }
table.list .nowrap { white-space: nowrap; }
table.list .overdue { color: var(--danger); font-weight: 600; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }

/* ---------- order ---------- */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card > .hd h2, .card > .hd h3 { margin: 0; font-size: 15px; }
.card > .bd { padding: 16px; }
.card + .card { margin-top: 16px; }
.spot-card { border-left: 6px solid var(--line-strong); }
.spot-card .lineno { font-weight: 700; color: var(--muted); }
.section-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 18px 0 8px; display: flex; align-items: center; gap: 10px; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.workflow { background: var(--subtle); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.checkrow { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.timer { font-size: 12px; color: var(--muted); display: flex; gap: 10px; margin-top: 4px; }
.timer .over { color: var(--danger); font-weight: 600; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.files li:last-child { border-bottom: none; }
.files .kind { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; min-width: 100px; }
.files audio { height: 32px; max-width: 260px; }
.files img.thumb { height: 56px; max-width: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: var(--field); display: block; }
.upload { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.upload select { width: auto; }
.blog-entry, .hist-entry { padding: 10px 0; border-bottom: 1px solid var(--line); }
.blog-entry:last-child, .hist-entry:last-child { border-bottom: none; }
.blog-entry .meta, .hist-entry .meta { font-size: 12px; color: var(--muted); }
.blog-entry .body { white-space: pre-wrap; margin-top: 3px; line-height: 1.45; }
.hist-entry { font-size: 13px; padding: 7px 0; }
.sticky { position: sticky; top: 76px; }
.scrollbox { max-height: 380px; overflow-y: auto; }
.notice { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; line-height: 1.45; }
.notice.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); }
.notice.error { background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger-ink); }
.notice.info { background: var(--accent-soft); border: 1px solid var(--info-line); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 10px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal .hd { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.modal .bd { padding: 18px 20px; }
.modal .ft { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--toast-bg); color: #fff; padding: 9px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.err { background: var(--danger); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(400px, 100%); }
.login .brand { margin-bottom: 18px; font-size: 17px; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-color: var(--accent); font-weight: 600; }
table.admin td input, table.admin td select { padding: 5px 7px; }
table.admin tr { cursor: default; }
.inactive td { opacity: .55; }

/* ---------- schedule & billing ---------- */
.order-tabs { margin-top: -2px; }
.tabcount { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; }
.tabdot { color: var(--accent); font-size: 10px; }
.tabstep { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 11px; font-weight: 700; margin-right: 4px; }
.tabs a.active .tabstep { background: var(--accent); color: #fff; }
.adv-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.adv-pick { display: flex; gap: 8px; }
.inherited { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; background: var(--subtle); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.inherited > div span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.inherited > div strong { font-size: 15px; }
.inherited .btn { margin-left: auto; }
.adv-pick input { flex: 1; min-width: 0; }
.sched .card + .card, .sched > .card { margin-top: 16px; }
.sched-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: stretch; }
.sched-top .card { margin: 0 !important; }
.sched-actions { display: grid; gap: 8px; align-content: start; min-width: 0; }
/* Long labels (e.g. in Spanish) wrap inside the card instead of widening the page. */
.sched-actions .btn { white-space: normal; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.sched-actions .hint { overflow-wrap: anywhere; }
.traffic-check { margin-top: 6px; font-weight: 600; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px 18px; }
.sum-grid span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.sum-grid strong { font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sum-grid > div:first-child { grid-column: span 2; } /* the flight dates need two columns */
.sched-radios { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; }
details.acct { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.acct summary { cursor: pointer; font-weight: 600; }
.sgrid-wrap { overflow-x: auto; }
table.sgrid { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.sgrid th { font-size: 11px; color: var(--muted); font-weight: 700; text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); background: var(--subtle); white-space: nowrap; }
table.sgrid td { padding: 3px 3px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.sgrid input, table.sgrid select { padding: 4px 5px; font-size: 13px; border-radius: 4px; }
table.sgrid input[type=date] { width: 128px; }
table.sgrid input[type=time] { width: 104px; }
table.sgrid.lines tr.l1 td { border-bottom: none; padding-top: 7px; }
table.sgrid.lines tr.l2 td { padding: 2px 3px 8px; }
table.sgrid.lines tr.l2:hover td, table.sgrid.lines tr.l1:hover td { background: transparent; }
.l2-row { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12px; }
.l2-f { display: inline-flex; gap: 5px; align-items: center; }
.l2-f > span:first-child { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .06em; }
.l2-row .acts { margin-left: auto; }
table.sgrid .warn { background: var(--warn-soft); font-size: 12px; color: var(--warn-ink); padding: 4px 8px; border-radius: 4px; margin-top: 5px; }
table.sgrid .strong { font-weight: 600; }
table.sgrid .w-typ { width: 58px; } table.sgrid .w-sta { width: 84px; } table.sgrid .w-len { width: 62px; }
table.sgrid .w-rate { width: 84px; text-align: right; } table.sgrid .w-day { width: 42px; text-align: center; padding: 4px 2px; }
table.sgrid .w-wk { width: auto; } table.sgrid .w-copy { width: auto; max-width: 240px; }
table.sgrid .daypart { width: auto; font-size: 12px; color: var(--muted); }
table.sgrid th.day, table.sgrid td.day { text-align: center; background: var(--day-bg, rgba(15,118,110,.04)); }
table.sgrid .num { text-align: right; white-space: nowrap; padding-right: 8px; }
table.sgrid .ln { font-weight: 700; color: var(--muted); text-align: center; }
table.sgrid tfoot td { border-bottom: none; padding: 5px 4px; }
table.sgrid .tlabel { text-align: right; color: var(--muted); font-weight: 600; padding-right: 10px; }
table.sgrid.simple td.wide { width: 50%; }
table.sgrid.breakdown td, table.sgrid.breakdown th { padding: 7px 8px; }
.empty-row { color: var(--muted); padding: 16px !important; text-align: center; }
button.icon { border: 1px solid transparent; background: none; cursor: pointer; padding: 3px 5px; border-radius: 4px; color: var(--muted); font-size: 13px; }
button.icon:hover { border-color: var(--line-strong); color: var(--ink); }
button.icon.danger:hover { color: var(--danger); border-color: var(--danger-line); }
.pkg-grid { display: grid; grid-template-columns: repeat(12, minmax(70px, 1fr)); gap: 8px; }
.totals-row { display: flex; gap: 24px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.totals-row strong { font-variant-numeric: tabular-nums; margin-left: 6px; }
table.list .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .sched-top { grid-template-columns: 1fr; } .pkg-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

@media (max-width: 1100px) { .order-layout { grid-template-columns: 1fr; } .sticky { position: static; } }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .topbar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; position: static; }
  .brand { min-width: 0; }
  .brand-label, .usermenu .who, .usermenu [data-action=change-password] { display: none; }
  .brand-logo { height: 24px; max-width: 140px; }
  .topbar .btn.primary { padding: 6px 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .sidenav { position: static; height: auto; display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 8px; }
  .sidenav h4, .sidenav .nav-status { display: none; }
  .sidenav a { white-space: nowrap; }
  .g2, .g3, .sched-radios, .adv-row { grid-template-columns: 1fr; }
  .pkg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4, .spot-row1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 16px 12px 60px; }
  .files audio { max-width: 100%; }
}

/* Multi-choice picker (routing rules): a dropdown of checkboxes */
details.multi { position: relative; min-width: 160px; }
details.multi > summary { list-style: none; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 30px 7px 10px; background: var(--field); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
details.multi > summary::-webkit-details-marker { display: none; }
details.multi > summary::after { content: '▾'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
details.multi[open] > summary { border-color: var(--accent); }
.multi-panel { position: fixed; z-index: 60; max-height: 280px; overflow: auto; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.14); padding: 8px; }
.multi-panel label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 5px; white-space: nowrap; cursor: pointer; }
.multi-panel label:hover { background: var(--hover); }
.multi-panel input { accent-color: var(--accent); }
.multi-panel .hint { padding: 2px 6px 6px; white-space: normal; min-width: 180px; }
table.routing td { vertical-align: middle; }

/* ---------- color-coded sections: each part of an order has its own tint and edge color ---------- */
.card.sec { border-left: 4px solid var(--sec-bar); background: var(--sec-tint); }
.card.sec > .hd { background: transparent; }
.sec-customer { --sec-tint: var(--sec-customer); --sec-bar: var(--bar-customer); }
.sec-schedule { --sec-tint: var(--sec-schedule); --sec-bar: var(--bar-schedule); }
.sec-bonus    { --sec-tint: var(--sec-bonus);    --sec-bar: var(--bar-bonus); }
.sec-package  { --sec-tint: var(--sec-package);  --sec-bar: var(--bar-package); }
.sec-instr    { --sec-tint: var(--sec-instr);    --sec-bar: var(--bar-instr); }
.sec-billing  { --sec-tint: var(--sec-billing);  --sec-bar: var(--bar-billing); }
.sec-ntr      { --sec-tint: var(--sec-ntr);      --sec-bar: var(--bar-ntr); }
.sec-digital  { --sec-tint: var(--sec-digital);  --sec-bar: var(--bar-digital); }
.sec-copy     { --sec-tint: var(--sec-copy);     --sec-bar: var(--bar-copy); }
.sec-actions  { --sec-tint: var(--sec-actions);  --sec-bar: var(--bar-actions); }
.card.sec .hd h2::before, .card.sec .hd h3::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--sec-bar); margin-right: 8px; vertical-align: 1px; }
/* Tables inside a colored section keep a clean surface so the numbers stay easy to read. */
.card.sec table.sgrid th { background: transparent; }
/* The spot card keeps its status color on the left edge; the copy tint fills it, the workflow box gets its own tint. */
.spot-card.sec { background: var(--sec-copy); }
.spot-card .workflow { background: var(--sec-workflow); border-color: color-mix(in srgb, var(--bar-workflow) 25%, var(--line)); }
.section-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: -4px 0 12px; }
.section-legend a { color: var(--muted); text-decoration: none; } .section-legend a:hover { color: var(--ink); }
.section-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 0; }

/* ---------- proposals ---------- */
.proposal-btn { font-weight: 600; }
.proposal-line { display: grid; gap: 6px; border-top: 1px dashed var(--line-strong); padding-top: 10px; margin-top: 2px; }
.proposal-line .proposal-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pbadge { display: inline-block; justify-self: start; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.pbadge.sent { background: #dbeafe; color: #1e40af; }
.pbadge.expired { background: #fef3c7; color: #92400e; }
.pbadge.accepted { background: #dcfce7; color: #166534; }
.pbadge.declined { background: #f1f5f9; color: #475569; text-decoration: line-through; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg a { padding: 6px 12px; color: var(--ink); text-decoration: none; border-right: 1px solid var(--line-strong); background: var(--panel); }
.seg a:last-child { border-right: 0; }
.seg a.active { background: var(--accent); color: #fff; font-weight: 600; }
.logo-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-cell .st-logo { height: 32px; max-width: 110px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 2px; }
.logo-cell label.btn { cursor: pointer; }

/* ---------- theme switch ---------- */
.theme-switch { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); border-radius: 6px; width: 32px; height: 30px; display: grid; place-items: center; cursor: pointer; font-size: 15px; padding: 0; }
.theme-switch:hover { border-color: var(--btn-hover-line); }

/* ---------- dark theme ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e151c;
  --panel: #16202a;
  --ink: #e4e9ee;
  --muted: #98a4b0;
  --line: #26333f;
  --line-strong: #364553;
  --accent: #14a397;
  --accent-ink: #ffffff;
  --accent-soft: #123430;
  --danger: #f2877d;
  --danger-soft: #3a1c1b;
  --warn-soft: #3a3016;
  --nav: #0a1016;
  --nav-ink: #b9c4ce;
  --nav-active: #1b2733;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
  --field: #0f1821;
  --subtle: #1a2530;
  --hover: #1d2a36;
  --disabled-bg: #1b2530;
  --disabled-ink: #a7b2bd;
  --chip-ink: #8ee8dc;
  --danger-line: #6b2b27;
  --danger-ink: #f6c1bb;
  --warn-line: #6b5520;
  --warn-ink: #f3d68a;
  --info-line: #1f5a53;
  --btn-hover-line: #4d5f70;
  --toast-bg: #2b3a48;
  --spec-bg: #2e2552; --spec-ink: #c9b8ff;
  --draft-bg: #3b3013; --draft-ink: #f6d58a;
  --tick-off: #4a5866;
  --day-bg: rgba(20,163,151,.07);
  --sec-customer: #142238;  --bar-customer: #60a5fa;
  --sec-schedule: #132a1c;  --bar-schedule: #4ade80;
  --sec-bonus: #11292a;     --bar-bonus: #2dd4bf;
  --sec-package: #221b38;   --bar-package: #a78bfa;
  --sec-instr: #2e2412;     --bar-instr: #fbbf24;
  --sec-billing: #1a1d36;   --bar-billing: #818cf8;
  --sec-ntr: #2f1d12;       --bar-ntr: #fb923c;
  --sec-digital: #2f1626;   --bar-digital: #f472b6;
  --sec-copy: #1e1b33;      --bar-copy: #a598f0;
  --sec-workflow: #122626;  --bar-workflow: #2dd4bf;
  --sec-actions: #18222c;   --bar-actions: #94a3b8;
}
:root[data-theme="dark"] .pbadge.sent { background: #1e3a6b; color: #bfdbfe; }
:root[data-theme="dark"] .pbadge.expired { background: #4a3a10; color: #fde68a; }
:root[data-theme="dark"] .pbadge.accepted { background: #14432a; color: #bbf7d0; }
:root[data-theme="dark"] .pbadge.declined { background: #253241; color: #a7b4c2; }
:root[data-theme="dark"] .modal-bg { background: rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .brand-logo, :root[data-theme="dark"] .login-logo { background: #fff; border-radius: 6px; padding: 2px 6px; }

/* Glossary of the Typ letters, under each schedule's title */
.typ-glossary { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 16px 2px; font-size: 12px; color: var(--muted); }
.typ-glossary b { color: var(--ink); margin-right: 3px; }

/* Station picker on schedule lines: one or more stations running the same schedule */
details.multi.sta-pick { min-width: 84px; max-width: 150px; }
details.multi.sta-pick > summary { padding: 6px 24px 6px 8px; }
details.multi.sta-pick > summary::after { right: 7px; }
.sta-ro { white-space: nowrap; }
.sta-x { font-size: 10.5px; color: var(--muted); font-weight: 400; white-space: nowrap; }

/* Copy changes */
.badge.cc { background: #ede9fe; color: #5b21b6; }
:root[data-theme="dark"] .badge.cc { background: #3b2a63; color: #ddd6fe; }
.cc-box { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 12px 14px; margin: 12px 0 4px; background: var(--sec-copy, transparent); }
.cc-quick { display: flex; gap: 8px; align-items: flex-end; padding-bottom: 22px; }
.notice.cc-instr { background: #f5f3ff; border: 1px solid #c4b5fd; margin-top: 12px; }
:root[data-theme="dark"] .notice.cc-instr { background: #2a2140; border-color: #5b4a8a; }
.notice.cc-instr a { margin-left: 6px; }
