:root {
  --ink: #17202a; --ink-2: #4a5563; --ink-3: #7b8594;
  --line: #e2e6ea; --line-2: #eef1f4; --bg: #f6f7f9; --card: #ffffff;
  --teal: #0f6e78; --teal-2: #e3f1f2; --teal-ink: #0b5560;
  --amber: #b07a12; --amber-2: #fdf4e1;
  --red: #b33a3a; --red-2: #fbeaea;
  --green: #2e7d4f; --green-2: #e6f4ec;
  --blue: #2f5f9e; --blue-2: #e8eff9;
  --radius: 10px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--sans); color: var(--ink); background: var(--bg); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); font-weight: 500; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 12px; }

/* layout */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #0f2a30; color: #cfe3e5; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: #8fc7cc; margin: 0 8px 22px; }
.brand b { display: block; font-family: var(--sans); font-size: 17px; letter-spacing: 0; color: #fff; }
.nav a { display: flex; justify-content: space-between; align-items: center; color: #cfe3e5; padding: 8px 10px; border-radius: 8px; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.on { background: rgba(143,199,204,.18); color: #fff; }
.nav .sep { height: 1px; background: rgba(255,255,255,.1); margin: 14px 4px; }
.pill { background: #e0a42b; color: #1b1b1b; border-radius: 99px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.side .who { position: absolute; bottom: 18px; left: 22px; right: 14px; font-size: 12px; color: #8fb3b7; }
.side .who form { display: inline; }
.side .who button { background: none; border: 0; color: #cfe3e5; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
main { padding: 26px 32px 60px; max-width: 1280px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.tight { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; letter-spacing: -0.02em; }
.stat span { color: var(--ink-3); font-size: 12px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: #f3f5f7; padding: 9px 12px; border-bottom: 1px solid var(--line); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click:hover td { background: #fafbfc; cursor: pointer; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

/* badges */
.badge { display: inline-block; font: 500 11px var(--mono); padding: 2px 8px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.st-01, .st-02, .st-04, .st-05, .st-06, .st-07, .st-08 { background: var(--teal-2); color: var(--teal-ink); }
.st-03 { background: var(--amber-2); color: var(--amber); }
.st-09 { background: var(--green-2); color: var(--green); }
.st-10, .st-11 { background: var(--red-2); color: var(--red); }
.lv { background: var(--blue-2); color: var(--blue); }
.rk-HOT { background: #fde8e1; color: #b4441f; } .rk-WARM { background: var(--amber-2); color: var(--amber); } .rk-COLD { background: var(--blue-2); color: var(--blue); }
.overdue { color: var(--red); font-weight: 600; }

/* journey strip */
.journey { display: flex; gap: 4px; margin: 10px 0 2px; }
.journey div { flex: 1; text-align: center; font-size: 11px; padding: 7px 4px; border-radius: 6px; background: var(--line-2); color: var(--ink-3); }
.journey div.done { background: var(--teal-2); color: var(--teal-ink); }
.journey div.now { background: var(--teal); color: #fff; font-weight: 600; }
.journey.dead div.now { background: var(--red); }

/* forms */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 11px; border-radius: 7px; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; background: #fff; }
.tabs a.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.tabs a.danger { color: var(--red); }
.tabs a.danger.on { background: var(--red); border-color: var(--red); color: #fff; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 11px; color: var(--ink-3); }
.field .err { font-size: 12px; color: var(--red); }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #cfd6dd; border-radius: 7px; background: #fff; color: var(--ink); width: 100%; }
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-2); border-color: var(--teal); }
.btn { display: inline-block; background: var(--teal); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font: 600 13px var(--sans); cursor: pointer; }
.btn:hover { background: var(--teal-ink); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--teal); border: 1px solid var(--teal); }
.btn.danger { background: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.formbar { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
details.more { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; color: var(--teal); font-size: 13px; margin-bottom: 10px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; }
.hidden { display: none !important; }

/* messages */
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid; }
.msg.success { background: var(--green-2); border-color: #bfe0cc; color: #1f5c39; }
.msg.error, .errorlist.nonfield { background: var(--red-2); border-color: #efc6c6; color: var(--red); }
.msg.warning { background: var(--amber-2); border-color: #f0dcae; color: #7a5410; }
ul.errorlist { list-style: none; margin: 0 0 10px; padding: 10px 14px; border-radius: 8px; }
.field ul.errorlist { padding: 0; margin: 0; color: var(--red); font-size: 12px; background: none; }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { padding: 9px 0 9px 16px; border-left: 2px solid var(--line); position: relative; margin-left: 4px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.tl li.in::before { background: var(--green); } .tl li.auto::before { background: var(--ink-3); }
.tl .when { font: 11px var(--mono); color: var(--ink-3); }
.bar { height: 8px; background: var(--teal-2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); }
.empty { color: var(--ink-3); padding: 18px; text-align: center; }
.pager { display: flex; gap: 10px; justify-content: flex-end; padding: 10px 12px; font-size: 13px; }

.login { max-width: 360px; margin: 12vh auto; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side .who { position: static; margin-top: 12px; }
  main { padding: 18px 16px 40px; }
  .split, .g2, .g3, .g4, .fields { grid-template-columns: 1fr; }
}

/* AI itineraries */
.ai-gen { font-size: 12px; color: var(--ink-3); margin: 14px 0 4px; }
.ai-opt { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 6px; border-top: 1px solid var(--line-2); color: var(--ink); }
.ai-opt:hover { background: #fafbfc; text-decoration: none; }
.ai-opt > b { font-family: var(--mono); color: var(--teal); }
.ai-opt .ai-title { display: block; font-weight: 600; }
.ai-opt .muted { font-size: 12px; }
.fit-WITHIN { background: var(--green-2); color: var(--green); }
.fit-STRETCH { background: var(--amber-2); color: var(--amber); }
.days { list-style: none; margin: 0; padding: 0; }
.days li { padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.days li b { display: block; font-size: 14px; }
.card.assumed { background: var(--amber-2); border-color: #f0dcae; color: #7a5410; font-size: 13px; }
.card.assumed ul { margin: 6px 0 0; padding-left: 18px; }
.vlist a { display: block; padding: 7px 8px; border-radius: 6px; font-size: 13px; color: var(--ink-2); }
.vlist a:hover { background: #fafbfc; text-decoration: none; }
.vlist a.on { background: var(--teal-2); color: var(--teal-ink); }

/* ops */
.badge.sev-HIGH { background: var(--red-2); color: var(--red); }
.badge.sev-MEDIUM { background: var(--amber-2); color: var(--amber); }
.badge.sev-LOW { background: var(--blue-2); color: var(--blue); }
.badge.st-NEEDS_CUSTOMER { background: #fbe9e1; color: #b4532a; }
.badge.st-OPTIONS_SENT { background: var(--blue-2); color: var(--blue); }
.badge.st-BOOKED, .badge.st-READY { background: var(--green-2); color: var(--green); }
.badge.st-CANCELLED { text-decoration: line-through; }
.badge.warn { background: var(--amber-2); color: var(--amber); }
.ops-board td { vertical-align: top; }
.ops-progress { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--line-2); min-width: 140px; }
.ops-progress .seg.needs { background: #c8643b; } .ops-progress .seg.queued { background: #c9ced6; }
.ops-progress .seg.options { background: var(--blue); } .ops-progress .seg.done { background: var(--teal); }
.ops-progress-text { margin-top: 4px; font-size: 11px; }
.ops-esc-link { display: block; padding: 8px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.ops-esc-link:hover { text-decoration: none; background: var(--bg); }
.ops-meta { margin-top: 4px; color: var(--ink-2); }
.ops-route { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ops-route a { padding: 4px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 13px; }
.ops-route a.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.ops-owners { min-width: 320px; }
.ops-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ops-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.ops-days a { position: relative; flex: 0 0 auto; text-align: center; padding: 5px 9px; border-radius: 9px; border: 1px solid var(--line); color: var(--ink-2); font-size: 11px; line-height: 1.2; background: #fff; }
.ops-days a b { display: block; font-size: 15px; color: var(--ink); }
.ops-days a.on { background: #0f2a30; border-color: #0f2a30; color: #cfe3e5; }
.ops-days a.on b { color: #fff; }
.ops-days .dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: #c8643b; }
.ops-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.ops-timeline li { margin: 0 0 8px; position: relative; }
.ops-timeline li::before { content: ""; position: absolute; left: -20px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--line); }
.ops-timeline li.st-NEEDS_CUSTOMER::before { background: #c8643b; border-color: #c8643b; }
.ops-timeline li.st-BOOKED::before, .ops-timeline li.st-READY::before { background: var(--teal); border-color: var(--teal); }
.ops-timeline a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; color: var(--ink); background: #fff; border: 1px solid var(--line); }
.ops-timeline li.transit a { border-style: dashed; background: #f7f9fc; }
.ops-timeline li.on a { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.ops-timeline li.st-CANCELLED a { opacity: .5; }
.ops-timeline a:hover { text-decoration: none; border-color: var(--teal); }
.ops-timeline .t { flex: 1; min-width: 0; }
.ops-timeline .t > span.muted { display: block; font-size: 12px; }
.ops-timeline .flags { text-align: right; }
.ico { flex: 0 0 28px; height: 28px; border-radius: 7px; background: var(--teal-2); color: var(--teal-ink); display: grid; place-items: center; font-size: 14px; }
.ico.flight::before { content: "✈"; } .ico.transfer::before { content: "→"; } .ico.train::before { content: "⇢"; }
.ico.ferry::before { content: "≈"; } .ico.hotel::before { content: "⌂"; } .ico.activity::before { content: "★"; }
.ico.dining::before { content: "◍"; }
.ops-legend { font-size: 12px; margin-top: 8px; }
.ops-legend .lg { display: inline-block; width: 12px; height: 10px; border: 1px solid var(--ink-3); border-radius: 3px; margin: 0 4px 0 10px; vertical-align: middle; }
.ops-legend .lg.transit { border-style: dashed; }
.ops-node h1 { font-size: 20px; }
.ops-node h2, .ops-panel h2 { margin-top: 18px; }
.ops-item { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; margin-bottom: 8px; }
.ops-item.open { border-left: 3px solid #c8643b; }
.ops-item.sev-HIGH { border-left: 3px solid var(--red); } .ops-item.sev-MEDIUM { border-left: 3px solid var(--amber); }
.ops-item.resolved { opacity: .65; border-left-color: var(--line); }
.ops-item p { margin: 6px 0; }
.ops-reply { background: var(--green-2); border-radius: 7px; padding: 6px 9px; margin-top: 6px; }
.ops-notes { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; }
.ops-notes li { padding: 3px 0; border-top: 1px solid var(--line-2); }
.ops-notes-internal { background: var(--amber-2); border-radius: 7px; padding: 6px 9px; margin-top: 8px; font-size: 13px; }
.ops-inline { display: flex; gap: 6px; margin-top: 6px; }
.ops-inline input, .ops-inline select { flex: 1; width: auto; }
.ops-add { margin-top: 12px; }
.ops-add summary { cursor: pointer; color: var(--teal); font-weight: 500; }
.ops-contacts { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; }
.ops-contacts li { padding: 5px 0; border-top: 1px solid var(--line-2); }
@media (max-width: 1100px) { .ops-grid { grid-template-columns: 1fr; } }
.ops-chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; margin-bottom: 10px; }
.ops-msg { max-width: 85%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; }
.ops-msg.customer { align-self: flex-start; background: var(--bg); }
.ops-msg.ops { align-self: flex-end; background: #eef5f4; border-color: #d4e6e3; }
.ops-options { display: grid; gap: 6px; margin-top: 6px; }
.ops-option { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ops-option.held { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal) inset; }
.ops-msg.jude { align-self: flex-end; background: #f3eefb; border-color: #dccff0; }
.ops-jude { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.ops-jude form { display: inline; }
.ops-jude ul { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; }
.ops-jude li { padding: 5px 0; border-top: 1px solid var(--line-2); }

/* Supply: hotels and transfers on itineraries */
.supply-choice { font-size: 12px; margin: 2px 0 6px; }
.supply-choice a { margin-left: 6px; }
.supply-card { display: flex; gap: 12px; align-items: center; }
.supply-card > div { flex: 1; }
.supply-card img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; }
.supply-photos { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.supply-photos img { width: 110px; height: 74px; object-fit: cover; border-radius: 6px; }
