/* KTM Voyage CRM — bookings module styling [BKG].
   The Booking List (Vasko's Excel mental model): season switcher, month header
   rows, the exact colour legend (red=cancelled, orange=realised, blue=tickets
   via KTM, yellow=action needed), YoY pax footer — plus the booking detail page
   (release chips R1/R2/R3, big action buttons, timeline, najava cards).
   Brand tokens come from css/base.css. */

/* ================= LIST PAGE ================= */

.ph-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

/* season switcher */
.seasonswitch{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-bottom:12px}
.seasonswitch .ss-label{font-size:12px;font-weight:700;color:var(--muted);letter-spacing:.03em;margin-right:2px}
.ss-btn{padding:8px 16px;border:1px solid var(--line);background:#fff;border-radius:999px;font-weight:700;font-size:13.5px;color:var(--muted);min-height:40px}
.ss-btn:hover{border-color:var(--gold);color:#292109}
.ss-btn.on{background:var(--gold);border-color:var(--gold);color:#211a05}

/* colour legend — exactly Vasko's Excel colours */
.bkg-legend{display:flex;gap:16px;flex-wrap:wrap;align-items:center;margin:2px 0 12px;font-size:12.5px;color:var(--muted)}
.bkg-legend span{display:inline-flex;align-items:center;gap:6px}
.bkg-legend .lg{width:14px;height:14px;border-radius:4px;border:1px solid rgba(0,0,0,.12);display:inline-block}
.lg-red{background:#f5d9d4}
.lg-orange{background:#fae3c8}
.lg-blue{background:#dbe7f7}
.lg-yellow{background:#faf3c3}

/* row tints (red > orange > yellow > blue priority is applied in JS) */
tr.tint-red>td{background:#f9e4e0}
tr.tint-orange>td{background:#fbeeda}
tr.tint-yellow>td{background:#fbf6d5}
tr.tint-blue>td{background:#e7effb}
tr.tint-red:hover>td{background:#f5d9d4}
tr.tint-orange:hover>td{background:#fae3c8}
tr.tint-yellow:hover>td{background:#faf3c3}
tr.tint-blue:hover>td{background:#dbe7f7}
tr.tint-red>td{color:#7c4034}

/* month header rows */
.bkg-table table.data{min-width:880px}
tr.bkg-month>td{background:var(--dark);color:#fff;padding:9px 14px;font-size:13px;border-top:2px solid var(--gold)}
tr.bkg-month b{font-family:"Playfair Display",Georgia,serif;font-size:14.5px;letter-spacing:.02em;margin-right:10px}
tr.bkg-month span{color:#c9cedb;font-size:12px}

/* row content */
.bkg-nr{font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.bkg-group b{display:block;font-size:13.5px}
.bkg-group small{display:block;color:var(--muted);font-size:12px}
.bkg-pax{font-variant-numeric:tabular-nums;font-weight:700}
.bkg-pax .pax-prev{color:var(--muted-2);font-weight:400}
.bkg-status{white-space:nowrap}
.bkg-status .flag{display:inline-flex;align-items:center;margin-left:6px;font-size:11px;font-weight:700;padding:2px 7px;border-radius:999px;border:1px solid}
.flag-tickets{background:#dbe7f7;border-color:#b7cdec;color:#3c5f96}
.flag-action{background:#faf3c3;border-color:#e6d76e;color:#6b5f22}

/* sortable column headers */
th.sortable{cursor:pointer;user-select:none;white-space:nowrap}
th.sortable:hover{color:#292109;background:#f4f2ea}
th.sortable .sort-ind{display:inline-block;width:14px;margin-left:3px;color:var(--gold);font-size:10px}
th.sortable.on{color:#292109}

/* YoY footer — Vasko's #1 number */
.bkg-yoy{display:flex;gap:14px;align-items:baseline;flex-wrap:wrap;margin-top:14px;background:var(--dark);color:#c9cedb;border-radius:var(--radius);padding:14px 20px;border-left:4px solid var(--gold)}
.bkg-yoy .yoy-season{font-size:12.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.bkg-yoy .yoy-now{font-family:"Playfair Display",Georgia,serif;font-size:24px;color:#fff}
.bkg-yoy .yoy-prev{font-size:13px}
.bkg-yoy .yoy-delta{font-size:14px;padding:3px 10px;border-radius:999px}
.bkg-yoy .yoy-delta.up{background:rgba(47,158,81,.25);color:#7ee2a1}
.bkg-yoy .yoy-delta.down{background:rgba(202,99,80,.25);color:#f4a493}

/* create/edit modal form grid */
.bkg-formgrid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}

/* ================= QoL: bulk select + action bar ================= */

.bkg-selth,.bkg-sel{width:38px;text-align:center;cursor:pointer}
.bkg-sel input,.bkg-selth input{width:18px;height:18px;accent-color:var(--gold);cursor:pointer;vertical-align:middle}
.bulkbar{position:sticky;bottom:14px;z-index:30;display:flex;gap:8px;align-items:center;flex-wrap:wrap;
  margin-top:14px;background:var(--dark);color:#fff;border-radius:999px;padding:10px 18px;
  box-shadow:0 8px 26px rgba(0,0,0,.35);border:1px solid rgba(204,181,45,.45)}
.bulkbar .bb-count{font-weight:700;font-size:13.5px;color:var(--gold);margin-right:4px;white-space:nowrap}
.bulkbar .btn{min-height:38px;white-space:nowrap}
.bulkbar .btn-ghost{background:transparent;color:#e8e6dc;border-color:rgba(255,255,255,.25)}
.bulkbar .btn-ghost:hover{border-color:var(--gold);color:#fff}
.bulkbar .bb-cancel{color:#f4a493;border-color:rgba(228,179,169,.5)}
.bulkbar .bb-cancel:hover{background:rgba(202,99,80,.2);border-color:#e4b3a9}
.bulkbar .bb-clear{border-color:transparent;color:#c9cedb}

/* keyboard cursor (↑↓) */
tr.bkg-row.kb-on>td{box-shadow:inset 0 0 0 2px var(--gold)}
tr.bkg-row.kb-on>td:first-child{border-radius:6px 0 0 6px}
tr.bkg-row.kb-on>td:last-child{border-radius:0 6px 6px 0}

/* this-week arrivals: gold accent on the left edge */
tr.bkg-week>td:first-child{border-left:4px solid var(--gold)}

/* quick chips (action filter + this-week + month jumps) */
.bkg-qchips{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0 0 12px}
.qchip{display:inline-flex;align-items:center;gap:6px;border-radius:999px;border:1px solid var(--line);
  background:#fff;padding:7px 14px;font-size:12.5px;font-weight:700;color:var(--muted);min-height:36px;cursor:pointer}
.qchip:hover{border-color:var(--gold);color:#292109}
.qchip-action.on{background:#faf3c3;border-color:#e6d76e;color:#6b5f22}
.qchip-week{background:#f0f5ee;border-color:#cfe0cd;color:#2f6b40}
.mchips{display:inline-flex;gap:3px;flex-wrap:wrap;align-items:center;margin-left:6px}
.mchip{border:1px solid var(--line);background:#fff;border-radius:8px;padding:5px 8px;font-size:11.5px;
  font-weight:700;color:var(--muted);min-height:32px;cursor:pointer;text-transform:uppercase;letter-spacing:.02em}
.mchip:hover{border-color:var(--gold);color:#292109}
.mchip.off{opacity:.35;cursor:default}

/* keyboard hint + column chooser */
.bkg-kbdhint{color:var(--muted-2);font-size:12px;margin-top:10px}
.col-checks{display:grid;grid-template-columns:1fr 1fr;gap:2px 18px}
.col-check small{color:var(--muted-2);font-weight:400}
.col-check.is-always{opacity:.6}

/* ================= DETAIL PAGE ================= */

.bd-head{margin-bottom:10px}
.bd-back{padding-left:10px}
.bd-title h1{font-size:28px}
.bd-title .desc{font-size:15px}
.bd-status{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.bd-status .pill{font-size:13px;padding:6px 14px}
.bd-status .flag{display:inline-flex;align-items:center;font-size:11.5px;font-weight:700;padding:4px 10px;border-radius:999px;border:1px solid}

/* release countdown chips */
.bd-chips{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 18px;margin-bottom:16px}
.bd-chips-title{font-size:12px;font-weight:700;color:var(--muted);letter-spacing:.04em;text-transform:uppercase;margin-bottom:9px}
.bd-chips-row{display:flex;gap:10px;flex-wrap:wrap}
.bd-chips-hint{color:var(--muted-2);font-size:12px;margin-top:9px}
.rchip{display:inline-flex;align-items:center;gap:9px;border-radius:999px;padding:8px 15px;font-size:13px;border:1px solid var(--line);background:#f6f4ee;min-height:40px}
.rchip b{font-family:"Playfair Display",Georgia,serif;font-size:14px}
.rchip .rc-date{font-variant-numeric:tabular-nums;font-weight:700}
.rchip .rc-when{font-size:12px;font-weight:700}
.rchip.calm{background:#f0f5ee;border-color:#cfe0cd;color:#2f6b40}
.rchip.soon{background:#fbf3d8;border-color:#e6d76e;color:#6b5f22}
.rchip.over{background:#f9e4e0;border-color:#e4b3a9;color:#8e3a2b}
.rchip.ok{background:#e9f5ec;border-color:#bfe0c8;color:#256e3d}
.rchip.muted{background:#f2f1ec;border-color:var(--line);color:var(--muted-2)}

/* status stepper — "where is this booking in the flow?" */
.bd-stepper{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#fff;border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow);padding:13px 18px;margin-bottom:16px}
.bd-step{display:inline-flex;align-items:center;gap:8px}
.bd-step-dot{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;
  font-style:normal;font-size:12.5px;font-weight:700;border:2px solid var(--line);color:var(--muted-2);background:#fff;flex:0 0 auto}
.bd-step-label{font-size:13px;font-weight:700;color:var(--muted-2);white-space:nowrap}
.bd-step.done .bd-step-dot{background:var(--ok);border-color:var(--ok);color:#fff}
.bd-step.done .bd-step-label{color:#256e3d}
.bd-step.now .bd-step-dot{background:var(--gold);border-color:var(--gold);color:#211a05}
.bd-step.now .bd-step-label{color:#292109}
.bd-step-line{flex:1 1 26px;min-width:18px;height:2px;background:var(--line);border-radius:2px}
.bd-stepper-cancelled{background:#f9e4e0;border-color:#e4b3a9;color:#8e3a2b;font-weight:700;font-size:13.5px}

/* big action buttons */
.bd-actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}
.bd-actions .btn{min-height:44px}
.btn-cancelbooking{color:#8e3a2b;border-color:#e4b3a9}
.btn-cancelbooking:hover{background:#f9e4e0}
.btn-danger-ghost{color:#8e3a2b;border-color:#e4b3a9}
.btn-danger-ghost:hover{background:#f9e4e0}

/* tab body */
.bd-tabbody{background:#fff;border:1px solid var(--line);border-radius:0 var(--radius) var(--radius) var(--radius);box-shadow:var(--shadow);padding:20px 22px;margin-top:-1px}
.bd-hint{color:var(--muted);font-size:13px;margin:0 0 14px;max-width:74ch}
.bd-sub{color:var(--muted);font-size:12.5px}
.bd-warn{background:#fbf3d8;border:1px solid #e6d76e;color:#6b5f22;border-radius:8px;padding:10px 14px;font-size:13px;font-weight:600;margin-bottom:12px}
.bd-actionnote{background:#faf3c3;border:1px solid #e6d76e;color:#6b5f22;border-radius:8px;padding:11px 15px;font-size:13.5px;font-weight:700;margin-bottom:14px}

/* info grid */
.bd-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px 22px}
.bd-kv span{display:block;font-size:11.5px;font-weight:700;color:var(--muted);letter-spacing:.03em;text-transform:uppercase;margin-bottom:3px}
.bd-kv b{font-size:14.5px;font-weight:700;color:var(--ink)}
.bd-kv .bd-sub{font-weight:400}
.bd-notes{margin-top:16px;border-top:1px dashed var(--line);padding-top:12px}
.bd-notes span{display:block;font-size:11.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin-bottom:4px}
.bd-notes p{margin:0;white-space:pre-wrap}
.bd-dangerzone{margin-top:22px;border-top:1px dashed var(--line);padding-top:14px}
.bd-tabactions{margin-top:14px;display:flex;gap:10px}

/* subgroups table */
.bd-tabbody table.data tfoot td{background:#f6f4ee;font-size:13px;padding:10px 14px}
.num{text-align:right;font-variant-numeric:tabular-nums}

/* subgroup modal editor */
.sg-rowhead{display:grid;grid-template-columns:2fr .7fr 1.1fr 1.1fr 44px;gap:8px;font-size:11.5px;font-weight:700;color:var(--muted);margin-bottom:6px}
.sg-row{display:grid;grid-template-columns:2fr .7fr 1.1fr 1.1fr 44px;gap:8px;margin-bottom:8px;align-items:center}
.sg-row input{padding:10px 11px;border:1px solid var(--line);border-radius:8px;font-size:14px;min-width:0}
.sg-row input:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(204,181,45,.18)}
.sg-del{color:#8e3a2b;min-height:40px}

/* status timeline */
.bd-timeline{list-style:none;margin:16px 0 0;padding:0 0 0 6px;position:relative}
.bd-timeline::before{content:"";position:absolute;left:12px;top:8px;bottom:8px;width:2px;background:var(--line)}
.tl-item{position:relative;display:flex;gap:16px;padding:0 0 18px 0}
.tl-dot{position:relative;z-index:1;width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--gold);margin-top:4px;flex:0 0 auto}
.tl-dot.s-cancelled{border-color:var(--bad)}
.tl-dot.s-realised{border-color:#d98b2b}
.tl-dot.s-guaranteed{border-color:var(--ok)}
.tl-dot.s-release{border-color:var(--teal)}
.tl-line{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.tl-arrow{color:var(--muted-2)}
.tl-meta{color:var(--muted);font-size:12.5px;margin-top:3px}
.tl-empty{color:var(--muted);list-style:none}

/* notes timeline (generic notes API) */
.bd-noteform{display:flex;gap:10px;align-items:flex-start;margin-bottom:16px}
.bd-noteform textarea{flex:1 1 auto;padding:11px 13px;border:1px solid var(--line);border-radius:10px;
  font-size:14px;font-family:inherit;resize:vertical;min-height:44px}
.bd-noteform textarea:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(204,181,45,.18)}
.bd-noteform .btn{min-height:44px;white-space:nowrap}
.bd-notelist{list-style:none;margin:0;padding:0}
.bd-noteitem{border-left:3px solid var(--gold);background:#faf9f4;border-radius:0 10px 10px 0;
  padding:10px 14px;margin-bottom:10px}
.bd-notemeta{color:var(--muted);font-size:12px;font-weight:700;margin-bottom:3px}
.bd-notetext{margin:0;font-size:13.5px;white-space:pre-wrap;overflow-wrap:anywhere}

/* najava & documents cards */
.bd-opsgrid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.bd-opscard .cb{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.nj-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.nj-list{list-style:none;margin:0;padding:0;width:100%}
.nj-list li{display:flex;align-items:center;gap:9px;padding:7px 0;border-bottom:1px dashed var(--line);font-size:13.5px}
.nj-list li:last-child{border-bottom:none}
.nj-list li.done{color:var(--muted);text-decoration:line-through;text-decoration-color:rgba(0,0,0,.25)}
.nj-list li small{text-decoration:none;color:var(--muted-2)}
.nj-mark{width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex:0 0 auto;border:1px solid var(--line);color:var(--muted-2);background:#fff}
.nj-list li.done .nj-mark{background:var(--ok);border-color:var(--ok);color:#fff}
.bd-linklist{list-style:none;margin:0;padding:0;width:100%}
.bd-linklist li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px dashed var(--line);font-size:13px}
.bd-linklist li:last-child{border-bottom:none}
.bd-calcline{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;flex-wrap:wrap;font-size:13.5px}

/* ================= RESPONSIVE (usable at 390px) ================= */

@media (max-width:900px){
  .bd-grid{grid-template-columns:1fr 1fr}
  .bd-opsgrid{grid-template-columns:1fr}
}

@media (max-width:560px){
  .bkg-formgrid{grid-template-columns:1fr}
  .bd-grid{grid-template-columns:1fr}
  .ph-actions{width:100%}
  .ph-actions .btn{flex:1 1 auto}
  .bd-actions .btn{flex:1 1 100%;justify-content:center}
  .bd-chips-row{flex-direction:column;align-items:stretch}
  .rchip{justify-content:space-between}
  .bkg-yoy{flex-direction:column;gap:4px;align-items:flex-start}
  .seasonswitch .ss-btn{flex:1 1 auto;text-align:center}
  .sg-rowhead{display:none}
  .sg-row{grid-template-columns:1fr 1fr;grid-auto-rows:auto;border:1px dashed var(--line);border-radius:8px;padding:10px}
  .sg-row input[name="sgName"]{grid-column:1/-1}
  .bd-tabbody{padding:14px}
  .bd-title .desc{font-size:13.5px}
  /* QoL on phones: bulk bar wraps into a rounded card; chips scroll; no kbd hint */
  .bulkbar{border-radius:16px;bottom:8px;padding:10px 12px}
  .bulkbar .btn{flex:1 1 45%;justify-content:center}
  .mchips{width:100%;margin-left:0;overflow-x:auto;flex-wrap:nowrap;padding-bottom:4px}
  .bkg-kbdhint{display:none}
  .col-checks{grid-template-columns:1fr}
  .bd-stepper{gap:6px}
  .bd-step-label{font-size:11.5px}
  .bd-noteform{flex-direction:column}
  .bd-noteform .btn{width:100%;justify-content:center}
}

/* ================= PRINT ================= */

@media print{
  .ph-actions,.seasonswitch,.bd-actions,.bd-dangerzone,.bd-tabactions,.bd-back,.bd-head,
  .bulkbar,.bkg-qchips,.bkg-kbdhint,.bkg-selth,.bkg-sel,.bd-noteform{display:none!important}
  tr.bkg-row.kb-on>td{box-shadow:none}
  .bkg-table,.bd-tabbody,.bd-chips{border:none;box-shadow:none}
  .bkg-table table.data{min-width:0}
  tr.bkg-month>td{background:#eee!important;color:#000;border-top:2px solid #999;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  tr.tint-red>td,tr.tint-orange>td,tr.tint-yellow>td,tr.tint-blue>td{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .bkg-yoy{background:#eee!important;color:#000;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .bkg-yoy .yoy-now{color:#000}
  .bkg-legend{display:flex}
}

/* ---------- P2 polish: long operator/program names never overflow ---------- */
.bkg-group b,.bkg-group small{overflow-wrap:anywhere}
.bd-title h1,.bd-title .desc{overflow-wrap:anywhere}
.bd-kv b{overflow-wrap:anywhere}
