:root {
  color-scheme: light;
  --blue-deep: #0c4c86;
  --blue: #136eb4;
  --blue-soft: #4eb6d0;
  --yellow: #fff018;
  --ink: #08223d;
  --muted: #55718a;
  --line: rgba(8, 34, 61, 0.14);
  --panel: rgba(255, 255, 255, 0.92);
  --white: #ffffff;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(5, 32, 58, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(78, 182, 208, 0.95), rgba(19, 110, 180, 0.96) 52%, rgba(12, 76, 134, 0.98)),
    var(--blue);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.hero {
  position: relative;
  min-height: clamp(260px, 42vw, 520px);
  overflow: hidden;
  background: var(--blue);
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(8, 34, 61, 0.04), rgba(8, 34, 61, 0.22));
  pointer-events: none;
}

.hero__image {
  width: 100%;
  height: 100%;
  min-height: clamp(260px, 42vw, 520px);
  object-fit: cover;
  object-position: center top;
  display: block;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--white);
  font-weight: 900;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.brand__text {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
  overflow-wrap: anywhere;
}

.nav-link {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--white);
  font-weight: 800;
  background: rgba(8, 34, 61, 0.2);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: -44px auto 56px;
  position: relative;
  z-index: 3;
}

.intro,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 4vw, 36px);
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue-deep);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(1.35rem, 3vw, 2.25rem);
}

h3 {
  margin-bottom: 6px;
}

.lede,
.section-heading p,
.muted {
  color: var(--muted);
}

.lede {
  max-width: 58ch;
  margin-bottom: 0;
  font-size: 1.05rem;
}

.section-heading {
  color: var(--white);
  margin: 26px 0 14px;
}

.section-heading p {
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
  background: var(--white);
  text-align: center;
}

.button--primary {
  background: var(--yellow);
}

.button--ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.button--danger {
  color: var(--white);
  background: var(--danger);
}

.bus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.bus-card {
  min-height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(5, 32, 58, 0.13);
}

.bus-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-header {
  display: grid;
  gap: 18px;
  padding: 24px clamp(16px, 4vw, 56px);
  color: var(--white);
}

.page-header .brand {
  justify-self: start;
}

.page-header__body {
  width: min(1120px, 100%);
  margin: 0 auto;
}

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

.panel {
  padding: clamp(18px, 4vw, 32px);
}

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

.field {
  display: grid;
  gap: 7px;
}

.field--full {
  grid-column: 1 / -1;
}

label {
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--white);
}

input,
select {
  min-height: 46px;
  appearance: auto;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.panel--stacked {
  margin-top: 18px;
}

.delegate-corner {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
}

.delegate-icon-button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  padding: 9px 13px;
  color: var(--white);
  cursor: pointer;
  font-weight: 900;
  background: rgba(8, 34, 61, 0.48);
  box-shadow: 0 12px 28px rgba(5, 32, 58, 0.2);
}

.delegate-icon-button--active {
  color: var(--ink);
  background: var(--yellow);
}

.delegate-popover {
  position: absolute;
  top: 52px;
  right: 0;
  width: min(330px, calc(100vw - 28px));
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.delegate-popover h2 {
  font-size: 1.15rem;
}

.delegate-login {
  display: grid;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 22px;
  font-weight: 800;
}

.check-row input {
  width: 20px;
  min-height: 20px;
}

.status {
  min-height: 26px;
  margin-top: 14px;
  font-weight: 800;
}

.status[data-tone="success"] {
  color: #087443;
}

.status[data-tone="error"] {
  color: var(--danger);
}

.admin-tools {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto;
  gap: 12px;
  align-items: end;
  margin: 20px 0;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

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

.table-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  white-space: nowrap;
}

.table-check input,
td input[type="checkbox"],
th input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
}

.export-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.export-grid__label {
  flex-basis: 100%;
  margin-bottom: 0;
}

.export-grid .button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.recurring-list {
  display: grid;
  gap: 10px;
}

.recurring-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
}

.recurring-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.submission-list {
  display: grid;
  gap: 10px;
}

.submission-day {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.submission-day:first-child {
  margin-top: 0;
}

.submission-day h3,
.submission-day h4 {
  margin-bottom: 0;
}

.submission-day h3 {
  border-bottom: 2px solid rgba(8, 34, 61, 0.12);
  padding-bottom: 8px;
}

.submission-day h4 {
  margin-top: 8px;
  color: var(--blue-deep);
}

.submission-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--yellow);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
}

.submission-card--fault {
  border-left-color: var(--danger);
}

.submission-card--resolved {
  border-left-color: #087443;
  background: #f0fff7;
}

.submission-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.submission-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.submission-card__meta span {
  margin: 0;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--ink);
  background: rgba(19, 110, 180, 0.1);
  font-size: 0.82rem;
  font-weight: 800;
}

.submission-card__action {
  justify-self: start;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-section-title {
  margin-top: 28px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--white);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--blue-deep);
  font-size: 0.82rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  padding: 28px;
  color: var(--white);
  text-align: center;
}

.admin-lock {
  max-width: 520px;
  margin: 42px auto 0;
}

@media (max-width: 760px) {
  .intro,
  .admin-tools,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .brand {
    max-width: 72%;
  }

  .delegate-corner {
    top: 12px;
    right: 12px;
  }

  .brand__mark {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }

  .shell,
  .page-shell {
    width: min(100% - 20px, 1120px);
  }

  .shell {
    margin-top: -28px;
  }

  .page-header {
    padding: 18px 14px 24px;
  }

  h1 {
    font-size: clamp(1.8rem, 12vw, 3rem);
    line-height: 1;
  }

  h2 {
    font-size: 1.3rem;
  }

  .intro {
    align-items: stretch;
    display: grid;
  }

  .hero__image {
    object-position: 50% top;
  }

  .button {
    width: 100%;
  }

  .recurring-item {
    display: grid;
  }

  .export-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .export-grid__label {
    grid-column: 1 / -1;
  }

  .table-wrap {
    margin-inline: -10px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 11px 10px;
    font-size: 0.86rem;
  }
}

@media (max-width: 430px) {
  .hero {
    min-height: 220px;
  }

  .hero__image {
    min-height: 220px;
  }

  .brand__text {
    font-size: 0.92rem;
    line-height: 1.1;
  }

  .nav-link {
    padding: 9px 10px;
  }

  .panel,
  .intro {
    padding: 18px 14px;
  }

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