@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;900&family=Lato:wght@400;700;900&family=Cormorant+Garamond:ital,wght@1,500&display=swap');

:root {
  --saffron: #ff9933;
  --saffron-dark: #e07b00;
  --saffron-light: #ffd099;
  --saffron-pale: #fff4e6;
  --green: #138808;
  --green-dark: #0a6006;
  --green-pale: #ebf8eb;
  --navy: #000080;
  --cream: #fff9f2;
  --warm-white: #fffdf9;
  --dark: #1c1208;
  --text-body: #3a2800;
  --text-mid: #6b4f1a;
  --text-light: #9c7b45;
  --border: #e8d5b0;
  --red: #9d3b33;
  --shadow: 0 8px 40px rgba(28, 18, 8, .10);
  --shadow-hover: 0 14px 46px rgba(255, 153, 51, .22);
  --font-display: "Playfair Display", Georgia, serif;
  --font-elegant: "Cormorant Garamond", Georgia, serif;
  --font-body: "Lato", "Segoe UI", system-ui, sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--warm-white);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.tricolor-strip {
  height: 5px;
  background: linear-gradient(to right, var(--saffron) 0 33.3%, #fff 33.3% 66.6%, var(--green) 66.6% 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(18px, 4vw, 48px);
  min-height: 76px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 253, 249, .96);
  box-shadow: 0 2px 20px rgba(28, 18, 8, .08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  text-decoration: none;
  color: var(--dark);
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--saffron-dark);
  letter-spacing: .05em;
}

.brand-text span {
  font-family: var(--font-elegant);
  color: var(--text-mid);
  font-size: .86rem;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-body);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 13px;
  border-radius: 4px;
}

nav a:hover {
  color: var(--saffron-dark);
  background: var(--saffron-pale);
}

.public-shell,
.admin-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.public-shell { padding: 0 0 80px; }
.admin-shell { padding: 42px 0 80px; }

.hero {
  margin-inline: calc(50% - 50vw);
  padding: 72px max(24px, calc(50vw - 560px)) 64px;
  background:
    radial-gradient(rgba(255, 153, 51, .07) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(135deg, var(--dark) 0%, #3a1800 56%, var(--green-dark) 100%);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "AISA";
  position: absolute;
  right: -28px;
  top: 18px;
  font-family: var(--font-display);
  font-size: 12rem;
  color: rgba(255, 153, 51, .055);
  pointer-events: none;
}

.hero h1,
.panel h1,
.payment-screen h1 {
  font-family: var(--font-display);
  color: inherit;
}

.hero h1 {
  max-width: 850px;
  margin: 0 auto 18px;
  font-size: 4rem;
  line-height: 1.08;
}

.hero p {
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--font-elegant);
  font-size: 1.35rem;
  font-style: italic;
  color: rgba(255, 255, 255, .74);
}

h1 {
  font-size: 3rem;
  line-height: 1.12;
  margin: 0 0 16px;
}

h2 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  color: var(--dark);
}

p { line-height: 1.65; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--saffron-dark);
  font-weight: 900;
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .14em;
}

.eyebrow::after {
  content: "";
  width: 44px;
  height: 2px;
  background: var(--saffron);
  border-radius: 2px;
}

.list {
  display: grid;
  gap: 18px;
  padding-top: 42px;
}

.trip-card,
.panel,
.state-card,
.metrics article,
.qr-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.trip-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  border-top: 4px solid var(--saffron);
}

.trip-card:hover {
  box-shadow: var(--shadow-hover);
}

.panel {
  padding: 30px;
  margin: 34px 0 22px;
}

.panel.wide { overflow: hidden; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 2px solid var(--saffron);
  border-radius: 6px;
  background: var(--saffron);
  color: var(--dark);
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .84rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  background: var(--saffron-dark);
  border-color: var(--saffron-dark);
  color: #fff;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.button.primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: .75rem;
}

.button.danger {
  background: #fff;
  border-color: var(--red);
  color: var(--red);
}

.inline-form {
  display: inline-flex;
  margin-left: 6px;
}

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

.stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text-mid);
  font-size: .88rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font: inherit;
  color: var(--text-body);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(255, 153, 51, .22);
  border-color: var(--saffron);
}

textarea { resize: vertical; }
.full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

.payment-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  padding-top: 44px;
}

.payment-screen > div:first-child {
  grid-row: span 2;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px;
  border-top: 4px solid var(--saffron);
}

.payment-screen h1 {
  font-size: 6rem;
  letter-spacing: 0;
  color: var(--dark);
}

.amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--green-dark);
  margin: 0;
}

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

.copy-button {
  width: 100%;
  background: #fff;
  border-color: var(--border);
  color: var(--text-body);
}

.copy-button:hover {
  background: var(--saffron-pale);
  border-color: var(--saffron);
  color: var(--dark);
}

.qr-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.qr-card img {
  width: min(100%, 260px);
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.qr-card span {
  color: var(--text-light);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.qr-card strong {
  font-family: var(--font-display);
  color: var(--dark);
  font-size: 1.55rem;
}

.state-card {
  padding: 24px;
  display: grid;
  gap: 8px;
  border-left: 5px solid var(--saffron);
}

.state-card strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--dark);
}

.state-card.waiting { background: #fffaf2; }
.state-card.success { border-left-color: var(--green); background: var(--green-pale); }
.state-card.expired { border-left-color: var(--red); background: #fff6f3; }

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

.metrics article {
  padding: 22px;
}

.metrics span { color: var(--text-mid); }
.metrics strong {
  display: block;
  font-family: var(--font-display);
  color: var(--dark);
  font-size: 42px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: stretch;
  padding: 30px;
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 153, 51, .16), transparent 34%),
    linear-gradient(135deg, var(--dark) 0%, #3a1800 58%, var(--green-dark) 100%);
  box-shadow: var(--shadow);
}

.dashboard-hero h1 {
  color: #fff;
  margin-bottom: 10px;
}

.dashboard-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, .74);
}

.dashboard-total {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 160px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .08);
}

.dashboard-total span,
.dashboard-metrics span {
  color: var(--text-mid);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dashboard-total span {
  color: rgba(255, 255, 255, .72);
}

.dashboard-total strong {
  font-family: var(--font-display);
  font-size: 4.6rem;
  line-height: 1;
  color: var(--saffron-light);
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}

.dashboard-metrics article {
  display: grid;
  gap: 6px;
  padding: 18px;
  min-height: 128px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-metrics strong {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--dark);
}

.dashboard-metrics small {
  color: var(--text-light);
  font-weight: 700;
}

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

.manifest-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.manifest-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.manifest-card h2 {
  font-size: 1.7rem;
}

.manifest-card-head > strong {
  font-family: var(--font-display);
  color: var(--green-dark);
  font-size: 3rem;
  line-height: 1;
}

.seat-meter {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1dfbd;
}

.seat-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--saffron), var(--green));
}

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

.seat-stats span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-mid);
  background: var(--warm-white);
  font-size: .8rem;
  font-weight: 900;
}

.seat-stats strong {
  font-family: var(--font-display);
  color: var(--dark);
  font-size: 1.45rem;
  line-height: 1;
}

.bus-manifest {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 118px;
}

.bus-fill {
  display: grid;
  grid-template-rows: 88px auto;
  gap: 7px;
  justify-items: center;
}

.bus-fill::before {
  content: "";
  grid-row: 1;
  width: 100%;
  max-width: 64px;
  height: 88px;
  border: 2px solid var(--dark);
  border-radius: 8px 8px 5px 5px;
  background:
    radial-gradient(circle at 20% 14%, rgba(28, 18, 8, .38) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 14%, rgba(28, 18, 8, .38) 0 3px, transparent 4px),
    radial-gradient(circle at 80% 14%, rgba(28, 18, 8, .38) 0 3px, transparent 4px),
    linear-gradient(to top, var(--green) var(--fill-height, 0%), #f3e4c8 var(--fill-height, 0%));
}

.bus-fill em {
  color: var(--text-mid);
  font-size: .72rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.notice {
  padding: 14px 16px;
  border-radius: 6px;
  background: var(--green-pale);
  border: 1px solid #b2dfb2;
  margin-bottom: 18px;
}

.muted { color: var(--text-mid); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--text-mid); text-transform: capitalize; }

.site-footer {
  background: var(--green-dark);
  color: rgba(255, 255, 255, .9);
  padding: 42px 24px;
}

.footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255, 255, 255, .12);
  padding: 4px;
}

.footer-brand div {
  display: grid;
}

.footer-brand strong {
  font-family: var(--font-display);
  color: var(--saffron-light);
  font-size: 1.45rem;
}

.footer-brand span,
.site-footer p {
  color: rgba(255, 255, 255, .72);
}

.site-footer p {
  max-width: 620px;
  margin: 0;
}

.site-footer a {
  color: var(--saffron-light);
}

.footer-tricolor {
  height: 3px;
  background: linear-gradient(to right, var(--saffron) 0 33.3%, #fff 33.3% 66.6%, var(--green) 66.6% 100%);
}

.admin-page {
  background: linear-gradient(180deg, #fff9f2 0%, #fffdf9 42%);
}

.admin-topbar .brand {
  font-family: var(--font-display);
  color: var(--dark);
}

.admin-shell .panel,
.admin-shell .metrics article {
  border-radius: var(--radius);
}

@media (max-width: 760px) {
  .topbar,
  .trip-card,
  .payment-screen {
    display: grid;
  }

  .topbar {
    justify-items: start;
    padding-block: 12px;
  }

  .brand-text span {
    font-size: .78rem;
  }

  .hero::after {
    font-size: 7rem;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .hero p {
    font-size: 1.12rem;
  }

  h1 {
    font-size: 2rem;
  }

  .payment-screen h1 {
    font-size: 3.25rem;
  }

  .grid-form,
  .metrics,
  .dashboard-hero,
  .dashboard-metrics,
  .manifest-grid,
  .seat-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-total {
    min-height: 128px;
  }

  .payment-screen {
    grid-template-columns: 1fr;
  }

  .payment-screen > div:first-child {
    grid-row: auto;
    padding: 26px 20px;
  }

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

  .panel {
    padding: 24px 20px;
  }
}
