/*!*********************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!../../node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*********************************************************************************************************************************************************************************************************************************************************************/
/* ==========================================================================
   Digchi Admin — design system
   Warm, refined, food-brand admin. Terracotta accent over warm neutrals.
   Light + dark (system, overridable via [data-theme] on <html>).
   All screens style through these tokens + component classes (no inline soup).
   ========================================================================== */

/* Brand fonts (Phase 6 Slice 4) — self-hosted so the admin chrome and the
   storefront-branding preview render the same faces the mobile app bundles.
   Vazirmatn + Lalezar carry Persian glyphs; Inter is Latin. */
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Vazirmatn-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Vazirmatn-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Vazirmatn-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Inter-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Lalezar';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Lalezar-Regular.ttf') format('truetype');
}

:root {
  /* Brand — terracotta (Digchi) */
  --brand: #c2410c;
  --brand-hover: #9a3412;
  --brand-active: #7c2d12;
  --brand-contrast: #ffffff;
  --brand-soft: #fdeee6; /* subtle tint for active/selected states */
  --brand-ring: rgba(194, 65, 12, 0.35);

  /* Warm neutral scale (stone) */
  --bg: #faf8f5; /* app background */
  --bg-subtle: #f3efe9; /* recessed areas */
  --surface: #ffffff; /* cards, inputs */
  --surface-hover: #faf8f5;
  --sidebar: #ffffff;
  --border: #e9e3db;
  --border-strong: #ddd5ca;

  --text: #1c1917;
  --text-muted: #78716c;
  --text-faint: #a8a29e;

  /* Semantic */
  --success: #15803d;
  --success-soft: #e7f4ec;
  --warning: #b45309;
  --warning-soft: #fbf0e2;
  --danger: #b91c1c;
  --danger-soft: #fbeaea;
  --info: #1d4ed8;
  --info-soft: #e8eefb;

  /* Radii */
  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04), 0 1px 3px rgba(28, 25, 23, 0.06);
  --shadow: 0 2px 4px rgba(28, 25, 23, 0.04), 0 4px 12px rgba(28, 25, 23, 0.07);
  --shadow-lg: 0 8px 24px rgba(28, 25, 23, 0.1), 0 2px 6px rgba(28, 25, 23, 0.06);
  --shadow-ring: 0 0 0 3px var(--brand-ring);

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 140ms;

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Vazirmatn', sans-serif;
  --sidebar-w: 248px;
  --topbar-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand: #ea6a37;
    --brand-hover: #f3814f;
    --brand-active: #f79d74;
    --brand-contrast: #1a1512;
    --brand-soft: #2a1c13;
    --brand-ring: rgba(234, 106, 55, 0.4);
    --bg: #1a1816;
    --bg-subtle: #211e1b;
    --surface: #242019;
    --surface-hover: #2b271f;
    --sidebar: #201d18;
    --border: #38332c;
    --border-strong: #453f37;
    --text: #f6f2ec;
    --text-muted: #a8a29b;
    --text-faint: #7c766d;
    --success: #4ade80;
    --success-soft: #16281c;
    --warning: #f0a24e;
    --warning-soft: #2c2113;
    --danger: #f47171;
    --danger-soft: #2c1615;
    --info: #7da3f8;
    --info-soft: #17203a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme='dark'] {
  --brand: #ea6a37;
  --brand-hover: #f3814f;
  --brand-active: #f79d74;
  --brand-contrast: #1a1512;
  --brand-soft: #2a1c13;
  --brand-ring: rgba(234, 106, 55, 0.4);
  --bg: #1a1816;
  --bg-subtle: #211e1b;
  --surface: #242019;
  --surface-hover: #2b271f;
  --sidebar: #201d18;
  --border: #38332c;
  --border-strong: #453f37;
  --text: #f6f2ec;
  --text-muted: #a8a29b;
  --text-faint: #7c766d;
  --success: #4ade80;
  --success-soft: #16281c;
  --warning: #f0a24e;
  --warning-soft: #2c2113;
  --danger: #f47171;
  --danger-soft: #2c1615;
  --info: #7da3f8;
  --info-soft: #17203a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* ---- base ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
h1,
h2,
h3,
h4 {
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 650;
  color: var(--text);
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  color: var(--brand-hover);
}
button {
  font-family: inherit;
}
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-ring);
  border-radius: var(--r-sm);
}
::selection {
  background: var(--brand-soft);
}

/* ---- layout: shell ------------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 4px;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
}
.sidebar__logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-active));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.sidebar__brandname {
  font-weight: 680;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.sidebar__section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 14px 10px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.nav-item[data-active='true'] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.nav-item__icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.sidebar__spacer {
  flex: 1 1;
}
.sidebar__user {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.main {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--topbar-h);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
          backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar__crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  min-width: 0;
}
.topbar__crumbs .sep {
  color: var(--text-faint);
}
.topbar__crumbs a:hover {
  color: var(--text);
}
.content {
  padding: 28px;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
}

/* ---- page header --------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-header h1 {
  font-size: 23px;
}
.page-header__sub {
  color: var(--text-muted);
  margin-top: 3px;
  font-size: 14px;
}
.page-header__actions {
  display: flex;
  gap: 8px;
  flex: none;
}

/* ---- card ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card--pad {
  padding: 20px;
}
.card__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card__head h2 {
  font-size: 15.5px;
  font-weight: 620;
}
.card__body {
  padding: 20px;
}
.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* ---- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.btn:active {
  transform: translateY(0.5px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn--primary {
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover:not(:disabled) {
  background: var(--brand-hover);
}
.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--text-faint);
}
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}
.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}
.btn--danger:hover:not(:disabled) {
  background: var(--danger-soft);
}
.btn--danger-solid {
  background: var(--danger);
  color: #fff;
}
.btn--sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}
.btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
}
.btn--block {
  width: 100%;
}

/* ---- forms --------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label,
.label {
  font-size: 13px;
  font-weight: 560;
  color: var(--text);
}
.field__hint {
  font-size: 12.5px;
  color: var(--text-muted);
}
.field__error {
  font-size: 12.5px;
  color: var(--danger);
}
.input,
.textarea,
.select {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-faint);
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--shadow-ring);
}
.textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.5;
}
.select {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
.input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.input-prefix:focus-within {
  border-color: var(--brand);
  box-shadow: var(--shadow-ring);
}
.input-prefix > span {
  padding: 0 4px 0 11px;
  color: var(--text-muted);
}
.input-prefix > input {
  border: 0;
  box-shadow: none;
  padding-left: 4px;
  background: transparent;
}
.input-prefix > input:focus {
  box-shadow: none;
}

/* Suffix variant — a unit (%, etc.) trailing the input (Slice 2 policy editor). */
.input-suffix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.input-suffix:focus-within {
  border-color: var(--brand);
  box-shadow: var(--shadow-ring);
}
.input-suffix > span {
  padding: 0 11px 0 4px;
  color: var(--text-muted);
}
.input-suffix > input {
  border: 0;
  box-shadow: none;
  padding-right: 4px;
  background: transparent;
}
.input-suffix > input:focus {
  box-shadow: none;
}

/* ---- grid helpers -------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 16px;
  gap: 16px;
}
@media (max-width: 620px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.muted {
  color: var(--text-muted);
}
.grow {
  flex: 1 1;
  min-width: 0;
}

/* ---- badges -------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 560;
  background: var(--bg-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--success {
  background: var(--success-soft);
  color: var(--success);
}
.badge--warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge--info {
  background: var(--info-soft);
  color: var(--info);
}
.badge--neutral {
  background: var(--bg-subtle);
  color: var(--text-muted);
}
.badge--brand {
  background: var(--brand-soft);
  color: var(--brand);
}

/* ---- tabs ---------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.tab {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 540;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tab:hover {
  color: var(--text);
}
.tab[data-active='true'] {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 620;
}

/* ---- table --------------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr {
  transition: background var(--dur) var(--ease);
}
.table tbody tr:hover {
  background: var(--surface-hover);
}
.table tbody tr:last-child td {
  border-bottom: 0;
}

/* ---- list rows (cards) --------------------------------------------------- */
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.list-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

/* ---- thumb / avatar ------------------------------------------------------ */
.thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--bg-subtle);
  flex: none;
}
.thumb--empty {
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 10px;
  border: 1px dashed var(--border-strong);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 640;
  font-size: 13px;
  flex: none;
}

/* ---- empty state --------------------------------------------------------- */
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-muted);
}
.empty__icon {
  font-size: 30px;
  margin-bottom: 10px;
}
.empty h3 {
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--text);
}

/* ---- misc ---------------------------------------------------------------- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.price {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 620;
}
.color-swatch {
  width: 40px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  padding: 0;
  cursor: pointer;
  background: transparent;
}
.divider {
  height: 1px;
  background: var(--border);
  border: 0;
}
.rtl {
  direction: rtl;
  text-align: right;
}

/* ---- segmented control --------------------------------------------------- */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.segmented__opt {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 550;
  font-family: inherit;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.segmented__opt:hover:not([data-active='true']) {
  color: var(--text);
}
.segmented__opt[data-active='true'] {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* ---- range slider -------------------------------------------------------- */
.range {
  width: 100%;
  accent-color: var(--brand);
  height: 22px;
  cursor: pointer;
}

/* ---- stat tiles ---------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  grid-gap: 12px;
  gap: 12px;
}
.stat {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px 16px;
}
.stat__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat__value {
  font-size: 20px;
  font-weight: 660;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
/* vs-previous-period delta under a KPI (Reports, Phase 6) */
.stat__delta {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 620;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.stat__delta--success {
  color: var(--success);
}
.stat__delta--danger {
  color: var(--danger);
}
.stat__delta--neutral {
  color: var(--text-faint);
}

/* ---- mini bar chart + split bar (Reports, Phase 6) ----------------------- */
.chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
  min-width: 100%;
}
.chart__axis {
  display: flex;
  gap: 4px;
  min-width: 100%;
}
.chart__col {
  flex: 1 1;
  min-width: 10px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.chart__axis .chart__col {
  height: auto;
  font-size: 11px;
  color: var(--text-faint);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chart__track {
  width: 100%;
  flex: 1 1;
  display: flex;
  align-items: flex-end;
  /* No fill: a filled track reads as a full-height bar on a zero day. The
     baseline below is what tells the reader where the axis is. */
  border-bottom: 1px solid var(--border);
}
.chart__bar {
  width: 100%;
  min-height: 2px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--brand);
  transition: height var(--dur) var(--ease);
}
.chart__col:hover .chart__bar {
  background: var(--brand-hover);
}
.split {
  display: flex;
  height: 10px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--bg-subtle);
  margin-bottom: 10px;
}
.split__pickup {
  background: var(--brand);
}
.split__delivery {
  /* `--info` (not `--warning`): the warning amber sits too close to the brand
     terracotta to tell two adjacent segments apart at 10px tall. */
  background: var(--info);
}
/* New vs returning customers (Analytics, Phase 6 Slice 2). Green reads as
   "growth" for the new half; the returning half stays deliberately quiet so the
   eye lands on the thing that changes. */
.split__new {
  background: var(--success);
}
.split__returning {
  background: var(--border-strong);
}

/* The trend chart is metric-switchable, so the bar takes the metric's colour —
   the same hue as the KPI it belongs to, which is what makes the toggle read as
   a change of subject rather than a change of data. */
/* Each metric re-declares `background` under its own `.chart__col:hover` rule.
   Specificity is IDENTICAL to the base `.chart__col:hover .chart__bar` rule
   above (0,3,0), so these win purely because they come later — keep this block
   below that one. Without them, hovering an Orders or Commission bar snapped it
   back to the brand terracotta mid-chart, so the hovered bar showed one metric's
   colour while the toggle said another. */
.chart__bar--info {
  background: var(--info);
}
.chart__col:hover .chart__bar--info {
  background: var(--info);
  filter: brightness(0.92);
}
.chart__bar--success {
  background: var(--success);
}
.chart__col:hover .chart__bar--success {
  background: var(--success);
  filter: brightness(0.92);
}

/* ---- share meter (Analytics leaderboards, Phase 6 Slice 2) --------------- */
/* An inline bar behind a percentage: the ranking is legible at a glance without
   a second chart, and it degrades to just the number when the share is 0. */
.meter {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.meter__track {
  width: 64px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--bg-subtle);
  overflow: hidden;
  flex: none;
}
.meter__fill {
  /* `display: block` is load-bearing: the fill is a `<span>` inside a plain block
     container, so as an inline box it would ignore `width` and `height` outright
     and the bar would never render at all. */
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--brand);
  transition: width var(--dur) var(--ease);
}
.meter__value {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  min-width: 46px;
  text-align: right;
}

/* ---- table helpers ------------------------------------------------------- */
.num {
  text-align: right;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}
.kv + .kv {
  border-top: 1px solid var(--border);
}
.kv__k {
  color: var(--text-muted);
}
.kv__v {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 560;
}
.kv--total {
  font-size: 15px;
}
.kv--total .kv__v {
  font-weight: 680;
}

/* ---- detail two-column layout -------------------------------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-gap: 20px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline__row {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}
.timeline__row:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 3px;
  flex: none;
  z-index: 1;
}
.timeline__row[data-past='true'] .timeline__dot {
  background: var(--border-strong);
}

/* thin scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* ---------------------------------------------------------------------------
   Print — used by the Shopping List export (Phase 5 Slice 2). Drop the panel
   chrome and the interactive columns so a printed buy-list is just the table.
   --------------------------------------------------------------------------- */

/* ==========================================================================
   Admin Dashboard (Phase 6 Slice 3)
   The home screen leads with the news, not the numbers: the needs-attention
   queue sits above the KPIs, and collapses to a single calm line when there is
   nothing to do. Everything below reuses the existing tokens — no new colours,
   no new type — so the platform's most-visited screen reads as part of the same
   product, not a redesign of it.
   ========================================================================== */

/* A refresh in flight dims the stale figures rather than tearing them down, so
   the layout never jumps under the pointer mid-read. */
.stack[data-stale='true'] {
  opacity: 0.55;
  transition: opacity var(--dur) var(--ease);
}

/* Home base has four KPIs instead of Analytics' five, so they can breathe. */
.stat--hero {
  padding: 16px 18px;
}
.stat--hero .stat__value {
  font-size: 27px;
  line-height: 1.15;
  margin-top: 2px;
}

/* ---- the needs-attention queue ------------------------------------------- */
.attn {
  list-style: none;
  margin: 0;
  padding: 0;
}
.attn__row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  align-items: center;
  grid-gap: 14px;
  gap: 14px;
  padding: 13px 20px 13px 17px;
  /* The rail is the whole point: severity is legible as a shape before a word
     of it is read. 3px of colour, inset so it aligns with the card's radius. */
  -webkit-border-start: 3px solid transparent;
          border-inline-start: 3px solid transparent;
}
.attn__row + .attn__row {
  border-top: 1px solid var(--border);
}
.attn__row:hover {
  background: var(--surface-hover);
}
.attn__row[data-severity='critical'] {
  border-inline-start-color: var(--danger);
}
.attn__row[data-severity='warning'] {
  border-inline-start-color: var(--warning);
}
.attn__row[data-severity='info'] {
  border-inline-start-color: var(--border-strong);
}

.attn__count {
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--text);
}
.attn__row[data-severity='critical'] .attn__count {
  color: var(--danger);
}
.attn__row[data-severity='warning'] .attn__count {
  color: var(--warning);
}
.attn__row[data-severity='info'] .attn__count {
  color: var(--text-muted);
}

.attn__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.attn__label {
  font-weight: 570;
  color: var(--text);
}
.attn__label:hover {
  color: var(--brand);
}
.attn__hint {
  font-size: 12.5px;
  color: var(--text-muted);
}
/* The two store-shaped rows name the stores, so each one links to its own fix
   instead of dumping the admin on a list to search through. */
.attn__stores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.attn__store {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attn__store:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.attn__store--more {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.attn__go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  border-radius: var(--r-sm);
}
.attn__row:hover .attn__go {
  color: var(--brand);
}
/* The chevron points the way out of the row; in Farsi that way is left. */
[dir='rtl'] .attn__go svg {
  transform: scaleX(-1);
}

.attn__headicon--critical {
  color: var(--danger);
}
.attn__headicon--warning {
  color: var(--warning);
}
.attn__headicon--info {
  color: var(--text-muted);
}

/* All clear: deliberately NOT a card. An empty queue should take up less room
   than a full one, and read as a state of the platform rather than a widget. */
.attn-clear {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--success-soft);
}
.attn-clear__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--success);
  color: var(--surface);
}
.attn-clear__title {
  font-weight: 600;
}

/* ---- dashboard layout ---------------------------------------------------- */
/* Chart and payouts side by side; the chart gets the room because it is the
   thing you scan, the payout card the thing you check. */
.dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  grid-gap: 20px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .dash-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dash-note {
  margin-top: 10px;
  font-size: 12px;
}

/* A dense series (a month of days beside the payout card) tightens its gaps so
   the bars stay wider than the space between them and the trend reads as a
   shape. The base chart keeps its roomier spacing for short ranges. */
.chart[data-dense='true'] .chart__bars,
.chart[data-dense='true'] .chart__axis {
  gap: 2px;
}
.chart[data-dense='true'] .chart__col {
  min-width: 7px;
}

.dash-owed__label {
  font-size: 12px;
  color: var(--text-muted);
}
.dash-owed__value {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  margin: 2px 0 3px;
}

/* The leaderboard's rank column: real information (this table IS an ordering),
   so it is set quietly rather than as a badge competing with the store name. */
.dash-rank {
  color: var(--text-faint);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  text-align: center;
}

/* ---- quick actions ------------------------------------------------------- */
.quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px dashed var(--border-strong);
  background: var(--bg-subtle);
}
.quick__label {
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  -webkit-margin-end: 4px;
          margin-inline-end: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .stack[data-stale='true'] {
    transition: none;
  }
}

@media print {
  /* Force the light palette: printing while the panel is in dark mode would
     otherwise put near-white text on white paper. */
  :root,
  :root[data-theme='dark'] {
    --bg: #fff;
    --surface: #fff;
    --text: #111;
    --text-muted: #444;
    --text-faint: #666;
    --border: #ddd;
    --border-strong: #bbb;
  }

  /* Hide the app chrome and the header's action buttons — but NOT every `.btn`:
     the detail table renders each row's "Have" value inside a ghost button, and
     hiding those blanks the whole Have column on the printout. */
  .sidebar,
  .topbar,
  .page-header__actions {
    display: none !important;
  }

  .shell,
  .main,
  .content {
    display: block !important;
    grid-template-columns: none !important;
    background: #fff !important;
    color: #111 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  /* An in-table button prints as its plain label (the Have value), not a control. */
  .table .btn {
    border: 0 !important;
    background: transparent !important;
    color: #111 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .table thead {
    display: table-header-group; /* repeat headers across pages */
  }

  .table tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  input[type='checkbox'] {
    /* keep the tick boxes — they're the point of a printed shopping list */
    display: inline-block !important;
  }
}

/* ==========================================================================
   Storefront & branding editor + live preview (Phase 6 Slice 4)
   ========================================================================== */
.storefront-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-gap: 24px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .storefront-editor { grid-template-columns: 1fr; }
}
.storefront-preview { position: -webkit-sticky; position: sticky; top: 16px; }

/* Featured-dish picker */
.featured-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-gap: 8px;
  gap: 8px;
}
.featured-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}
.featured-opt--on { border-color: var(--brand); background: var(--brand-soft); }
.featured-opt__img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; flex: none; }
.featured-opt__img--empty { display: grid; place-items: center; background: var(--bg); color: var(--text-faint); }
.featured-opt__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.featured-opt__order {
  -webkit-margin-start: auto;
          margin-inline-start: auto;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  display: grid; place-items: center;
  flex: none;
}

/* The customer Store Page preview ("phone") — colors/fonts are inline (the store theme) */
.phone {
  max-width: 340px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}
.phone__hero { position: relative; height: 120px; }
.phone__hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone__hero-scrim { position: absolute; inset: 0; }
.phone__body { padding: 0 16px 16px; }
.phone__logo {
  width: 56px; height: 56px;
  border-radius: 16px;
  border: 3px solid;
  margin-top: -28px;
  overflow: hidden;
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.phone__logo img { width: 100%; height: 100%; object-fit: cover; }
.phone__name { font-size: 20px; font-weight: 700; margin-top: 10px; line-height: 1.2; }
.phone__tag { font-size: 13px; margin-top: 3px; }
.phone__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.phone__badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.phone__section { font-size: 15px; font-weight: 700; margin-top: 16px; margin-bottom: 8px; }
.phone__featured { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.phone__fcard { flex: none; width: 120px; border: 1px solid; border-radius: 12px; overflow: hidden; }
.phone__fcard img, .phone__fcard-empty { display: block; width: 120px; height: 78px; object-fit: cover; }
.phone__fcard-meta { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.phone__menu { border: 1px solid; border-radius: 14px; overflow: hidden; }
.phone__row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 1px solid; font-size: 14px; }
.phone__row-name { font-weight: 500; }
.phone__cart { margin-top: 16px; text-align: center; padding: 12px; border-radius: 999px; font-weight: 700; font-size: 14px; }

