:root {
  --bg: #f7f7f7;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #fffaf0;
  --text: #010101;
  --muted: #555555;
  --line: rgba(1, 1, 1, 0.12);
  --accent: #e4ae19;
  --accent-dark: #010101;
  --accent-soft: #fff3c7;
  --brand-blue: #010101;
  --brand-blue-soft: #f7e4a3;
  --return-soft: #fff3c7;
  --return-text: #010101;
  --shadow: 0 18px 45px rgba(1, 1, 1, 0.12);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(228, 174, 25, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(1, 1, 1, 0.16), transparent 24%),
    linear-gradient(180deg, #fffaf0 0%, #f7f7f7 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1280px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 28px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: grid;
  gap: 22px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-logo {
  width: 110px;
  display: block;
  object-fit: contain;
}

.auth-title {
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.auth-form {
  gap: 16px;
  width: 100%;
}

.login-hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.text-link-button {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--brand-blue);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.text-link-button:hover {
  color: var(--accent);
}

.auth-form .primary-button {
  width: 100%;
  justify-content: center;
}

.topbar,
.panel,
.card,
.bus-tile {
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.topbar {
  position: relative;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 20px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 118px;
  height: auto;
  display: block;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

h1 {
  font-size: clamp(1.55rem, 2.3vw, 2.35rem);
}

.hero-copy,
.section-copy,
.card-head p,
.calendar-caption,
.trip-meta,
.empty-state span {
  color: var(--muted);
}

.hero-copy {
  max-width: 32ch;
  text-align: right;
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-live {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.topbar-live strong {
  font-size: 0.98rem;
  color: var(--text);
}

.topbar-live span {
  color: var(--muted);
  font-size: 0.9rem;
}

.user-menu-shell {
  position: relative;
  z-index: 45;
}

.user-menu-button {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.user-menu-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--brand-blue) 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 24px rgba(1, 1, 1, 0.16);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.user-menu-avatar.has-image {
  color: transparent;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  z-index: 60;
}

.user-menu-card {
  padding: 16px;
  border-radius: 20px;
  background: #fffaf0;
  border: 1px solid rgba(1, 1, 1, 0.08);
  box-shadow: 0 18px 40px rgba(1, 1, 1, 0.16);
  display: grid;
  gap: 8px;
}

.user-menu-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.layout {
  display: grid;
  gap: 20px;
}

.site-footer {
  padding: 2px 6px 10px;
  text-align: center;
  display: grid;
  gap: 4px;
}

.site-footer-version {
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer-version strong {
  color: var(--accent);
  font-weight: 800;
}

.site-footer-link {
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.site-footer-link:hover {
  color: var(--brand-blue);
}

.panel {
  padding: 22px;
}

.section-head,
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head-compact {
  margin-bottom: 10px;
}

.overview-controls {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
}

.overview-search {
  min-width: 220px;
}

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

.bus-tile {
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.bus-tile:hover {
  transform: translateY(-2px);
}

.bus-tile.active {
  border-color: rgba(1, 1, 1, 0.4);
  box-shadow: 0 18px 45px rgba(1, 1, 1, 0.16);
}

.bus-image-shell {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 10px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(228, 174, 25, 0.12), rgba(1, 1, 1, 0.12));
}

.bus-image {
  max-width: 100%;
  max-height: 88px;
  object-fit: contain;
}

.bus-info {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.bus-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.fleet-panel {
  background:
    radial-gradient(circle at top left, rgba(228, 174, 25, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(1, 1, 1, 0.2), transparent 32%),
    linear-gradient(145deg, rgba(1, 1, 1, 0.96), rgba(24, 24, 24, 0.94));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 55px rgba(8, 12, 26, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.fleet-panel .eyebrow,
.fleet-panel h2,
.fleet-panel .section-copy {
  color: #fffaf0;
}

.fleet-panel .section-copy {
  color: rgba(255, 250, 240, 0.78);
}

.fleet-panel .bus-tile {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 14px 28px rgba(5, 8, 18, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.fleet-panel .bus-tile.active {
  border-color: rgba(228, 174, 25, 0.42);
  box-shadow:
    0 18px 36px rgba(5, 8, 18, 0.28),
    0 0 0 1px rgba(1, 1, 1, 0.2);
}

.fleet-panel .bus-image-shell {
  background:
    radial-gradient(circle at 18% 24%, rgba(228, 174, 25, 0.38), transparent 42%),
    radial-gradient(circle at 82% 22%, rgba(1, 1, 1, 0.34), transparent 40%),
    linear-gradient(135deg, rgba(228, 174, 25, 0.38), rgba(1, 1, 1, 0.58) 62%, rgba(1, 1, 1, 0.46));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 24px rgba(9, 13, 28, 0.12);
}

.fleet-panel .bus-info strong {
  color: #ffffff;
}

.fleet-panel .bus-meta {
  color: rgba(255, 250, 240, 0.82);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 18px;
}

.card {
  padding: 20px;
  background: var(--panel-strong);
}

.booking-form,
.card-head {
  display: grid;
  gap: 14px;
}

.input-help {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(1, 1, 1, 0.18);
  border-color: var(--accent);
}

.currency-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.currency-field:focus-within {
  outline: 2px solid rgba(1, 1, 1, 0.18);
  border-color: var(--accent);
}

.currency-prefix {
  padding: 12px 0 12px 14px;
  color: var(--muted);
  font-weight: 800;
}

.currency-field input {
  border: none;
  border-radius: 0;
  outline: none;
  box-shadow: none;
}

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

.primary-button,
.ghost-button {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.form-actions,
.trip-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--brand-blue) 100%);
  color: #fff;
  font-weight: 800;
}

.ghost-button {
  padding: 10px 14px;
  background: rgba(1, 1, 1, 0.06);
  color: var(--text);
  font-weight: 700;
}

.danger-button {
  background: rgba(228, 174, 25, 0.12);
  color: var(--accent-dark);
}

.popover-confirm {
  display: grid;
  gap: 18px;
}

.popover-confirm p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.calendar-caption {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.calendar-grid {
  --calendar-gap: 10px;
  --timeline-row-height: 86px;
  --timeline-row-gap: 8px;
  --timeline-bar-offset: 26px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--calendar-gap);
}

.calendar-weekday {
  padding: 10px;
  text-align: center;
  background: rgba(1, 1, 1, 0.05);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.calendar-week {
  grid-column: 1 / -1;
}

.calendar-week-board {
  position: relative;
}

.calendar-days-row,
.calendar-timeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--calendar-gap);
}

.calendar-day {
  position: relative;
  min-height: calc(98px + (var(--lane-count, 1) * var(--timeline-row-height)) + ((var(--lane-count, 1) - 1) * var(--timeline-row-gap)));
  padding: 12px 12px 44px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  align-content: start;
}

.calendar-day-footer {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: grid;
  gap: 4px;
}

.calendar-holiday-badges,
.calendar-commemorative-list {
  display: grid;
  gap: 4px;
}

.calendar-holiday-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(228, 174, 25, 0.12);
  color: var(--accent-dark);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.2;
}

.calendar-commemorative-item {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
}

.calendar-day.is-muted {
  opacity: 0.38;
}

.calendar-day.is-today {
  border-color: var(--brand-blue);
  box-shadow: inset 0 0 0 2px rgba(1, 1, 1, 0.16);
}

.calendar-day-number {
  font-weight: 800;
}

.calendar-timeline {
  position: absolute;
  inset: 6px 0 42px 0;
  pointer-events: none;
  padding: 0;
  display: block;
}

.timeline-bar {
  position: absolute;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.77rem;
  font-weight: 700;
  border: 1px solid transparent;
  overflow: visible;
  pointer-events: auto;
  box-shadow: 0 8px 18px rgba(1, 1, 1, 0.1);
}

.timeline-bar-content {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  width: 100%;
}

.timeline-bus-code {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--trip-badge-bg, rgba(255, 255, 255, 0.72));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}

.timeline-bar.booked {
  background: var(--trip-bar-bg, var(--brand-blue-soft));
  color: var(--trip-bar-text, #010101);
}

.timeline-bar.departure {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.timeline-bar.return {
  background: var(--return-soft);
  color: var(--return-text);
}

.timeline-bar.starts-here {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.timeline-bar.ends-here {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.timeline-bar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-bar-label {
  min-width: 0;
  text-align: center;
  font-size: 0.62rem;
}

.timeline-bar-tools {
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 18, 33, 0.88);
  box-shadow: 0 10px 20px rgba(15, 18, 33, 0.18);
}

.timeline-icon-button,
.icon-button {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  color: #010101;
  font-size: 0.62rem;
  font-weight: 800;
}

.calendar-popover-header .icon-button {
  width: 34px;
  height: 34px;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 10px 18px rgba(1, 1, 1, 0.12);
}

.timeline-icon-image {
  width: 12px;
  height: 12px;
  display: block;
  object-fit: contain;
}

.trip-list {
  display: grid;
  gap: 8px;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.legend i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.legend-booked {
  background: var(--brand-blue-soft);
}

.legend-departure {
  background: var(--accent-soft);
}

.legend-return {
  background: var(--return-soft);
}

.trip-item,
.empty-state {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}

.trip-item {
  display: grid;
  gap: 10px;
}

.trip-title-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.hidden {
  display: none;
}

.calendar-popover {
  position: fixed;
  inset: 0;
  background: rgba(1, 1, 1, 0.18);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.calendar-popover.hidden {
  display: none;
}

.calendar-popover-card {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: 24px;
  background: #fffaf0;
  border: 1px solid rgba(1, 1, 1, 0.1);
  box-shadow: 0 24px 60px rgba(1, 1, 1, 0.18);
  padding: 20px;
  display: grid;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(1, 1, 1, 0.5) rgba(1, 1, 1, 0.08);
}

.calendar-popover-card::-webkit-scrollbar {
  width: 10px;
}

.calendar-popover-card::-webkit-scrollbar-track {
  background: rgba(1, 1, 1, 0.08);
  border-radius: 999px;
}

.calendar-popover-card::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(228, 174, 25, 0.72), rgba(1, 1, 1, 0.72));
  border-radius: 999px;
}

.calendar-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.calendar-popover-content,
.popover-stack,
.popover-form {
  display: grid;
  gap: 12px;
}

.admin-header,
.admin-users-list {
  display: grid;
  gap: 10px;
}

.creator-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(1, 1, 1, 0.06);
  border: 1px solid rgba(1, 1, 1, 0.1);
}

.creator-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--brand-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
}

.creator-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.creator-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.creator-meta {
  display: grid;
  gap: 2px;
}

.creator-meta span {
  color: var(--muted);
  font-size: 0.88rem;
}

.inline-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.inline-toggle input {
  width: 18px;
  height: 18px;
}

.admin-user-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.status-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(1, 1, 1, 0.09);
  color: var(--brand-blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.trip-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.empty-state {
  text-align: center;
  display: grid;
  gap: 4px;
}

@media (max-width: 1100px) {
  .bus-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 1280px);
    padding-top: 18px;
  }

  .auth-screen {
    padding: 16px;
  }

  .auth-card {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .auth-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-logo {
    width: 96px;
  }

  .topbar,
  .section-head,
  .detail-header,
  .calendar-top {
    flex-direction: column;
    align-items: start;
  }

  .hero-copy {
    text-align: left;
    max-width: none;
  }

  .topbar-side {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-live {
    justify-items: start;
  }

  .overview-controls {
    width: 100%;
    align-items: stretch;
  }

  .overview-search {
    min-width: 0;
    width: 100%;
  }

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

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    --calendar-gap: 8px;
    --timeline-row-height: 78px;
    --timeline-bar-offset: 24px;
  }

  .calendar-day {
    min-height: calc(60px + (var(--lane-count, 1) * var(--timeline-row-height)) + ((var(--lane-count, 1) - 1) * var(--timeline-row-gap)));
    padding: 10px;
  }

  .calendar-days-row,
  .calendar-timeline {
    gap: var(--calendar-gap);
  }

  .timeline-bar {
    min-height: 38px;
    padding: 7px 9px;
    flex-direction: column;
    align-items: start;
    justify-content: center;
  }

  .calendar-timeline {
    inset: 32px 0 8px 0;
    padding: 0 4px;
  }
}
