:root {
  --bg: #f1f4f9;
  --panel: #f7f8fb;
  --card: #ffffff;
  --border: #e1e6f2;
  --text: #191c33;
  --muted: #5a6175;
  --accent: #0c3f83;
  --accent-soft: #4c8dff;
  --success: #2bc975;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page-shell {
  min-height: 100vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.nav-bar {
  background: #111539;
  border-radius: 32px;
  padding: 1.5rem;
  color: #fff;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  box-shadow: 0 15px 40px rgba(5, 8, 39, 0.2);
}

.admin-page {
  background: var(--bg);
}

.admin-shell {
  padding: 2rem 3rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: var(--panel);
  border-radius: 32px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(15, 23, 55, 0.15);
}

.hero-stat {
  text-align: right;
}

.hero-stat strong {
  display: block;
  font-size: 1.5rem;
  color: var(--accent);
}

.form-grid,
.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.panel {
  background: var(--panel);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 15px 30px rgba(10, 13, 40, 0.15);
}

.panel-form label,
.admin-form form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.panel-form input,
.panel-form select,
.admin-form form input,
.admin-form form select {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
}

.panel-form button,
.admin-form form button {
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border-radius: 12px;
  border: none;
  color: #fff;
  padding: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
}

.admin-table {
  background: var(--panel);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 15px 30px rgba(10, 13, 40, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-table header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
  padding: 0.8rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.status-badge {
  padding: 0.2rem 0.6rem;
  background: rgba(43, 201, 117, 0.2);
  border-radius: 999px;
  color: var(--success);
  font-weight: 600;
}

.ghost-btn {
  background: rgba(17, 21, 56, 0.08);
  color: var(--text);
  border-radius: 12px;
  border: none;
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline article {
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.hourly-quotas {
  background: var(--panel);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 15px 30px rgba(10, 13, 40, 0.15);
}

.hourly-quotas header {
  margin-bottom: 1rem;
}

.hourly-quotas {
  background: var(--panel);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 15px 30px rgba(10, 13, 40, 0.15);
}

.quota-direction table {
  width: 100%;
  border-collapse: collapse;
}

.quota-direction th,
.quota-direction td {
  border: 1px solid var(--border);
  padding: 0.4rem;
  text-align: center;
}

.quota-direction th {
  background: #f3f5fb;
  color: var(--text);
}

.quota-direction td input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.3rem;
  text-align: center;
}

.admin-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border-radius: 24px;
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 15px 30px rgba(10, 13, 40, 0.15);
}

.admin-actions .message {
  margin: 0;
  font-weight: 600;
}

.agent-options {
  display: none;
  gap: 1rem;
}

.agent-options.is-visible {
  display: flex;
}

.tiny-password {
  width: 160px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 0.9rem;
  text-align: center;
}

.message.success {
  color: var(--success);
}

.message.error {
  color: #d02a2a;
}

.admin-station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.station-card.small {
  padding: 1rem;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 10px 20px rgba(17, 28, 58, 0.08);
}

.station-card.small .badge {
  align-self: flex-start;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
}

.status-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-subtitle {
  color: var(--muted);
  max-width: 38ch;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.brand-logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.2rem;
}

.brand-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.nav-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.logout-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.pill {
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s ease;
}

.pill.active {
  background: var(--accent);
  box-shadow: 0 10px 20px rgba(12, 63, 131, 0.35);
}

.user-pill {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
}

.user-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-selector select {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  font-size: 0.9rem;
}

.hero {
  background: var(--panel);
  border-radius: 32px;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  box-shadow: 0 25px 45px rgba(24, 33, 71, 0.15);
}

.hero h1 {
  margin: 0;
  font-size: 2.3rem;
  letter-spacing: -0.02em;
}

.hero-status {
  text-align: right;
}

.hero-status span {
  font-weight: 600;
  color: var(--accent);
  display: block;
  font-size: 1.05rem;
}

.hero-status p {
  margin: 0;
  color: var(--muted);
}

.stations-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.direction-row {
  background: var(--panel);
  border-radius: 32px;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(15, 23, 55, 0.15);
}

.direction-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.direction-label {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.4rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.direction-time {
  background: var(--card);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.station-card {
  background: var(--card);
  border-radius: 24px;
  padding: 1rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 140px;
  position: relative;
  box-shadow: 0 12px 30px rgba(17, 28, 58, 0.08);
}

.station-card .station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.station-code {
  font-weight: 700;
  font-size: 1.1rem;
}

.station-name {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(43, 201, 117, 0.12);
  color: var(--success);
}

.station-card .status {
  font-size: 0.85rem;
  color: var(--muted);
}

.station-card .time-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.time-chip {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #eef2ff;
  font-size: 0.8rem;
  color: var(--accent);
}

.station-card .cta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.station-highlight {
  border-color: var(--success);
  box-shadow: 0 12px 30px rgba(43, 201, 117, 0.25);
}

.station-card button {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
  letter-spacing: 0.05em;
}

.station-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border: none;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(11, 15, 45, 0.6);
  z-index: 50;
  padding: 1rem;
}

.overlay.visible {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: 28px;
  padding: 2rem;
  width: min(420px, 100%);
  box-shadow: 0 25px 60px rgba(15, 23, 55, 0.3);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-direction,
.modal-line,
.modal-quota {
  margin: 0.2rem 0;
  color: var(--muted);
}

.modal-error {
  color: #d02a2a;
  font-size: 0.9rem;
  height: 1.2rem;
}

.modal-card form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1rem;
}

.modal-card form input {
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.modal-card form button {
  margin-top: 1rem;
  width: 100%;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
  padding: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-bar {
    grid-template-columns: 1fr;
    text-align: center;
  }

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

.login-shell {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.login-card {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 30px 60px rgba(15, 23, 55, 0.15);
  text-align: left;
}

.login-card h1 {
  margin-top: 0;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form label {
  font-size: 0.95rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.login-form input {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
}

.login-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
  border: none;
  padding: 0.9rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.login-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

