/* Pania · Stoc rămas — brand theme after pania.ro: black, white and olive green, Rubik with Pacifico accents.
   Colors are tokens; dark mode redefines them. Mobile first. */
:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f2f2ee;
  --ink: #111111;              /* Pania black: hero bands and the send bar */
  --on-ink: #f5f5f1;
  --on-ink-muted: #a9a9a1;
  --text: #1b1b19;
  --muted: #6b6b64;
  --border: #e4e4de;
  --border-strong: #cdcdc5;
  --primary: #4e7f31;          /* Pania green, a touch deeper so white text passes contrast */
  --primary-hover: #406a27;
  --primary-ink: #3f6a26;      /* green text on light surfaces */
  --primary-soft: #edf3e7;
  --on-primary: #ffffff;
  --leaf-light: #93c26f;       /* green on black */
  --selected-bg: #111111;
  --selected-fg: #f5f5f1;
  --warn: #8a5a00;
  --warn-soft: #fbf2de;
  --err: #b3261e;
  --err-soft: #fbe9e7;
  --info-soft: #eef1f3;
  --focus-ring: rgba(78, 127, 49, .35);
  --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 4px 14px rgba(17, 17, 17, .05);
  --shadow-lift: 0 14px 34px rgba(17, 17, 17, .14);
  --radius: 10px;
  --radius-sm: 6px;
  --tap: 48px;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --script: "Pacifico", "Snell Roundhand", "Brush Script MT", cursive;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0e;
    --surface: #191917;
    --surface-2: #22221f;
    --ink: #050505;
    --on-ink: #f1f1ec;
    --on-ink-muted: #9d9d95;
    --text: #f1f1ec;
    --muted: #a8a89f;
    --border: #2c2c28;
    --border-strong: #3b3b36;
    --primary: #6ea84a;
    --primary-hover: #7db957;
    --primary-ink: #95c970;
    --primary-soft: #1b2714;
    --on-primary: #0c1407;
    --leaf-light: #93c26f;
    --selected-bg: #f1f1ec;
    --selected-fg: #111111;
    --warn: #e8b85a;
    --warn-soft: #2d2412;
    --err: #ff8a80;
    --err-soft: #3a1d1a;
    --info-soft: #1d2126;
    --focus-ring: rgba(147, 194, 111, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-lift: 0 14px 34px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { font-weight: 500; line-height: 1.2; margin: 0; letter-spacing: .005em; }
p { margin: 0 0 .6em; }
strong { font-weight: 600; }
a { color: var(--primary-ink); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.container { max-width: 760px; margin: 0 auto; padding: 18px 16px 48px; }
.page-admin .container { max-width: 1080px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-weight: 500; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow {
  display: block; margin: 0 0 8px;
  font-size: .74rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--primary-ink);
}
.eyebrow-on-dark { color: var(--leaf-light); }
.script { font-family: var(--script); font-weight: 400; letter-spacing: 0; color: var(--leaf-light); font-size: 1.4rem; line-height: 1.3; margin: 0 0 6px; }

.live-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px);
  padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--ink); color: var(--on-ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  font-weight: 500; white-space: nowrap;
}
.demo-banner {
  background: var(--primary); color: var(--on-primary); text-align: center;
  font-size: .76rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; padding: 5px 12px;
}

/* ---- brand ---- */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.leaf-fill { fill: var(--primary); }
.leaf-rib { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1.4; stroke-linecap: round; }
.leaf-line { fill: none; stroke: var(--text); stroke-width: 2.1; stroke-linejoin: round; }
.brand-logo { display: block; width: auto; height: 36px; }
.brandbar .brand-logo { height: 42px; }
@media (prefers-color-scheme: dark) {
  .brand-logo { filter: brightness(0) invert(1); opacity: .92; }  /* the dark-green logo, in white */
}
.brand-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-tag {
  padding-left: 12px; border-left: 1px solid var(--border);
  font-size: .7rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--primary-ink); white-space: nowrap;
}
@media (max-width: 400px) { .brand-tag { display: none; } }

/* ---- bars ---- */
.brandbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.brandbar-inner { max-width: 760px; margin: 0 auto; padding: 14px 20px; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-admin .topbar-inner { max-width: 1080px; }
.admin-topbar { position: static; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar-actions form { margin: 0; }

.admin-nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-nav-inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 6px; }
.admin-nav a {
  display: block; text-align: center; padding: 12px 2px 10px; border-bottom: 2px solid transparent;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .9rem; white-space: nowrap;
}
.admin-nav a:hover { color: var(--text); }
.admin-nav a.is-active { color: var(--text); border-bottom-color: var(--primary); }
@media (min-width: 640px) {
  .admin-nav-inner { display: flex; gap: 6px; padding: 0 16px; }
  .admin-nav a { padding: 14px 10px 12px; font-size: .94rem; }
}

/* ---- hero band (black, like the product banners on pania.ro) ---- */
.hero { position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink); }
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 34px 20px 78px; }
.hero-compact .hero-inner { padding: 20px 20px 70px; }
.hero-title { font-size: clamp(1.55rem, 6vw, 2.25rem); font-weight: 500; letter-spacing: .01em; line-height: 1.15; overflow-wrap: anywhere; }
.hero-lead { color: var(--on-ink-muted); margin: 10px 0 0; }
.hero-watermark { position: absolute; right: -34px; bottom: -48px; width: 230px; height: 230px; opacity: .13; z-index: 0; pointer-events: none; }
.hero-watermark .leaf-fill { fill: var(--leaf-light); }
.hero-watermark .leaf-line { stroke: var(--on-ink); }
.hero-watermark .leaf-rib { stroke: transparent; }
.has-hero .container { position: relative; margin-top: -48px; padding-top: 0; }
.lift { box-shadow: var(--shadow-lift); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; letter-spacing: .01em; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease, transform .08s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { border-color: var(--text); }
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* Inactive but still focusable (reorder arrows at the ends): dim the icon, keep the focus ring visible. */
.btn[aria-disabled="true"] { cursor: not-allowed; border-color: var(--border); color: var(--muted); }
.btn[aria-disabled="true"] > * { opacity: .45; }
.btn[aria-disabled="true"]:hover { border-color: var(--border); }
.btn.is-busy { cursor: progress; opacity: .7; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; }
.btn-danger-ghost { background: transparent; color: var(--err); border-color: var(--err); }
.btn-lg { min-height: 52px; font-size: 1.05rem; padding: 0 26px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn-xs { min-height: 34px; min-width: 34px; padding: 0 8px; font-size: .95rem; }
.btn-block { display: flex; width: 100%; }
.btn-icon { min-width: 44px; padding: 0; font-size: 1.35rem; line-height: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { flex: none; }

/* ---- forms ---- */
input[type="text"], input[type="password"], input[type="search"], input[type="date"], input:not([type]), select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px; font-size: 1rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus-ring); outline-offset: 0; border-color: var(--primary); }
.is-invalid, [aria-invalid="true"] { border-color: var(--err) !important; background: var(--err-soft) !important; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label { display: block; font-weight: 500; font-size: .92rem; margin-bottom: 6px; }
.field .field-label { margin-bottom: 0; }
.field-error { color: var(--err); font-weight: 500; margin: 8px 0 0; }
.hint { display: block; color: var(--muted); font-size: .85rem; margin: 6px 0 0; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; min-height: 40px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.check-group { border: 0; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); column-gap: 16px; }
.check-group legend { padding: 10px 0 2px; font-size: .74rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.input-with-btn { display: flex; gap: 8px; align-items: center; }
.input-with-btn input { flex: 1; min-width: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 24px; }
.stack-form > .card { margin-bottom: 14px; }
.stack-gap { margin: 16px 0 10px; }
.add-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.add-grid .field-wide { grid-column: 1 / -1; }
@media (min-width: 720px) { .add-product .add-grid { grid-template-columns: 2fr 1fr 1fr; } .add-product .field-wide { grid-column: auto; } }

/* ---- cards, notices, badges ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card, .card + section, section + .card { margin-top: 14px; }
.card-title { font-size: 1.05rem; margin-bottom: 12px; }
.card-heading { font-size: 1.35rem; margin-bottom: 10px; }
.card-head-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head-row .card-title { margin: 0; }
.form-card { margin-bottom: 14px; }
.notice {
  border-radius: 8px; padding: 12px 14px; margin: 0 0 14px;
  background: var(--info-soft); color: var(--text); border-left: 3px solid var(--muted);
}
.notice p:last-child { margin: 0; }
.notice-ok { background: var(--primary-soft); border-left-color: var(--primary); }
.notice-err { background: var(--err-soft); border-left-color: var(--err); }
.notice-warn { background: var(--warn-soft); border-left-color: var(--warn); }
.notice-icon { display: flex; gap: 10px; align-items: flex-start; }
.notice-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.icon-inline { width: 22px; height: 22px; flex: none; color: var(--primary); }
.empty-state { text-align: center; padding: 30px 18px; }
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 500; letter-spacing: .02em; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge-ok { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* ---- sign-in pages ---- */
.page-entry .container { max-width: 460px; }
.entry-form { padding: 22px; }
.entry-form .btn { margin-top: 16px; }
.code-input {
  font-size: 1.6rem !important; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; text-align: center;
  min-height: 60px !important; font-variant-numeric: tabular-nums;
}
.code-input::placeholder { letter-spacing: .06em; font-size: 1rem; font-weight: 400; text-transform: none; }
.entry-help { color: var(--muted); margin: 16px 4px 0; font-size: .92rem; text-align: center; }

/* ---- two-step login: linking the phone, backup codes ---- */
.page-entry .container:has(.entry-wide) { max-width: 560px; }
.totp-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 18px; }
.totp-steps li::marker { font-weight: 600; color: var(--primary-ink); }
.totp-steps label { display: block; margin-bottom: 8px; }
.totp-add { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 12px 0 6px; }
.totp-add-side { flex: 1 1 180px; }
.totp-add-side p { margin: 0 0 8px; }
/* A QR code needs dark on light, also in dark mode. */
.totp-qr { width: 196px; max-width: 100%; padding: 6px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); flex: none; }
.totp-qr svg { display: block; width: 100%; height: auto; }
@media (max-width: 480px) { .totp-add-side { order: -1; } }   /* on a phone, the button comes first */
.totp-key summary { cursor: pointer; color: var(--primary-ink); font-weight: 500; }
.totp-key-text { margin: 8px 0 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.backup-codes { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px; font-size: 1.15rem; }
.backup-codes li { padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); text-align: center; }
.backup-rules { margin: 16px 0 0; padding-left: 1.2em; color: var(--muted); font-size: .92rem; }
.backup-codes-card .notice { margin-top: 0; }
.print-only { display: none; }
.totp-code-field { max-width: 220px; font-variant-numeric: tabular-nums; letter-spacing: .12em; }
.backup-num { color: var(--muted); font-weight: 400; margin-right: 4px; }
.backup-confirm { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.backup-confirm .btn { margin-top: 8px; }
.backup-entry { margin-top: 14px; }
.backup-entry summary, .entry-help-more summary, .details-plain summary { cursor: pointer; color: var(--primary-ink); font-weight: 500; }
.backup-entry .field-label { display: block; margin: 10px 0 6px; }
.totp-backup-field { text-transform: uppercase; letter-spacing: .08em; }
.entry-help-more { margin: 16px 4px 0; font-size: .9rem; color: var(--muted); }
.entry-help-more p { margin: 8px 0 0; }
.details-plain { margin-top: 12px; }
.details-plain ol { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--muted); }
@media (max-width: 360px) { .backup-codes { grid-template-columns: 1fr; } }
.entry-footer { text-align: center; margin-top: 40px; font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; }
.entry-footer a { color: var(--muted); text-decoration: none; }
.entry-footer a:hover { color: var(--text); }
.page-plain .container { padding-top: 32px; }

/* ---- store room ---- */
.day-card { margin-bottom: 14px; padding: 16px 18px; }
.day-date { margin: 0; font-size: 1.25rem; font-weight: 500; }

.search-box { margin: 0 0 12px; }
.product-group { margin-top: 20px; }
.group-title { margin: 0 4px 8px; font-size: .74rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.group-head .group-title { margin-bottom: 0; }
.list-card { padding: 0; overflow: hidden; }
.qty-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 12px 11px 16px; border-top: 1px solid var(--border);
  transition: background-color .15s ease;
}
.qty-row:first-child { border-top: 0; }
.qty-row.has-value { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.qty-row.has-error { background: var(--err-soft); box-shadow: inset 3px 0 0 var(--err); }
.qty-name { display: flex; flex-direction: column; min-width: 0; flex: 1; cursor: pointer; }
.qty-title { font-weight: 500; overflow-wrap: anywhere; }
.qty-meta { font-size: .8rem; color: var(--muted); }
.stepper { display: flex; align-items: center; flex: none; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.step {
  width: 46px; height: 46px; border: 0; border-radius: 7px; background: transparent; color: var(--text);
  font-size: 1.45rem; line-height: 1; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.step:hover { background: var(--surface-2); }
.step:active { background: var(--primary-soft); color: var(--primary-ink); }
.qty-input {
  width: 3.2em !important; min-height: 40px !important; padding: 4px 2px !important;
  border: 0 !important; background: transparent !important; text-align: center;
  font-size: 1.2rem !important; font-weight: 600; font-variant-numeric: tabular-nums;
}
.qty-input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-radius: 6px; }
.qty-input::placeholder { color: var(--muted); opacity: .55; }
.filter-empty { text-align: center; padding: 12px; }
.note-card { margin-top: 20px; }

/* ---- the black send bar ---- */
.has-sticky .container { padding-bottom: 128px; }
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--ink); color: var(--on-ink);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .18);
}
.sticky-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-admin .sticky-inner { max-width: 1080px; }
.sticky-total { display: flex; flex-direction: column; line-height: 1.1; }
.sticky-label { font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--on-ink-muted); }
.sticky-value { font-size: 1.65rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sticky-bar .btn-lg { min-width: 150px; }
.sticky-bar .btn-ghost { color: var(--on-ink); border-color: rgba(255, 255, 255, .3); }
.sticky-bar .btn-ghost:hover { border-color: var(--on-ink); }
.sticky-value.is-multi { font-size: 1.05rem; line-height: 1.2; }
.tile-value.tile-units { font-size: 1.35rem; line-height: 1.25; }
.sticky-bar .btn-row { flex-wrap: nowrap; gap: 6px; }
.sticky-bar .btn-row .btn { padding: 0 14px; font-size: .92rem; }
@media (max-width: 380px) { .sticky-bar .btn-row .btn { flex: 1 1 auto; min-width: 0; padding: 0 10px; white-space: normal; line-height: 1.15; } }
.page-admin .qty-row.has-value { background: transparent; box-shadow: none; }

/* ---- confirm dialog ---- */
dialog:not([open]) { display: none; }
.dialog {
  border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
}
.dialog::backdrop { background: rgba(10, 10, 10, .6); }
.dialog[open] { animation: dialog-in .2s cubic-bezier(.2, .8, .2, 1); }
.dialog[open]::backdrop { animation: fade-in .2s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.dialog-body { padding: 22px; margin: 0; }
.dialog-title { font-size: 1.25rem; margin-bottom: 4px; }
.dialog-summary { margin: 14px 0; max-height: 45vh; overflow-y: auto; padding-right: 8px; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { flex: 1; }
.summary-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.summary-table th, .summary-table td { padding: 9px 2px; border-bottom: 1px solid var(--border); text-align: left; }
.summary-table th { font-weight: 400; }
.summary-table td { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-empty { font-weight: 500; padding: 6px 0 10px; }


/* ---- sent ---- */
.success-card { padding: 22px; }
.success-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.success-head .eyebrow { margin-bottom: 2px; }
.success-line { margin: 0; }
.success-mark { width: 48px; height: 48px; flex: none; border-radius: 999px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.icon-success { width: 28px; height: 28px; }
.note-quote { font-style: italic; margin: 10px 0; overflow-wrap: anywhere; }
.success-actions { display: grid; gap: 10px; margin-top: 18px; }

/* ---- admin layout ---- */
.page-head { margin: 8px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.page-head h1 { font-size: 1.6rem; }
.page-head .eyebrow { margin-bottom: -4px; }
.page-head-row { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
@media (max-width: 560px) { .page-head h1 { font-size: 1.4rem; } }
.breadcrumb { margin: 0 0 6px; font-size: .9rem; }
.breadcrumb a { text-decoration: none; }
.lead-text { color: var(--muted); }
.section-title { margin: 30px 0 12px; font-size: .78rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.date-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-nav .btn-icon { flex: none; }
.date-nav-field {
  position: relative; display: flex; align-items: center; justify-content: center;
  flex: 1 1 0; min-width: 0; max-width: 340px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
}
.date-nav-text { display: flex; gap: 6px; align-items: baseline; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-nav-rel { color: var(--primary-ink); text-transform: capitalize; }
.date-nav-field input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; cursor: pointer; }
.date-nav-field input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.date-nav-field:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-color: var(--primary); }
.date-nav-today { flex-basis: 100%; }
@media (min-width: 640px) { .date-nav-today { flex-basis: auto; } }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.tile-label { font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tile-value { font-size: 1.75rem; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile-value small { font-size: .95rem; color: var(--muted); font-weight: 400; }
.tile-accent { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.tile-accent .tile-label { color: var(--leaf-light); }
.tile-accent .tile-value small { color: inherit; opacity: .72; }
.tile-wide { grid-column: 1 / -1; }
.tile-parts { display: flex; flex-wrap: wrap; gap: 2px 28px; }
.tile-parts > span { white-space: nowrap; }

.missing-card { background: var(--warn-soft); border-color: transparent; box-shadow: none; }
.missing-list { list-style: none; margin: 0; padding: 0; }
.missing-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--border); }
.missing-list li:first-child { border-top: 0; }
.missing-name { font-weight: 500; }

.cards-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }
.cards-grid .card { margin: 0; }
.store-card { display: flex; flex-direction: column; gap: 6px; }
.store-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.store-card-head h3 { font-size: 1.05rem; }
.store-card-foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th, .mini-table td { padding: 5px 0; text-align: left; border-bottom: 1px dashed var(--border); }
.mini-table th { font-weight: 400; }
.mini-table td { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

.table-card { padding: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table thead th { font-size: .7rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.data-table tbody th { font-weight: 500; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .is-zero { color: var(--muted); }
.table-scroll .data-table th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.table-scroll .data-table thead th:first-child { background: var(--surface-2); }
.breakdown { display: block; margin-top: 2px; font-weight: 400; font-size: .84rem; color: var(--muted); }
@media (max-width: 560px) {
  .data-table { font-size: .88rem; }
  .data-table th, .data-table td { padding: 9px 8px; }
  .data-table tbody th { min-width: 110px; }
}

.plan-table .total-cell { font-weight: 600; background: var(--primary-soft); color: var(--primary-ink); }
.plan-table thead .total-cell { background: var(--ink); color: var(--on-ink); }
.th-source { display: block; margin-top: 3px; font-size: .62rem; letter-spacing: .06em; text-transform: none; font-weight: 400; }
.th-source.reported { color: var(--primary-ink); }
.th-source.waiting { color: var(--warn); }
.th-source.no_targets { color: var(--muted); }

/* ---- targets grid ---- */
.target-tools { margin-bottom: 14px; }
.target-tools .tool-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.target-tools .tool-row + .tool-row { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.target-tools label { display: flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 500; }
.target-tools select { width: auto; min-height: 38px; padding: 6px 10px; }
.target-table { min-width: 620px; }
.target-table td { padding: 6px 4px; vertical-align: middle; }
.target-table tbody th { vertical-align: middle; }
.target-table .is-weekend { background: var(--surface-2); }
.target-input {
  width: 3.8em !important; min-height: 38px !important; padding: 4px 6px !important;
  text-align: center; font-weight: 600; font-variant-numeric: tabular-nums;
}
.target-input::placeholder { color: var(--muted); opacity: .55; font-weight: 400; }
.sticky-note { color: var(--on-ink-muted); font-size: .85rem; }

.th-source.none { color: var(--err); }
.data-table .group-row th { background: var(--surface-2); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: 8px; padding-bottom: 8px; }
.plan-table tfoot th, .plan-table tfoot td { border-top: 2px solid var(--text); border-bottom: 0; font-weight: 600; }
.plan-note { margin-top: 10px; }

.details-card { margin-top: 18px; padding: 0; }
.details-card summary { padding: 14px 18px; cursor: pointer; font-weight: 500; }
.details-card[open] summary { border-bottom: 1px solid var(--border); }
.details-body { padding: 14px 18px; }
.filter-card { margin-bottom: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  color: var(--text); text-decoration: none; font-weight: 500; font-size: .9rem;
}
.chip:hover { border-color: var(--text); }
.chip.is-active { background: var(--selected-bg); border-color: var(--selected-bg); color: var(--selected-fg); }
.filter-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; align-items: end; }
.filter-grid label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: .85rem; font-weight: 500; color: var(--muted); }
.filter-grid input, .filter-grid select { min-width: 0; font-size: 1rem; }  /* 16px: iOS does not zoom */
.filter-grid label:nth-of-type(3) { grid-column: 1 / -1; }
.filter-grid .btn { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .filter-grid { grid-template-columns: 1fr 1fr 1.5fr auto; }
  .filter-grid label:nth-of-type(3), .filter-grid .btn { grid-column: auto; }
}

.list-row, .product-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.list-row:first-child, .product-row:first-child { border-top: 0; }
a.list-row:hover { background: var(--surface-2); }
.list-main { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--text); text-decoration: none; }
.list-main strong { font-weight: 500; overflow-wrap: anywhere; }
.chevron { color: var(--muted); font-size: 1.4rem; }
.is-inactive { opacity: .6; }
.move-btns { display: flex; gap: 4px; flex: none; }
.move-btns form { margin: 0; }

/* Products page: reorder by dragging the grip or with the arrows (app.js glides and saves). */
.btn-move { color: var(--text); }
.icon-move { width: 18px; height: 18px; }
.icon-grip { width: 20px; height: 20px; }
.reorder-help .icon-grip { width: 1.15em; height: 1.15em; vertical-align: -.25em; color: var(--muted); }
[data-reorder-list] { position: relative; }
.product-row { background: var(--surface); }
.product-row.is-inactive { opacity: 1; }
.product-row.is-inactive > .list-main { opacity: .6; }
.drag-handle {
  display: none; flex: none; align-items: center; justify-content: center;
  width: 32px; height: 44px; margin: -6px -4px -6px -10px; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted);
  cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.is-reorderable .drag-handle { display: inline-flex; }
.drag-handle:hover { color: var(--text); background: var(--surface-2); }
.drag-handle:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; color: var(--text); }
.product-row.is-dragging { position: relative; z-index: 3; border-radius: var(--radius-sm); box-shadow: 0 12px 30px rgba(17, 17, 17, .22), 0 0 0 1px var(--border-strong); }
.is-dragging .drag-handle { cursor: grabbing; color: var(--primary); }
body.is-reordering, body.is-reordering * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.product-row.just-moved { animation: just-moved 1.4s ease-out; }
@keyframes just-moved { from { background: var(--primary-soft); } to { background: var(--surface); } }
@media (max-width: 480px) {
  .product-row { gap: 10px; padding-right: 12px; }
  .product-row .move-btns { flex-direction: column; }
}

/* ---- Excel links (Setări) and the tables Excel imports ---- */
.excel-steps { margin: 0 0 14px; padding-left: 20px; }
.excel-steps li { margin-bottom: 6px; }
.excel-links { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.excel-links li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.excel-links li:first-child { border-top: 0; }
.excel-link-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.excel-url { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; color: var(--muted); }
.page-export .table-card { margin-bottom: 8px; }
@media (max-width: 480px) { .excel-links li { flex-direction: column; align-items: stretch; } }

/* ---- smooth navigation (app.js swaps pages without reloading) ---- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
main.nav-enter { animation: nav-enter .2s ease-out; }
@keyframes nav-enter { from { opacity: 0; } }  /* opacity only: a transform would move the fixed send bar */
.nav-progress {
  position: fixed; top: 0; left: 0; z-index: 100; height: 3px; width: 0; opacity: 0;
  background: var(--primary); box-shadow: 0 0 8px var(--primary); pointer-events: none;
}
.nav-progress.is-loading { opacity: 1; width: 85%; transition: width 8s cubic-bezier(.1, .8, .2, 1), opacity .1s; }
.nav-progress.is-done { opacity: 0; width: 100%; transition: width .15s ease-out, opacity .3s ease .15s; }
[tabindex="-1"]:focus { outline: none; }
.notice[data-flash], [data-poll-banner]:not([hidden]) { animation: notice-in .28s cubic-bezier(.2, .8, .2, 1); }
.live-banner:not([hidden]) { animation: banner-in .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes notice-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, -8px); } }
a.list-row, .list-main, .admin-nav a, .chip { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
form[aria-busy="true"] { cursor: progress; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translateX(-50%); display: flex; align-items: center; gap: 14px;
  width: max-content; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: var(--radius);
  background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 28px rgba(0, 0, 0, .25); font-size: .93rem;
  animation: toast-in .2s ease-out;
}
.toast.is-error { box-shadow: inset 4px 0 0 var(--err), 0 8px 28px rgba(0, 0, 0, .25); }
.toast-action { flex: none; padding: 6px 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.toast-close { flex: none; width: 32px; height: 32px; margin: -6px -10px -6px -4px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; opacity: .75; }
.toast-close:hover { opacity: 1; }
.toast-action:focus-visible, .toast-close:focus-visible { outline: 2px solid var(--on-ink); outline-offset: 2px; }
.has-sticky .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }  /* above the black send bar */
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .product-row.just-moved, .toast, main.nav-enter, .notice[data-flash], .dialog[open], .dialog[open]::backdrop,
  [data-poll-banner]:not([hidden]), .live-banner:not([hidden]) { animation: none; }
  .btn { transition: none; }
  .btn:active:not(:disabled):not([aria-disabled="true"]) { transform: none; }
}
.row-delete { margin: 0; flex: none; }
.btn-delete { color: var(--err); }
.btn-delete:hover { border-color: var(--err); background: var(--err-soft); }
.icon-trash { width: 17px; height: 17px; }
.list-row .list-main:hover strong { text-decoration: underline; text-underline-offset: 3px; }

.link-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.link-card .field-label { color: var(--leaf-light); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.link-card .muted { color: var(--on-ink-muted); }
.link-card .btn-ghost { color: var(--on-ink); border-color: rgba(255, 255, 255, .3); }
.link-card .btn-ghost:hover { border-color: var(--on-ink); }
.link-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.big-code { font-size: 2rem; overflow-wrap: anywhere; }
.link-card-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-thumb { flex: none; display: block; padding: 6px; background: #fff; border-radius: 10px; line-height: 0; }
.qr-thumb img { width: 132px; height: 132px; }
.qr-thumb:focus-visible { outline: 3px solid var(--leaf-light); outline-offset: 2px; }
.qr-warning { margin: 0; padding: 8px 12px; border-left: 3px solid var(--leaf-light); background: rgba(255, 255, 255, .08); color: var(--on-ink); }
.link-text { overflow-wrap: anywhere; }
.danger-zone { margin-top: 28px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }

/* ---- demo guide ---- */
.page-guide .container { max-width: 760px; }
.guide-cols { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .guide-cols { grid-template-columns: 1.4fr 1fr; } }
.guide-stores { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.guide-stores form { margin: 0; }
.guide-store {
  display: grid; grid-template-columns: 1fr auto; align-items: center; width: 100%; text-align: left;
  padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer;
}
.guide-store:hover { border-color: var(--text); }
.guide-store-name { font-weight: 500; }
.guide-store-meta { grid-column: 1; font-size: .82rem; color: var(--muted); }
.guide-store .chevron { grid-column: 2; grid-row: 1 / span 2; }
.guide-admin { display: flex; flex-direction: column; gap: 6px; }
.guide-password { margin: 6px 0 10px; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.guide-step { display: flex; gap: 14px; align-items: flex-start; margin: 0 !important; }
.guide-num {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 999px;
  background: var(--ink); color: var(--on-ink); font-weight: 600; font-size: .9rem;
}
.guide-body h3 { font-size: 1.05rem; margin: 4px 0 6px; }
.guide-body p { color: var(--muted); }
.guide-body .btn { margin-top: 4px; }
.inline-form { display: inline; margin: 0; }
.guide-reset { margin-top: 22px; }
.demo-banner a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---- printable store sheet ---- */
.page-sheet .container { max-width: 820px; }
.sheet-tools { display: flex; justify-content: space-between; margin-bottom: 16px; }
.sheet { background: #fff; color: #111; border: 1px solid #111; border-radius: 16px; padding: 34px; }
.sheet .leaf-fill { fill: #4e7f31; }
.sheet .leaf-line { stroke: #111; }
.sheet .brand { color: #111; }
.sheet .brand-logo { height: 54px; filter: none; opacity: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid #ddd; }
.sheet-kicker { font-size: .74rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: #3f6a26; }
.sheet-title { font-size: 2.3rem; margin: 22px 0 8px; }
.sheet-lead { font-size: 1.05rem; color: #444; }
.sheet-grid { display: grid; gap: 26px; grid-template-columns: 1fr; align-items: center; margin-top: 20px; }
@media (min-width: 600px) { .sheet-grid { grid-template-columns: 220px 1fr; } }
.sheet-qr { display: block; width: 220px; height: 220px; margin: 0 auto; background: #fff; }
.sheet-step { font-size: 1.02rem; margin: 0 0 12px; }
.sheet-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 6px; border-radius: 999px;
  background: #4e7f31; color: #fff; font-size: .85rem; font-weight: 600;
}
.sheet-link { font-weight: 500; overflow-wrap: anywhere; }
.sheet-code { display: inline-block; max-width: 100%; margin: 4px 0 16px; padding: 8px 18px; border: 2px solid #111; border-radius: 10px; font-size: 2.4rem; letter-spacing: .2em; overflow-wrap: anywhere; }
.sheet-code-long { font-size: 1.5rem; letter-spacing: .08em; }
.sheet-grid > * { min-width: 0; }
.sheet-foot { margin: 20px 0 0; font-size: .9rem; color: #555; }
.sheet-backup { margin: 18px 0 0; font-size: .95rem; color: #333; }
.sheet + .sheet { margin-top: 24px; }

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, .brandbar, .admin-nav, .hero, .no-print, .sheet-tools, .notice, .demo-banner, [data-poll-banner], .date-nav .btn, .sticky-bar,
  .toast, .nav-progress, .drag-handle, .live-banner { display: none !important; }
  .has-hero .container { margin-top: 0; }
  .container { max-width: none; padding: 0; }
  .card, .tile { box-shadow: none; border-color: #999; break-inside: avoid; }
  .tile-accent { background: #fff; color: #000; }
  .details-card > *:not(summary) { display: block !important; }
  .table-scroll { overflow: visible !important; }
  .table-scroll .data-table th:first-child { position: static; }
  .data-table { font-size: 8.5pt; }
  .data-table th, .data-table td { padding: 3px 5px; }
  .data-table thead th { white-space: normal; }
  .sheet { border-color: #000; break-inside: avoid; }
  .sheet + .sheet { margin-top: 0; break-before: page; }
  .print-only { display: block; }
  .backup-codes li { border-color: #000; }
  @page { margin: 12mm; }
}
