/*
  Pure Dose design system: shared by the storefront and the back-office (D31).

  This file is the only place that defines colours, type and components
  (buttons, fields, cards, tables, badges, notices). The storefront and
  back-office stylesheets load after it and only lay pages out: they never
  define their own colours or restyle a component.

  Palette (D40, the owner's brand chart): warm white, forest green and charcoal,
  with ochre for calls to action, and sage and terracotta as accents. Layout
  and components keep the style of gruns.co (D32).

  Logical properties (margin-inline, padding-block...) make Arabic pages
  (dir="rtl") mirror automatically.
*/
:root {
  --cream: #f6f8f5;
  --white: #ffffff;
  --ink: #2a2d30;
  --muted: #5f6461;
  --line: #e1e6df;
  --line-strong: #cbd3c8;
  --forest: #2f4f43;
  --forest-dark: #233c33;
  --forest-soft: #e2ebe6;
  --deep: #3a3d40;
  --deep-dark: #2d3033;
  --deep-light: #4a4e52;
  --on-dark: #f6f8f5;
  --on-dark-muted: #c9cec8;
  --on-dark-line: rgb(246 248 245 / 0.14);
  --surface-muted: #eef2ec;
  --row-alert: #f7ebe5;
  --sage: #839c7d;
  --sage-dark: #4f6849;
  --sage-soft: #e6ede4;
  --terracotta: #b05b3b;
  --terracotta-text: #9a4e31;
  --terracotta-dark: #7f4029;
  --terracotta-soft: #f4e3db;
  --sun: #d99b52;
  --sun-dark: #c4863d;
  --sun-text: #7a5220;
  --sun-soft: #f7e8d2;
  --error: #a3261b;
  --radius-sm: 10px;
  --radius: 20px;
  --shadow: 0 1px 2px rgb(42 45 48 / 0.05), 0 8px 24px rgb(42 45 48 / 0.07);
  --shadow-lift: 0 2px 4px rgb(42 45 48 / 0.06), 0 16px 32px rgb(42 45 48 / 0.12);
  --font-latin: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-arabic: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Naskh Arabic", "Geeza Pro", Arial, sans-serif;
  /* Chunky display type for storefront headlines, from fonts already on the device (D19: no web fonts). */
  --font-display: "Arial Rounded MT Bold", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-latin);
  font-size: 1rem;
  line-height: 1.55;
}
html[lang="ar"] body { font-family: var(--font-arabic); line-height: 1.75; }
:lang(ar) { font-family: var(--font-arabic); }
:lang(fr) { font-family: var(--font-latin); }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 0 0 0.5rem; }
img { display: block; max-width: 100%; }
a { color: var(--forest); }
a:hover { color: var(--forest-dark); }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
button { font: inherit; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; }

/* Section title with the yellow underline */
.section-title { font-size: 1.6rem; line-height: 1.3; margin: 0 0 1.5rem; }
.section-title::after {
  content: "";
  display: block;
  width: 2.75rem;
  height: 3px;
  margin-block-start: 0.55rem;
  border-radius: 2px;
  background: var(--sun);
}
.section-title.centered { text-align: center; }
.section-title.centered::after { margin-inline: auto; }

/* Buttons: .btn plus one variant. Links and buttons look the same. */
/* Pill buttons with bold labels. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.6rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--forest);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--forest-dark); color: var(--white); }
.btn .icon { width: 1.1rem; height: 1.1rem; }
.btn-secondary { background: var(--white); border-color: var(--line-strong); color: var(--forest); }
.btn-secondary:hover { background: var(--forest-soft); border-color: var(--forest); color: var(--forest-dark); }
.btn-accent { background: var(--sun); color: var(--ink); }
.btn-accent:hover { background: var(--sun-dark); color: var(--ink); }
.btn-danger { background: var(--terracotta-text); color: var(--white); }
.btn-danger:hover { background: var(--terracotta-dark); color: var(--white); }
.btn-danger-outline { background: var(--white); border-color: var(--terracotta); color: var(--terracotta-text); }
.btn-danger-outline:hover { background: var(--terracotta-soft); color: var(--terracotta-dark); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--forest-soft); color: var(--forest-dark); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
/* A button that reads as a link (remove from cart...). */
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--forest); }
.back-link { display: inline-flex; align-items: center; gap: 0.25rem; margin-block-end: 1rem; color: var(--muted); font-size: 0.92rem; text-decoration: none; }
.back-link:hover { color: var(--forest); }
.back-link .icon { width: 1rem; height: 1rem; }
html[dir="rtl"] .back-link .icon { transform: scaleX(-1); }

/* Form fields: a .field wraps a label, the control, help and errors. */
.field { display: grid; gap: 0.35rem; align-content: start; }
.field > label { font-weight: 600; font-size: 0.95rem; }
.field :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea) {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Inputs, selects and buttons line up in a row. */
.field :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select) { min-height: 2.85rem; }
.field :is(input, select, textarea):focus { border-color: var(--forest); outline: none; box-shadow: 0 0 0 3px var(--forest-soft); }
.field select:disabled { color: var(--muted); background: var(--sage-soft); }
/* A compact field beside small buttons (.btn-sm), e.g. inside a list row. */
.field-sm :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select) { min-height: 0; padding: 0.35rem 0.6rem; font-size: 0.9rem; }
.field textarea { resize: vertical; }
.field:has(.field-error) :is(input, select, textarea) { border-color: var(--error); }
.help { margin: 0; color: var(--muted); font-size: 0.85rem; }
.help ul { margin: 0; padding-inline-start: 1.1rem; }
.field-error { margin: 0; color: var(--error); font-size: 0.9rem; }
.form-error {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--error);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--error);
}
.form-grid { display: grid; gap: 1rem; }
/* A label for a value that is not an input (read-only figure in a form grid). */
.field-label { font-weight: 600; font-size: 0.95rem; }
/* Checkbox with its text on one line. */
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; cursor: pointer; }
.check-danger { color: var(--terracotta-text); }
/* On/off switch: a real checkbox, drawn as a sliding pill. */
.switch { position: relative; display: inline-flex; align-items: center; gap: 0.65rem; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 2.75rem; height: 1.55rem; border-radius: 999px; background: var(--line-strong); transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; inset-block-start: 0.2rem; inset-inline-start: 0.2rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--forest); }
.switch input:checked + .switch-track::after { transform: translateX(1.2rem); }
html[dir="rtl"] .switch input:checked + .switch-track::after { transform: translateX(-1.2rem); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--forest); outline-offset: 2px; }
.switch-sm { font-size: 0.9rem; font-weight: 500; }
/* Dashed drop zone around a file input, with a preview of the chosen image. */
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 12rem;
  padding: 1rem;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone:focus-within, .dropzone.is-dragover { border-color: var(--forest); background: var(--forest-soft); }
.dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-empty { display: grid; justify-items: center; gap: 0.3rem; color: var(--muted); }
.dropzone-empty .icon { width: 2.25rem; height: 2.25rem; color: var(--forest); }
.dropzone-preview { max-height: 14rem; border-radius: 8px; object-fit: contain; }
/* Round icon-only button, for table row actions. Give it an aria-label. */
.icon-btn { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border: 0; border-radius: 50%; background: var(--forest-soft); color: var(--forest); cursor: pointer; }
.icon-btn:hover { background: var(--forest); color: var(--white); }
.icon-btn .icon { width: 1.05rem; height: 1.05rem; }
.icon-btn-sm { width: 1.75rem; height: 1.75rem; }
.icon-btn-sm .icon { width: 0.9rem; height: 0.9rem; }
/* Reorderable list: drag rows by the handle, or use the arrow buttons (shown by a script). */
.sort-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; counter-reset: sort; }
.sort-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  counter-increment: sort;
}
.sort-item::before { content: counter(sort); min-width: 1.2rem; color: var(--muted); font-weight: 800; text-align: center; }
.sort-item.is-dragging { opacity: 0.5; border-style: dashed; }
.sort-handle { display: inline-grid; color: var(--muted); cursor: grab; }
.sort-label { flex: 1; font-weight: 600; }
.sort-actions { display: inline-flex; gap: 0.3rem; }
.sort-actions .icon-btn { width: 1.9rem; height: 1.9rem; }
.sort-actions .icon-btn:disabled { opacity: 0.35; cursor: default; background: var(--forest-soft); color: var(--forest); }
/* Quantity stepper: a number box; a small script adds − and + around it (.is-enhanced). */
.stepper { display: inline-flex; align-items: center; }
.stepper input { width: 4.5rem; text-align: center; font-weight: 800; }
.stepper.is-enhanced { border: 1px solid var(--line-strong); border-radius: 999px; background: var(--white); }
.stepper.is-enhanced input { width: 3rem; min-height: 2.6rem; padding: 0; border: 0; background: transparent; box-shadow: none; -moz-appearance: textfield; }
.stepper.is-enhanced input::-webkit-inner-spin-button, .stepper.is-enhanced input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn { width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%; background: transparent; color: var(--forest); font-size: 1.25rem; font-weight: 800; cursor: pointer; }
.stepper-btn:hover { background: var(--forest-soft); }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--forest); }

/* Cards */
.card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}
.card > :last-child { margin-block-end: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-block-end: 1rem; }
.card-head > * { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 1.1rem 1.25rem 0; }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; } /* relative: hidden labels stay inside the scroll box */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { padding: 0.7rem 0.85rem; border-block-end: 1px solid var(--line); text-align: start; vertical-align: middle; }
.table thead th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.table tbody tr:last-child > * { border-block-end: 0; }
.table tbody tr:hover > * { background: #fbfbf7; }
.table tfoot :is(th, td) { border-block-start: 1px solid var(--line); border-block-end: 0; }
.table tbody th[scope="row"] { font-weight: 400; }
.num { text-align: end !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table thead .num, .table tfoot .num { white-space: normal; }
@media (max-width: 40rem) { .table th, .table td { padding: 0.6rem 0.5rem; } .table :is(th, td):first-child { padding-inline-start: 1rem; } .table :is(th, td):last-child { padding-inline-end: 1rem; } }
.ref { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; }
/* Dense table for many columns (order list, D47): smaller text, tighter cells. */
.table-compact { font-size: 0.875rem; }
.table-compact th, .table-compact td { padding: 0.55rem 0.6rem; }
.table-compact .cell-sub { font-size: 0.8rem; }
/* A wide table that turns into one card per row below 85rem, so it never scrolls sideways.
   Cells show their column name from data-label; .card-main spans the card, .card-actions sits top-right. */
@media (max-width: 84.99rem) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody { display: block; }
  .table-cards tr { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.75rem 1rem; padding: 1rem; border-block-end: 1px solid var(--line); }
  .table-cards tbody tr:last-child { border-block-end: 0; }
  .table-cards tbody tr:hover > * { background: transparent; }
  .table-cards :is(th, td), .table-cards :is(th, td):first-child, .table-cards :is(th, td):last-child { display: block; padding: 0; border: 0; }
  .table-cards td[data-label]::before { content: attr(data-label); display: block; margin-block-end: 0.15rem; color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
  .table-cards .card-main { grid-column: 1 / -1; padding-inline-end: 5rem; }
  .table-cards .card-actions { position: absolute; inset-block-start: 1rem; inset-inline-end: 1rem; }
  .table-cards .num { text-align: start !important; }
}

/* Badges: soft pills for states. */
.badge, .status, .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-dark);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-out { background: var(--terracotta-soft); color: var(--terracotta-text); }
.badge-low { background: var(--sun-soft); color: var(--sun-text); }
.badge-muted { background: #efefea; color: var(--muted); }
.badge-forest { background: var(--forest-soft); color: var(--forest); }
.tag { background: var(--sun-soft); color: var(--sun-text); }
.tag-called { background: var(--forest-soft); color: var(--forest); }
/* Order statuses, one colour family per stage. */
.status { background: #efefea; color: var(--muted); }
.status-pending { background: var(--sun-soft); color: var(--sun-text); }
.status-confirmed, .status-ready_to_ship { background: var(--forest-soft); color: var(--forest); }
.status-shipped { background: #e4ecef; color: #2f5566; }
.status-delivered, .status-paid { background: var(--forest); color: var(--white); }
.status-return_not_received, .status-return_received { background: var(--terracotta-soft); color: var(--terracotta-text); }
.status-cancelled { background: #efefea; color: var(--muted); }
.status-abandoned_cart { background: #f1efe9; color: #7b6d5a; }
/* A status pill that is also a dropdown (order list, D44): same colours, room for an arrow. */
select.status {
  appearance: none;
  border: 0;
  padding-inline-end: 1.5rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 0.75rem center, right 0.5rem center;
  background-size: 0.25rem 0.25rem;
  background-repeat: no-repeat;
}
[dir="rtl"] select.status { background-position: left 0.5rem center, left 0.75rem center; }
select.status:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

/* Messages inside a page (the storefront also shows them as toasts). */
.message {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--forest);
  border-radius: var(--radius-sm);
  background: var(--white);
}
.message-warning { border-inline-start-color: var(--sun); background: var(--sun-soft); border-color: #ecd9bf; }
.message-error { border-inline-start-color: var(--error); }

/* Empty state: an icon in a soft circle and a short line. */
.empty-state { display: grid; justify-items: center; gap: 0.5rem; padding: 2.5rem 1rem; color: var(--muted); text-align: center; }
.empty-state .icon-circle { width: 4rem; height: 4rem; }
.empty-state p { margin: 0; }
.icon-circle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--forest-soft);
  color: var(--forest);
}
.icon-circle .icon { width: 50%; height: 50%; }
.icon-circle.sage { background: var(--sage-soft); color: var(--sage-dark); }
.icon-circle.terracotta { background: var(--terracotta-soft); color: var(--terracotta-text); }
.icon-circle.sun { background: var(--sun-soft); color: var(--sun-text); }

/* Small helpers */
.small { color: var(--muted); font-size: 0.9rem; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.error { color: var(--error); }
.price { color: var(--terracotta-text); font-weight: 700; white-space: nowrap; }
/* Sales (D34): the old price struck through, a "−20 %" badge. Countdown (D48): its colour is
   picked by the super admin per size and set inline as --countdown-bg, with a readable --countdown-ink. */
.was { color: var(--muted); font-weight: 500; white-space: nowrap; }
.sale-badge { background: var(--terracotta-text); color: var(--white); }
.countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--countdown-bg, var(--terracotta));
  color: var(--countdown-ink, var(--white));
  font-weight: 800;
}
.countdown-title { display: inline-flex; align-items: center; gap: 0.4rem; }
.countdown-cells { display: inline-flex; gap: 0.35rem; }
.countdown-cell { display: inline-grid; justify-items: center; min-width: 2.6rem; padding: 0.2rem 0.35rem; border-radius: 8px; background: rgb(0 0 0 / 0.22); color: var(--white); line-height: 1.1; }
.countdown-cell b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.countdown-cell small { font-size: 0.68rem; font-weight: 600; opacity: 0.85; }
/* Order totals: subtotal, delivery, total (cart, checkout, back-office order form). */
.totals { margin: 0; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.35rem; color: var(--muted); }
.summary-row dt, .summary-row dd { margin: 0; }
.summary-row dd { color: var(--ink); }
.summary-total { margin-block-start: 0.35rem; padding-block-start: 0.75rem; border-block-start: 1px solid var(--line); color: var(--ink); font-size: 1.15rem; font-weight: 800; }
.summary-total .price { font-size: 1.25rem; }

/* Tabs (D46): a soft bar of buttons, the open one raised. Panels follow with data-tab-panel. */
.tabs { display: flex; gap: 0.25rem; padding: 0.3rem; overflow-x: auto; border-radius: 12px; background: var(--sage-soft); }
.tab { position: relative; flex: 1 0 auto; padding: 0.55rem 1rem; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--white); color: var(--forest); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }
.tab:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.tab.has-error::after { content: ""; position: absolute; inset-block-start: 0.4rem; inset-inline-end: 0.45rem; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--error); }
/* The step bar under tabbed forms: where you are, then Previous and Next. */
.step-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.step-bar-buttons { display: flex; gap: 0.5rem; }
/* Two-way switch between views (table or grid): icon links, the current one raised. */
.view-switch { display: inline-flex; gap: 0.2rem; padding: 0.2rem; border-radius: 10px; background: var(--sage-soft); }
.view-switch a { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 8px; color: var(--muted); }
.view-switch a:hover { color: var(--ink); }
.view-switch a[aria-current="true"] { background: var(--white); color: var(--forest); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }
.view-switch .icon { width: 1.1rem; height: 1.1rem; }
/* A small two-tap delete inside a row or card: the trash button opens the confirmation. */
/* Opens in place (not as a popover), so table scroll boxes and card corners never cut it. */
.row-confirm { display: inline-block; vertical-align: middle; }
.row-confirm[open] { display: block; }
.row-confirm > summary { list-style: none; margin-inline-start: auto; }
.row-confirm > summary::-webkit-details-marker { display: none; }
.row-confirm-panel { display: grid; gap: 0.5rem; max-width: 15rem; margin-block-start: 0.5rem; margin-inline-start: auto; padding: 0.85rem; border: 1px solid var(--terracotta); border-radius: 12px; background: var(--white); text-align: start; white-space: normal; }
.row-confirm-panel p { margin: 0; }
.icon-btn-danger { background: var(--terracotta-soft); color: var(--terracotta-text); }
.icon-btn-danger:hover { background: var(--terracotta); color: var(--white); }

/* Tabs that are links with a count (order statuses, D47). Swipe on a phone, wrap on wider screens. */
.count-tabs { display: flex; gap: 0.5rem; overflow-x: auto; padding-block-end: 0.25rem; }
@media (min-width: 48rem) { .count-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); overflow-x: visible; padding-block-end: 0; } }
.count-tab { display: grid; gap: 0.15rem; flex: 1 0 8.5rem; padding: 0.6rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--muted); font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.count-tab:hover { border-color: var(--forest); color: var(--ink); }
.count-tab-count { color: var(--ink); font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.count-tab-label { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.count-tab[aria-current="page"] { border-color: var(--forest); background: var(--forest); color: var(--white); }
.count-tab[aria-current="page"] .count-tab-count { color: var(--white); }
.count-tab:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
/* A dot in a status colour (use with .status-<code>): the pill colour, ringed by its text colour. */
.status-dot { display: inline-block; flex: none; width: 0.6rem; height: 0.6rem; padding: 0; border: 2px solid currentColor; border-radius: 50%; }
.count-tab[aria-current="page"] .status-dot { border-color: var(--white); }
/* One line, cut with an ellipsis. */
.truncate { display: block; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Components set `display`, which would beat the hidden attribute without this. */
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Two-tap confirmation without JavaScript: the real button is inside. */
.confirm > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  color: var(--forest);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}
.confirm > summary:hover { background: var(--forest-soft); }
.confirm-danger > summary { border-color: var(--terracotta); color: var(--terracotta-text); }
.confirm-danger > summary:hover { background: var(--terracotta-soft); }
.confirm > summary::-webkit-details-marker { display: none; }
.confirm[open] { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fcfcf9; }
.confirm[open] > summary { margin-block-end: 0.75rem; }
