/* zapa — design system
   Servit la /admin/static/app.css. Prefixul /admin/ e obligatoriu: pe k4a.ro
   doar `handle /admin*` ajunge la app prin Caddy, restul e WordPress.

   Limbaj: grotesc geometric, colțuri ascuțite, accent lime folosit ca suprafață
   (niciodată ca text), mono pentru orice identificator. */

/* ---------- Fonturi ---------- */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/admin/static/fonts/spacegrotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/admin/static/fonts/spacegrotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/admin/static/fonts/jetbrainsmono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/admin/static/fonts/jetbrainsmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --bg: #fafbf8;
  --surface: #ffffff;
  --surface-2: #f0f2ec;
  --fg: #101311;
  --muted: #585d56;
  --rule: #e3e6dd;
  --rule-strong: #c4c9bd;

  /* Lime-ul e suprafață, nu text: contrastul lui pe alb e 1.4:1. */
  --accent: #c6f53f;
  --accent-hover: #b6e82a;
  --accent-ink: #0f120e;

  --danger: #c0271a;
  --danger-soft: #fdeceb;
  --warn: #7d5300;
  --warn-soft: #fff2d4;
  --ok: #156340;
  --ok-soft: #e4f4eb;

  --font-ui: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-2xs: 10px;
  --fs-xs: 11px;
  --fs-sm: 13px;
  --fs-ui: 14px;
  --fs-base: 16px;
  --fs-md: 19px;
  --fs-lg: 26px;
  --fs-xl: 38px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 40px;
  --sp-7: 64px;

  --r: 2px;
  --r-lg: 4px;
  --shell: 1080px;
  --ctl: 32px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f0d;
    --surface: #151814;
    --surface-2: #1c201b;
    --fg: #e9ece6;
    --muted: #949a91;
    --rule: #252a24;
    --rule-strong: #3b423a;

    --accent: #cbff4d;
    --accent-hover: #d9ff7a;
    --accent-ink: #0d0f0d;

    --danger: #ff8073;
    --danger-soft: #2b1411;
    --warn: #e8bb55;
    --warn-soft: #2a2110;
    --ok: #6fd3a0;
    --ok-soft: #10241a;
  }
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: var(--fs-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "ss02";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
h1 { font-size: var(--fs-lg); }
h2 { font-size: var(--fs-md); }
h3 { font-size: var(--fs-base); }

p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--fg); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

hr { border: none; border-top: 1px solid var(--rule); margin: var(--sp-5) 0; }

/* Lime-ul singur n-ar fi vizibil pe fundal deschis — inelul are miez de cerneală. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 1px;
  box-shadow: 0 0 0 5px var(--accent);
  border-radius: var(--r);
}

::selection { background: var(--accent); color: var(--accent-ink); }

svg { flex: none; }
.ico { width: 16px; height: 16px; stroke: currentColor; fill: none;
       stroke-width: 1.75; stroke-linecap: square; stroke-linejoin: miter; }
.ico--lg { width: 20px; height: 20px; }

/* ---------- Layout ---------- */

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 var(--sp-5); }
main.shell { flex: 1 0 auto; padding-bottom: var(--sp-7); }

.topbar { border-bottom: 1px solid var(--rule); background: var(--bg); }
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); min-height: 56px;
}

.brand { display: inline-flex; align-items: center; gap: var(--sp-2); text-decoration: none; color: var(--fg); }
.brand__mark { width: 24px; height: 24px; }
.brand__word { font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.05em; }

.topbar__right {
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted);
}
.whoami { letter-spacing: 0.06em; text-transform: uppercase; }

.tabs {
  display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--rule);
  margin: 0 0 var(--sp-6); overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: var(--sp-3) var(--sp-3); color: var(--muted); text-decoration: none;
  font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 500;
  letter-spacing: 0.02em; border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; min-height: 42px; display: flex; align-items: center; gap: var(--sp-2);
}
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.tabs a[aria-current="page"] .ico { color: var(--fg); }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5);
}
.page-head__actions { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }

.backlink {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--muted);
  text-decoration: none; margin-bottom: var(--sp-4); min-height: 30px;
}
.backlink:hover { color: var(--fg); }

.section { margin-bottom: var(--sp-6); }
.section__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap;
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--rule); margin-bottom: var(--sp-4);
}
.section__title {
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}

.stack > * + * { margin-top: var(--sp-4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.inline { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }

.sitefoot {
  flex-shrink: 0; border-top: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted);
  letter-spacing: 0.04em;
}
.sitefoot__inner {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) 0; flex-wrap: wrap;
}
.sitefoot a { color: var(--muted); text-decoration: none; }
.sitefoot a:hover { color: var(--fg); }

/* ---------- Text ---------- */

.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Butoane ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl); padding: 0 var(--sp-3);
  border: 1px solid var(--rule-strong); border-radius: var(--r);
  background: var(--surface); color: var(--fg);
  font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 500;
  letter-spacing: -0.01em; line-height: 1; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background-color 110ms ease, border-color 110ms ease, color 110ms ease;
}
.btn:hover { border-color: var(--fg); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  font-weight: 600;
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); background: var(--danger-soft); }

.btn--quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn--quiet:hover { color: var(--fg); border-color: var(--rule-strong); }

.btn--sm { height: 26px; padding: 0 var(--sp-2); font-size: var(--fs-xs); gap: 4px; }
.btn--sm .ico { width: 13px; height: 13px; }

.btn--icon { padding: 0; width: var(--ctl); }
.btn--sm.btn--icon { width: 26px; }

.btn--lg { height: 40px; padding: 0 var(--sp-4); font-size: var(--fs-ui); }

/* Butoanele rămân mici vizual, dar ținta de atingere nu scade sub 44px. */
@media (pointer: coarse) {
  .btn { min-height: 40px; }
  .btn--sm { min-height: 40px; padding: 0 var(--sp-3); }
  .btn--sm.btn--icon, .btn--icon { width: 40px; }
}

.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn-group { display: inline-flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- Formulare ---------- */

form { margin: 0; }
.field { margin-bottom: var(--sp-4); }
.field:last-child { margin-bottom: 0; }

.field > label, .label {
  display: block; margin-bottom: 6px;
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}

.field__hint { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.field__error { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--danger); font-weight: 500; }

input[type=text], input[type=url], input[type=email], input[type=password],
input[type=search], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r);
  color: var(--fg); font-family: var(--font-ui);
  /* 16px: sub pragul ăsta Safari pe iOS face zoom la focus și nu mai iese. */
  font-size: var(--fs-base); line-height: 1.35;
}
input.mono, textarea.mono, .field--mono input { font-family: var(--font-mono); font-size: var(--fs-ui); }
textarea { min-height: 88px; resize: vertical; }

select {
  appearance: none; padding-right: var(--sp-6); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 18px center, right 12px center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.65; }
input:hover, select:hover, textarea:hover { border-color: var(--fg); }

.field--invalid input, .field--invalid select, .field--invalid textarea {
  border-color: var(--danger); background: var(--danger-soft);
}

.checkbox {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  min-height: 38px; padding: var(--sp-2) 0; cursor: pointer;
  font-size: var(--fs-ui); color: var(--fg);
}
.checkbox input {
  width: 18px; height: 18px; min-height: 0; margin: 1px 0 0;
  accent-color: var(--accent); flex: none;
}
.checkbox__body { display: block; }
.checkbox__hint { display: block; font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }

.filterbar { display: flex; gap: var(--sp-2); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.filterbar .field { margin-bottom: 0; }
.filterbar__search { flex: 1 1 240px; }
.filterbar__status { flex: 0 0 160px; }
.filterbar .btn { height: 38px; }

.swatch-row { display: flex; align-items: center; gap: var(--sp-2); }
input[type=color] {
  width: 40px; height: 34px; min-height: 34px; padding: 2px; flex: none;
  background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: var(--r); cursor: pointer;
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: none; }
.swatch-row output { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--muted); text-transform: uppercase; }

.range-row { display: flex; align-items: center; gap: var(--sp-3); }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); height: 34px; }
.range-row output {
  font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 500;
  color: var(--fg); min-width: 52px; text-align: right;
}

/* ---------- Alerte ---------- */

.alert {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3); border: 1px solid; border-left-width: 3px;
  border-radius: var(--r); font-size: var(--fs-sm); margin-bottom: var(--sp-4);
}
.alert p { margin: 0; }
.alert p + p { margin-top: var(--sp-2); }
.alert--error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.alert--warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.alert--ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.alert--info { border-color: var(--rule-strong); background: var(--surface-2); color: var(--fg); }

/* ---------- Badge ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px;
  border: 1px solid var(--rule-strong); border-radius: var(--r);
  font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.badge--expired { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.badge--soon { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.badge--qr { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ---------- Tabele ---------- */

.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); }

.table th, .table td {
  padding: 10px var(--sp-2); text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--rule);
}
.table th {
  font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  border-bottom-color: var(--rule-strong); white-space: nowrap;
}
.table tbody tr:hover { background: var(--surface-2); }
.table td:first-child, .table th:first-child { padding-left: 0; }
.table td:last-child, .table th:last-child { padding-right: 0; text-align: right; }

.table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.table .cell-target { max-width: 220px; }
.table .cell-when { white-space: nowrap; }
.table .actions { white-space: nowrap; }
.table .actions form { display: inline; }
.short-row { display: flex; align-items: center; gap: 6px; }

.shorturl {
  font-family: var(--font-mono); font-size: var(--fs-ui); font-weight: 500;
  color: var(--fg); text-decoration: none; white-space: nowrap;
  border-bottom: 1px solid var(--rule-strong);
}
.shorturl:hover { border-bottom-color: var(--accent); border-bottom-width: 2px; }

.drilldown { color: var(--fg); text-decoration: underline; text-decoration-color: var(--rule-strong); }
.drilldown:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

.target { color: var(--muted); text-decoration: none; font-size: var(--fs-sm); }
.target:hover { color: var(--fg); }
.target .host { color: var(--fg); font-weight: 500; }

tr.is-expired .shorturl { color: var(--muted); text-decoration: line-through; }
tr.is-new { animation: flash-in 2.2s ease-out; }
@keyframes flash-in { 0% { background: var(--accent); } 100% { background: transparent; } }

@media (max-width: 760px) {
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr { border-bottom: 1px solid var(--rule-strong); padding: var(--sp-3) 0; }
  .table tbody tr:hover { background: transparent; }
  .table td {
    border: none; padding: 3px 0; display: flex; gap: var(--sp-3);
    align-items: baseline; justify-content: space-between; text-align: right;
  }
  .table td::before {
    content: attr(data-label); font-family: var(--font-mono); font-size: var(--fs-2xs);
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
    text-align: left; flex: none;
  }
  .table td[data-label=""]::before { content: none; }
  .table td.actions { justify-content: flex-start; flex-wrap: wrap; gap: var(--sp-2); padding-top: var(--sp-3); }
  .table td.cell-main { flex-direction: column; align-items: flex-start; text-align: left; padding-bottom: var(--sp-2); }
  .table td > * { min-width: 0; }
  .table .cell-target { max-width: none; }
  .table .cell-when { white-space: normal; }
  .table .shorturl { white-space: normal; word-break: break-all; }
  .short-row { flex-wrap: wrap; }
}

/* ---------- Empty ---------- */

.empty {
  padding: var(--sp-6) var(--sp-4); text-align: center;
  border: 1px dashed var(--rule-strong); border-radius: var(--r-lg); color: var(--muted);
}
.empty__title { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.03em; color: var(--fg); margin-bottom: var(--sp-2); }
.empty__body { font-size: var(--fs-sm); margin-bottom: var(--sp-4); }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-top: var(--sp-4); font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--muted);
}

/* ---------- Toast ---------- */

.toasts {
  position: fixed; bottom: var(--sp-4); left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: var(--sp-2);
  width: calc(100% - var(--sp-5) * 2); max-width: 400px; pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--sp-2);
  background: var(--fg); color: var(--bg); border-radius: var(--r);
  padding: 10px var(--sp-3); font-size: var(--fs-sm); font-weight: 500;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.2); animation: toast-in 160ms ease-out;
}
.toast--ok { background: var(--accent); color: var(--accent-ink); }
.toast--error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Dialog ---------- */

dialog.confirm {
  border: 1px solid var(--rule-strong); border-radius: var(--r-lg);
  background: var(--bg); color: var(--fg); padding: var(--sp-5);
  max-width: 400px; width: calc(100% - var(--sp-5) * 2); font-family: var(--font-ui);
}
dialog.confirm::backdrop { background: rgb(0 0 0 / 0.45); }
dialog.confirm h2 { margin-bottom: var(--sp-2); }
dialog.confirm p { color: var(--muted); font-size: var(--fs-sm); }
dialog.confirm .btn-group { margin-top: var(--sp-5); display: flex; justify-content: flex-end; }

/* ---------- QR ---------- */

.qr-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas: "form preview"; gap: var(--sp-6); align-items: start;
}
.qr-layout__form { grid-area: form; min-width: 0; }
.qr-layout__preview { grid-area: preview; position: sticky; top: var(--sp-4); }

.qr-card { border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--surface); padding: var(--sp-3); }
.qr-stage {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; border-radius: var(--r); overflow: hidden;
}
.qr-stage svg, .qr-stage img { max-width: 100%; height: auto; display: block; }
.qr-stage .placeholder { color: var(--muted); font-size: var(--fs-sm); padding: var(--sp-5); text-align: center; }
.qr-stage.is-loading { position: relative; }
.qr-stage.is-loading > * { opacity: 0.3; }
.qr-stage.is-loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%; animation: shimmer 1s linear infinite; opacity: 0.35;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.qr-meta {
  margin-top: var(--sp-2); text-align: center;
  font-family: var(--font-mono); font-size: var(--fs-2xs);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.qr-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.qr-actions .btn { flex: 1; }

.qr-thumb {
  display: block; width: 44px; height: 44px; border-radius: var(--r);
  overflow: hidden; border: 1px solid var(--rule);
}
.qr-thumb img { width: 100%; height: 100%; display: block; }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-3); }
.logo-card { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: var(--sp-3); background: var(--surface); text-align: center; }
.logo-card__img {
  height: 80px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-radius: var(--r); margin-bottom: var(--sp-2);
}
.logo-card__img img { max-width: 80%; max-height: 64px; object-fit: contain; }
.logo-card__name { font-size: var(--fs-sm); font-weight: 500; word-break: break-word; margin-bottom: 2px; }

@media (max-width: 860px) {
  .qr-layout { grid-template-columns: 1fr; grid-template-areas: "preview" "form"; gap: var(--sp-4); }
  /* Pe mobil preview-ul urcă deasupra formularului și rămâne lipit sus —
     altfel reglezi culori fără să vezi codul. */
  .qr-layout__preview {
    position: sticky; top: 0; z-index: 20; background: var(--bg);
    padding-bottom: var(--sp-2); border-bottom: 1px solid var(--rule);
  }
  .qr-layout__preview .qr-stage { min-height: 140px; }
  .qr-layout__preview .qr-stage svg, .qr-layout__preview .qr-stage img { max-height: 140px; width: auto; }
}

/* ---------- Statistici ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.stat { border-top: 2px solid var(--fg); padding-top: var(--sp-2); }
.stat--accent { border-top-color: var(--accent); }
.stat__label {
  font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px;
}
.stat__value { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.stat__sub { font-size: var(--fs-sm); color: var(--muted); }

.spark { width: 100%; height: auto; display: block; overflow: visible; }
.spark__bar { fill: var(--accent); }
.spark__bar--empty { fill: var(--rule); }
.spark__hit { fill: transparent; cursor: pointer; }
.spark__col:hover .spark__bar, .spark__col:focus-visible .spark__bar { fill: var(--fg); }
.spark__col:focus-visible { outline: none; }
.spark__baseline { stroke: var(--rule-strong); stroke-width: 1; }
.spark__marker { stroke: var(--danger); stroke-width: 1; stroke-dasharray: 3 3; }
.spark__axis, .spark__label { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); letter-spacing: 0.04em; }
.spark__label { fill: var(--fg); font-weight: 500; }

.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3);
  align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-ui);
}
.bar-list__track { display: block; height: 3px; background: var(--rule); margin-top: 5px; overflow: hidden; }
.bar-list__fill { display: block; height: 100%; background: var(--accent); }
.bar-list__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; color: var(--muted); }

.facets { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 640px) { .facets { grid-template-columns: 1fr; } }

/* ---------- Pagini centrate ---------- */

.centered { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: var(--sp-6) var(--sp-5); }
.centered__inner { width: 100%; max-width: 360px; }
.centered__mark { display: inline-flex; align-items: center; gap: var(--sp-2); text-decoration: none; color: var(--fg); margin-bottom: var(--sp-2); }
.centered__mark svg { width: 32px; height: 32px; }
.centered__mark span { font-size: 30px; font-weight: 700; letter-spacing: -0.05em; }
.centered__sub {
  font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--sp-6);
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .shell { padding: 0 var(--sp-4); }
  h1 { font-size: 21px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat__value { font-size: 28px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
}

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

@media print {
  .topbar, .tabs, .sitefoot, .actions, .btn, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
}
