:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --line: #d8dfeb;
  --text: #1b2740;
  --muted: #6f7d95;
  --brand: #0a3f8f;
  --brand-deep: #062a63;
  --teal: #00a7c6;
  --gold: #f1b93f;
  --green: #71b63a;
  --shadow: 0 16px 40px rgba(10, 30, 66, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f0f2f5;
  color: var(--text);
  font-family: 'Source Sans 3', sans-serif;
}

h1, h2, h3, h4, strong { font-family: 'Outfit', sans-serif; }

.utility-bar {
  min-height: 42px;
  padding: 8px 18px;
  background: #ffffff;
  border-bottom: 1px solid #dae1ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.utility-left {
  color: #354868;
  font-size: 0.92rem;
}

.utility-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.divider { color: #7d8ea9; }

.utility-login {
  text-decoration: none;
  color: #182642;
  font-weight: 600;
}

.utility-login-btn {
  border: 0;
  background: none;
  color: #182642;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.top-actions-strip {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 10px;
}

.wallet-badge,
.user-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: #eff4fd;
  border: 1px solid #cfdaef;
  color: #18335f;
  font-size: 0.86rem;
}

.main-nav {
  background: #2f75c7;
  padding: 0 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.nav-brand {
  color: #fff;
  font-size: 1.22rem;
  font-weight: 700;
  margin-right: 12px;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
}

.nav-btn.active { color: #fff; border-bottom: 3px solid var(--gold); }

.app-shell { padding: 20px; }

.view { display: none; }
.view.active { display: block; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.search-card { padding: 12px; }
.search-row {
  display: grid;
  grid-template-columns: auto auto 150px minmax(170px, 1fr) auto minmax(190px, 1fr) 150px auto auto;
  gap: 8px;
  align-items: center;
}

.mode-chip {
  height: 42px;
  width: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f3f6fb;
  cursor: pointer;
}

.mode-chip.active { border-color: #efad3e; box-shadow: inset 0 0 0 1px #efad3e; }

.select-btn,
input,
select {
  width: 100%;
  border: 1px solid #bec8da;
  border-radius: 9px;
  padding: 10px 12px;
  min-height: 42px;
  background: #fff;
  color: var(--text);
  font-size: 1rem;
}

.icon-btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fbff;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
}

.btn {
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
  padding: 10px 16px;
  min-height: 42px;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover { filter: brightness(0.97); }
.btn-green { background: var(--green); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-ghost { background: #f8fbff; border-color: var(--line); color: #23314e; }
.block { width: 100%; }

.trip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 12px;
}

.trip-header-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.booking-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 12px;
  align-items: start;
}

.filter-panel {
  position: sticky;
  top: 8px;
}

.filter-panel h3 {
  margin-top: 0;
}

.filter-panel label {
  display: block;
  margin: 8px 0 4px;
  font-weight: 600;
}

.tabs-row { display: flex; gap: 8px; flex-wrap: wrap; }
.day-tab {
  background: #eff4fc;
  border: 1px solid #c8d4ea;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.day-tab.active { background: #dfeaff; color: #1c52a0; }

.trip-list { display: flex; flex-direction: column; gap: 12px; }
.trip-card {
  border: 1px solid #cfdbef;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.trip-top {
  display: grid;
  grid-template-columns: 2.4fr 1.2fr 1fr 1fr auto;
  gap: 12px;
  padding: 14px;
  align-items: center;
}

.trip-route h4 { margin: 0; font-size: 1.7rem; }
.trip-route p { margin: 2px 0; color: #8e3a33; font-weight: 600; }
.trip-meta { color: var(--muted); font-size: 0.95rem; }
.trip-time strong { font-size: 1.6rem; }
.trip-operator {
  display: inline-block;
  margin-top: 6px;
  background: linear-gradient(90deg, #eff8ff 0%, #e8f0ff 100%);
  border: 1px solid #c6d7f6;
  color: #244f94;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.84rem;
}

.mini-layout {
  display: grid;
  grid-template-columns: repeat(6, 10px);
  gap: 3px;
  justify-content: center;
}
.mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #cfd7e6;
}
.mini-dot.available { background: #5fb2e6; }
.mini-dot.female { background: #e9a1cd; }
.mini-dot.sold { background: #d8dde7; }

.trip-fare {
  text-align: right;
  color: #2452ad;
  font-weight: 700;
  font-size: 1.8rem;
}
.trip-policy {
  margin-top: 6px;
  color: #3d8f44;
  font-size: 0.86rem;
  font-weight: 600;
}

.trip-open {
  border-top: 1px dashed var(--line);
  display: none;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  padding: 12px;
}
.trip-card.open .trip-open { display: grid; }

.seat-board {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.deck-title { margin: 4px 0 8px; color: var(--muted); font-weight: 700; }

.seat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.seat {
  border: 1px solid #a9b8d4;
  border-radius: 8px;
  text-align: center;
  padding: 7px 0;
  font-weight: 600;
  background: #f6fbff;
  cursor: pointer;
}

.seat.available { background: #76bfeb; color: #0d294f; }
.seat.female { background: #efb7d9; color: #5c1f4b; }
.seat.sold,
.seat.blocked { background: #e7ebf3; color: #8b96aa; cursor: not-allowed; }
.seat.selected { outline: 3px solid #f3aa3b; }

.legend { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; font-size: 0.9rem; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

.booking-form .grid-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.booking-form h4 { margin: 0 0 10px; }
.fare-box {
  border: 1px dashed #b7c5dc;
  border-radius: 10px;
  padding: 10px;
  background: #f7fbff;
  margin: 10px 0;
}
.fare-line { display: flex; justify-content: space-between; margin: 4px 0; }

.small-text,
.hint { color: var(--muted); font-size: 0.9rem; }

.tag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.tag-btn {
  border: 1px solid #cbd8ec;
  background: #f7faff;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.inline-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-scroll { max-height: 320px; overflow: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px; border-bottom: 1px solid #e2e9f5; text-align: left; }

a { color: inherit; }

.log-card pre {
  margin: 0;
  background: #0a1a35;
  color: #cce4ff;
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  max-height: 320px;
}

.auth-hub {
  background: linear-gradient(120deg, rgba(10, 63, 143, 0.04), rgba(0, 167, 198, 0.05));
  border: 1px solid #c8d8ee;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-card {
  border: 1px solid #d6e2f5;
  border-radius: 14px;
  background: #fff;
  padding: 20px 14px 14px;
  display: grid;
  gap: 7px;
  min-height: 220px;
}

.auth-card h3 {
  margin: 0;
  color: #0b3b86;
  font-size: 1.2rem;
}

.auth-desc {
  margin: 0 0 4px;
  color: var(--muted);
}

.search-select-wrap { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #c6d3e8;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 25;
  max-height: 280px;
  overflow: auto;
}
.dropdown.hidden { display: none; }
.dropdown-search {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 8px;
  border-bottom: 1px solid #e1e8f4;
}
.dropdown-group {
  margin: 0;
  padding: 8px;
  background: #f4f8ff;
  font-weight: 700;
  color: #3c4f76;
}
.dropdown-item {
  padding: 8px 10px;
  cursor: pointer;
}
.dropdown-item:hover { background: #edf4ff; }

@media (max-width: 1100px) {
  .utility-bar {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  .utility-right {
    width: 100%;
    justify-content: flex-end;
  }

  .main-nav {
    padding: 8px 12px;
  }

  .nav-brand {
    width: 100%;
    margin-bottom: 4px;
  }

  .top-actions-strip {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin: 0;
    padding: 4px 0;
  }

  .search-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-grid { grid-template-columns: 1fr; }

  .booking-layout,
  .trip-top,
  .trip-open,
  .grid-2,
  .booking-form .grid-fields { grid-template-columns: 1fr; }

  .trip-route h4,
  .trip-fare,
  .trip-time strong { font-size: 1.15rem; }
}
