:root {
  --bg: #f8fafc;
  --bg-accent: #fff7ed;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #f97316;
  --accent-dark: #c2410c;
  --card: #ffffff;
  --border: #e2e8f0;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Public Sans", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #fff7ed 0%, #f8fafc 45%, #f1f5f9 100%);
  color: var(--text);
  min-height: 100vh;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}

.brand {
  font-family: "Space Grotesk", "Public Sans", sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.3px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.35);
}

nav a {
  text-decoration: none;
  color: #f8fafc;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(248, 250, 252, 0.25);
}

.content {
  padding: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  font-family: "Space Grotesk", "Public Sans", sans-serif;
  font-size: 30px;
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

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

.section-title {
  margin: 12px 0 4px;
  font-family: "Space Grotesk", "Public Sans", sans-serif;
  font-size: 18px;
}

.rider-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title {
  font-family: "Space Grotesk", "Public Sans", sans-serif;
  font-size: 18px;
  margin: 0;
}

.panel-sub {
  margin: 0;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.stat-card {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
}

.stat-card strong {
  font-size: 20px;
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e2e8f0;
  color: #0f172a;
}

.badge--ok {
  background: #dcfce7;
  color: #166534;
}

.badge--warn {
  background: #fef3c7;
  color: #92400e;
}

.badge--late {
  background: #fee2e2;
  color: #7f1d1d;
}

.badge--info {
  background: #dbeafe;
  color: #1d4ed8;
}

.card {
  background: var(--card);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.task-card {
  display: grid;
  gap: 12px;
}

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

.task-head h3 {
  margin: 0;
  font-size: 18px;
}

.task-meta {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row.wrap {
  flex-wrap: wrap;
}

input,
select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

button,
.button {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.button.secondary {
  background: #0f172a;
}

.button.ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent-dark);
}

button:disabled,
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.alert {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  margin: 10px 0;
}

.route-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #0f172a;
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.route-box .button {
  background: #f97316;
}

.route-map {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.gps-status {
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  background: #e2e8f0;
}

.cashbox {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0 6px;
  background: var(--bg-accent);
}

.cashbox__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.cashbox__amount {
  font-size: 26px;
  font-weight: 700;
  margin: 4px 0 8px;
}

.cashbox__controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.cashbox__paid {
  max-width: 160px;
}

.cashbox__change {
  margin-top: 8px;
  font-weight: 700;
}

.scan-box {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.scan-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scan-manual input {
  max-width: 160px;
}

.history-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.history-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.due-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.due-pill {
  background: #dcfce7;
  color: #166534;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.due-pill.due-late {
  background: #fee2e2;
  color: #7f1d1d;
}

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

details summary {
  list-style: none;
  cursor: pointer;
}

details summary::-webkit-details-marker {
  display: none;
}

.qr-scan {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: grid;
  gap: 8px;
}

.qr-video {
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #111827;
}

.scan-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}

.scan-modal.is-open {
  display: flex;
}

.scan-modal__card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.scan-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scan-video {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #111827;
}

@media (max-width: 980px) {
  .rider-layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
