/* Plant Trading Post seller portal. Brand color comes from settings via --brand. */

:root {
  --brand: #2f6b3c;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #ffffff);
  --brand-line: color-mix(in srgb, var(--brand) 28%, #ffffff);
  --brand-dark: color-mix(in srgb, var(--brand) 80%, #000000);

  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-2: #fafbf8;
  --border: #e2e5dd;
  --border-strong: #cfd4c8;
  --text: #1c231e;
  --muted: #646d66;
  --faint: #8b938c;

  --success: #2f7d4a;
  --success-bg: #e8f4ec;
  --warn: #9a6500;
  --warn-bg: #fdf3dc;
  --danger: #b4302a;
  --danger-bg: #fbeae8;
  --info: #2d5f9a;
  --info-bg: #e8f0fa;
  --progress: #6a46b0;
  --progress-bg: #f0eafa;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 30, 20, 0.05), 0 1px 3px rgba(20, 30, 20, 0.06);
  --shadow-lg: 0 8px 24px rgba(20, 30, 20, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5rem; font-weight: 650; }
h1 { font-size: 1.55rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }
small, .small { font-size: 0.85em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 0.9em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0.05em 0.35em; }
pre { font-family: var(--mono); font-size: 0.82rem; background: #1d2420; color: #e9efe6; padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; color: inherit; }

.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }
.icon-lg { width: 28px; height: 28px; }

/* ---- App shell ------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 0.6rem; padding: 1.1rem 1.1rem 1rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand img { max-height: 40px; max-width: 190px; object-fit: contain; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-size: 0.85rem; letter-spacing: 0.02em; flex: none;
}
.brand-name { font-size: 0.98rem; line-height: 1.2; }
.nav { padding: 0.25rem 0.6rem 1rem; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); padding: 0.9rem 0.6rem 0.3rem; }
.nav a {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem 0.65rem; border-radius: 8px;
  color: #3a433d; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); }
.nav a.active .icon { color: var(--brand); }
.nav .icon { color: var(--faint); }
.nav .count {
  margin-left: auto; background: var(--brand); color: var(--brand-ink); font-size: 0.72rem; font-weight: 700;
  border-radius: 999px; padding: 0.05rem 0.45rem; min-width: 1.4rem; text-align: center;
}
.nav .count.alert { background: var(--danger); }
.sidebar-foot { border-top: 1px solid var(--border); padding: 0.75rem 0.9rem; display: flex; align-items: center; gap: 0.6rem; }
.avatar {
  width: 32px; height: 32px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 0.78rem; flex: none;
}
.me { display: flex; align-items: center; gap: 0.55rem; color: var(--text); min-width: 0; flex: 1; }
.me:hover { text-decoration: none; }
.me-text { min-width: 0; }
.me-name { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 1.75rem 2rem 4rem; max-width: 1240px; width: 100%; container-type: inline-size; }
.demo-banner {
  background: #fff8e1; border-bottom: 1px solid #f0dfa6; color: #6d5300; font-size: 0.85rem;
  padding: 0.45rem 2rem; display: flex; gap: 0.5rem; align-items: center;
}

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem;
    background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
  }
  .topbar .brand { padding: 0; }
  .content { padding: 1.25rem 1rem 4rem; }
  .demo-banner { padding: 0.45rem 1rem; }
}
.scrim { display: none; }
.sidebar.open + .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.25); z-index: 45; }

/* ---- Page header -------------------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 0.2rem; }
.page-head .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
.breadcrumb a { color: var(--muted); }

/* ---- Cards & layout ------------------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1.15rem 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; }
.card + .card, .card + .grid, .grid + .card, .stack > * + * { margin-top: 1rem; }
.grid > *, .split > *, .products > * { margin-top: 0 !important; }
.section-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; margin: 0 0 0.6rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
/* Breakpoints follow the content column (not the viewport), so the sidebar is accounted for. */
@container (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 860px) { .split { grid-template-columns: 1fr; } .sticky { position: static; } }
@container (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@container (max-width: 440px) { .grid-4 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---- Stats -------------------------------------------------------------------------------- */
.stat { padding: 1rem 1.15rem; }
.stat .label { color: var(--muted); font-size: 0.82rem; display: flex; align-items: center; gap: 0.4rem; }
.stat .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 0.15rem; }
.stat .hint { font-size: 0.8rem; color: var(--muted); }
a.stat { display: block; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--brand-line); }

/* ---- Buttons ------------------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; font: inherit; font-weight: 600;
  font-size: 0.9rem; line-height: 1.2; padding: 0.55rem 0.95rem; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: #b9c0b2; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--danger); border-color: #e7c2bf; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn-sm { padding: 0.32rem 0.6rem; font-size: 0.82rem; border-radius: 6px; }
.btn-lg { padding: 0.75rem 1.25rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-dark); cursor: pointer; }
button.link:hover { text-decoration: underline; }
form.inline { display: inline; }

/* ---- Forms -------------------------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 0.3rem; }
.field { margin-bottom: 0.95rem; }
.field .help { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"],
input[type="url"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 0.52rem 0.7rem; min-height: 2.4rem;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 1rem; height: 1rem; }
input[type="color"] { width: 3rem; height: 2.4rem; padding: 0.15rem; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; }
.check { display: flex; gap: 0.55rem; align-items: flex-start; font-weight: 500; margin-bottom: 0.75rem; }
.check input { margin-top: 0.2rem; }
.check .help { display: block; }
.form-row { display: grid; gap: 0 0.85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.three { grid-template-columns: 2fr 1fr 1fr; }
.form-row.four { grid-template-columns: 2fr 1fr 1fr 1fr; }
@container (max-width: 640px) { .form-row.four { grid-template-columns: 1fr 1fr; } }
@container (max-width: 480px) { .form-row, .form-row.three, .form-row.four { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input[type="search"] { max-width: 280px; }
.filters select { width: auto; min-width: 160px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.input-icon input { padding-left: 2.1rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 2rem 1rem; text-align: center;
  background: var(--surface-2); cursor: pointer; transition: border-color 0.15s, background 0.15s; display: block;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input[type="file"] { display: none; }
.dropzone .title { font-weight: 650; font-size: 1rem; margin-top: 0.4rem; }
.dropzone .filename { margin-top: 0.4rem; font-weight: 600; color: var(--brand-dark); }

/* ---- Alerts ------------------------------------------------------------------------------- */
.alert { border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid; display: flex; gap: 0.6rem; align-items: flex-start; }
.alert-success { background: var(--success-bg); border-color: #bfdcc8; color: #1f5a34; }
.alert-error { background: var(--danger-bg); border-color: #efc5c1; color: #8c231e; }
.alert-info { background: var(--info-bg); border-color: #c7d8ee; color: #234b7a; }
.alert-warn { background: var(--warn-bg); border-color: #efd9a1; color: #6f4900; }
.alert ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: 0.6; font-size: 1.1rem; line-height: 1; }

/* ---- Badges ------------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.76rem; font-weight: 650; padding: 0.16rem 0.55rem;
  border-radius: 999px; white-space: nowrap; background: #eef0eb; color: #4a524c;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.8; }
.badge.plain::before { display: none; }
.tone-success { background: var(--success-bg); color: var(--success); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-danger { background: var(--danger-bg); color: var(--danger); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-progress { background: var(--progress-bg); color: var(--progress); }
.tone-muted { background: #f0f1ee; color: #7a827c; }
.tone-brand { background: var(--brand-soft); color: var(--brand-dark); }
.pill-new { background: var(--brand); color: var(--brand-ink); font-size: 0.68rem; font-weight: 700; border-radius: 999px; padding: 0.08rem 0.45rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Tables ------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 650; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfa; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.wrap { min-width: 180px; }
.table .primary { font-weight: 600; }
.card > .table-wrap > .table th:first-child, .card > .table-wrap > .table td:first-child { padding-left: 1.25rem; }
.card > .table-wrap > .table th:last-child, .card > .table-wrap > .table td:last-child { padding-right: 1.25rem; }
.table-compact td, .table-compact th { padding: 0.45rem 0.7rem; }

/* ---- Data tables ---------------------------------------------------------------------------- */
.dt-toolbar { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dt-search { flex: 1 1 240px; max-width: 420px; }
.dt-search input { min-height: 2.15rem; padding-top: 0.35rem; padding-bottom: 0.35rem; }
.dt-tools { display: flex; gap: 0.4rem; margin-left: auto; }
.dt-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; padding: 0.5rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.3rem 0.15rem 0.65rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); border: 1px solid var(--brand-line); font-size: 0.8rem; font-weight: 600; }
.chip span { display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 999px; font-size: 0.9rem; line-height: 1; }
.chip:hover { text-decoration: none; }
.chip:hover span { background: var(--brand); color: var(--brand-ink); }
.chip-clear { font-size: 0.8rem; margin-left: 0.2rem; }
.dt-table th { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.dt-table th, .dt-table td { padding-left: 0.7rem; padding-right: 0.7rem; }
/* Rows scroll inside the card (both ways) under a sticky header, so column names, the toolbar
   and the pagination stay in view. The header line is a shadow: collapsed borders don't stick. */
.dt-scroll { overflow: auto; max-height: max(22rem, calc(100vh - 15rem)); max-height: max(22rem, calc(100dvh - 15rem)); }
.dt-table thead th { position: sticky; top: 0; z-index: 2; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--border); }
@media print { .dt-scroll { max-height: none; overflow: visible; } }
.th { display: inline-flex; align-items: center; gap: 0.2rem; }
.th-sort { display: inline-flex; align-items: center; gap: 0.25rem; color: inherit; }
.th-sort:hover { color: var(--text); text-decoration: none; }
.sort-idle { opacity: 0.35; }
.th-sort:hover .sort-idle { opacity: 0.85; }
.th-filter { border: 0; background: none; padding: 0.22rem; border-radius: 5px; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; opacity: 0.5; }
.th-filter:hover, .th-filter:focus-visible { background: var(--border); opacity: 1; color: var(--text); }
.th-filter.active { opacity: 1; color: var(--brand-ink); background: var(--brand); }
.table th.th-active { color: var(--brand-dark); }
.icon-xs { width: 13px; height: 13px; }
.dt-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.55rem 1rem; border-top: 1px solid var(--border); }
.dt-per a { padding: 0.1rem 0.35rem; border-radius: 5px; color: var(--muted); margin-left: 0.1rem; }
.dt-per a:hover { text-decoration: none; background: var(--surface-2); }
.dt-per a.current { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.dt-pages { margin-left: auto; display: flex; gap: 0.2rem; align-items: center; }
.dt-pages .page { min-width: 2rem; height: 2rem; padding: 0 0.4rem; display: inline-grid; place-items: center; border-radius: 6px; color: var(--text); font-size: 0.85rem; border: 1px solid transparent; }
.dt-pages .page:hover { background: var(--surface-2); border-color: var(--border); text-decoration: none; }
.dt-pages .page.current { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.dt-pages .gap { color: var(--faint); padding: 0 0.2rem; }
.table .dt-actions { width: 1%; white-space: nowrap; text-align: right; }
.items-cell > div { white-space: nowrap; }
.items-cell > div + div { margin-top: 0.1rem; }
.row-actions { display: inline-flex; gap: 0.1rem; }
.row-actions .btn { padding: 0.3rem 0.4rem; }
.btn-danger-ghost:hover { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #962620; border-color: #962620; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Dialogs ---------------------------------------------------------------------------------- */
dialog.dt-dialog { border: 1px solid var(--border); border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 2rem)); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(20, 30, 20, 0.22); }
dialog.dt-dialog::backdrop { background: rgba(28, 35, 30, 0.35); backdrop-filter: blur(2px); }
.dt-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 0.85rem 0.75rem 1.15rem; border-bottom: 1px solid var(--border); }
.dt-dialog-head strong { display: inline-flex; gap: 0.45rem; align-items: center; }
.dt-dialog-body { padding: 1rem 1.15rem; max-height: 65vh; overflow-y: auto; }
.dt-dialog-body > .field:last-child { margin-bottom: 0; }
.dt-dialog-foot { display: flex; gap: 0.5rem; align-items: center; padding: 0.75rem 1.15rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.preset { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 0.88rem; }
.preset:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.preset:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }
.preset-custom { margin: 0.35rem 0 0.6rem; }
.dt-number { display: grid; grid-template-columns: 84px 1fr; gap: 0.5rem; }
.dt-col-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.dt-col-list .check { margin: 0.3rem 0; }

/* ---- Empty states ------------------------------------------------------------------------- */
.empty { text-align: center; padding: 2.75rem 1rem; color: var(--muted); }
.empty .icon-lg { color: var(--brand-line); margin-bottom: 0.5rem; }
.empty h3 { color: var(--text); }

/* ---- Catalog ------------------------------------------------------------------------------ */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.product { display: flex; flex-direction: column; overflow: hidden; }
.product .media { aspect-ratio: 4 / 3; background: var(--brand-soft); display: grid; place-items: center; overflow: hidden; }
.product .media img { width: 100%; height: 100%; object-fit: cover; }
.product .media .icon-lg { width: 46px; height: 46px; color: var(--brand-line); }
.product .body { padding: 0.85rem 0.95rem 0.95rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.product .name { font-weight: 650; line-height: 1.3; }
.product .meta { font-size: 0.8rem; color: var(--muted); }
.product .price { font-size: 1.15rem; font-weight: 700; }
.product .price s { font-size: 0.8rem; color: var(--faint); font-weight: 500; margin-left: 0.35rem; }
.product .foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
.product details { font-size: 0.82rem; color: var(--muted); }
.product details summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; }
.product.out { opacity: 0.72; }
.stock-in { color: var(--success); }
.stock-low { color: var(--warn); }
.stock-out, .stock-backorder { color: var(--danger); }
.stock { font-size: 0.8rem; font-weight: 650; display: inline-flex; align-items: center; gap: 0.3rem; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.live-note { font-size: 0.8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.35rem; }
.live-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 0 rgba(47, 125, 74, 0.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 125, 74, 0.45); } 70% { box-shadow: 0 0 0 7px rgba(47, 125, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 125, 74, 0); } }

/* ---- Order form ---------------------------------------------------------------------------- */
.lines { display: flex; flex-direction: column; gap: 0.6rem; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 92px 96px 36px; gap: 0.6rem; align-items: center; }
.line .total { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.line-head { display: grid; grid-template-columns: minmax(0, 1fr) 92px 96px 36px; gap: 0.6rem; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 650; }
.line .warn { grid-column: 1 / -1; font-size: 0.8rem; color: var(--warn); margin-top: -0.3rem; }
@container (max-width: 520px) { .line, .line-head { grid-template-columns: minmax(0, 1fr) 70px 36px; } .line .total, .line-head .total { display: none; } }
.summary-row { display: flex; justify-content: space-between; padding: 0.35rem 0; }
.summary-row.total { font-size: 1.15rem; font-weight: 700; border-top: 1px solid var(--border); margin-top: 0.4rem; padding-top: 0.7rem; }
.sticky { position: sticky; top: 1rem; }

/* ---- Order detail ------------------------------------------------------------------------- */
.steps { display: flex; gap: 0; margin: 0.25rem 0 0.5rem; }
.step { flex: 1; text-align: center; position: relative; font-size: 0.78rem; color: var(--faint); font-weight: 600; }
.step .dot { width: 26px; height: 26px; border-radius: 999px; margin: 0 auto 0.35rem; background: #eef0eb; border: 2px solid #e0e3dc; display: grid; place-items: center; position: relative; z-index: 1; }
.step::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: #e0e3dc; }
.step:first-child::before { display: none; }
.step.done .dot, .step.current .dot { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.step.done, .step.current { color: var(--text); }
.step.done::before, .step.current::before { background: var(--brand); }
.step.current .dot { box-shadow: 0 0 0 4px var(--brand-soft); }
.step .dot .icon { width: 14px; height: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 0.9rem 1.4rem; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 0.45rem; width: 8px; height: 8px; border-radius: 999px; background: var(--brand-line); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 1.1rem; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.error::before { background: var(--danger); }
.timeline .when { font-size: 0.78rem; color: var(--muted); }
.address { font-style: normal; line-height: 1.55; }
.tracking-list { display: flex; flex-direction: column; gap: 0.4rem; }
.tracking { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }

/* ---- Labels ------------------------------------------------------------------------------- */
.label-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1.1rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); }
.label-card:last-child { border-bottom: 0; }
.label-card.skipped { opacity: 0.55; }
.label-card.needs { background: #fffdf6; }
.label-card.done { background: #f7fbf8; }
.label-thumb { border: 1px solid var(--border); border-radius: 6px; background: #fff; display: block; overflow: hidden; }
.label-thumb img { width: 100%; display: block; }
.label-thumb .noimg { aspect-ratio: 2 / 3; display: grid; place-items: center; color: var(--faint); font-size: 0.8rem; }
.label-fields .form-row { gap: 0 0.6rem; }
.label-fields .field { margin-bottom: 0.55rem; }
.label-fields label { font-size: 0.75rem; color: var(--muted); font-weight: 600; margin-bottom: 0.15rem; }
.label-fields input, .label-fields select { min-height: 2.1rem; padding: 0.35rem 0.55rem; font-size: 0.88rem; }
.issues { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
@container (max-width: 680px) { .label-card { grid-template-columns: 1fr; } .label-thumb { max-width: 160px; } }
.sticky-bar {
  position: sticky; bottom: 0; z-index: 20; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px);
  border-top: 1px solid var(--border); padding: 0.8rem 1.15rem; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
  border-radius: 0 0 var(--radius) var(--radius);
}
.spinner { width: 34px; height: 34px; border-radius: 999px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 0.9s linear infinite; margin: 0 auto 0.75rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Claims thread ------------------------------------------------------------------------ */
.thread { display: flex; flex-direction: column; gap: 0.85rem; }
.msg { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; background: var(--surface); max-width: 760px; }
.msg.team { background: var(--brand-soft); border-color: var(--brand-line); margin-left: auto; }
.msg .who { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.3rem; display: flex; gap: 0.5rem; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.attachments { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.attachments a { display: block; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
.attachments img { width: 96px; height: 96px; object-fit: cover; display: block; }
.attachments .file { padding: 0.45rem 0.65rem; font-size: 0.82rem; }

/* ---- Announcements ------------------------------------------------------------------------- */
.announcement { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.announcement:last-child { border-bottom: 0; }
.announcement h3 { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0.25rem 0 0.75rem; }
.prose img { max-width: 100%; }

/* ---- Packing station ----------------------------------------------------------------------- */
.scan-box { display: flex; gap: 0.6rem; }
.scan-box input { font-size: 1.15rem; min-height: 3rem; font-family: var(--mono); }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.85rem 1.15rem; border-bottom: 1px solid var(--border); }
.job:last-child { border-bottom: 0; }
.job .title { font-weight: 650; }
.job .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
.toggle { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; cursor: pointer; margin: 0; }

/* ---- Auth pages ---------------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), var(--bg)); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .card-body { padding: 1.75rem; }
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-brand img { max-height: 56px; max-width: 240px; }
.auth-brand .brand-mark { width: 48px; height: 48px; margin: 0 auto 0.6rem; font-size: 1rem; border-radius: 12px; }
.auth-brand .name { font-weight: 700; font-size: 1.2rem; }
.auth-brand .tagline { color: var(--muted); font-size: 0.9rem; }
.auth-foot { text-align: center; margin-top: 1rem; font-size: 0.88rem; }

.error-page { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.error-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; max-width: 460px; text-align: center; box-shadow: var(--shadow); }

/* ---- Misc --------------------------------------------------------------------------------- */
.pagination { display: flex; gap: 0.5rem; justify-content: flex-end; padding: 0.8rem 1.25rem; border-top: 1px solid var(--border); }
.copy-box { display: flex; gap: 0.5rem; align-items: center; }
.copy-box input { font-family: var(--mono); font-size: 0.85rem; }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: 0; }
.health { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 0.85rem; }
.health::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--faint); }
.health.ok::before { background: var(--success); }
.health.bad::before { background: var(--danger); }
.health.idle::before { background: var(--border-strong); }
.color-row { display: flex; gap: 0.5rem; align-items: center; }
.color-row input[type="text"] { max-width: 120px; font-family: var(--mono); }
.thumb-sm { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--brand-soft); display: inline-grid; place-items: center; vertical-align: middle; }
.thumb-sm .icon { color: var(--brand-line); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }
.attention a { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--border); color: var(--text); }
.attention a:last-child { border-bottom: 0; }
.attention a:hover { background: var(--surface-2); text-decoration: none; }
.qa { display: flex; gap: 0.6rem; flex-wrap: wrap; }
