@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/dmsans.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --ink: #10231f; --emerald: #0d4a3e; --emerald-deep: #08352c; --side: #0f1f1c; --mint: #e4f1ea;
  --gold: #f5b324; --bg: #f5f4ef; --white: #fff; --line: #e4e2da; --muted: #5d6c67;
  --error: #b3261e; --error-bg: #fbeceb; --warn-bg: #fdf3da; --warn: #7a5300; --ok-bg: #e4f1ea; --ok: #0d4a3e;
  --display: 'Bricolage', system-ui, sans-serif; --body: 'DM Sans', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); }
h1, h2 { font-family: var(--display); letter-spacing: -.015em; line-height: 1.15; margin: 0; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.08rem; font-weight: 650; margin-bottom: 12px; }
p { margin: 0 0 .7em; }
a { color: var(--emerald); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.pre { white-space: pre-line; margin: 0; overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:focus-visible { outline: 3px solid #dd9d10; outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 9px; padding: 9px 15px; font: 600 .95rem var(--body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--emerald); color: var(--white); }
.btn-primary:hover { background: var(--emerald-deep); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #ffc23d; }
.btn-ghost { background: var(--white); border-color: #cfccc1; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-sm { padding: 6px 11px; font-size: .86rem; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.btn-danger { background: none; border: 0; color: var(--error); font: 500 .88rem var(--body); cursor: pointer; padding: 5px 6px; border-radius: 6px; white-space: nowrap; }
.btn-danger:hover { background: var(--error-bg); }
.is-armed { outline: 2px solid var(--error); outline-offset: 1px; }

/* Layout */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: #d3dfda; display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font: 700 1.05rem var(--display); padding: 4px 8px 16px; }
.side nav { flex: 1; }
.side nav a { display: flex; align-items: center; justify-content: space-between; color: #d3dfda; text-decoration: none; padding: 7px 10px; border-radius: 8px; font-weight: 500; margin-bottom: 1px; }
.side nav a:hover { background: #1b2f2a; color: var(--white); }
.side nav a[aria-current] { background: var(--emerald); color: var(--white); }
.side-label { font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: #93a8a0; margin: 16px 10px 5px; }
.count { background: var(--gold); color: var(--ink); border-radius: 999px; font-size: .74rem; font-weight: 700; padding: 0 7px; }
.side-user { border-top: 1px solid #2a3d38; padding: 12px 10px 2px; font-size: .88rem; }
.side-user p { margin-bottom: 6px; }
.side-user strong, .side-user span { display: block; }
.side-user strong { color: var(--white); }
.side-user span { color: #93a8a0; }
.side-user a { color: inherit; display: block; margin-bottom: 4px; }
.topbar { display: none; }
.content { padding: 26px clamp(16px, 3vw, 36px) 56px; max-width: 1260px; }
.page-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title .muted { margin: 5px 0 0; }
.crumb { margin: 0 0 3px; font-size: .86rem; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Panels */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 13px; padding: 18px 20px; margin-bottom: 15px; }
.panel.narrow { max-width: 680px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 22px 0; text-align: center; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 15px; }
.tile { background: var(--white); border: 1px solid var(--line); border-radius: 13px; padding: 14px 18px; }
.tile span { display: block; color: var(--muted); font-size: .88rem; }
.tile strong { font: 700 1.8rem var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { overflow-x: auto; margin-inline: -4px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid #efede6; vertical-align: top; }
.table tbody tr:hover { background: #fbfaf6; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.muted { text-decoration: none; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: .8rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill-new { background: #e4edfb; color: #1b4a94; }
.pill-contacted { background: #ece8fb; color: #4a33a0; }
.pill-follow_up { background: var(--warn-bg); color: var(--warn); }
.pill-quoted { background: #dff3f5; color: #0f5a63; }
.pill-completed { background: var(--ok-bg); color: var(--ok); }
.pill-lost { background: #efedea; color: #57524a; }
.pager { display: flex; justify-content: center; gap: 18px; padding-top: 12px; font-size: .92rem; }

/* Forms */
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.field .opt { font-weight: 400; color: var(--muted); font-size: .8rem; }
.field input, .field textarea, select, .rate-input, .sort-input { width: 100%; border: 1px solid #cfccc1; background: var(--white); color: var(--ink); border-radius: 8px; padding: 8px 10px; font: 400 .96rem var(--body); }
.field input:focus, .field textarea:focus, select:focus, .rate-input:focus, .sort-input:focus { outline: 0; border-color: var(--emerald); box-shadow: 0 0 0 3px var(--mint); }
.rate-input { width: 150px; font-family: var(--mono); }
.sort-input { width: 70px; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--error); }
.field .error, .error-text { color: var(--error); font-size: .84rem; margin: 3px 0 0; }
.field .hint { color: var(--muted); font-size: .8rem; margin: 3px 0 0; }
.stack { display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 12px; }
.wide { grid-column: 1 / -1; }
.gap-top { margin-top: 12px; }
.form-actions { margin-top: 14px; }
.lead-form { max-width: 880px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--emerald); }
.check small { display: block; color: var(--muted); font-size: .8rem; }
.check-pad { align-self: end; padding-bottom: 9px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.danger-row { margin-top: 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; }
.thumb { max-width: 220px; border-radius: 8px; margin: 8px 0; display: block; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; background: var(--white); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; margin-bottom: 15px; }
.filters.flat { border: 0; padding: 0; margin: 0; }
.filters .field { min-width: 130px; }
.filters .grow { flex: 1; min-width: 200px; }
.seg { display: inline-flex; background: #efede6; border-radius: 9px; padding: 3px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px !important; height: 1px; padding: 0; }
.seg span { display: block; padding: 5px 16px; border-radius: 7px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.seg label { margin: 0; }
.seg input:checked + span { background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.seg input:focus-visible + span { outline: 3px solid #dd9d10; }

/* Passengers */
.steppers { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.stepper { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 6px 14px; }
.stepper-label { font-weight: 600; min-width: 54px; }
.stepper button { width: 36px; height: 36px; border-radius: 8px; border: 0; font-size: 1.25rem; line-height: 1; cursor: pointer; background: #efede6; color: var(--ink); }
.stepper [data-plus] { background: var(--emerald); color: var(--white); }
.stepper output { min-width: 24px; text-align: center; font: 500 1.05rem var(--mono); }
.pax-list { display: grid; gap: 8px; }
.pax-row { display: grid; grid-template-columns: 54px 1fr 1fr 1fr 1fr 32px; gap: 8px; align-items: end; background: #faf9f5; border-radius: 10px; padding: 10px; }
.pax-row label { font-size: .78rem; font-weight: 500; color: var(--muted); }
.pax-tag { font-size: .8rem; font-weight: 600; padding-bottom: 9px; }
.pax-row[data-type=child] .pax-tag { color: #0f5a63; }
.pax-remove { border: 0; background: none; font-size: 1.3rem; color: var(--muted); cursor: pointer; height: 38px; border-radius: 6px; }
.pax-remove:hover { background: var(--error-bg); color: var(--error); }

/* Lead page */
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 15px; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 11px 18px; margin: 0; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 15px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: #c0bdb1; }
.tl-call::before { background: var(--emerald) !important; }
.tl-note::before { background: var(--gold) !important; }
.tl-head { margin: 0; }
.tl-system .tl-head strong { font-weight: 400; color: var(--muted); }
.tl-head .muted { font-size: .82rem; white-space: nowrap; }
.complete-panel summary { font: 650 1.08rem var(--display); cursor: pointer; }
.complete-panel details[open] summary { margin-bottom: 10px; }

/* Alerts */
.alert { border-radius: 9px; padding: 10px 13px; margin-bottom: 13px; font-size: .94rem; overflow-wrap: anywhere; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert a { color: inherit; font-weight: 600; }

/* Login */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 80% 0%, #14705d 0%, transparent 70%), var(--emerald-deep); }
.auth-card { background: var(--white); border-radius: 18px; padding: 30px; width: min(410px, 100%); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.auth-card h1 { margin-bottom: 14px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font: 700 1rem var(--display); color: var(--ink); text-decoration: none; margin-bottom: 20px; }
.auth-note { font-size: .84rem; color: var(--muted); margin: 14px 0 0; text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 62px; }
.pw-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 5px 8px; border-radius: 6px; color: var(--emerald); font: 600 .84rem var(--body); cursor: pointer; }
.pw-toggle:hover { background: var(--mint); }
.otp-input { font: 500 1.5rem var(--mono) !important; letter-spacing: .35em; text-align: center; }

@media (max-width: 1020px) { .lead-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; position: fixed; inset: 49px 0 0 0; height: auto; z-index: 20; }
  .side.is-open { display: flex; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--side); color: var(--white); padding: 8px 12px; position: sticky; top: 0; z-index: 21; font-weight: 600; }
  .menu-btn { background: none; color: var(--white); border: 1px solid #3a4f49; border-radius: 7px; padding: 5px 10px; font: 600 .86rem var(--body); }
  .topbar .btn-primary { background: var(--gold); color: var(--ink); }
  .pax-row { grid-template-columns: 1fr 1fr; }
  .pax-tag { grid-column: 1; padding: 0; }
  .pax-remove { grid-column: 2; grid-row: 1; justify-self: end; width: 32px; height: 26px; }
}
@media (max-width: 560px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .filters .field { flex: 1 1 100%; }
}
.side-brand img { height: 18px; width: auto; }
.auth-brand { flex-direction: column; align-items: flex-start; gap: 6px; }
.auth-brand img { height: 22px; width: auto; }
.auth-brand span { color: var(--muted); font-size: .86rem; }
