/* TourCRM — "Maison" luxury design system (ink + gold on ivory). Playfair Display + Inter. */
:root{
  --violet:#9a7b2e; --violet2:#caa451; --blue:#8a6a1f; --mint:#9a7b2e;
  --gold:#9a7b2e; --gold2:#caa451; --ink:#1b1712; --ink2:#33291b;
  --bg:#f5f1e8; --bg-card:#ffffff; --bg-sidebar:#17130e;
  --text-main:#231d14; --text-muted:#6f6353; --border:#e9e1d1;
  --success:#9a7b2e; --danger:#b0402c; --warning:#b1801d;
  --surface:#efe9dc;--surface-2:#faf7f0;--gold-dark:#8a6412;--radius:14px; --ease:cubic-bezier(.4,0,.2,1);
  --grad-gold:linear-gradient(100deg,#caa451,#9a6f1c);
  --font-head:'Playfair Display',Georgia,serif; --font-ui:'Inter',system-ui,sans-serif; --font-num:'JetBrains Mono',monospace;
}
*{box-sizing:border-box;margin:0;padding:0}
.skip-link{position:absolute;left:-9999px;top:0;z-index:2000;background:var(--ink);color:#fff;padding:12px 20px;border-radius:0 0 10px 0;font-weight:700;text-decoration:none}
.skip-link:focus{left:0}
tr.cursor-pointer[role=link]:focus-visible{outline:2px solid var(--gold2);outline-offset:-2px}
html,body{overflow-x:hidden;overflow-x:clip;max-width:100%}
body{font-family:var(--font-ui);background:var(--bg);color:var(--text-main);-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto}

/* layout shell */
.admin-wrapper{display:flex;min-height:100vh}
.sidebar{width:266px;background:var(--bg-sidebar);color:#e9dcc2;display:flex;flex-direction:column;flex-shrink:0;position:relative;overflow:hidden;transition:transform .3s var(--ease);z-index:70}
.sidebar::before{content:"";position:absolute;top:-18%;left:-30%;width:150%;height:300px;background:radial-gradient(circle,rgba(154,123,46,.5),transparent 62%);filter:blur(60px)}
.sidebar-header{padding:22px 24px;border-bottom:1px solid rgba(255,255,255,.07);position:relative}
.brand-title{font-family:var(--font-head);font-size:1.35rem;color:#fff}
.brand-subtitle{font-size:.72rem;letter-spacing:.16em;text-transform:uppercase;color:#b8a988;margin-top:2px}
.nav-section{flex:1;overflow-y:auto;padding:14px 12px;position:relative}
.nav-label{font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;color:#9a8b6f;margin:16px 12px 6px}
.nav-item{display:flex;align-items:center;gap:12px;padding:10px 13px;border-radius:11px;color:#d9ccb1;font-weight:500;font-size:.9rem;transition:background .18s var(--ease),color .18s}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:var(--grad-gold);color:#241c0c;font-weight:700;box-shadow:0 10px 22px -12px rgba(202,164,81,.75)}
.nav-icon{width:20px;text-align:center;font-size:.95rem}
.nav-bottom{padding:12px;border-top:1px solid rgba(255,255,255,.07)}

.main-content{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 28px;background:rgba(255,255,255,.82);backdrop-filter:blur(12px);border-bottom:1px solid var(--border);height:66px}
.topbar-left{display:flex;align-items:center;gap:14px;min-width:0}
.page-title{font-family:var(--font-head);font-size:1.3rem;font-weight:400}
.menu-btn{display:none;background:none;border:none;font-size:1.2rem;color:var(--text-main);cursor:pointer}
.topbar-right{display:flex;align-items:center;gap:12px}
.user-name{font-weight:600;font-size:.9rem}.user-role{font-size:.7rem;text-transform:uppercase;letter-spacing:.06em;color:#fff;background:linear-gradient(92deg,var(--violet2),var(--blue));padding:3px 9px;border-radius:20px}
.user-avatar{width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,var(--violet2),var(--blue));color:#fff;display:grid;place-items:center;font-weight:700}
.page-content{flex:1;overflow-y:auto}
.scroll-area{padding:26px;max-width:1400px;margin:0 auto}

/* cards + stats */
.card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:22px;box-shadow:0 20px 46px -30px rgba(40,31,17,.25)}
.card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;gap:12px}
.card-title{font-family:var(--font-head);font-size:1.05rem;font-weight:400}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:18px;margin-bottom:24px}
.stat-card{position:relative;overflow:hidden}
.stat-label{font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted);font-weight:600}
.amt-large{font-family:var(--font-num);font-size:1.7rem;font-weight:700;margin-top:8px}
.stat-card .ic{position:absolute;right:16px;top:16px;font-size:1.4rem;opacity:.16}
.border-primary{border-top:3px solid var(--violet)}.border-success{border-top:3px solid var(--success)}
.border-danger{border-top:3px solid var(--danger)}.border-blue{border-top:3px solid var(--blue)}
.text-success{color:var(--success)}.text-danger{color:var(--danger)}.text-muted{color:var(--text-muted)}
.row{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:18px}

/* tables */
.table-responsive{overflow-x:auto}
.table{width:100%;border-collapse:collapse;font-size:.9rem}
.table th{text-align:left;font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);font-weight:700;padding:11px 12px;border-bottom:2px solid var(--border)}
.table td{padding:11px 12px;border-bottom:1px solid var(--border)}
.table tbody tr.cursor-pointer{cursor:pointer;transition:background .15s}
.table tbody tr.cursor-pointer:hover{background:rgba(154,123,46,.05)}
.text-end{text-align:right}
.badge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:20px;font-size:.72rem;font-weight:700;background:rgba(154,123,46,.12);color:var(--violet)}

/* buttons */
.btn{display:inline-flex;align-items:center;gap:8px;padding:9px 17px;border-radius:11px;border:1px solid transparent;font-weight:600;font-size:.9rem;font-family:var(--font-ui);cursor:pointer;transition:transform .15s var(--ease),filter .15s}
.btn:hover{transform:translateY(-1px)}
.btn-sm{padding:7px 13px;font-size:.82rem}
.btn-primary{background:var(--ink);color:#f4ead4;border-color:var(--ink);box-shadow:0 12px 24px -14px rgba(27,23,18,.75);letter-spacing:.01em}
.btn-primary:hover{background:#2a2317;box-shadow:0 14px 28px -12px rgba(27,23,18,.8)}
.btn-outline-primary{border-color:var(--border);color:#6f5a1f;background:#fff}
.btn-outline-primary:hover{border-color:var(--gold);background:rgba(154,123,46,.08);color:#5f4c18}

/* forms */
.form-label{display:block;font-size:.78rem;font-weight:600;color:var(--text-muted);margin-bottom:6px}
input,select,textarea{width:100%;padding:10px 13px;border:1px solid var(--border);border-radius:11px;font-family:var(--font-ui);font-size:.92rem;background:#fff;color:var(--text-main);transition:border-color .18s,box-shadow .18s}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--violet2);box-shadow:0 0 0 4px rgba(154,123,46,.14)}

/* toasts */
#toast-container{position:fixed;top:20px;right:20px;z-index:3000;display:flex;flex-direction:column;gap:10px}
.toast-message{background:rgba(255,255,255,.96);backdrop-filter:blur(12px);padding:13px 18px;border-radius:13px;box-shadow:0 20px 46px -18px rgba(40,31,17,.45);border:1px solid var(--border);border-left:4px solid var(--violet2);display:flex;align-items:center;gap:11px;font-weight:600;font-size:.9rem;cursor:pointer;animation:toastIn .35s var(--ease)}
.toast-message.success{border-left-color:var(--success)}.toast-message.success i{color:var(--success)}
.toast-message.error{border-left-color:var(--danger)}.toast-message.error i{color:var(--danger)}
@keyframes toastIn{from{opacity:0;transform:translateX(30px)}to{opacity:1;transform:none}}
@keyframes slideOut{to{opacity:0;transform:translateX(30px)}}

/* login */
.login-body{background:var(--bg-sidebar);min-height:100vh;display:flex;align-items:flex-start;justify-content:center;position:relative;overflow-x:hidden;overflow-y:auto;padding:max(24px,calc((100vh - 540px) / 2)) 16px 80px}
.aurora{position:absolute;inset:0;pointer-events:none}
.aurora::before,.aurora::after{content:"";position:absolute;border-radius:50%;filter:blur(90px);opacity:.55}
.aurora::before{width:55vw;height:55vw;left:-10vw;top:-18vw;background:radial-gradient(circle,rgba(154,123,46,.7),transparent 62%)}
.aurora::after{width:48vw;height:48vw;right:-8vw;bottom:-14vw;background:radial-gradient(circle,rgba(154,123,46,.35),transparent 60%)}
.login-card{position:relative;z-index:2;background:linear-gradient(160deg,rgba(255,255,255,.09),rgba(255,255,255,.03));backdrop-filter:blur(20px) saturate(1.3);padding:42px 38px;border-radius:22px;box-shadow:0 40px 90px -30px rgba(0,0,0,.7);width:100%;max-width:410px;text-align:center;border:1px solid rgba(255,255,255,.12)}
.brand-mark{width:54px;height:54px;margin:0 auto 18px;border-radius:16px;background:linear-gradient(135deg,var(--violet2),var(--blue));display:grid;place-items:center;box-shadow:0 14px 34px -12px rgba(154,123,46,1)}
.brand-mark svg{width:28px;height:28px}
.login-title{font-family:var(--font-head);font-size:2rem;color:#fff;margin-bottom:4px}
.login-title b{background:linear-gradient(100deg,#e9dcc2,var(--violet2) 45%,var(--mint));-webkit-background-clip:text;background-clip:text;color:transparent}
.login-sub{color:#b8a988;font-size:.76rem;text-transform:uppercase;letter-spacing:.16em;font-weight:600;margin-bottom:26px}
.login-card .lb{display:block;text-align:left;font-size:.72rem;font-weight:700;color:#e9dcc2;margin-bottom:8px;letter-spacing:.06em;text-transform:uppercase}
.login-card input{background:rgba(255,255,255,.06);border:1.5px solid rgba(255,255,255,.14);color:#fff}
.login-card input::placeholder{color:#9a8b6f}
.login-btn{width:100%;padding:13px;border-radius:12px;background:linear-gradient(92deg,var(--violet2),var(--blue));color:#fff;border:none;font-weight:600;font-size:1rem;margin-top:22px;cursor:pointer;box-shadow:0 14px 30px -12px rgba(154,123,46,1)}
.login-btn:hover{filter:brightness(1.08)}

@media screen and (max-width:900px){
  .sidebar{position:fixed;height:100%;transform:translateX(-100%)}
  .sidebar.active{transform:none}
  .menu-btn{display:block}
  .scroll-area{padding:16px}
}

/* M2: modals, pills, timeline, key-value, layout utils */
.d-flex{display:flex}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
/* Equal tracks, always. A grid item refuses to shrink below its content
   unless told to, so one wide table used to blow its column out and shove
   the next card off the page. */
.form-grid>*{min-width:0}
.form-grid>.card{margin-bottom:0}
.card,.stat-card{min-width:0}
.card .table-responsive{max-width:100%}
.filter-bar{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
.filter-bar>div{min-width:120px}
.modal-overlay{position:fixed;inset:0;background:rgba(30,22,12,.55);backdrop-filter:blur(6px);z-index:2000;display:none;align-items:flex-start;justify-content:center;padding:20px;overflow-y:auto;-webkit-overflow-scrolling:touch}
.modal-overlay.open{display:flex}
.modal{background:var(--bg-card);border-radius:var(--radius);width:100%;max-width:520px;padding:24px;box-shadow:0 40px 90px -30px rgba(0,0,0,.5);max-height:92vh;max-height:max(320px,calc(100dvh - 40px));overflow-y:auto;margin:auto;animation:toastIn .28s var(--ease)}
.modal-title{font-family:var(--font-head);font-size:1.2rem;font-weight:400;margin-bottom:16px}
.modal-body{margin-bottom:18px}
.modal-footer{display:flex;justify-content:flex-end;gap:10px}
textarea{resize:vertical;font-family:var(--font-ui)}
.pill{display:inline-block;padding:3px 11px;border-radius:20px;font-size:.72rem;font-weight:700}
.st-lead{background:rgba(138,106,31,.14);color:var(--blue)}
.st-follow{background:rgba(229,163,61,.16);color:#b9791b}
.st-booked{background:rgba(154,123,46,.15);color:var(--success)}
.st-dead{background:rgba(176,64,44,.13);color:var(--danger)}
.kv{width:100%;border-collapse:collapse;font-size:.9rem}
.kv td{padding:7px 0;border-bottom:1px solid var(--border);vertical-align:top}
.kv td:first-child{color:var(--text-muted);font-weight:600;width:38%;font-size:.82rem}
.timeline{display:flex;flex-direction:column;gap:14px}
.tl-item{display:flex;gap:12px}
.tl-dot{width:12px;height:12px;border-radius:50%;margin-top:5px;flex-shrink:0;background:var(--violet2)}
.tl-dot.st-lead{background:var(--blue)}.tl-dot.st-follow{background:var(--warning)}.tl-dot.st-booked{background:var(--success)}.tl-dot.st-dead{background:var(--danger)}

/* M3: quote builder line grids */
.line-head, .line-row { display:grid; gap:8px; align-items:center; }
.line-head { font-size:.66rem; text-transform:uppercase; letter-spacing:.04em; padding:0 2px 6px; }
.line-row { margin-bottom:8px; }
.line-row input { padding:8px 10px; font-size:.85rem; }
.flight-grid { grid-template-columns:1.3fr .8fr .8fr .55fr .8fr .8fr .9fr .9fr 36px; }
.hotel-grid { grid-template-columns:1.6fr .7fr .9fr .7fr 1.1fr 1.1fr 1fr 36px; }
.transport-grid { grid-template-columns:.95fr 1.5fr .95fr .7fr .9fr .9fr .5fr .8fr 34px; } /* Car | Route | Date | Time | From | To | Pax | Fare | x */
.visa-grid { grid-template-columns:1.6fr .7fr 1fr 34px; }
.price-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:30px; align-items:start; }
/* stopover / next-day note under a flight row in the builder */
.seg-note { grid-column:1/-1; font-size:.74rem; font-weight:600; color:#8a6412; background:rgba(177,128,29,.09); border:1px solid rgba(177,128,29,.22); border-radius:8px; padding:4px 10px; width:fit-content; margin-top:2px; }
.seg-note i { font-size:.68rem; margin-right:4px; }
/* Easy-PNR-style flight itinerary table: logo | Date | Airline | Flight No | Cabin | Depart | From | Arrive | At | Duration | Transit — roomy columns, gold header, zebra */
.itin-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--border); border-radius:14px; background:#fff; box-shadow:0 1px 0 rgba(255,255,255,.6) inset, 0 14px 34px -26px rgba(122,86,20,.35); }
.flight-tbl { width:100%; border-collapse:collapse; font-size:.86rem; font-variant-numeric:tabular-nums; }
.flight-tbl th { white-space:nowrap; text-align:left; font-size:.66rem; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); font-weight:800; padding:12px 16px; background:linear-gradient(180deg,#f7efdc,#f1e7cf); border-bottom:2px solid rgba(154,123,46,.35); }
.flight-tbl td { vertical-align:middle; padding:12px 16px; border-bottom:1px solid var(--border); }
.flight-tbl tbody tr:nth-child(even) td { background:rgba(202,164,81,.05); }
.flight-tbl tbody tr:hover td { background:rgba(202,164,81,.1); }
.flight-tbl .fx-logo { width:54px; padding-right:6px; }
.flight-tbl .fx-logo img { height:24px; width:auto; max-width:46px; object-fit:contain; border-radius:5px; background:#fff; padding:1px 3px; }
.flight-tbl .fx-code { font-family:var(--font-num); font-size:.78rem; font-weight:700; color:var(--text-muted); }
.flight-tbl .fx-date { white-space:nowrap; font-weight:600; }
.flight-tbl .fx-airline { font-weight:700; min-width:98px; }
.flight-tbl .fx-no strong { font-family:var(--font-num); font-size:.9rem; }
.flight-tbl .fx-no .fx-cls { margin-left:5px; color:var(--text-muted); font-family:var(--font-num); font-size:.82rem; }
.flight-tbl .fx-cabin { color:var(--text-main); }
.flight-tbl .fx-time { font-family:var(--font-num); font-weight:700; white-space:nowrap; }
.flight-tbl .fx-apt { font-size:.83rem; max-width:190px; }
.flight-tbl .fx-dur { font-family:var(--font-num); white-space:nowrap; color:#6f5a1f; font-weight:600; }
.flight-tbl .fx-note { font-size:.72rem; font-weight:600; color:var(--gold-dark); white-space:nowrap; margin-top:2px; }
/* journey grouping header (Easy PNR style): numbered badge + "Journey N · MAN → IST → MED" + date pill */
.itin-journey { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0 0 11px; }
.itin-wrap + .itin-journey { margin-top:24px; }
.itin-jnum { display:inline-grid; place-items:center; width:27px; height:27px; border-radius:9px; background:linear-gradient(140deg,var(--gold2,#caa451),var(--gold,#9a7b2e)); color:#2a2015; font-family:var(--font-num); font-size:.78rem; font-weight:800; box-shadow:0 1px 0 rgba(255,255,255,.4) inset, 0 8px 18px -12px rgba(154,123,46,.7); }
.itin-jroute { font-family:var(--font-head); font-weight:800; font-size:1rem; letter-spacing:-.01em; color:var(--text-main); }
.itin-jsep { color:var(--gold,#9a7b2e); margin:0 3px; }
.itin-jcodes { font-family:var(--font-num); color:var(--gold,#9a7b2e); font-weight:800; letter-spacing:.02em; }
.itin-jdate { font-family:var(--font-num); font-size:.72rem; font-weight:700; color:var(--text-muted); background:#fff; border:1px solid var(--border); border-radius:999px; padding:4px 12px; white-space:nowrap; }
/* mobile SCREEN: stacked cards (uses data-label on each cell). Scoped to `screen`
   so PRINT/PDF always keeps the real desktop table, even when printed from a phone. */
@media screen and (max-width:760px){
  .itin-wrap { border:0; box-shadow:none; overflow:visible; background:transparent; }
  .flight-tbl { display:block; min-width:0; width:100%; }
  .flight-tbl thead { display:none; }
  .flight-tbl tbody { display:block; }
  .flight-tbl tbody tr { display:block; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:4px 14px; margin-bottom:12px; box-shadow:0 10px 26px -20px rgba(40,31,17,.4); }
  .flight-tbl tbody tr:nth-child(even) td, .flight-tbl tbody tr:hover td { background:transparent; }
  .flight-tbl td { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-start; gap:4px 16px; border:0; border-bottom:1px solid var(--border); padding:9px 0; white-space:normal; text-align:right; overflow-wrap:anywhere; }
  .flight-tbl tbody tr td:last-child { border-bottom:0; }
  .flight-tbl td::before { content:attr(data-label); font-size:.62rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); font-weight:700; text-align:left; flex:0 0 auto; white-space:nowrap; align-self:center; }
  .flight-tbl td:empty { display:none; }
  /* logo shows as a left-aligned header at the top of each flight card (was hidden) */
  .flight-tbl .fx-logo { display:flex; justify-content:flex-start; align-items:center; width:auto; padding:10px 0 8px; border-bottom:1px solid var(--border); }
  .flight-tbl .fx-logo::before { content:none; }
  .flight-tbl .fx-logo img { height:30px; max-width:130px; max-height:34px; }
  .flight-tbl .fx-logo .fx-code { font-size:.92rem; }
  .flight-tbl .fx-apt { max-width:none; }
  .flight-tbl .fx-time, .flight-tbl .fx-date, .flight-tbl .fx-dur { white-space:normal; }
  .flight-tbl .fx-note { flex:0 0 100%; text-align:right; margin-top:0; }
  /* admin LIST tables (inquiries, bookings, payments…) stack into per-row cards on phones —
     no horizontal scroll, no cut. Cells with data-label show a label; the rest just stack. */
  .table-responsive { overflow-x:visible; }
  .table-responsive > .table { min-width:0; width:100%; }
  .table-responsive > .table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .table-responsive > .table tr { display:block; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; margin-bottom:10px; padding:4px 14px; box-shadow:0 10px 26px -20px rgba(40,31,17,.4); }
  .table-responsive > .table td { display:flex; justify-content:space-between; align-items:center; gap:14px; border:0; border-bottom:1px solid var(--border); padding:9px 0; text-align:right; white-space:normal; overflow-wrap:anywhere; width:auto !important; }
  .table-responsive > .table tr td:last-child { border-bottom:0; }
  .table-responsive > .table td::before { content:attr(data-label); font-size:.6rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); font-weight:700; text-align:left; flex:0 0 auto; }
  .table-responsive > .table td:empty { display:none; }
  .table-responsive > .table td[colspan] { justify-content:center; text-align:center; }
  .table-responsive > .table td[colspan]::before { content:none; }
}
.chk { display:inline-flex; align-items:center; gap:8px; font-size:.88rem; font-weight:600; color:var(--text-muted); cursor:pointer; width:fit-content; }

/* Arrangements: compact tappable chips + category blocks (mobile + web) */
.arr-block { padding:12px 0; border-top:1px solid var(--border); }
.arr-block:first-of-type { border-top:0; padding-top:2px; }
.arr-head { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:9px; }
.arr-head h4 { font-family:var(--font-head); font-size:.98rem; margin:0; display:flex; align-items:center; gap:8px; }
.arr-head h4 i { color:var(--violet); }
.arr-head .text-muted { font-weight:400; }
.arr-chips { display:flex; flex-wrap:wrap; gap:7px; }
.arr-chips > form { display:inline-flex; max-width:100%; min-width:0; margin:0; }
.arr-chip { display:inline-flex; align-items:center; gap:7px; padding:6px 12px; border-radius:999px; font-size:.8rem; font-weight:600; line-height:1.25; border:1px solid transparent; cursor:pointer; font-family:var(--font-ui); transition:filter .15s, transform .08s; max-width:100%; text-align:left; overflow-wrap:anywhere; }
.arr-chip.static { cursor:default; }
.arr-chip:not(.static):hover { filter:brightness(.96); }
.arr-chip:not(.static):active { transform:scale(.97); }
.arr-chip .dot { width:9px; height:9px; border-radius:50%; flex:none; box-shadow:0 0 0 2px rgba(255,255,255,.6); }
.arr-chip.on { background:rgba(154,123,46,.12); border-color:rgba(154,123,46,.32); color:#6f5a1f; }
.arr-chip.on .dot { background:#9a7b2e; }
.arr-chip.off { background:rgba(176,64,44,.07); border-color:rgba(176,64,44,.22); color:#8a3524; }
.arr-chip.off .dot { background:#b0402c; }
.arr-legs { display:flex; flex-direction:column; gap:4px; font-size:.82rem; color:var(--text-muted); margin-top:2px; }
.arr-legs .leg b { color:var(--text-main); font-weight:600; }
.chk input { width:auto; cursor:pointer; }
.airline-logo { height:24px; width:auto; max-width:46px; object-fit:contain; border-radius:5px; background:#fff; padding:1px 3px; flex:none; }
.action-icon { background:none; border:none; color:var(--danger); cursor:pointer; font-size:.9rem; padding:6px; border-radius:8px; }
.action-icon:hover { background:rgba(176,64,44,.1); }
.margin-box { margin-top:14px; background:linear-gradient(92deg,var(--violet2),var(--blue)); color:#fff; border-radius:12px; padding:14px 18px; display:flex; justify-content:space-between; align-items:center; }
.margin-box span { font-size:.72rem; text-transform:uppercase; letter-spacing:.1em; font-weight:600; opacity:.85; }
.margin-box strong { font-family:var(--font-num); font-size:1.4rem; }
@media screen and (max-width:980px){
  /* quote builder line rows become clean 2-up cards on tablet, 1-up on phone; headers hide */
  .line-head{ display:none; }
  .flight-grid,.hotel-grid,.transport-grid,.visa-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; background:var(--panel2,#faf7f0); border:1px solid var(--border); border-radius:12px; padding:12px; margin-bottom:12px; position:relative; }
  .line-row input,.line-row select{ width:100%; }
  .line-row .action-icon{ position:absolute; top:8px; right:8px; }
  .price-grid{ grid-template-columns:minmax(0,1fr); }
}
@media screen and (max-width:560px){
  .flight-grid,.hotel-grid,.transport-grid,.visa-grid{ grid-template-columns:minmax(0,1fr); }
}
/* compare-quotes matrix: shrink to fit the phone, never scroll sideways */
@media screen and (max-width:760px){
  .compare-wrap{ overflow-x:visible !important; }
  .compare-table{ min-width:0 !important; width:100%; table-layout:fixed; font-size:.74rem; }
  .compare-table th,.compare-table td{ min-width:0 !important; padding:8px 7px; overflow-wrap:anywhere; word-break:break-word; }
  .compare-table .btn{ padding:5px 9px; font-size:.72rem; }
}

/* print / PDF documents — full-width, centred, professional (no horizontal slider) */
.doc-body { background:#efe9dd; padding:24px 16px 64px; font-family:var(--font-ui); color:var(--text-main); }
.doc-toolbar { max-width:960px; margin:0 auto 16px; display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
.doc-sheet { max-width:960px; margin:0 auto; background:#fff; border-radius:18px; box-shadow:0 34px 80px -34px rgba(40,31,17,.42); padding:48px 54px; }
.doc-head { display:flex; flex-direction:column; align-items:center; text-align:center; gap:6px; border-bottom:2px solid var(--gold,#caa451); padding-bottom:24px; }
.doc-brand { display:flex; gap:14px; align-items:center; justify-content:center; }
.doc-logo { max-height:60px; max-width:170px; object-fit:contain; }
.doc-agency { font-family:var(--font-head); font-size:1.85rem; letter-spacing:.06em; color:var(--violet); }
.doc-contact { color:var(--text-muted); font-size:.84rem; margin-top:2px; }
.doc-title-box { font-family:var(--font-head); font-size:1.05rem; letter-spacing:.16em; text-transform:uppercase; color:var(--gold-deep,#9a7b2e); margin-top:8px; padding:5px 20px; border:1px solid var(--border); border-radius:999px; }
.doc-meta { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px 20px; margin:26px 0; }
.doc-meta > div { min-width:0; }
.doc-meta .l { display:block; font-size:.66rem; text-transform:uppercase; letter-spacing:.09em; color:var(--text-muted); font-weight:700; margin-bottom:3px; }
.doc-meta b { font-size:.95rem; overflow-wrap:break-word; }
.doc-sec { font-family:var(--font-head); font-weight:500; font-size:1.14rem; margin:26px 0 10px; color:var(--violet); display:flex; align-items:center; gap:8px; }
.doc-sec::before { content:''; width:4px; height:16px; border-radius:2px; background:var(--gold,#caa451); }
.doc-table { width:100%; border-collapse:collapse; font-size:.85rem; table-layout:auto; }
.doc-table th { text-align:left; font-size:.64rem; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); border-bottom:2px solid var(--border); padding:9px 8px; white-space:nowrap; }
.doc-table td { padding:9px 8px; border-bottom:1px solid var(--border); overflow-wrap:break-word; }
.doc-table tbody tr:nth-child(even) td { background:rgba(202,164,81,.05); }
/* flight table inside a document: full width, wraps instead of sliding */
.doc-sheet .table-responsive, .doc-sheet .itin-wrap { overflow-x:visible; border:0; box-shadow:none; background:transparent; }
.doc-sheet .flight-tbl { width:100%; table-layout:auto; }
.doc-sheet .flight-tbl th, .doc-sheet .flight-tbl td { white-space:normal; word-break:normal; overflow-wrap:break-word; }
.doc-sheet .flight-tbl .fx-apt { max-width:none; }
.doc-sheet .flight-tbl .fx-airline { min-width:0; }
.doc-total { display:flex; justify-content:space-between; align-items:center; margin-top:28px; background:linear-gradient(92deg,var(--violet2),var(--blue)); color:#fff; border-radius:14px; padding:18px 24px; }
.doc-total span { font-size:.74rem; text-transform:uppercase; letter-spacing:.1em; font-weight:600; opacity:.9; }
.doc-total strong { font-family:var(--font-num); font-size:1.55rem; }
.doc-summary { width:100%; max-width:340px; margin-left:auto; margin-top:28px; border-collapse:collapse; }
.doc-summary td { padding:9px 4px; font-size:.9rem; }
.doc-summary td:last-child { text-align:right; font-family:var(--font-num); }
.doc-summary .due td { border-top:2px solid var(--text-main); font-weight:700; font-size:1.05rem; color:var(--violet); }
.doc-terms { margin-top:30px; padding-top:18px; border-top:1px solid var(--border); font-size:.74rem; color:var(--text-muted); line-height:1.55; }
.doc-terms p { margin-bottom:6px; }
.doc-terms ul { margin:6px 0 6px 18px; } .doc-terms li { margin-bottom:4px; }
/* voucher tables (hotel + transport): full-width, centred, premium gold header — replaces the old empty-right key/value layout */
.voucher-tbl { margin-top:4px; }
.voucher-tbl th { background:linear-gradient(180deg,#f7efdc,#f1e7cf); color:#6f5a1f; border-bottom:2px solid rgba(154,123,46,.35); padding:11px 14px; }
.voucher-tbl td { padding:12px 14px; vertical-align:middle; }
.voucher-tbl td .v-sub { display:block; font-size:.72rem; color:var(--text-muted); font-weight:600; margin-top:2px; }
.voucher-tbl td[data-label="Confirmation"] strong { font-family:var(--font-num); }
/* keep money / number columns tight to their content so wide tables never leave a dead gap before the amount */
.table th.text-end, .table td.text-end, .doc-table th.text-end, .doc-table td.text-end { white-space:nowrap; width:1%; }
@media screen and (max-width:760px){
  /* vouchers stack into per-row cards on phones (uses data-label) — no horizontal scroll.
     screen-only so a phone print/PDF still uses the real voucher table. */
  .voucher-tbl thead { display:none; }
  .voucher-tbl tbody tr { display:block; border:1px solid var(--border); border-radius:12px; padding:8px 12px; margin-bottom:10px; }
  .voucher-tbl tbody tr:nth-child(even) td { background:transparent; }
  .voucher-tbl td { display:flex; justify-content:space-between; gap:14px; border:0; border-bottom:1px solid var(--border); padding:7px 0; width:auto; white-space:normal; }
  .voucher-tbl tbody tr td:last-child { border-bottom:0; }
  .voucher-tbl td::before { content:attr(data-label); font-size:.66rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); font-weight:700; }
  .voucher-tbl td .v-sub { display:inline; margin:0 0 0 6px; }
}
@media print {
  /* quote / invoice: wider portrait page (like the Easy PNR itinerary PDF) so the full-airport-name flight table fits with room to breathe */
  /* margin:0 so the browser prints NO header/footer line (page title / site URL);
     the page margins are re-created as sheet padding instead */
  @page { size: 265mm 375mm; margin: 0; }
  /* vouchers have no wide flight table, so they print on standard A4 portrait */
  @page slim { size: A4 portrait; margin: 0; }
  .doc-body { background:#fff; padding:0; }
  .doc-sheet { box-shadow:none; border-radius:0; max-width:100%; width:100%; padding:15mm 16mm; }
  .doc-slim { page: slim; padding:14mm 15mm; }
  .doc-toolbar { display:none !important; }
  .doc-total, .doc-table tbody tr:nth-child(even) td, .doc-head { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .doc-table, .flight-tbl { font-size:8pt; width:100%; }
  .doc-table td, .doc-table th, .flight-tbl td, .flight-tbl th { padding:5pt 6pt; white-space:normal; }
  .flight-tbl .fx-logo img { height:12pt; max-width:42pt; }
  .flight-tbl tbody tr:nth-child(even) td { background:#faf6ec !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .doc-table tr, .flight-tbl tr { break-inside:avoid; }
  .doc-sec, .doc-total { break-after:avoid; }
}
@media screen and (max-width:760px){
  /* screen-only phone padding/overflow for the document view; print keeps its @page sheet padding */
  .doc-sheet { padding:28px 20px; }
  .doc-meta { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .doc-sheet .table-responsive, .doc-sheet .itin-wrap { overflow-x:auto; }
  .doc-sheet .flight-tbl { table-layout:auto; min-width:0; }
}

.login-link{display:block;margin-top:16px;color:#b8a988;font-size:.85rem;text-decoration:none}
.login-link:hover{color:#fff}

/* M5: polish — topbar search, charts, reveal, upcoming, refinements */
.topbar-search{display:flex;align-items:center;gap:8px;background:#f3eee3;border:1px solid var(--border);border-radius:11px;padding:7px 12px;transition:box-shadow .2s,border-color .2s}
.topbar-search:focus-within{border-color:var(--violet2);box-shadow:0 0 0 4px rgba(154,123,46,.12);background:#fff}
.topbar-search i{color:var(--text-muted);font-size:.82rem}
.topbar-search input{border:none;background:transparent;padding:0;width:210px;font-size:.86rem}
.topbar-search input:focus{box-shadow:none}
.topbar-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;color:var(--text-muted);border:1px solid var(--border);transition:all .18s}
.topbar-icon:hover{color:var(--violet);border-color:var(--violet2);background:rgba(154,123,46,.06)}
.user-meta{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2}
.user-role{font-size:.62rem}
@media screen and (max-width:760px){.topbar-search{display:none}.user-meta{display:none}}
@media screen and (min-width:901px){.topbar-search+.topbar-icon{display:none}}
.mini-link{font-size:.8rem;color:var(--violet);font-weight:600}
.mini-link:hover{text-decoration:underline}
.card{transition:box-shadow .25s var(--ease),transform .25s var(--ease)}
.stat-card:hover{transform:translateY(-3px);box-shadow:0 26px 50px -28px rgba(40,31,17,.4)}
.nav-item{position:relative}
.btn-danger{background:var(--danger);color:#fff;border-color:var(--danger);box-shadow:0 12px 24px -14px rgba(176,64,44,.7)}
.btn-danger:hover{background:#9a3524;border-color:#9a3524;color:#fff}
.btn-outline-danger{border:1px solid var(--border);color:var(--danger);background:#fff}
.btn-outline-danger:hover{border-color:var(--danger);background:rgba(176,64,44,.07)}

/* reveal-on-load */
.reveal{opacity:0;transform:translateY(10px);animation:revealIn .5s var(--ease) forwards}
.stats-grid .reveal:nth-child(1){animation-delay:.02s}.stats-grid .reveal:nth-child(2){animation-delay:.08s}
.stats-grid .reveal:nth-child(3){animation-delay:.14s}.stats-grid .reveal:nth-child(4){animation-delay:.2s}
@keyframes revealIn{to{opacity:1;transform:none}}

/* bar chart */
.chart-legend{display:flex;gap:14px;font-size:.72rem;color:var(--text-muted)}
.chart-legend .lg{display:flex;align-items:center;gap:6px}
.chart-legend .lg::before{content:"";width:10px;height:10px;border-radius:3px;display:inline-block}
.chart-legend span{display:inline-flex;align-items:center;gap:6px}
.chart-legend .dot{width:10px;height:10px;border-radius:50%;display:inline-block;flex:none}
.lg-sales::before{background:linear-gradient(180deg,var(--violet2),var(--blue))}
.lg-margin::before{background:var(--mint)}
.bar-chart{display:flex;align-items:flex-end;gap:4px;height:180px;padding-top:10px}
.bc-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%}
.bc-bars{flex:1;display:flex;align-items:flex-end;gap:5px;width:100%;justify-content:center}
.bc-bar{width:26%;border-radius:6px 6px 0 0;min-height:3px;transition:height .6s var(--ease)}
.bc-sales{background:linear-gradient(180deg,var(--violet2),var(--blue))}
.bc-margin{background:var(--mint)}
.bc-label{font-size:.7rem;color:var(--text-muted);margin-top:8px;font-weight:600}

/* upcoming travel rows */
.up-row{display:flex;align-items:center;gap:12px;padding:10px 8px;border-radius:11px;transition:background .16s}
.up-row:hover{background:rgba(154,123,46,.06)}
.up-row+.up-row{border-top:1px solid var(--border)}
.up-date{width:44px;height:44px;border-radius:11px;background:linear-gradient(135deg,var(--violet2),var(--blue));color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;flex-shrink:0}
.up-date span{font-family:var(--font-num);font-weight:700;font-size:1rem;line-height:1}
.up-date small{font-size:.6rem;text-transform:uppercase;opacity:.85}

/* ============ M6: panel refresh, dark mode, mobile ============ */
/* brand lockup */
.sidebar-header{display:flex;align-items:center;justify-content:space-between}
.brand-lockup{display:flex;align-items:center;gap:12px}
.brand-lockup .brand-mark{width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,var(--violet2),var(--blue));display:grid;place-items:center;color:#fff;font-size:1.05rem;box-shadow:0 10px 24px -10px rgba(154,123,46,.9);flex-shrink:0}
.sidebar-close{display:none;background:none;border:none;color:#b8a988;font-size:1.2rem;cursor:pointer;padding:4px}
.side-user{display:flex;align-items:center;gap:10px;padding:10px 12px;margin-bottom:8px;border-radius:12px;background:rgba(255,255,255,.04)}
.side-user .su-name{font-size:.84rem;font-weight:600;color:#efe6d4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-user .su-role{font-size:.68rem;color:#b8a988;text-transform:uppercase;letter-spacing:.05em}
.user-avatar.sm{width:34px;height:34px;font-size:.9rem;border-radius:10px}
.nav-item.active .nav-icon{filter:drop-shadow(0 2px 6px rgba(154,123,46,.6))}

/* mobile drawer overlay */
.sidebar-overlay{position:fixed;inset:0;background:rgba(30,22,12,.5);backdrop-filter:blur(2px);z-index:60;opacity:0;visibility:hidden;transition:opacity .3s}
.sidebar-overlay.active{opacity:1;visibility:visible}

/* mobile bottom nav */
.bottom-nav{display:none;position:fixed;bottom:0;left:0;right:0;z-index:55;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-top:1px solid var(--border);padding:6px 4px calc(6px + env(safe-area-inset-bottom));justify-content:space-around}
.bn-item{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 2px;color:var(--text-muted);font-size:.64rem;font-weight:600;border-radius:10px}
.bn-item i{font-size:1.1rem}
.bn-item.active{color:var(--violet)}
.bn-item.active i{transform:translateY(-1px)}

/* ---- dark mode ---- */
[data-theme="dark"]{--bg:#14110c;--bg-card:#211b12;--text-main:#efe7d6;--text-muted:#a89a80;--border:rgba(255,255,255,.09)}
[data-theme="dark"] body{background:var(--bg)}
[data-theme="dark"] .topbar{background:rgba(26,21,14,.9)}
[data-theme="dark"] input,[data-theme="dark"] select,[data-theme="dark"] textarea{background:#1a150f;color:var(--text-main);border-color:var(--border)}
[data-theme="dark"] .btn-outline-primary,[data-theme="dark"] .btn-outline-danger{background:transparent}
[data-theme="dark"] .topbar-search{background:#1a150f}
[data-theme="dark"] .topbar-icon{background:transparent;border-color:var(--border);color:var(--text-muted)}
[data-theme="dark"] .toast-message{background:rgba(29,23,16,.97)}
[data-theme="dark"] .table tbody tr.cursor-pointer:hover{background:rgba(154,123,46,.1)}
[data-theme="dark"] .up-row:hover{background:rgba(154,123,46,.1)}
[data-theme="dark"] .badge{background:rgba(154,123,46,.18)}
[data-theme="dark"] .side-user{background:rgba(255,255,255,.05)}
[data-theme="dark"] .doc-body,[data-theme="dark"].doc-body{background:#14110c}
[data-theme="dark"] .margin-box strong{color:#fff}

/* ---- responsive ---- */
@media screen and (max-width:900px){
  .sidebar{position:fixed;top:0;left:0;height:100%;transform:translateX(-100%);box-shadow:0 0 60px rgba(0,0,0,.5)}
  .sidebar.active{transform:none}
  .sidebar-close{display:block}
  .menu-btn{display:block}
  .scroll-area{padding:16px}
  .row{grid-template-columns:1fr !important}
  .topbar-search{display:none}
  body.nav-open{overflow:hidden}
}
@media screen and (max-width:760px){
  .bottom-nav{display:flex}
  .page-content{padding-bottom:72px}
  .user-meta,.topbar-icon[title="Settings"]{display:none}
  .bar-chart{height:150px}
}
@media screen and (max-width:440px){
  .stats-grid{grid-template-columns:1fr}
  .filter-bar>div{min-width:100%}
}

/* leaderboard */
.rank{display:inline-grid;place-items:center;width:26px;height:26px;font-size:.82rem;font-weight:700;color:var(--text-muted)}
.rank-top{font-size:1.1rem}
.lb-bar{background:rgba(154,123,46,.12);border-radius:6px;height:8px;overflow:hidden}
.lb-fill{height:100%;background:linear-gradient(90deg,var(--violet2),var(--blue));border-radius:6px;transition:width .6s var(--ease)}

/* tags, bulk bar, activity, reference */
.tag{display:inline-block;margin:4px 4px 0 0;padding:2px 9px;border-radius:20px;font-size:.68rem;font-weight:600;background:rgba(154,123,46,.16);color:#9a7b2e}
[data-theme="dark"] .tag{background:rgba(154,123,46,.18);color:var(--mint)}
.bulk-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--bg-card);border:1px solid var(--border);border-radius:12px;padding:12px 16px;margin-bottom:14px;box-shadow:0 12px 30px -18px rgba(40,31,17,.4)}
.ref-add{display:flex;gap:8px;padding:0 22px 14px;align-items:center}
.act-ic{width:32px;height:32px;border-radius:10px;background:rgba(154,123,46,.12);color:var(--violet);display:grid;place-items:center;font-size:.8rem;flex-shrink:0}

/* modal explicit close button (no accidental backdrop close) */
.modal{position:relative}
.modal-x{position:absolute;top:12px;right:12px;width:32px;height:32px;border-radius:9px;border:none;background:rgba(154,123,46,.09);color:var(--text-muted);cursor:pointer;font-size:.95rem;display:grid;place-items:center;transition:all .16s}
.modal-x:hover{background:var(--danger);color:#fff}
.brand-name-caps{text-transform:uppercase;letter-spacing:.02em}
/* travelled/upcoming rows */
.up-row.past .up-date{background:linear-gradient(135deg,#a89a80,#9a8b6f)}

/* vouchers */
.doc-emergency{margin-top:24px;padding:14px 18px;border-radius:12px;background:rgba(154,123,46,.07);border:1px solid rgba(154,123,46,.2)}
.doc-emergency .l{display:block;font-size:.68rem;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);font-weight:700;margin-bottom:4px}
.doc-emergency strong{display:block;font-family:var(--font-head);color:var(--violet);font-size:1.05rem}

/* ============ "Maison" luxury polish ============ */
body{background:radial-gradient(1100px 460px at 100% -12%,rgba(202,164,81,.07),transparent 60%),var(--bg)}
.brand-title,.page-title,.card-title,.modal-title,.doc-agency,.doc-sec,.doc-title-box,.login-title,.login-title b{letter-spacing:-.015em;font-weight:600}
.amt-large{letter-spacing:-.01em}
/* gold hairline under document section headings */
.doc-sec{padding-bottom:6px;border-bottom:1px solid rgba(154,123,46,.28)}
/* warm sidebar keylines + gold glow tamed */
.sidebar{border-right:1px solid rgba(202,164,81,.10)}
.sidebar::before{opacity:.55}
.sidebar-header{border-bottom:1px solid rgba(202,164,81,.14)}
.brand-subtitle,.su-role,.login-sub{color:#b7a888}
.brand-mark{background:var(--grad-gold)!important;color:#231a08!important}
.brand-mark i,.brand-mark svg{color:#231a08}
/* gold focus ring */
input:focus,select:focus,textarea:focus{border-color:var(--gold2);box-shadow:0 0 0 3px rgba(202,164,81,.20)}
.table th,.doc-table th{letter-spacing:.08em}
/* warm luxury status pills */
.st-lead{background:rgba(138,122,92,.14);color:#8a7a5c}
.st-follow{background:rgba(177,128,29,.16);color:#8a6412}
.badge{background:rgba(154,123,46,.13);color:#6f5a1f}
.tag{background:rgba(154,123,46,.13);color:#9a7b2e}
/* login: gold sign-in + gilded title */
.login-title b{background:linear-gradient(100deg,#efdcae,#caa451 55%,#9a6f1c);-webkit-background-clip:text;background-clip:text;color:transparent}
.login-btn{background:var(--grad-gold);color:#231a08;box-shadow:0 14px 30px -12px rgba(202,164,81,.8)}
.login-card .lb{color:#d9ccb1}
/* dark mode: warm espresso + gold */
[data-theme="dark"]{--bg:#14110c;--bg-card:#211b12;--text-main:#efe7d6;--text-muted:#a89a80;--border:rgba(202,164,81,.14);--surface:#1a150f;--surface-2:#1d1811;--gold-dark:#d9b96a}
[data-theme="dark"] .btn-primary{background:var(--grad-gold);color:#231a08;border-color:transparent}
[data-theme="dark"] .btn-outline-primary{color:var(--gold2);border-color:var(--border)}
[data-theme="dark"] .badge{background:rgba(202,164,81,.18);color:var(--gold2)}
[data-theme="dark"] .nav-item.active{color:#231c0c}

/* ============ Maison — spacing, rhythm & calm (eye-soothing) ============ */
body{line-height:1.55;background:radial-gradient(1200px 520px at 100% -18%,rgba(202,164,81,.045),transparent 62%),var(--bg)}
/* light mode only: must never beat the [data-theme="dark"] override above (same specificity, later wins) */
:root:not([data-theme="dark"]){--text-main:#2a2318}
/* full-width page frame — use the whole screen, evenly guttered */
.scroll-area{padding:30px 40px;max-width:none;width:100%;margin:0}
.topbar{height:72px;padding:16px 40px}
/* calmer, airier cards */
.card{padding:26px 28px;border-radius:16px;box-shadow:0 16px 42px -30px rgba(40,31,17,.18);border-color:var(--border)}
.card-header{margin-bottom:20px}
/* Cards STACKED in normal flow get breathing room between them. Cards laid
   out by a grid do not: the grid's own gap already spaces them, and a stray
   margin-top on every card after the first pushed each one 20px down inside
   its own track, which is what made every row of cards look misaligned. The
   exemption is listed per container because CSS cannot ask "are you a grid
   item?"; add any new grid container here. */
.card + .card{margin-top:20px}
.row>.card+.card,
.price-grid>.card+.card,
.form-grid>.card+.card,
.stats-grid>.card+.card,
.grid>.card+.card{margin-top:0}
.stat-card{padding:24px 26px}
.stats-grid{gap:20px;margin-bottom:30px;grid-template-columns:repeat(auto-fit,minmax(min(100%,234px),1fr))}
.row{gap:20px}
/* refined type hierarchy */
.page-title{font-size:1.5rem;font-weight:600;line-height:1.2}
.card-title{font-size:1.14rem;line-height:1.25}
.modal-title{font-size:1.28rem;margin-bottom:20px}
.amt-large{font-size:1.74rem;margin-top:10px}
.stat-label{letter-spacing:.12em;font-size:.7rem}
/* airier, quieter tables */
.table{font-size:.92rem}
.table th{padding:13px 15px;letter-spacing:.09em}
.table td{padding:13px 15px}
.kv td{padding:9px 0}
/* softer controls */
input,select,textarea{padding:11px 14px;border-radius:12px}
.btn{padding:10px 18px;border-radius:12px}
.btn-sm{padding:8px 14px}
.form-grid{gap:14px}
.filter-bar{gap:14px}
/* calmer nav rhythm */
.nav-section{padding:16px 14px}
.nav-item{padding:11px 14px;margin-bottom:2px}
.nav-label{margin:18px 12px 8px}
/* modals + documents get room to breathe */
.modal{padding:28px 30px;border-radius:18px}
.doc-sheet{padding:52px 56px;border-radius:18px}
.doc-meta{gap:16px;margin:26px 0}
/* mobile re-tighten so spacing stays balanced on small screens */
@media screen and (max-width:820px){
  .scroll-area{padding:18px}
  .topbar{height:62px;padding:14px 18px}
  .card{padding:20px}
  .stat-card{padding:20px}
  .stats-grid{gap:14px;margin-bottom:22px}
  .modal{padding:22px 20px}
  .doc-sheet{padding:26px 22px}
  .table th,.table td{padding:11px 12px}
}

/* M25: equal-height cards in all grids */
.row{align-items:stretch}
.row>.card{height:100%;display:flex;flex-direction:column}
.row>.card>.table-responsive,.row>.card>.kv{flex:1}
.kpis,.cards{align-items:stretch}
.kpis>*,.cards>*{height:100%}

/* cross-site credit link — fixed footer so it never disturbs the centered card */
.login-body .login-credit{position:fixed;left:0;right:0;bottom:16px;margin:0;text-align:center;z-index:2;font-size:.8rem;color:#8a7d69}
.doc-body .login-credit{text-align:center;margin:26px 0 18px;font-size:.8rem;color:#8a7d69}
.login-credit a{color:#caa451;font-weight:600;text-decoration:none;border-bottom:1px solid rgba(202,164,81,.4)}
.login-credit a:hover{color:#e8c778}

/* wider document so the Easy-PNR flight itinerary table (logo + 10 cols) fits; the flight-tbl styling + mobile cards live in the itinerary block near the top */
.doc-sheet{max-width:1180px}

/* ============================================================
   M27 — PREMIUM POLISH PASS (typography, depth, tables, PDF docs)
   CSS-only, brand palette preserved (espresso + gold + ivory).
   ============================================================ */

/* 1. Tabular figures for all money / times / counts so columns align */
.amt-large,.margin-box strong,.doc-total strong,.doc-summary td:last-child,
.fx-time,.fx-dur,.fx-no strong,.up-date span,.kv td,.table td.text-end,
.doc-table td,.st-booked,.lb-fill{font-variant-numeric:tabular-nums}
.table,.doc-table,.doc-summary{font-variant-numeric:tabular-nums}

/* 2. Balanced headline wrapping — no lonely last words */
.page-title,.card-title,.modal-title,.doc-agency,.doc-sec,.login-title,
.doc-title-box,.stat-label,.doc-emergency strong{text-wrap:balance}

/* 3. Layered, softer card elevation + gold hairline top-lit edge */
.card{box-shadow:0 1px 2px rgba(40,31,17,.04),0 10px 24px -18px rgba(40,31,17,.22),0 30px 60px -46px rgba(40,31,17,.20)}
.stat-card{border-top:none}
.stat-card::after{content:"";position:absolute;inset:0 0 auto 0;height:3px;border-radius:16px 16px 0 0;background:var(--grad-gold);opacity:.9}
.stat-card.border-success::after{background:linear-gradient(100deg,#b7923f,#7d6320)}
.stat-card.border-danger::after{background:linear-gradient(100deg,#c66a55,#9a3524)}

/* 4. Primary button — subtle top sheen + gold keyline for a tactile, gilded feel */
.btn-primary{background:linear-gradient(180deg,#2a2317,var(--ink));position:relative;box-shadow:0 1px 0 rgba(255,255,255,.06) inset,0 12px 24px -14px rgba(27,23,18,.75),0 0 0 1px rgba(202,164,81,.14)}
.btn-primary:hover{background:linear-gradient(180deg,#332a1b,#221c12)}
[data-theme="dark"] .btn-primary:hover{background:var(--grad-gold);filter:brightness(1.07)}

/* 5. Tactile press state on all buttons + accessible gold focus ring */
.btn:active{transform:translateY(0) scale(.985)}
.btn:focus-visible,.login-btn:focus-visible,.topbar-icon:focus-visible,
.nav-item:focus-visible,.modal-x:focus-visible,.action-icon:focus-visible{
  outline:none;box-shadow:0 0 0 3px var(--bg),0 0 0 5px rgba(202,164,81,.55)}
[data-theme="dark"] .btn:focus-visible{box-shadow:0 0 0 3px var(--bg-card),0 0 0 5px rgba(202,164,81,.6)}

/* 6. Refined tables — zebra striping + gentle row hover on every table */
.table tbody tr:nth-child(even) td{background:rgba(202,164,81,.035)}
.table tbody tr{transition:background .15s var(--ease)}
.table tbody tr:hover td{background:rgba(154,123,46,.06)}
[data-theme="dark"] .table tbody tr:nth-child(even) td{background:rgba(202,164,81,.05)}
[data-theme="dark"] .table tbody tr:hover td{background:rgba(202,164,81,.09)}
/* header contrast + rounded table container feel */
.table thead th{background:rgba(202,164,81,.05);position:sticky;top:0}
[data-theme="dark"] .table thead th{background:rgba(202,164,81,.06)}

/* 7. Badges & pills — hairline keyline + crisper weight */
.badge,.pill,.tag{box-shadow:inset 0 0 0 1px rgba(154,123,46,.14)}
.badge{padding:4px 11px}

/* 8. Inputs — inset depth so fields read as recessed, calmer default border */
input,select,textarea{box-shadow:inset 0 1px 2px rgba(40,31,17,.04)}
[data-theme="dark"] input,[data-theme="dark"] select,[data-theme="dark"] textarea{box-shadow:inset 0 1px 2px rgba(0,0,0,.25)}

/* 9. Sidebar active item — gold keyline rail for a premium indicator */
.nav-item.active::before{content:"";position:absolute;left:4px;top:8px;bottom:8px;width:3px;border-radius:3px;background:#231a08;opacity:.55}

/* 10. Toasts — layered shadow already good; add crisp gold accent bar sheen */
.toast-message{box-shadow:0 2px 6px rgba(40,31,17,.10),0 24px 50px -22px rgba(40,31,17,.5)}

/* ---------- PDF / PRINT DOCUMENTS — true premium ---------- */

/* 11. Masthead — double gold rule (thick + hairline) under the header */
.doc-head{border-bottom:2px solid var(--gold,#caa451);box-shadow:0 3px 0 rgba(202,164,81,.28)}
.doc-agency{background:linear-gradient(100deg,#8a6f1c,#caa451 55%,#9a7b2e);-webkit-background-clip:text;background-clip:text;color:transparent}

/* 12. Title chip — gilded pill with soft tint */
.doc-title-box{background:linear-gradient(180deg,rgba(202,164,81,.10),rgba(202,164,81,.04));border-color:rgba(202,164,81,.4);box-shadow:inset 0 0 0 1px rgba(255,255,255,.5)}

/* 13. Meta block — tint panels instead of loose cells */
.doc-meta{background:linear-gradient(180deg,rgba(202,164,81,.05),transparent);border:1px solid rgba(202,164,81,.16);border-radius:14px;padding:18px 22px}

/* 14. Section header — gold tick + hairline already; add elegant flourish rule that fills the row */
.doc-sec::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,rgba(202,164,81,.4),transparent);margin-left:4px}

/* 15. Doc tables — refined header band, softer zebra, rounded clipped container */
.doc-table{border-radius:12px;overflow:hidden}
.doc-table thead th{background:rgba(202,164,81,.08);border-bottom:1px solid rgba(202,164,81,.3)}
.doc-table tbody tr:nth-child(even) td{background:rgba(202,164,81,.045)}
.doc-table tbody tr:last-child td{border-bottom:none}

/* 16. Totals bar — richer gilded gradient + layered depth + inset sheen */
.doc-total,.margin-box{background:linear-gradient(105deg,#8a6f1c,#caa451 55%,#a5842c);box-shadow:0 14px 30px -16px rgba(154,123,46,.6),inset 0 1px 0 rgba(255,255,255,.22)}
.doc-total strong{text-shadow:0 1px 1px rgba(40,31,17,.25)}

/* 17. Summary block — premium framed panel with due-line emphasis */
.doc-summary{background:linear-gradient(180deg,rgba(202,164,81,.05),transparent);border:1px solid rgba(202,164,81,.16);border-radius:14px;padding:8px 18px 12px}
.doc-summary .due td{border-top:2px solid rgba(202,164,81,.5);color:#8a6f1c}

/* 18. Terms & emergency panels — clean full-width hairline (no stray accent bar) */
.doc-emergency{box-shadow:inset 0 0 0 1px rgba(202,164,81,.12),0 10px 24px -20px rgba(154,123,46,.5)}

/* 19. Doc sheet — warmer paper edge so it reads as a printed card on screen */
.doc-sheet{box-shadow:0 1px 0 rgba(202,164,81,.25),0 34px 80px -34px rgba(40,31,17,.42);border:1px solid rgba(202,164,81,.10)}

/* 20. Motion — gate the reveal/press animations behind reduced-motion preference */
/* ===================== Ledger module (merged from OTA Ledger) ===================== */
.badge-CLIENT { background:#f3ead3; color:#9a7b2e; }
.badge-HOTEL { background:#f0e9d8; color:#8a6a1f; }
.badge-VISA { background:#f2e3d8; color:#b0402c; }
.badge-TRANSPORT { background:#fff2d6; color:#96690d; }
.badge-TICKET { background:#f3ead3; color:#9a7b2e; }
.badge-CLIENT,.badge-HOTEL,.badge-VISA,.badge-TRANSPORT,.badge-TICKET { display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:999px; font-size:.72rem; font-weight:700; }
.text-debit { color:var(--success); } .text-credit { color:var(--danger); }
.ledger-wrapper { display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; background:var(--bg-card); box-shadow:0 20px 46px -30px rgba(40,31,17,.25); margin-bottom:8px; }
.ledger-col { display:flex; flex-direction:column; min-width:0; }
.ledger-col.left { border-right:1px solid var(--border); }
.col-header { padding:14px; text-align:center; font-weight:700; text-transform:uppercase; letter-spacing:.1em; font-size:.74rem; background:linear-gradient(180deg,#f7efdc,#f1e7cf); color:var(--text-muted); border-bottom:1px solid var(--border); }
.ledger-col.left .col-header { box-shadow:inset 0 -2px 0 var(--success); }
.ledger-col.right .col-header { box-shadow:inset 0 -2px 0 var(--danger); }
.ledger-footer { grid-column:1 / -1; display:grid; grid-template-columns:1fr 1fr; background:linear-gradient(180deg,#f7efdc,#f1e7cf); border-top:2px solid var(--border); }
.foot-cell { padding:16px 20px; text-align:right; font-weight:700; font-family:var(--font-num); }
.foot-cell:first-child { border-right:1px solid var(--border); }
.tx-list { list-style:none; margin:0; padding:0; flex:1; }
.tx-item { display:flex; justify-content:space-between; align-items:center; padding:14px 16px; border-bottom:1px solid var(--border); gap:15px; position:relative; transition:background .15s, box-shadow .15s; overflow-wrap:anywhere; }
.tx-item:last-child { border-bottom:none; }
.tx-item:hover { background:rgba(154,123,46,.06); box-shadow:inset 3px 0 0 var(--gold2); }
.tx-desc { font-weight:600; }
.tx-date { font-size:.78rem; color:var(--text-muted); margin-top:3px; font-family:var(--font-num); }
.tx-sub { font-size:.78rem; color:var(--text-muted); margin-top:2px; }
.tx-amt { font-family:var(--font-num); font-weight:700; min-width:96px; text-align:right; }
.tx-actions { position:absolute; right:12px; top:10px; display:none; background:var(--bg-card); border-radius:8px; }
.tx-item:hover .tx-actions, .tx-item:focus-within .tx-actions { display:flex; gap:6px; }
.bar-track { background:rgba(154,123,46,.12); border-radius:6px; height:8px; overflow:hidden; min-width:60px; }
.bar-fill { height:100%; background:linear-gradient(90deg,var(--violet2),var(--blue)); border-radius:6px; }
@media screen and (max-width:760px){
  /* the two ledger columns stack on phones; tap the row to reveal actions */
  .ledger-wrapper { grid-template-columns:1fr; }
  .ledger-col.left { border-right:0; border-bottom:1px solid var(--border); }
  .ledger-footer { grid-template-columns:1fr 1fr; }
  .tx-actions { display:flex; position:static; background:transparent; }
  .tx-item { flex-wrap:wrap; }
}
/* printable statement / invoice (standalone page) */
.stmt-body { background:#f3ead3; min-height:100vh; padding:28px 16px 60px; font-family:var(--font-ui); color:var(--text-main); }
.stmt-toolbar { max-width:860px; margin:0 auto 16px; display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.stmt-sheet { max-width:860px; margin:0 auto; background:#fff; border-radius:20px; box-shadow:0 1px 2px rgba(11,18,38,.05), 0 34px 80px -32px rgba(11,18,38,.4); padding:48px 52px; position:relative; overflow:hidden; }
.stmt-sheet::before { content:""; position:absolute; top:0; left:0; right:0; height:5px; background:linear-gradient(90deg,var(--violet2),var(--gold2) 45%,var(--gold) 70%,var(--violet2)); -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.stmt-head { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; flex-wrap:wrap; padding-bottom:26px; border-bottom:2px solid var(--border); }
.stmt-agency { font-family:var(--font-head); font-size:1.9rem; color:#9a7b2e; }
.stmt-sub { color:var(--text-muted); font-size:.8rem; text-transform:uppercase; letter-spacing:.14em; font-weight:600; margin-top:4px; }
.stmt-doc { font-family:var(--font-head); font-size:1.25rem; color:var(--text-main); text-align:right; margin-bottom:8px; }
.stmt-meta table { border-collapse:collapse; font-size:.86rem; margin-left:auto; }
.stmt-meta td { padding:3px 0 3px 18px; }
.stmt-meta td:first-child { color:var(--text-muted); font-weight:600; font-size:.74rem; text-transform:uppercase; letter-spacing:.06em; }
.stmt-meta td:last-child { font-family:var(--font-num); font-weight:600; text-align:right; }
.stmt-party { padding:22px 0 4px; }
.stmt-label { font-size:.72rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.1em; margin-bottom:6px; display:inline-flex; align-items:center; gap:7px; }
.stmt-label::before { content:""; width:14px; height:2px; border-radius:2px; background:linear-gradient(90deg,var(--gold2),var(--violet2)); -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.stmt-name { font-size:1.18rem; font-weight:700; }
.stmt-contact { display:flex; gap:18px; flex-wrap:wrap; color:var(--text-muted); font-size:.88rem; margin-top:6px; }
.stmt-contact i { font-size:.78rem; margin-right:4px; color:var(--violet2); }
.stmt-table { width:100%; border-collapse:collapse; margin-top:26px; font-size:.9rem; }
.stmt-table th { text-align:left; font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); border-bottom:2px solid var(--border); padding:11px 10px; background:rgba(154,123,46,.06); -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.stmt-table td { padding:11px 10px; border-bottom:1px solid var(--border); vertical-align:top; }
.stmt-table tbody tr:nth-child(even) td { background:rgba(154,123,46,.028); -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.stmt-table .num, .stmt-table th.num { text-align:right; font-family:var(--font-num); white-space:nowrap; }
.stmt-details { color:var(--text-muted); font-size:.82rem; }
.stmt-table tfoot td { border-top:2px solid var(--text-main); border-bottom:none; font-weight:700; font-family:var(--font-num); }
.stmt-footer { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; margin-top:34px; padding-top:22px; border-top:1px solid var(--border); flex-wrap:wrap; }
.stmt-note { color:var(--text-muted); font-size:.78rem; max-width:380px; line-height:1.55; }
.balance-due { background:linear-gradient(120deg,var(--violet2),var(--blue)); color:#fff; border-radius:16px; padding:16px 26px; display:flex; flex-direction:column; gap:2px; box-shadow:0 16px 36px -14px rgba(154,123,46,.7); position:relative; overflow:hidden; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.balance-due::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,rgba(255,255,255,.18),transparent 50%); pointer-events:none; }
.balance-due span { font-size:.72rem; text-transform:uppercase; letter-spacing:.12em; font-weight:600; opacity:.85; }
.balance-due strong { font-family:var(--font-num); font-size:1.5rem; letter-spacing:-.01em; }
@media screen and (max-width:640px){ .stmt-sheet { padding:28px 20px; } .stmt-head { flex-direction:column; } .stmt-doc, .stmt-meta td:last-child { text-align:left; } .stmt-meta td { padding-left:0; padding-right:18px; } .stmt-meta table { margin-left:0; } .stmt-table { display:block; overflow-x:auto; } }
@media print {
  .stmt-body { background:#fff; padding:0; }
  .stmt-toolbar { display:none !important; }
  .stmt-sheet { box-shadow:none; border-radius:0; max-width:100%; width:100%; padding:14mm 15mm; }
  .stmt-table { font-size:8.5pt; }
  .stmt-table td, .stmt-table th { padding:4pt 5pt; }
  .stmt-table tr { break-inside:avoid; }
}
[data-theme="dark"] .col-header, [data-theme="dark"] .ledger-footer { background:linear-gradient(180deg,#2a2316,#241d12); }
[data-theme="dark"] .badge-CLIENT, [data-theme="dark"] .badge-TICKET { background:rgba(202,164,81,.16); color:#d9b96a; }
[data-theme="dark"] .badge-HOTEL { background:rgba(138,106,31,.2); color:#cfae62; }
[data-theme="dark"] .badge-VISA { background:rgba(176,64,44,.18); color:#d98a77; }
[data-theme="dark"] .badge-TRANSPORT { background:rgba(150,105,13,.2); color:#d9b25f; }

@media (prefers-reduced-motion:reduce){
  .reveal{animation:none!important;opacity:1!important;transform:none!important}
  .toast-message,.modal{animation:none!important}
  *{transition-duration:.001ms!important}
}

/* ============ PHONE ERGONOMICS ============
   Two faults that only bite on a real handset, never in a resized desktop
   window, so they survived every previous pass.

   `screen and` on every query here: an A4 page is about 794px wide, so a bare
   max-width rule in this range fires inside printed PDFs as well. */
@media screen and (max-width:760px){
  /* iOS Safari zooms the entire page whenever a focused control has a font
     smaller than 16px. The layout then sits off-centre and the user has to
     pinch back out again, on every single field. 16px is the browser's
     threshold, not a taste. */
  /* !important because several views set a smaller size inline for a compact
     desktop control, and an inline style beats a media query. On a phone the
     zoom is the worse problem. */
  input:not([type=checkbox]):not([type=radio]):not([type=range]),
  select, textarea{font-size:16px!important}

  /* A fingertip is roughly 9mm. Under about 40px the small edit and delete
     buttons that fill these tables get mis-tapped, and one of them deletes
     things. */
  .btn,.btn-sm,button.btn{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:6px}
  .btn-sm{padding-top:8px;padding-bottom:8px}
  /* Row actions sit side by side rather than wrapping under each other. */
  td.text-end .btn+.btn,td.text-end .btn+form{margin-left:4px}
}

/* Grids never fall below one column. Several views set the template inline
   (repeat(4,1fr) for the passenger counts, .7fr 1fr 1fr for a booking row),
   and an inline style beats any stylesheet rule, so the floor has to shout.
   At 760 rather than 440: four fields across a 480px phone leaves 60px of
   content each, which a date picker and a select cannot render. */
@media screen and (max-width:760px){
  .form-grid,.stats-grid,.row{grid-template-columns:1fr!important}
}

/* ============ REMAINING LAYOUT REPAIRS ============ */

/* A card header that cannot wrap makes a long title shrink to its min-content
   width and break over four lines beside its button. */
.card-header{flex-wrap:wrap}

/* The quote builder's remove-row button was absolutely positioned into the
   top-right corner of the card, which on a tablet is exactly where the second
   field sits. Tapping to focus Airline deleted the row instead. It now takes
   its own line at the end of the row, and is a real touch target. */
@media screen and (max-width:980px){
  .line-row .action-icon{position:static;grid-column:1/-1;justify-self:end;min-width:40px;min-height:40px;display:inline-grid;place-items:center}
}

/* Forcing five quotes to fit a phone gives six 56px columns and breaks
   "MAN to IST to MED" one character per line. Past three columns it is more
   readable scrolled than squeezed. */
@media screen and (max-width:760px){
  .compare-wrap{overflow-x:auto!important}
  .compare-table th,.compare-table td{min-width:104px!important}
}

/* ============ NO HOLES IN A GRID ============
   A two-column .form-grid with an odd number of fields leaves the last one
   sitting alone beside an empty half. It reads as a field that failed to
   render rather than as a form that simply has five things in it, and it is
   the reason "Amount" and "Room type" each had a gap next to them.

   The last child only stretches when it is genuinely alone on its row, which
   for a two-column grid means its position is odd. The :not() guard keeps it
   away from the grids whose columns are set inline (four passenger counts,
   .7fr 1fr 1fr on a booking row), where "odd" means nothing. */
.form-grid:not([style*="grid-template-columns"])>*:last-child:nth-child(odd){grid-column:1/-1}

/* An explicit opt-in for fields that should always take the full width,
   whatever the count around them. */
.form-grid>.span-2{grid-column:1/-1}

/* ============ CASCADE REPAIRS ============
   These all lost the cascade where they were originally written. Media
   queries add no specificity and a later plain rule beats an earlier one, so
   the fixes live here, at the end, where they win. */

/* Declared but never defined, and used on 15 elements: every ledger and group
   filter bar, "Add entry", "Close period" and the magic-link field printed on
   the PDF. Only .doc-toolbar was ever hidden. */
@media print{ .no-print{display:none!important} }

/* Phone sizing that the old 760 block never managed to apply. */
@media screen and (max-width:760px){
  .page-title{font-size:1.15rem}
  .amt-large{font-size:1.35rem}
  .card{padding:18px}
  .modal{padding:20px}
  .scroll-area{padding:14px}
  .topbar{padding:12px 16px;height:60px}

  /* The bottom nav reserves env(safe-area-inset-bottom) for the home
     indicator but the content padding did not, so on a notched phone the last
     row sat permanently under the bar. */
  .page-content{padding-bottom:calc(72px + env(safe-area-inset-bottom))}

  /* Delete and edit icons are 26px. Two of them 4px apart, and one deletes a
     user or a reference row. */
  .action-icon{min-width:40px;min-height:40px;padding:0;display:inline-grid;place-items:center}
  .modal-x{width:40px;height:40px}
  .topbar-icon{width:40px;height:40px}
  .bulk-cb,input[type=checkbox]{width:22px!important;height:22px;accent-color:var(--violet)}

  /* .text-end forces nowrap at higher specificity than the card-stack rule
     that tries to undo it, so a cell holding a figure plus a status pill
     could not wrap and ran off the card. */
  .table-responsive>.table td.text-end{white-space:normal}

  /* Totals stacked under lists that had already stacked. */
  .ledger-footer{grid-template-columns:1fr}
  .foot-cell{text-align:left}
  .foot-cell:first-child{border-right:0;border-bottom:1px solid var(--border)}
}

/* Cards laid out by FLEX need the same exemption grids got: the waiting-for-a-
   bed chips sit in a .d-flex and every one after the first stepped down 20px. */
.d-flex>.card+.card,.filter-bar>.card+.card{margin-top:0}

/* A 5% tint is not a background: sticky headers let the rows scroll straight
   through the header text wherever a table has a height cap. */
.table thead th{background:var(--bg-card);z-index:2;box-shadow:inset 0 -2px 0 var(--border)}

/* The itinerary's gold band was outranked by .table thead th and .doc-table
   thead th, both of which are more specific than .flight-tbl th. */
.flight-tbl thead th{background:linear-gradient(180deg,#f7efdc,#f1e7cf);box-shadow:none}
[data-theme="dark"] .flight-tbl thead th{background:linear-gradient(180deg,#2a2216,#241d13)}

/* The toolbar was still 960px wide after the sheet grew to 1180 for the
   eleven-column flight table, so Print sat 110px inside the paper's edge. */
.doc-toolbar{max-width:1180px}

/* Printed tables have no scroller and the page clips overflow, so on a phone
   the last columns were not squeezed, they were simply gone. */
@media screen and (max-width:760px){
  .doc-sheet .doc-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
}

/* keep the gilded totals crisp when printing */
@media print{
  .doc-total,.margin-box,.doc-meta,.doc-summary,.doc-table thead th,
  .doc-emergency,.doc-title-box{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .doc-meta,.doc-summary{border-color:rgba(202,164,81,.3)}
  .stat-card::after,.card{box-shadow:none}
}

/* ============ PRINT SAFETY NET (must stay LAST so it wins cascade ties) ============
   A printed/saved PDF must always match the desktop web layout, even when a phone
   browser leaks its screen styles into the print rendering: every mobile card-stack
   is forced back to a real table, headers return, and the airline logo column stays. */
@media print {
  .sidebar, .bottom-nav, .menu-btn, .topbar-icon { display:none !important; }
  .itin-wrap { border:1px solid var(--border) !important; box-shadow:none !important; overflow:visible !important; background:#fff !important; }
  .flight-tbl, .table-responsive > .table, .voucher-tbl, .stmt-table { display:table !important; width:100% !important; min-width:0 !important; }
  .flight-tbl thead, .table-responsive > .table thead, .voucher-tbl thead, .stmt-table thead {
    display:table-header-group !important; position:static !important; width:auto !important;
    height:auto !important; overflow:visible !important; clip:auto !important; }
  .flight-tbl tbody, .table-responsive > .table tbody, .voucher-tbl tbody { display:table-row-group !important; }
  .flight-tbl tbody tr, .table-responsive > .table tr, .voucher-tbl tbody tr {
    display:table-row !important; border:0 !important; border-radius:0 !important;
    box-shadow:none !important; padding:0 !important; margin:0 !important; background:transparent !important; }
  .flight-tbl td, .table-responsive > .table td, .voucher-tbl td { display:table-cell !important; width:auto !important; }
  .flight-tbl td::before, .table-responsive > .table td::before, .voucher-tbl td::before { content:none !important; }
  .flight-tbl .fx-logo { display:table-cell !important; width:54px !important; padding:6pt !important; border-bottom:1px solid var(--border) !important; }
  .flight-tbl .fx-logo img { display:inline-block !important; }
  .table-responsive { overflow:visible !important; border:0 !important; box-shadow:none !important; }
  /* ledger account book prints with debit and credit side by side, like the web view */
  .ledger-wrapper { grid-template-columns:1fr 1fr !important; }
}
