:root {
  --white: #FDFDFF;
  --surface: #FFFFFF;
  --page: #F5F5F7;
  --ink: #12130F;
  --muted: rgba(18, 19, 15, 0.56);
  --soft: rgba(18, 19, 15, 0.06);
  --brand: #8806CE;
  --green: #08A045;
  --red: #E23009;
  --yellow: #FFCC00;
  --shadow: 2px 4px 24px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;
}

*::-webkit-scrollbar { display: none; }

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  background: var(--page);
  font-family: "General Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  display: flex;
  justify-content: center;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; }
button { border: 0; cursor: pointer; }

.app-shell {
  width: 390px;
  max-width: 100vw;
  min-height: 100dvh;
  background: var(--surface);
  padding: calc(32px + env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.top-bar,
.admin-header-card,
.section-head,
.order-top,
.row,
.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  line-height: 14px;
  margin-bottom: 4px;
}

.brand-title {
  color: var(--ink);
  font-size: 34px;
  line-height: 36px;
  font-weight: 900;
  letter-spacing: -1px;
}

.brand-title span,
.section-title {
  background: linear-gradient(90deg, #8806CE 0%, #E23009 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.card,
.login-card,
.admin-header-card {
  background: var(--surface);
  border-radius: 40px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card {
  margin-top: 72px;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-header-card {
  flex-direction: row;
  align-items: center;
}

.admin-name {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 22px;
}

.section-title {
  font-size: 22px;
  line-height: 28px;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span,
.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 12px;
}

.input,
.textarea,
select.input {
  width: 100%;
  border: 1px solid rgba(18, 19, 15, 0.10);
  outline: none;
  background: #FDFDFF;
  border-radius: 24px;
  padding: 12px 13px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
}

.textarea {
  min-height: 78px;
  resize: none;
}

.input:focus,
.textarea:focus {
  border-color: rgba(136, 6, 206, 0.42);
  box-shadow: 0 0 0 4px rgba(136, 6, 206, 0.08);
}

.btn,
.icon-btn,
.tab,
.filter-chip {
  min-height: 42px;
  border-radius: 28px;
  background: var(--green);
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active,
.icon-btn:active,
.tab:active,
.filter-chip:active { transform: scale(0.98); }
.btn.brand { background: var(--brand); }
.btn.red { background: var(--red); }
.btn.soft,
.icon-btn {
  background: rgba(18, 19, 15, 0.06);
  color: var(--ink);
}
.btn.small { min-height: 34px; font-size: 11px; padding: 0 11px; }
.icon-btn { width: 42px; height: 42px; padding: 0; font-size: 18px; }

.notice,
.empty-card {
  padding: 14px;
  border-radius: 32px;
  background: #F7F7F9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 0;
  background: linear-gradient(180deg, #FFFFFF 68%, rgba(255, 255, 255, 0));
}

.tab {
  min-height: 38px;
  background: rgba(18, 19, 15, 0.06);
  color: var(--ink);
  font-size: 11px;
  padding: 0 6px;
}
.tab.active { background: var(--brand); color: var(--white); }

.tab-section { display: none; flex-direction: column; gap: 12px; }
.tab-section.active { display: flex; }

.stats-grid,
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  min-height: 82px;
  background: #F7F7F9;
  border-radius: 32px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 13px;
}

.stat-card strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
  line-height: 26px;
}

.filter-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  background: rgba(18, 19, 15, 0.06);
  color: var(--ink);
  font-size: 11px;
}
.filter-chip.active { background: var(--brand); color: var(--white); }

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card,
.menu-card,
.rider-card {
  border: 1px solid rgba(18, 19, 15, 0.08);
  border-radius: 32px;
  padding: 12px;
  background: #FDFDFF;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-id,
.item-name,
.rider-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  line-height: 18px;
}

.price {
  color: var(--green);
  font-size: 17px;
  font-weight: 950;
  line-height: 20px;
  white-space: nowrap;
}

.status-pill {
  width: fit-content;
  border-radius: 1998px;
  padding: 7px 10px;
  background: rgba(136, 6, 206, 0.10);
  color: var(--brand);
  font-size: 11px;
  font-weight: 950;
  line-height: 12px;
}
.status-pill.preparing { background: rgba(255, 204, 0, 0.22); color: #9A6A00; }
.status-pill.out_for_delivery { background: rgba(136, 6, 206, 0.12); color: var(--brand); }
.status-pill.delivered { background: rgba(8, 160, 69, 0.12); color: var(--green); }
.status-pill.cancelled,
.status-pill.payment_failed { background: rgba(226, 48, 9, 0.12); color: var(--red); }

.row {
  color: rgba(18, 19, 15, 0.74);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.row strong {
  color: var(--ink);
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  word-break: break-word;
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.actions-grid.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.menu-edit-grid {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 8px;
}

.switch-row {
  align-items: center;
  padding: 12px;
  border-radius: 32px;
  background: #F7F7F9;
}

.switch-row b {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 16px;
}

.switch-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  margin-top: 2px;
}

.switch-row input[type="checkbox"] {
  width: 42px;
  height: 24px;
  accent-color: var(--brand);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: 342px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  border-radius: 28px;
  background: #12130F;
  color: #FDFDFF;
  font-size: 12px;
  font-weight: 800;
  z-index: 50;
  display: none;
  text-align: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

[hidden] { display: none !important; }

@supports (corner-shape: squircle) {
  .card,
  .login-card,
  .admin-header-card,
  .stat-card,
  .order-card,
  .menu-card,
  .rider-card,
  .input,
  .textarea,
  .btn,
  .icon-btn,
  .tab,
  .filter-chip,
  .notice,
  .empty-card,
  .switch-row,
  .toast,
  .status-pill {
    corner-shape: squircle;
  }
}


.admin-order-map,
.rider-order-map {
  width: 100%;
  height: 180px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(8,160,69,.12), rgba(136,6,206,.12)), #F7F7F9;
  overflow: hidden;
  border: 1px solid rgba(18, 19, 15, 0.08);
}

.map-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
}

@supports (corner-shape: squircle) {
  .admin-order-map,
  .rider-order-map { corner-shape: squircle; }
}
