:root {
  color-scheme: dark;
  --bg: #070d14; --card: #0f1824; --ink: #e3eef6; --muted: #8299ad;
  --brand: #1fc6ec; --brand-dark: #0d9dc0; --line: #1e3042;
  --ok: #34c47c; --err: #ff6f61;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; }
a { color: var(--brand); }
::selection { background: rgba(31,198,236,.35); }
.topbar { background: #0a1220; border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 18px rgba(31,198,236,.12); color: #fff; padding: 10px 14px; }
.topbar .brand { display: inline-block; text-decoration: none; line-height: 0; }
.topbar .brand img { height: 36px; width: auto; border-radius: 8px; display: block; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; align-items: center; }
.topbar nav a { color: #9db4c8; text-decoration: none; font-size: .95rem; padding: 4px 0; }
.topbar nav a:hover { color: var(--brand); }
.topbar nav a.logout { margin-left: auto; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 18px 14px 40px; }
h1 { font-size: 1.45rem; margin: 8px 0 14px; color: #eaf5fb; }
h2 { font-size: 1.1rem; margin: 26px 0 10px; color: #d6e7f2; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--err); }
code { color: var(--brand); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-wrap: anywhere; min-width: 0; }
.kpi { font-size: 1.4rem; font-weight: 700; color: #f0f8fd; }
.kpi-label { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }

th { background: #13202f; font-weight: 600; font-size: .82rem; color: #9db4c8; }
tr:last-child td { border-bottom: none; }
tr.totals td { background: #12202e; font-weight: 700; border-top: 2px solid var(--brand-dark); }
tr.voided td { color: var(--muted); text-decoration: line-through; }
.btn { display: inline-block; background: #13202f; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; font-size: .95rem; color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--brand-dark); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #04222e; font-weight: 600; }
.btn.primary:hover { background: #4fd9f7; border-color: #4fd9f7; }
.linkbtn { background: none; border: none; color: var(--brand); cursor: pointer; font-size: .85rem; padding: 0; }
form.inline { display: inline; }
.searchbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.searchbar input, .searchbar select { flex: 1 1 180px; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; max-width: 560px; display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; color: #c9dbe9; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea { font: inherit; padding: 9px 10px; border: 1px solid #23384c;
  border-radius: 8px; background: #0b1420; color: var(--ink); font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(31,198,236,.25); }
input::placeholder, textarea::placeholder { color: #5c7285; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; background: #16283a; color: #9db4c8; }
.pill.ticketed, .pill.won { background: #0f2f22; color: var(--ok); }
.pill.void, .pill.lost { background: #33161a; color: var(--err); }
.pill.refunded { background: #2f2610; color: #e8b73f; }
.pill.call { background: #0d2a3a; color: var(--brand); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.flash.error { background: #33161a; color: var(--err); }
.flash.ok { background: #0f2f22; color: var(--ok); }
.login-card { max-width: 380px; margin: 60px auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 26px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 0 40px rgba(31,198,236,.10); }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-logo { width: 100%; border-radius: 10px; display: block; }
.comm-form { display: flex; gap: 8px; margin-bottom: 12px; }
.comm-form input { flex: 1; }
.comm-list { list-style: none; padding: 0; }
.comm-list li { background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px; }
.notes { background: #241d0e; border: 1px solid #4a3d18; border-radius: 8px; padding: 10px 12px; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px; }
@media (max-width: 640px) {
  h1 { font-size: 1.25rem; }
  .grid2 { grid-template-columns: 1fr; }
  th, td { padding: 8px 9px; }
  .comm-form { flex-wrap: wrap; }
  .comm-form input { flex: 1 1 100%; }
}
.pnr-box { background: #0d1c2b; border: 1px solid #1d3a52; border-radius: 10px; padding: 12px; }
.parse-result { background: #0f2a1e; border: 1px solid #1d4d37; border-radius: 10px; padding: 12px; }

.exch-flag { background: #241d0e; border: 1px solid #4a3d18; border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.exch-pill { color: #e8b73f; font-size: .75rem; white-space: nowrap; }
.sabre-box { font-family: monospace; font-size: 0.85rem; width: 100%; background: #0a141f; color: #9fe8a9; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.done { text-decoration: line-through; opacity: .6; }
.pill.email { background: #2a1f3a; color: #c9aef0; }

@media (max-width: 480px) {
  .table-wrap table { font-size: .75rem; }
  .table-wrap th, .table-wrap td { padding: 6px 5px; white-space: normal; }
  .table-wrap td.num, .table-wrap th.num { white-space: nowrap; overflow-wrap: normal; }
  .table-wrap td.route { overflow-wrap: anywhere; }
  .hide-sm { display: none; }
}

/* text wordmark fallback when a brand has no logo image configured */
.brand-text { font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; color: var(--accent, #22d3ee); }
.login-wordmark { font-weight: 700; font-size: 2rem; letter-spacing: .02em; color: var(--accent, #22d3ee); text-align: center; margin-bottom: 1rem; }
.login-logo.contain { object-fit: contain; background: transparent; box-shadow: none; }
