@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg-top: #fff5eb;
  --bg-bottom: #f3e4d8;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-soft: rgba(255, 248, 241, 0.92);
  --text: #211814;
  --muted: #73645b;
  --line: rgba(120, 0, 1, 0.12);
  --line-strong: rgba(120, 0, 1, 0.18);
  --accent: #780001;
  --accent-strong: #5f0001;
  --accent-soft: rgba(120, 0, 1, 0.08);
  --accent-glow: rgba(120, 0, 1, 0.18);
  --success: #0f8a5f;
  --warning: #af6a00;
  --shadow-lg: 0 22px 54px rgba(75, 37, 15, 0.14);
  --shadow-md: 0 14px 34px rgba(75, 37, 15, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  font-family: "Montserrat", "Gilroy", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.76) 0%, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at top right, rgba(120, 0, 1, 0.1) 0%, rgba(120, 0, 1, 0) 34%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--text);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(12px);
  pointer-events: none;
}

body::before {
  width: 220px;
  height: 220px;
  right: -50px;
  top: 80px;
  background: rgba(120, 0, 1, 0.08);
}

body::after {
  width: 180px;
  height: 180px;
  left: -40px;
  bottom: 110px;
  background: rgba(235, 172, 87, 0.12);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 920px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 16px calc(108px + env(safe-area-inset-bottom, 0px));
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 20px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(120, 0, 1, 0.96) 0%, rgba(151, 52, 24, 0.95) 55%, rgba(208, 125, 62, 0.9) 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero h1 {
  margin: 6px 0 0;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 232, 222, 0.88);
}

.subcopy {
  max-width: 520px;
  margin: 12px 0 0;
  color: rgba(255, 244, 237, 0.88);
  font-size: 14px;
  line-height: 1.55;
}

.ghost-button,
.primary-button,
.secondary-button,
.tab-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  font: inherit;
}

.ghost-button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

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

.status-banner {
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: var(--shadow-md);
}

.status-banner.warning {
  border-color: rgba(175, 106, 0, 0.24);
  background: rgba(255, 244, 226, 0.94);
}

.status-banner.error {
  border-color: rgba(120, 0, 1, 0.24);
  background: rgba(255, 241, 241, 0.96);
}

.hidden {
  display: none !important;
}

.tab-strip {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: min(920px, calc(100vw - 20px));
  padding: 10px;
  border: 1px solid rgba(120, 0, 1, 0.1);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.86);
  box-shadow: 0 16px 40px rgba(52, 24, 17, 0.16);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.tab-button {
  min-height: 54px;
  padding: 10px 8px;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tab-button.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow: 0 14px 24px var(--accent-glow);
}

.content {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.delivery-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 249, 244, 0.9) 100%);
}

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

.order-number {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill.pending { background: rgba(54, 69, 79, 0.08); color: #344553; }
.status-pill.assigned { background: rgba(34, 112, 194, 0.12); color: #1b67b4; }
.status-pill.picked_up { background: rgba(175, 106, 0, 0.12); color: var(--warning); }
.status-pill.delivered { background: rgba(15, 138, 95, 0.12); color: var(--success); }

.card-section {
  margin-top: 14px;
}

.items-grid,
.stats-grid,
.timestamps-grid,
.profile-grid {
  display: grid;
  gap: 10px;
}

.items-grid,
.timestamps-grid,
.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.item-row,
.metric-card,
.profile-row,
.timestamp-card {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(245, 238, 231, 0.82);
  border: 1px solid rgba(120, 0, 1, 0.08);
}

.metric-value {
  font-size: 30px;
  font-weight: 800;
  margin: 4px 0 0;
  letter-spacing: -0.04em;
}

.metric-label,
.label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.value {
  margin: 7px 0 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.5;
}

.actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow: 0 14px 24px var(--accent-glow);
}

.secondary-button {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.empty-state {
  padding: 32px 20px;
  border-radius: 24px;
  border: 1px dashed rgba(120, 0, 1, 0.18);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
  .shell {
    padding-inline: 12px;
  }

  .hero {
    flex-direction: column;
    padding: 20px 18px;
  }

  .ghost-button {
    width: 100%;
  }

  .tab-strip {
    width: calc(100vw - 16px);
    gap: 6px;
    padding: 8px;
    border-radius: 22px;
  }

  .tab-button {
    min-height: 50px;
    font-size: 11px;
    padding-inline: 4px;
  }

  .card {
    padding: 16px;
  }

  .card-header {
    flex-direction: column;
  }
}
