:root,
[data-theme="light"] {
  --bg: #f3f8f5;
  --bg-soft: #e7f0eb;
  --panel: #ffffff;
  --panel-2: #f2f7f4;
  --ink: #10241d;
  --muted: #5a7268;
  --accent: #c9920a;
  --accent-2: #0d8a7d;
  --danger: #dc2626;
  --ok: #16a34a;
  --line: rgba(16, 36, 29, 0.1);
  --shadow: 0 20px 50px rgba(16, 36, 29, 0.08);
  --shadow-soft: 0 8px 24px rgba(16, 36, 29, 0.05);
  --radius: 20px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --body-grad:
    radial-gradient(1000px 520px at 0% -5%, rgba(13, 138, 125, 0.14), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(201, 146, 10, 0.14), transparent 50%),
    linear-gradient(165deg, #f8fbf9, #eef5f1 45%, #f3f8f5);
  --sidebar-bg: rgba(255, 255, 255, 0.88);
  --card-grad: linear-gradient(165deg, #ffffff 0%, #f6faf8 100%);
  --input-bg: rgba(16, 36, 29, 0.035);
  --nav-hover: rgba(13, 138, 125, 0.1);
  --btn-ghost: rgba(16, 36, 29, 0.05);
  --hero-overlay: linear-gradient(105deg, rgba(16, 36, 29, 0.78) 0%, rgba(16, 36, 29, 0.35) 55%, rgba(16, 36, 29, 0.2) 100%);
  --hero-copy: #e8f2ee;
  --focus: rgba(13, 138, 125, 0.35);
}

[data-theme="dark"] {
  --bg: #0c221d;
  --bg-soft: #123029;
  --panel: #1a4036;
  --panel-2: #214d42;
  --ink: #f3f7f5;
  --muted: #a9c0b8;
  --accent: #f0b429;
  --accent-2: #2dd4bf;
  --danger: #ef4444;
  --ok: #22c55e;
  --line: rgba(243, 247, 245, 0.1);
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  --body-grad:
    radial-gradient(1100px 560px at 8% -8%, rgba(45, 212, 191, 0.16), transparent 58%),
    radial-gradient(900px 480px at 100% 0%, rgba(240, 180, 41, 0.14), transparent 52%),
    linear-gradient(160deg, #0a1c18, #123029 42%, #0c221d);
  --sidebar-bg: rgba(12, 34, 29, 0.92);
  --card-grad: linear-gradient(165deg, rgba(36, 82, 70, 0.95), rgba(26, 64, 54, 0.98));
  --input-bg: rgba(0, 0, 0, 0.28);
  --nav-hover: rgba(45, 212, 191, 0.12);
  --btn-ghost: rgba(255, 255, 255, 0.06);
  --hero-overlay: linear-gradient(105deg, rgba(8, 22, 18, 0.82) 0%, rgba(12, 34, 29, 0.45) 55%, rgba(12, 34, 29, 0.25) 100%);
  --hero-copy: #e8f2ee;
  --focus: rgba(45, 212, 191, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--body-grad);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--accent); }
.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar-bg);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
  padding: 1.35rem 1rem 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  margin: 0 0 1.4rem;
  padding: 0 0.35rem;
}
.brand span { color: var(--accent); }
.nav { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.72rem 0.9rem;
  border-radius: 14px;
  color: var(--muted);
  margin-bottom: 0.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav a:hover { transform: translateX(2px); }
.nav a.active, .nav a:hover {
  background: var(--nav-hover);
  color: var(--ink);
}
.nav a.active {
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-primary {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.nav-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.main { padding: 1.6rem 1.75rem 2rem; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.4rem; gap: 1rem; flex-wrap: wrap;
}
.topbar h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.15rem);
  margin-bottom: 0.2rem;
}
.topbar h1::after {
  content: "";
  display: block;
  width: 2.4rem;
  height: 3px;
  margin-top: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.topbar .muted { margin-top: 0.15rem; }
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.035em;
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.muted { color: var(--muted); line-height: 1.45; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-soft);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), transparent);
  pointer-events: none;
  border-radius: inherit;
}
[data-theme="dark"] .card::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
}
.card:hover {
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent-2) 28%, var(--line));
}
.stat {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.btn, button, .button {
  appearance: none; border: 0; cursor: pointer;
  background: var(--accent); color: #1a1405;
  font-weight: 800; border-radius: 999px;
  padding: 0.78rem 1.25rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font-family: inherit; font-size: 0.95rem;
  box-shadow: 0 8px 20px rgba(201, 146, 10, 0.22);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover, button:hover, .button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 12px 26px rgba(201, 146, 10, 0.28);
}
.btn:active, button:active { transform: translateY(0); }
.btn.secondary, button.secondary {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.secondary:hover, button.secondary:hover {
  background: var(--btn-ghost);
  box-shadow: none;
  filter: none;
}
.btn.danger { background: var(--danger); color: white; box-shadow: 0 8px 20px rgba(220, 38, 38, 0.22); }
.btn.ok { background: var(--ok); color: #052e16; box-shadow: none; }
.btn.ghost { background: var(--btn-ghost); color: var(--ink); box-shadow: none; }

label { display: block; font-size: 0.86rem; color: var(--muted); margin-bottom: 0.4rem; font-weight: 650; }
input, select, textarea {
  width: 100%; padding: 0.82rem 0.95rem; border-radius: 14px;
  border: 1px solid var(--line); background: var(--input-bg); color: var(--ink);
  font: inherit; margin-bottom: 0.95rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--focus);
  background: var(--panel);
}
.form-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-top: 0.55rem; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 0.85rem 0.45rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

.badge {
  display: inline-flex; align-items: center;
  padding: 0.22rem 0.62rem; border-radius: 999px;
  font-size: 0.74rem; font-weight: 800;
  background: rgba(13,138,125,0.12); color: var(--accent-2);
}
[data-theme="dark"] .badge { background: rgba(45,212,191,0.15); }
.badge.pending { background: rgba(201,146,10,0.16); color: var(--accent); }
.badge.rejected, .badge.full { background: rgba(220,38,38,0.12); color: #b91c1c; }
[data-theme="dark"] .badge.rejected,
[data-theme="dark"] .badge.full { background: rgba(239,68,68,0.18); color: #fecaca; }
.badge.approved, .badge.ongoing { background: rgba(22,163,74,0.14); color: #15803d; }
[data-theme="dark"] .badge.approved,
[data-theme="dark"] .badge.ongoing { background: rgba(34,197,94,0.18); color: #bbf7d0; }
.badge.upcoming { background: rgba(13,138,125,0.12); color: var(--accent-2); }
[data-theme="dark"] .badge.upcoming { background: rgba(45,212,191,0.15); }

.btn-sm {
  padding: 0.48rem 0.9rem;
  font-size: 0.82rem;
  min-height: 0;
}

.trip-panel { padding: 1.25rem 1.3rem 1.1rem; }
.trip-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--line);
}
.trip-panel__head h3 { margin: 0; font-size: 1.25rem; }
.trip-panel__meta { margin: 0.35rem 0 0; font-size: 0.86rem; }

.trip-list { display: flex; flex-direction: column; gap: 0.55rem; }

.trip-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 70%, transparent);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.trip-row:hover {
  border-color: color-mix(in srgb, var(--accent-2) 30%, var(--line));
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}
.trip-row--live {
  background:
    linear-gradient(135deg, rgba(22,163,74,0.08), transparent 55%),
    color-mix(in srgb, var(--panel-2) 55%, transparent);
  border-color: color-mix(in srgb, #16a34a 28%, var(--line));
}
.trip-row--pending {
  background:
    linear-gradient(135deg, rgba(201,146,10,0.1), transparent 55%),
    color-mix(in srgb, var(--panel-2) 55%, transparent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}
.trip-row--soon {
  background:
    linear-gradient(135deg, rgba(13,138,125,0.08), transparent 55%),
    color-mix(in srgb, var(--panel-2) 55%, transparent);
}
.trip-row--done { opacity: 0.92; }

.trip-row__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  background: rgba(13,138,125,0.12);
  flex-shrink: 0;
}
.trip-row--live .trip-row__icon {
  color: #15803d;
  background: rgba(22,163,74,0.14);
}
.trip-row--pending .trip-row__icon {
  color: var(--accent);
  background: rgba(201,146,10,0.16);
}
.trip-row--done .trip-row__icon {
  color: var(--muted);
  background: var(--btn-ghost);
}
[data-theme="dark"] .trip-row__icon { background: rgba(45,212,191,0.14); }
[data-theme="dark"] .trip-row--live .trip-row__icon {
  color: #bbf7d0;
  background: rgba(34,197,94,0.16);
}
[data-theme="dark"] .trip-row--pending .trip-row__icon {
  color: var(--accent);
  background: rgba(240,180,41,0.16);
}

.trip-row__title {
  font-weight: 750;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.3;
}
.trip-row__arrow {
  color: var(--accent-2);
  font-weight: 700;
  margin: 0 0.15rem;
}
.trip-row__sub {
  margin-top: 0.28rem;
  font-size: 0.84rem;
  line-height: 1.35;
}
.trip-row__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}
.trip-row__actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.trip-row__actions form { margin: 0; }

.trip-empty {
  text-align: center;
  padding: 2rem 1rem 1.4rem;
}
.trip-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.7rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  background: rgba(13,138,125,0.12);
}
.trip-empty p {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.trip-empty--compact { padding: 0.85rem 0.2rem; text-align: left; }

@media (max-width: 700px) {
  .trip-row {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
  .trip-row__aside {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
}

.flash {
  padding: 0.9rem 1.05rem; border-radius: 14px; margin-bottom: 1rem;
  background: rgba(13,138,125,0.1); border: 1px solid rgba(13,138,125,0.22);
}
[data-theme="dark"] .flash {
  background: rgba(45,212,191,0.15); border: 1px solid rgba(45,212,191,0.3);
}
.flash.error { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.28); }
[data-theme="dark"] .flash.error { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.35); }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  position: relative;
}
.auth-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 380px at 15% 20%, rgba(13, 138, 125, 0.16), transparent 60%),
    radial-gradient(600px 340px at 85% 80%, rgba(201, 146, 10, 0.14), transparent 55%);
  pointer-events: none;
}
.auth-card {
  width: min(460px, 100%);
  position: relative;
  padding: 1.6rem 1.55rem 1.45rem;
  animation: rise .45s ease both;
}
.auth-card h1 { font-size: 1.9rem; margin-bottom: 0.25rem; }
.auth-brand {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.04em;
  margin-bottom: 1.1rem;
}
.auth-brand span { color: var(--accent); }

.hero-home {
  min-height: 100vh;
  display: grid;
  align-content: end;
  padding: clamp(2rem, 5vw, 4rem) 1rem clamp(3rem, 8vw, 5.5rem);
  background:
    var(--hero-overlay),
    url('https://images.unsplash.com/photo-1544620341-a1f5e5beeb11?auto=format&fit=crop&w=2000&q=80') center/cover fixed;
  color: #f3f7f5;
  position: relative;
  overflow: hidden;
}
.hero-home::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 35%;
  background: linear-gradient(to top, rgba(8, 20, 16, 0.55), transparent);
  pointer-events: none;
}
.hero-home .container { position: relative; z-index: 1; max-width: 720px; margin-left: 0; }
.hero-home .brand span {
  background: linear-gradient(120deg, #f0b429, #f5d76e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-home .brand {
  font-size: clamp(3.2rem, 9vw, 5.6rem);
  margin-bottom: 0.55rem;
  color: #f3f7f5;
  animation: rise .55s ease both;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.hero-home p {
  max-width: 34rem;
  color: var(--hero-copy);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
  margin: 0;
  animation: rise .65s ease .05s both;
}
.hero-actions {
  display: flex; gap: 0.8rem; margin-top: 1.55rem; flex-wrap: wrap;
  animation: rise .7s ease .1s both;
}
.hero-actions .btn.secondary {
  color: #f3f7f5;
  border-color: rgba(243,247,245,0.35);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
}
.hero-actions .btn.secondary:hover {
  background: rgba(255,255,255,0.14);
}

.map-frame {
  height: 440px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-soft);
}
.seat-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.seat-controls .count {
  font-family: var(--font-display);
  font-size: 2.1rem; font-weight: 800; min-width: 3rem; text-align: center;
}
.ad-slot {
  border: 1px dashed rgba(201,146,10,0.45);
  color: var(--accent); border-radius: 14px; padding: 0.9rem; text-align: center; margin: 1rem 0;
  background: rgba(201,146,10,0.06);
}
.theme-switch {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  margin-bottom: 0.95rem;
}
.theme-switch button {
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: none;
}
.theme-switch button:hover { transform: none; filter: none; box-shadow: none; }
.theme-switch button.active {
  background: var(--accent);
  color: #1a1405;
  box-shadow: 0 4px 12px rgba(201, 146, 10, 0.25);
}
.theme-toggle-form { margin: 0; }

.location-picker-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input-bg);
}
.location-picker-summary {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}
.location-picker-icon {
  font-size: 1rem;
  line-height: 1.4;
  flex: 0 0 auto;
}
.location-picker-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.location-picker-actions .btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
}
.location-address {
  margin: 0;
  font-weight: 700;
  line-height: 1.45;
  font-size: 0.92rem;
  word-break: break-word;
}

body.location-modal-open { overflow: hidden; }

.location-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.location-modal[hidden] { display: none !important; }
.location-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 14, 0.62);
  backdrop-filter: blur(4px);
}
.location-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: calc(100vh - 2rem);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rise .25s ease both;
}
.location-modal-header,
.location-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.location-modal-footer {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}
.location-modal-close {
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  box-shadow: none;
  cursor: pointer;
}
.location-modal-close:hover {
  color: var(--ink);
  transform: none;
  filter: none;
}
.location-modal-body {
  padding: 0.85rem 1rem;
  overflow-y: auto;
}
.location-modal-body .location-search {
  margin: 0 0 0.6rem;
  width: 100%;
}
.location-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  max-height: 130px;
  overflow: auto;
}
.location-search-result {
  margin: 0;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.84rem;
  box-shadow: none;
  cursor: pointer;
}
.location-search-result:hover {
  background: rgba(201, 146, 10, 0.08);
  border-color: rgba(201, 146, 10, 0.25);
  transform: none;
  filter: none;
}
.location-modal .location-picker-map {
  height: 220px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #dbe7e2;
}
.location-modal .location-picker-map .leaflet-container {
  height: 100%;
  width: 100%;
  font: inherit;
}
.location-modal-address {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main { padding: 1.2rem 1rem 1.75rem; }
  .hero-home { background-attachment: scroll; align-content: end; }
}
