/* ---------- Reset & tokens ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg:            #0b0d10;
  --bg-elev:       #121519;
  --bg-elev-2:     #171b21;
  --border:        #23282f;
  --border-strong: #313841;
  --text:          #e9ecef;
  --text-dim:      #a1a7b0;
  --text-mute:     #6b7280;
  --accent:        #7cf29c;
  --accent-ink:    #0b0d10;
  --warn:          #ffb84d;
  --star:          #ffcc33;
  --radius:        10px;
  --radius-lg:     14px;
  --mono:          'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans:          'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 24px; }

.muted { color: var(--text-mute); font-size: 13px; }

/* Numbers get mono */
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11,13,16,0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark { color: var(--accent); font-size: 18px; }
.logo-text { font-weight: 700; letter-spacing: -0.01em; }

.tabs { display: inline-flex; background: var(--bg-elev); border: 1px solid var(--border); padding: 4px; border-radius: 999px; }
.tab {
  background: transparent; border: 0; color: var(--text-dim);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--text); color: var(--bg); }

/* Auth area in header */
.auth-area { display: inline-flex; align-items: center; gap: 8px; }
.auth-user {
  font-size: 13px; color: var(--text-dim); font-family: var(--mono);
  padding: 0 8px;
}
.auth-error {
  color: #ff8080; font-size: 13px; margin: 0;
  background: rgba(255,99,99,0.08); border: 1px solid rgba(255,99,99,0.25);
  padding: 8px 12px; border-radius: 6px;
}

/* ---------- Views ---------- */
.view { display: none; padding: 48px 0 80px; }
.view.is-active { display: block; }

/* ---------- Hero ---------- */
.hero { text-align: left; margin-bottom: 32px; }
.hero h1 {
  font-size: 44px; line-height: 1.08; letter-spacing: -0.02em;
  margin: 0 0 12px; font-weight: 700;
}
.hero .lede { color: var(--text-dim); font-size: 17px; margin: 0; max-width: 640px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.field input, .field select, .field textarea {
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 14px; font: inherit; outline: none;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--border-strong); background: var(--bg-elev-2);
}
.field input[type="number"] { font-family: var(--mono); }

.input-with-unit {
  position: relative; display: flex; align-items: center;
}

/* Autocomplete dropdown */
.field-ac { position: relative; }
.autocomplete {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-elev-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); z-index: 20;
  list-style: none; margin: 0; padding: 4px;
  max-height: 260px; overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.autocomplete li {
  padding: 10px 12px; border-radius: 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
.autocomplete li:hover, .autocomplete li.is-active { background: var(--bg-elev); }
.autocomplete .ac-main { font-size: 14px; color: var(--text); }
.autocomplete .ac-sub { font-size: 12px; color: var(--text-mute); }
.autocomplete .ac-info {
  padding: 10px 12px; color: var(--text-mute); font-size: 13px; cursor: default;
}
.autocomplete .ac-info:hover { background: transparent; }
.input-loading {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border: 2px solid var(--border-strong);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }
.input-with-unit input { flex: 1; padding-right: 56px; }
.input-with-unit .unit {
  position: absolute; right: 14px;
  color: var(--text-mute); font-family: var(--mono); font-size: 13px;
  pointer-events: none;
}

.trip-form {
  display: grid; grid-template-columns: 1fr 1fr 140px 160px auto; gap: 12px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; align-items: end;
  margin-bottom: 24px;
}
.trip-form .btn { height: 44px; }

.company-form {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.company-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: var(--radius); border: 0;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .05s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  background: transparent; color: var(--text); border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-elev-2); }

.link-btn {
  background: transparent; border: 0; color: var(--accent);
  cursor: pointer; padding: 0; font: inherit; text-decoration: underline;
}

/* ---------- List meta ---------- */
.list-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px 12px; color: var(--text-dim); font-size: 13px;
}
.trip-summary { font-family: var(--mono); color: var(--text); }

/* ---------- Company grid ---------- */
.company-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.company-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .15s, transform .15s;
}
.company-card:hover { border-color: var(--border-strong); }

.card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.card-name { font-size: 18px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.card-city { color: var(--text-dim); font-size: 13px; }
.card-desc { color: var(--text-dim); font-size: 14px; margin: 0; }

.rating {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-family: var(--mono);
}
.rating .star-icon { color: var(--star); }
.rating .count { color: var(--text-mute); }

.price-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-top: 14px; border-top: 1px dashed var(--border);
}
.price-meta { display: flex; flex-direction: column; gap: 2px; color: var(--text-dim); font-size: 13px; }
.price-meta .mono { color: var(--text); }

.final-price { text-align: right; }
.final-price .label {
  font-size: 11px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.final-price .value {
  font-family: var(--mono); font-size: 28px; font-weight: 600; color: var(--accent);
  display: block; line-height: 1.1;
}
.final-price.unavailable .value { color: var(--warn); font-size: 15px; }

.card-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.card-actions .btn { padding: 8px 14px; font-size: 13px; }

/* ---------- Empty state ---------- */
.empty-state {
  background: var(--bg-elev); border: 1px dashed var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  text-align: center; color: var(--text-dim);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-dialog {
  position: relative;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0 0 2px; font-size: 18px; letter-spacing: -0.01em; }
.modal-body {
  overflow-y: auto; overflow-x: hidden;
  padding: 20px 24px; display: flex; flex-direction: column; gap: 24px;
}
.modal-body h3 {
  margin: 0 0 10px; font-size: 12px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.icon-btn {
  background: transparent; border: 0; color: var(--text-dim);
  cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px;
}
.icon-btn:hover { background: var(--bg-elev-2); color: var(--text); }

/* ---------- Reviews ---------- */
.reviews-list { display: flex; flex-direction: column; gap: 12px; }
.review {
  background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.review-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.review-author { font-weight: 600; font-size: 14px; }
.review-time { color: var(--text-mute); font-size: 12px; font-family: var(--mono); }
.review-stars { color: var(--star); letter-spacing: 2px; font-size: 13px; }
.review-comment { margin: 6px 0 0; color: var(--text-dim); font-size: 14px; }
.no-reviews { color: var(--text-mute); font-size: 13px; }

/* ---------- Star input ---------- */
.star-input { display: inline-flex; gap: 4px; }
.star {
  background: transparent; border: 0; cursor: pointer;
  font-size: 24px; color: var(--border-strong); padding: 2px;
  transition: color .1s;
}
.star:hover, .star.is-hover, .star.is-selected { color: var(--star); }

.review-form { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Tab count badge ---------- */
.tab-count {
  display: inline-block; margin-left: 6px;
  background: var(--border-strong); color: var(--text);
  font-size: 11px; font-family: var(--mono);
  padding: 1px 6px; border-radius: 999px; min-width: 18px;
}
.tab.is-active .tab-count { background: var(--bg-elev); color: var(--text); }

/* ---------- List meta + city chip ---------- */
.meta-left { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.city-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(124,242,156,0.08); color: var(--text);
  border: 1px solid rgba(124,242,156,0.25);
  padding: 3px 4px 3px 10px; border-radius: 999px;
  font-size: 12px;
}
.city-chip strong { color: var(--accent); font-weight: 600; }
.chip-clear {
  background: transparent; border: 0; color: var(--text-dim);
  cursor: pointer; padding: 2px 6px; border-radius: 999px;
  font-size: 11px;
}
.chip-clear:hover { background: var(--bg-elev-2); color: var(--text); }

/* ---------- Card stats + actions ---------- */
.card-stats {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-dim);
}
.stat { display: inline-flex; align-items: center; gap: 4px; }
.stat .num { color: var(--text); font-size: 13px; }
.stat-warn .num { color: var(--warn); }

.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled {
  opacity: 0.4; cursor: not-allowed; filter: grayscale(0.3);
}

.card-actions { justify-content: space-between; }

/* ---------- Bookings view ---------- */
.booking-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
}
.chip {
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text-dim); padding: 6px 14px; border-radius: 999px;
  cursor: pointer; font: inherit; font-size: 13px;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.is-active {
  background: var(--text); color: var(--bg); border-color: var(--text);
}

.bookings-list { display: flex; flex-direction: column; gap: 12px; }

.booking-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.booking-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.booking-company { margin: 0 0 2px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.booking-meta { color: var(--text-mute); font-size: 12px; }
.booking-route { color: var(--text); font-size: 14px; }
.booking-numbers {
  display: flex; gap: 8px; align-items: center;
  color: var(--text-dim); font-size: 13px; flex-wrap: wrap;
}
.booking-numbers .dot { color: var(--text-mute); }
.booking-total { color: var(--text); font-weight: 600; }
.booking-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--border);
}

/* Status badges */
.status-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.status-pending   { background: rgba(255,184,77,0.12);  color: #ffb84d; border-color: rgba(255,184,77,0.25); }
.status-accepted  { background: rgba(100,160,255,0.12); color: #7fb4ff; border-color: rgba(100,160,255,0.25); }
.status-completed { background: rgba(124,242,156,0.12); color: var(--accent); border-color: rgba(124,242,156,0.25); }
.status-cancelled { background: rgba(255,99,99,0.1);    color: #ff8080; border-color: rgba(255,99,99,0.25); }
.status-noshow    { background: rgba(255,140,80,0.1);   color: #ffa270; border-color: rgba(255,140,80,0.25); }
.status-declined  { background: var(--bg-elev-2);       color: var(--text-mute); border-color: var(--border); }

/* ---------- Booking summary (in booking modal) ---------- */
.modal-sm { max-width: 440px; }
.booking-summary {
  background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px;
}
.summary-row.total {
  padding-top: 10px; border-top: 1px dashed var(--border);
  margin-top: 2px;
}
.summary-label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.summary-value { color: var(--text); }
.summary-row.total .summary-value { color: var(--accent); font-size: 18px; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0; border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .trip-form { grid-template-columns: 1fr 1fr; }
  .trip-form .btn { grid-column: 1 / -1; }
  .hero h1 { font-size: 32px; }
  .company-form .row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .trip-form { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; gap: 12px; height: auto; padding: 12px 0; }
}
