/* Houston City Tours - design tokens and shared components */
:root {
  --navy-950: #060E2E;
  --navy-900: #0B1A4A;
  --navy-800: #12276A;
  --royal-700: #1A3A9C;
  --royal-600: #1F47C4;
  --royal-500: #3260E6;
  --royal-100: #E7EDFF;
  --red-700: #A9121D;
  --red-600: #D0202E;
  --red-500: #E8394A;
  --red-100: #FDE8EA;
  --gold: #F4B740;

  --ink: #0E1530;
  --ink-2: #2E3A5C;
  --muted: #5B6585;
  --line: #DFE4EF;
  --line-2: #ECEFF6;
  --bg: #F3F5FA;
  --surface: #FFFFFF;
  --surface-2: #F7F8FC;

  --ok: #0B8457;
  --ok-bg: #E2F5EC;
  --warn: #9A5B00;
  --warn-bg: #FFF1D6;
  --bad: #C0202B;
  --bad-bg: #FCE6E8;

  --grad-hero: radial-gradient(1100px 520px at 88% -12%, rgba(50, 96, 230, .55), transparent 62%),
               radial-gradient(760px 420px at -8% 112%, rgba(208, 32, 46, .32), transparent 60%),
               linear-gradient(140deg, #060E2E 0%, #0B1A4A 46%, #17318F 100%);
  --grad-red: linear-gradient(135deg, #E8394A 0%, #C11522 100%);
  --grad-navy: linear-gradient(140deg, #16307F 0%, #0B1A4A 100%);
  --grad-royal: linear-gradient(135deg, #3260E6 0%, #1A3A9C 100%);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --shadow-1: 0 1px 2px rgba(11, 26, 74, .05), 0 6px 18px -8px rgba(11, 26, 74, .14);
  --shadow-2: 0 2px 6px rgba(11, 26, 74, .06), 0 22px 44px -18px rgba(11, 26, 74, .32);
  --font-display: "Big Shoulders Display", "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--font-body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--royal-600); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: .005em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mt-4 { margin-top: 36px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-sm); padding: 12px 18px;
  font-weight: 700; font-size: 15.5px; line-height: 1.2; cursor: pointer; text-decoration: none; transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad-red); color: #fff; box-shadow: 0 8px 20px -10px rgba(193, 21, 34, .7); }
.btn-primary:hover { box-shadow: 0 12px 26px -10px rgba(193, 21, 34, .85); }
.btn-navy { background: var(--grad-navy); color: #fff; }
.btn-royal { background: var(--grad-royal); color: #fff; }
.btn-ok { background: linear-gradient(135deg, #12A06C, #0B7A50); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: #B9C2D6; }
.btn-light { background: rgba(255, 255, 255, .12); color: #fff; border: 1.5px solid rgba(255, 255, 255, .28); }
.btn-light:hover { background: rgba(255, 255, 255, .2); }
.btn-link { background: none; color: var(--royal-600); padding: 6px 4px; }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 8px; }
.btn-xs { padding: 5px 9px; font-size: 13px; border-radius: 7px; gap: 5px; }
.btn-lg { padding: 15px 24px; font-size: 17px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 9px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-head .sub { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.card-body { padding: 20px 22px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.5; }
.badge .ic { width: 13px; height: 13px; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--royal-100); color: var(--royal-700); }
.b-neutral { background: var(--line-2); color: var(--muted); }
.b-navy { background: var(--navy-900); color: #fff; }

/* Forms */
.field { display: block; margin-bottom: 14px; }
.field > span, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink-2); }
.field .opt { font-weight: 500; color: var(--muted); font-size: 13px; }
.input, .select, .textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--royal-500); box-shadow: 0 0 0 4px rgba(50, 96, 230, .14); }
.input.err, .select.err { border-color: var(--bad); }
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6585' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px; }
.help { font-size: 13px; color: var(--muted); margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--royal-600); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14.5px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: #CBD2E1; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-sm); font-size: 15px; margin-bottom: 16px; }
.alert .ic { margin-top: 2px; width: 20px; height: 20px; }
.alert-ok { background: var(--ok-bg); color: #075C3C; }
.alert-warn { background: var(--warn-bg); color: #6E4100; }
.alert-bad { background: var(--bad-bg); color: #8E1119; }
.alert-info { background: var(--royal-100); color: var(--navy-800); }

/* Stepper (qty) */
.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.qty button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: 0 1px 2px rgba(11, 26, 74, .12); cursor: pointer; display: grid; place-items: center; color: var(--navy-900); }
.qty button:hover:not([disabled]) { background: var(--navy-900); color: #fff; }
.qty button[disabled] { opacity: .35; cursor: not-allowed; }
.qty output { min-width: 30px; text-align: center; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }

/* Occupancy bar */
.occ { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; position: relative; }
.occ > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3260E6, #1A3A9C); transition: width .5s var(--ease); }
.occ > b { position: absolute; top: 0; height: 100%; background: repeating-linear-gradient(45deg, rgba(244, 183, 64, .8) 0 4px, rgba(244, 183, 64, .45) 4px 8px); }
.occ.mid > i { background: linear-gradient(90deg, #F4B740, #E08A00); }
.occ.high > i { background: linear-gradient(90deg, #E8394A, #A9121D); }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFBFE; }
.table .actions { text-align: right; white-space: nowrap; }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--line-2); padding: 4px; border-radius: 12px; flex-wrap: wrap; }
.tabs button, .tabs a { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; text-decoration: none; }
.tabs .on, .tabs [aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(11, 26, 74, .12); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 24px); background: var(--navy-900); color: #fff;
  padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: all .25s var(--ease); z-index: 200; max-width: 92vw; box-shadow: var(--shadow-2); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Modal */
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(560px, 94vw); max-height: 90vh; box-shadow: var(--shadow-2); color: var(--ink); }
dialog.modal::backdrop { background: rgba(6, 14, 46, .62); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; color: #B4BDD2; margin-bottom: 8px; }

.qrbox { background: #fff; border-radius: 14px; padding: 10px; }
.qrbox svg { display: block; width: 100%; height: auto; }

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card-pad, .card-body { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
