/* ==========================================================================
   Unicrop design system — tokens, base and shared components.
   Used by the storefront (store.css) and the admin console (admin.css).
   ========================================================================== */

:root {
  color-scheme: light;

  /* Brand */
  --brand: #17614a;
  --brand-strong: #0f4b39;
  --brand-soft: #e2efe8;
  --brand-softer: #f0f7f3;
  --brand-ink: #ffffff;
  --lime: #b4cf2c;
  --lime-soft: #f2f7d8;
  --sun: #e39b2d;

  /* Neutrals (white) */
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --surface-3: #f1f4f2;
  --line: #e3e8e5;
  --line-strong: #cfd7d2;
  --ink: #15231c;
  --ink-2: #4a5a51;
  --ink-3: #6f7c74;

  /* Status (reserved: never used as decorative colour) */
  --ok: #1d7a45;      --ok-soft: #e1f2e7;
  --warn: #9a6200;    --warn-soft: #fbefd6;
  --bad: #b8371f;     --bad-soft: #fbe5df;
  --info: #285f9e;    --info-soft: #e2ecf8;
  --muted-soft: #eef1ef;

  --focus: 0 0 0 3px rgba(23, 97, 74, .28);
  --shadow-1: 0 1px 2px rgba(21, 35, 28, .06);
  --shadow-2: 0 2px 6px rgba(21, 35, 28, .06), 0 12px 32px -12px rgba(21, 35, 28, .14);
  --shadow-3: 0 24px 64px -16px rgba(21, 35, 28, .3);

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 18px;

  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Manrope", system-ui, sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #43b184; --brand-strong: #63c79c; --brand-soft: #173a2d; --brand-softer: #12271f; --brand-ink: #06140e;
    --lime: #c5de4a; --lime-soft: #26300f;
    --paper: #0d1411; --surface: #141d19; --surface-2: #18231e; --surface-3: #1d2a24;
    --line: #26352e; --line-strong: #34463d;
    --ink: #e7eee9; --ink-2: #aebcb3; --ink-3: #8a988f;
    --ok: #5bc68a; --ok-soft: #173326; --warn: #e6b04f; --warn-soft: #36290f; --bad: #f08068; --bad-soft: #3a1c15; --info: #7fb0ea; --info-soft: #172a40; --muted-soft: #222e29;
    --shadow-1: 0 1px 2px rgba(0,0,0,.3); --shadow-2: 0 2px 6px rgba(0,0,0,.25), 0 12px 32px -12px rgba(0,0,0,.5); --shadow-3: 0 24px 64px -16px rgba(0,0,0,.7);
    --focus: 0 0 0 3px rgba(67, 177, 132, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #43b184; --brand-strong: #63c79c; --brand-soft: #173a2d; --brand-softer: #12271f; --brand-ink: #06140e;
  --lime: #c5de4a; --lime-soft: #26300f;
  --paper: #0d1411; --surface: #141d19; --surface-2: #18231e; --surface-3: #1d2a24;
  --line: #26352e; --line-strong: #34463d;
  --ink: #e7eee9; --ink-2: #aebcb3; --ink-3: #8a988f;
  --ok: #5bc68a; --ok-soft: #173326; --warn: #e6b04f; --warn-soft: #36290f; --bad: #f08068; --bad-soft: #3a1c15; --info: #7fb0ea; --info-soft: #172a40; --muted-soft: #222e29;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3); --shadow-2: 0 2px 6px rgba(0,0,0,.25), 0 12px 32px -12px rgba(0,0,0,.5); --shadow-3: 0 24px 64px -16px rgba(0,0,0,.7);
  --focus: 0 0 0 3px rgba(67, 177, 132, .35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font: 500 15px/1.55 var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 650; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .4em; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.6rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
small, .small { font-size: .84rem; }
::selection { background: var(--lime); color: #12210c; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 999; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--radius-s); }
.skip-link:focus { top: 12px; color: var(--paper); }

.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ---------- Utilities ---------- */
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.strong { font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.stack-s { display: grid; gap: 8px; }
.stack-l { display: grid; gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0 !important; } .mt-s { margin-top: 8px; } .mt { margin-top: 16px; } .mt-l { margin-top: 28px; }
.hidden { display: none !important; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.link-quiet { color: inherit; }
.link-quiet:hover { color: var(--brand); }
.divider-dot::before { content: "·"; margin: 0 6px; color: var(--ink-3); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  font: 700 .9rem/1 var(--font-ui); letter-spacing: -.005em;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-bd); border-radius: 10px;
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background .15s var(--ease), border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { color: var(--btn-fg); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: var(--brand-ink); --btn-bd: var(--brand); }
.btn-primary:hover { --btn-bg: var(--brand-strong); border-color: var(--brand-strong); box-shadow: 0 6px 18px -8px rgba(23,97,74,.6); }
.btn-lime { --btn-bg: var(--lime); --btn-fg: #15240b; --btn-bd: var(--lime); }
.btn-lime:hover { filter: brightness(.96); border-color: var(--lime); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--ink-2); }
.btn-ghost:hover { --btn-bg: var(--surface-3); border-color: transparent; color: var(--ink); }
.btn-danger { --btn-bg: var(--bad); --btn-fg: #fff; --btn-bd: var(--bad); }
.btn-danger:hover { filter: brightness(.94); border-color: var(--bad); }
.btn-danger-quiet { --btn-bg: transparent; --btn-fg: var(--bad); --btn-bd: transparent; }
.btn-danger-quiet:hover { --btn-bg: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .84rem; border-radius: 9px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading { pointer-events: none; opacity: .8; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: .84rem; font-weight: 700; color: var(--ink); }
.field .req { color: var(--bad); margin-left: 2px; }
.hint { font-size: .8rem; color: var(--ink-3); }
.error-text { font-size: .8rem; color: var(--bad); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  font: 500 .93rem/1.4 var(--font-ui); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7c74' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: .85; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.is-invalid, .is-invalid:hover { border-color: var(--bad) !important; }
.is-invalid:focus { box-shadow: 0 0 0 3px rgba(184,55,31,.2) !important; }
.input-sm { min-height: 36px; padding: 6px 10px; font-size: .87rem; }
.input-group { display: flex; align-items: stretch; }
.input-group > .input { border-radius: 10px 0 0 10px; }
.input-group > .btn { border-radius: 0 10px 10px 0; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }
.input-affix { position: relative; }
.input-affix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; }
.input-affix > .input { padding-left: 28px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: var(--focus); }

/* Segmented radio (choice cards) */
.choice-group { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.choice { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-softer); box-shadow: inset 0 0 0 1px var(--brand); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }
.choice .choice-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--brand); flex: none; }
.choice:has(input:checked) .choice-icon { background: var(--brand); color: var(--brand-ink); }
.choice strong { display: block; font-size: .93rem; }
.choice span.muted { font-size: .82rem; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-1); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.02rem; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-l) var(--radius-l); }
@media (max-width: 560px) { .card-pad, .card-body { padding: 16px; } .card-head { padding: 14px 16px; } .card-foot { padding: 12px 16px; } }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: .76rem; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--muted-soft); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.plain { padding: 3px 10px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-lime { background: var(--lime-soft); color: #4d5c00; }
:root[data-theme="dark"] .badge-lime { color: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-lime { color: var(--lime); } }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: .9rem; font-weight: 600; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-bad { background: var(--bad-soft); color: var(--bad); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert ul { margin: 4px 0 0; padding-left: 18px; font-weight: 500; }

/* ---------- Tables ---------- */
.table-wrap { position: relative; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th a:hover { color: var(--ink); }
.table th a .icon { width: 13px; height: 13px; opacity: .5; }
.table th a.sorted .icon { opacity: 1; color: var(--brand); }
.table .col-check { width: 44px; padding-right: 0; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.compact .table td { padding-top: 9px; padding-bottom: 9px; }

/* Stacked table on narrow screens: each row becomes a card. */
@media (max-width: 760px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative; }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); text-align: left; flex: none; padding-top: 2px; }
  .table-stack td.cell-main { display: block; text-align: left; padding: 0 0 8px; }
  .table-stack td.cell-main::before, .table-stack td.col-check::before, .table-stack td.col-actions::before { display: none; }
  .table-stack td.col-check { position: absolute; right: 12px; top: 12px; width: auto; padding: 0; }
  .table-stack tr:has(td.col-check) td.cell-main { padding-right: 36px; }
  .table-stack td.col-actions { justify-content: flex-end; padding-top: 8px; width: 100%; }
}

/* ---------- Media cell ---------- */
.media { display: flex; align-items: center; gap: 12px; min-width: 0; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: var(--surface-3); border: 1px solid var(--line); flex: none; }
.thumb-l { width: 64px; height: 64px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: var(--brand-soft); color: var(--brand); flex: none; letter-spacing: .02em; }
.avatar-l { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-s { width: 30px; height: 30px; font-size: .7rem; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-3);
  padding: 6px; opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right; visibility: hidden;
  transition: opacity .14s var(--ease), transform .14s var(--ease), visibility .14s;
}
.dropdown-menu.left { right: auto; left: 0; transform-origin: top left; }
.dropdown.open > .dropdown-menu { opacity: 1; transform: none; visibility: visible; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; font: 600 .88rem var(--font-ui); color: var(--ink); text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); color: var(--ink); box-shadow: none; }
.menu-item .icon { color: var(--ink-3); }
.menu-item.danger, .menu-item.danger .icon { color: var(--bad); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu-label { padding: 8px 10px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Dialogs ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-l);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: pop .18s var(--ease); }
dialog.modal::backdrop { background: rgba(10, 20, 15, .5); backdrop-filter: blur(2px); animation: fade .18s; }
dialog.modal.modal-s { width: min(420px, calc(100vw - 24px)); }
dialog.modal.modal-l { width: min(760px, calc(100vw - 24px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-head h2 { font-size: 1.15rem; margin: 0; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.confirm-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bad-soft); color: var(--bad); margin-bottom: 12px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 560px) {
  dialog.modal, dialog.modal.modal-s, dialog.modal.modal-l { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--radius-l) var(--radius-l) 0 0; max-height: 92dvh; }
  dialog.modal[open] { animation: slideup .22s var(--ease); }
  .modal-foot .btn { flex: 1; }
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 1000; right: 16px; bottom: 16px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--radius); background: var(--ink); color: var(--paper); box-shadow: var(--shadow-3); font-size: .9rem; font-weight: 600; animation: toastin .25s var(--ease); }
.toast .icon { margin-top: 1px; }
.toast-ok .icon { color: #7fdca5; }
.toast-bad .icon { color: #ff9c86; }
.toast-info .icon { color: #9cc4f2; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0; }
.toast button:hover { opacity: 1; }
.toast.out { animation: toastout .2s forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastout { to { opacity: 0; transform: translateX(20px); } }
@media (max-width: 560px) { .toasts { left: 16px; right: 16px; width: auto; bottom: 12px; } }

/* ---------- Empty states ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 48px 20px; }
.empty-art { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-softer); color: var(--brand); margin-bottom: 8px; }
.empty-art .icon { width: 28px; height: 28px; }
.empty h3 { margin: 0; }
.empty p { color: var(--ink-3); max-width: 380px; margin: 0 0 10px; }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); }
.pager-info { font-size: .85rem; color: var(--ink-3); }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-links a, .pager-links span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 9px; font-weight: 700; font-size: .86rem; color: var(--ink-2); border: 1px solid transparent; }
.pager-links a:hover { background: var(--surface-3); color: var(--ink); }
.pager-links .current { background: var(--brand); color: var(--brand-ink); }
.pager-links .disabled { opacity: .4; }
.pager-links .gap { min-width: 20px; padding: 0; }
@media (max-width: 560px) { .pager { justify-content: center; } .pager-links .page-num { display: none; } .pager-links .page-num.current { display: inline-grid; } }

/* ---------- Tabs / chips ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: .88rem; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.tab .count { font-size: .74rem; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); }
.tab.active .count { background: var(--brand-soft); color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: .84rem; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active, .chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { box-shadow: var(--focus); }
.chip:has(input:disabled) { opacity: .45; cursor: not-allowed; text-decoration: line-through; }

/* ---------- Quantity stepper ---------- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); height: 40px; }
.qty button { width: 36px; height: 100%; border: 0; background: none; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; border-radius: 10px; }
.qty button:hover { color: var(--ink); background: var(--surface-3); }
.qty input { width: 44px; height: 100%; border: 0; background: none; text-align: center; font: 700 .95rem var(--font-ui); color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; }
.qty:focus-within { border-color: var(--brand); box-shadow: var(--focus); }

/* ---------- Description list ---------- */
.dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 10px 16px; margin: 0; font-size: .9rem; }
.dl dt { color: var(--ink-3); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--surface); background: var(--brand); box-shadow: 0 0 0 1px var(--line-strong); }
.timeline .dot.cancelled { background: var(--bad); }
.timeline li:not(:first-child) .dot { background: var(--line-strong); }
.timeline strong { display: block; font-size: .9rem; }
.timeline .muted { font-size: .8rem; }

/* ---------- Progress ---------- */
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand); transition: width .6s var(--ease); }

/* ---------- Skeleton / loading ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
}
.icon.flip { transform: rotate(180deg); }
button.tab { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-family: inherit; }
button.tab.active { border-bottom-color: var(--brand); }
[hidden] { display: none !important; }
