/* FeedLabels — identitatea vizuală DWF (dwf.ro, 27 oct 2026): Inter, navy #002060, albastru #0068FF,
   suprafețe albe pe fond albastru-gri deschis, carduri plate cu bordură fină, titluri cu greutate medie și litere strânse.
   Fără framework; toate culorile sunt tokeni de mai jos. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  /* Culorile DWF */
  --navy: #002060;            /* titluri, meniul lateral */
  --navy-2: #01388a;
  --accent: #0068ff;          /* butoane, acțiuni */
  --accent-dark: #0057df;
  --accent-ink: #0947aa;      /* cifre mari, linkuri accentuate */
  --link: #0060e5;
  --accent-soft: #eef4ff;
  --accent-line: #b5cef0;
  --text: #1c2a4a;
  --text-2: #3a4c6b;
  --muted: #536279;
  --faint: #93a3bb;
  --border: #d8e3f0;
  --border-strong: #b7c9e0;
  --bg: #f2f6fc;
  --surface: #ffffff;
  --surface-2: #f5f8fd;
  --surface-3: #e3eaf4;
  --sidebar: #002060;
  --sidebar-2: #0b2e73;
  --sidebar-text: #c5d5ed;
  --sidebar-muted: #7f97c0;
  --success: #1f7a4d;
  --success-ink: #235d43;
  --success-soft: #e8f4ed;
  --success-line: #b9dcc8;
  --warning: #9a5b00;
  --warning-soft: #fff6e0;
  --warning-line: #f0d9a4;
  --danger: #c0352b;
  --danger-soft: #fdeeec;
  --danger-line: #f3c5c0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: none;
  --shadow-lg: 0 18px 48px rgba(0, 32, 96, .16);
  --focus: 0 0 0 3px rgba(0, 104, 255, .22);
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); line-height: 1.55; font-size: 15px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
h1 { font-size: 2rem; font-weight: 500; letter-spacing: -.04em; line-height: 1.12; color: var(--navy); margin: 0 0 .35rem; }
h2 { font-size: 1.13rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; color: var(--navy); margin: 0 0 .8rem; }
h3 { font-size: 1rem; font-weight: 600; letter-spacing: -.015em; color: var(--navy); margin: 0; }
h4 { font-size: .92rem; font-weight: 600; letter-spacing: -.01em; color: var(--navy); margin: 1.25rem 0 .5rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .83rem; line-height: 1.5; margin: .25rem 0 0; }
/* Etichetă mică deasupra unui titlu sau a unei cifre, ca pe dwf.ro. */
.eyebrow { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 .35rem; }
.icon { display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 0; }

/* ---------- Structura aplicației: meniu lateral + conținut ---------- */
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 1rem .75rem; gap: 1rem; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.06rem; letter-spacing: -.02em; line-height: 1.1; padding: .3rem .5rem; }
.side-brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.side-brand .by { display: block; font-size: .64rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sidebar-muted); margin-top: .1rem; }
.side-label { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--sidebar-muted); padding: 0 .6rem; margin: 0 0 .35rem; }
.side-project select {
  width: 100%; background: var(--sidebar-2); color: #fff; border: 1px solid rgba(197, 213, 237, .22); border-radius: var(--radius-sm);
  padding: .5rem .6rem; font-weight: 600; font-size: .9rem;
}
.side-project select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; border-radius: var(--radius-sm);
  color: var(--sidebar-text); text-decoration: none; font-size: .92rem;
}
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.side-nav a .count { margin-left: auto; font-size: .72rem; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 999px; padding: 0 .45rem; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(197, 213, 237, .16); padding: .75rem .5rem 0; display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--sidebar-muted); }
.side-foot .email { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot button { background: none; border: none; color: var(--sidebar-text); padding: .3rem; border-radius: 6px; }
.side-foot button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.mobile-bar { display: none; }

main { padding: 2.25rem 2.5rem 4rem; max-width: 1200px; width: 100%; min-width: 0; }
main.wide { max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 0; max-width: 62ch; font-size: .95rem; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .mobile-bar {
    display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; background: var(--surface);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
  }
  .mobile-bar button { background: none; border: 1px solid var(--border); color: var(--text); padding: .35rem; }
  .mobile-bar .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 1.25rem 1rem 2.5rem; }
}

/* ---------- Carduri, secțiuni ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; margin-bottom: 1.25rem;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Cifre pe panoul de bord */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem 1.15rem; }
.stat .label { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1.35; }
.stat .value { font-size: clamp(1.4rem, 1.1rem + .9vw, 1.9rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.15; color: var(--navy); margin: .5rem 0 .35rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Etichetele cifrelor sunt simple, ca pe dwf.ro: text mic, majuscule, fără iconiță. */
.stat .label .icon { display: none; }
.stat .delta { line-height: 1.45; }
.stat .delta { font-size: .82rem; color: var(--muted); }
.delta.up, .up { color: var(--success); }
.delta.down, .down { color: var(--danger); }
.delta.warn { color: var(--warning); }

/* Bara ABC */
.stack-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: .5rem 0 .75rem; }
.stack-bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .85rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }

/* Conexiuni pe panou */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.conn-card {
  display: flex; align-items: center; gap: .75rem; padding: .8rem .9rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); text-decoration: none; color: var(--text); background: var(--surface);
}
.conn-card:hover { border-color: var(--accent); }
.conn-card .ic { width: 36px; height: 36px; border-radius: 9px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.conn-card .name { font-weight: 600; font-size: .92rem; }
.conn-card .state { font-size: .8rem; color: var(--muted); }
.conn-card .state.ok { color: var(--success); }
.conn-card .state.err { color: var(--danger); }

/* Listă de activitate */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.activity li:last-child { border-bottom: none; }
.activity .when { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--success); } .dot.err { background: var(--danger); } .dot.run { background: var(--accent); }

/* ---------- Formulare ---------- */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--navy); margin: .9rem 0 .35rem; }
input, select, textarea {
  width: 100%; padding: .55rem .7rem; font: inherit; font-size: .92rem; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--focus); }
input[type="checkbox"] { width: auto; }

button, a.button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-size: .9rem; font-weight: 600; padding: .62rem 1.05rem; border-radius: var(--radius-sm); cursor: pointer; letter-spacing: -.005em; transition: background-color .15s, border-color .15s, color .15s;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none; line-height: 1.2;
}
button:hover, a.button-link:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button:disabled { opacity: .55; cursor: default; }
button.secondary, a.button-link.secondary { background: var(--surface); color: var(--navy); border-color: var(--border-strong); }
button.secondary:hover, a.button-link.secondary:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
button.link { background: none; border: none; color: var(--accent); padding: 0; font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }
button.danger { color: var(--danger); border-color: var(--danger-line); background: var(--surface); }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
button.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger-solid:hover { background: #a12a21; border-color: #a12a21; }
button.small, a.button-link.small { padding: .32rem .7rem; font-size: .82rem; }
form button[type="submit"] { margin-top: 1.25rem; }
.auth-card form button[type="submit"] { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
form .actions button[type="submit"] { margin-top: 0; }

.error { color: var(--danger); font-size: .88rem; margin: .75rem 0 0; }
.ok { color: var(--success); font-size: .88rem; margin: .75rem 0 0; }
.ok:empty, .error:empty { margin: 0; }
.notice { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .9rem; }
.notice.warn { background: var(--warning-soft); border-color: var(--warning-line); color: #6b4000; margin-top: .75rem; }
.notice.blocked { background: var(--danger-soft); border-color: var(--danger-line); color: #8a241c; margin-top: .75rem; }

/* ---------- Autentificare ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--bg); }
.auth-card {
  width: 100%; max-width: 420px; padding: 2.25rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px;
}
.auth-card .side-brand { color: var(--navy); padding: 0; margin-bottom: 1.5rem; }
.auth-card .side-brand .by { color: var(--muted); }
body.auth main { padding: 0; max-width: none; }

/* ---------- Proiecte ---------- */
.project-list { list-style: none; margin: 0; padding: 0; }
.project-list li { padding: .9rem 0; border-bottom: 1px solid var(--border); }
.project-list li:last-child { border-bottom: none; }
.project-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.project-avatar { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: none; }
.project-main { display: flex; flex-direction: column; flex: 1; min-width: 200px; text-decoration: none; }
.project-link { font-weight: 600; color: var(--navy); text-decoration: none; letter-spacing: -.01em; }
.project-main:hover .project-link { color: var(--accent); }
.project-list .meta { color: var(--muted); font-size: .84rem; }
.project-actions { display: flex; gap: .5rem; }
.badge { font-size: .74rem; padding: .12rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }

.danger-dialog { max-width: 480px; width: calc(100% - 2rem); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; box-shadow: var(--shadow-lg); }
.danger-dialog::backdrop { background: rgba(0, 32, 96, .45); }
.danger-dialog h2 { color: var(--danger); }
.danger-zone { border-color: var(--danger-line); }
.danger-zone h2 { color: var(--danger); }

/* ---------- Conexiuni (fostul ghid) ---------- */
.steps { list-style: none; padding: 0; margin: 0; }
.step-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.step-head h3 { flex: 1; }
.step-num {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: .85rem;
}
.status { font-size: .74rem; font-weight: 600; padding: .18rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.status-connected { color: var(--success-ink); background: var(--success-soft); border-color: var(--success-line); }
.status-pending { color: var(--warning); background: var(--warning-soft); border-color: var(--warning-line); }
.status-error { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.status-neutral { color: var(--muted); }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; margin: .5rem 0; }
.platform {
  display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: .75rem .85rem; font-weight: 400;
}
.platform:hover { background: var(--surface-2); border-color: var(--accent); }
.platform.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.platform-name { font-weight: 600; }
.platform-note { font-size: .78rem; color: var(--muted); }
.howto { margin: 0 0 .5rem; padding-left: 1.2rem; color: var(--muted); font-size: .88rem; }
.connected-box p { margin: .3rem 0; }
.orders-box { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.orders-box h4 { margin-top: 0; }
progress { width: 100%; height: .55rem; accent-color: var(--accent); }
.file-list { margin: 0; padding-left: 1.2rem; font-size: .9rem; }
.docs input[type="file"] { border: none; padding: .5rem 0; }

/* ---------- Tabele ---------- */
.table-scroll { overflow-x: auto; }
.mini-table { border-collapse: collapse; margin: .5rem 0; font-size: .88rem; }
.mini-table th, .mini-table td { text-align: left; padding: .4rem 1rem .4rem 0; border-bottom: 1px solid var(--border); }
.mini-table th { color: var(--muted); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.mini-table.unmatched td { vertical-align: top; }
.inline-input { width: 9rem; padding: .32rem .5rem; font-size: .85rem; margin-right: .35rem; display: inline-block; }
.inline-select { width: auto; display: inline-block; padding: .25rem .45rem; font-size: .85rem; margin-left: .4rem; }

.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .9rem; align-items: center; }
.filters input { flex: 1 1 240px; width: auto; }
.filters select { flex: 0 1 190px; width: auto; }
.filters .check { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; margin: 0; white-space: nowrap; color: var(--text-2); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .87rem; }
.data-table th, .data-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th {
  color: var(--muted); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
  position: sticky; top: 0; background: var(--surface-2); z-index: 1;
}
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .strong { font-weight: 600; color: var(--navy); }
.data-table tr.inactive td { color: var(--muted); }
.product-cell { display: flex; gap: .7rem; align-items: center; min-width: 240px; }
.product-cell img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex: none; background: var(--surface-2); }
.product-cell a, .product-cell span { color: var(--navy); text-decoration: none; font-weight: 600; }
.product-cell a:hover { color: var(--accent); }
button.sort { background: none; border: none; color: inherit; font: inherit; font-weight: 600; padding: 0; text-transform: inherit; letter-spacing: inherit; }
button.sort:hover { background: none; color: var(--text); }
button.sort.active { color: var(--accent); }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; }

.abc { display: inline-block; min-width: 1.7rem; text-align: center; padding: .14rem .55rem; border-radius: 6px; font-weight: 600; font-size: .78rem; cursor: help; white-space: nowrap; }
.abc-A { background: #e1ecfd; color: #01388a; }
.abc-B { background: #eef4ff; color: #0947aa; }
.abc-C { background: #f1f4f9; color: #3a4c6b; }
.abc-NO_SALES { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.abc-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.abc-cell { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; font-weight: 400; padding: .7rem .85rem; }
.abc-cell:hover { background: var(--surface-2); border-color: var(--accent); }
.abc-cell strong { font-size: 1.05rem; font-weight: 600; color: var(--navy); }
.chip { display: inline-block; padding: .14rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; cursor: help; }
.chip-good { background: var(--success-soft); color: var(--success-ink); }
.chip-warn { background: var(--warning-soft); color: var(--warning); }
.chip-bad { background: var(--danger-soft); color: var(--danger); }
.chip-neutral { background: #f1f4f9; color: #3a4c6b; }
.chip-season { background: var(--accent-soft); color: var(--accent-ink); margin-top: .25rem; }

/* ---------- Etichete ---------- */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.slot-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem 1rem; background: var(--surface-2); }
.slot-box h4 { margin: 0 0 .5rem; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--navy); font-size: .84em; background: #eef2f8; padding: .08rem .35rem; border-radius: 4px; }
code.old { color: var(--muted); background: #eef2f8; }
.label-change { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.label-change .arrow { color: var(--faint); }
code.new { background: var(--success-soft); color: var(--success-ink); }
.urls code { word-break: break-all; }
.urls td { vertical-align: top; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .icon { color: var(--faint); margin-bottom: .5rem; }

/* ---------- Cum se calculează + motive ---------- */
details.rules > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
details.rules > summary::-webkit-details-marker { display: none; }
details.rules > summary h2 { margin: 0; }
details.rules > summary::after { content: 'Arată'; color: var(--accent); font-size: .85rem; font-weight: 600; }
details.rules[open] > summary::after { content: 'Ascunde'; }
.rule-box.off { opacity: .8; }
.rule-box p { margin: 0 0 .5rem; font-size: .88rem; color: var(--text-2); }
.rule-list { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.rule-list li { display: grid; grid-template-columns: minmax(6.5rem, auto) 1fr; gap: .6rem; padding: .3rem 0; border-top: 1px solid var(--border); }
.rule-list li:first-child { border-top: none; }
.rules-stability { margin: 1rem 0 0; padding-left: 1.2rem; font-size: .88rem; color: var(--text-2); }
.reason { font-size: .8rem; color: var(--text-2); margin: .25rem 0 0; line-height: 1.4; }
td .reason { max-width: 28rem; }
button.link { background: none; border: none; padding: 0; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
button.link:hover { background: none; color: var(--accent); text-decoration: underline; }

/* ---------- Fișa de produs ---------- */
.sheet-dialog { width: min(920px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); border: 1px solid var(--border); border-radius: 14px; padding: 0; box-shadow: var(--shadow-lg); }
.sheet-dialog::backdrop { background: rgba(0, 32, 96, .45); }
.sheet-close { position: sticky; top: .75rem; float: right; margin: .75rem .75rem 0 0; z-index: 2; }
.sheet-body { padding: 1.25rem 1.5rem 1.5rem; }
.sheet-head { display: flex; gap: 1rem; align-items: center; margin-bottom: .5rem; padding-right: 5rem; }
.sheet-head img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); flex: none; }
.sheet-head h2 { margin: 0; }
.sheet-section { margin-top: 1.4rem; }
.sheet-section h3 { margin-bottom: .4rem; }
.sheet-labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .7rem; margin-top: .6rem; }
.sheet-label { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .85rem; background: var(--surface-2); }
.sheet-label.off { background: var(--surface); }
.sheet-label .hint { margin-top: .35rem; }
.sheet-values { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .35rem; font-size: .86rem; }
.sheet-table { width: 100%; }
.sheet-table th { white-space: nowrap; vertical-align: top; }
.sheet-table td { vertical-align: top; }
.sheet-table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .sheet-body { padding: 1rem; }
  .sheet-head { padding-right: 0; flex-wrap: wrap; }
  .rule-list li { grid-template-columns: 1fr; gap: .1rem; }
}
.explain p { margin: 0 0 .6rem; font-size: .9rem; color: var(--text-2); }
.explain .rule-list { margin-bottom: .6rem; }
.explain .rule-list li { grid-template-columns: minmax(8.5rem, auto) 1fr; }
.explain + .abc-bar { margin-top: .8rem; }
details.explain-more { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .8rem; }
details.explain-more > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }
details.rules .slot-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.rule-note { display: inline-block; font-size: .78rem; font-weight: 600; line-height: 1.35; padding: .3rem .6rem; border-radius: 8px; color: var(--warning); background: var(--warning-soft); border: 1px solid var(--warning-line); }
.rule-list li > span:first-child { min-width: 0; }

/* Tabel lung (Produse): se derulează în propria zonă, cât ecranul, ca antetul și prima coloană să rămână vizibile
   și bara de derulare orizontală să fie mereu la vedere. */
.table-viewport { max-height: calc(100vh - 7rem); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table-viewport .data-table th { z-index: 2; }
.data-table.sticky-first th:first-child, .data-table.sticky-first td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--border); }
.data-table.sticky-first th:first-child { background: var(--surface-2); z-index: 3; }
.data-table.sticky-first tbody tr:hover td:first-child { background: var(--surface-2); }

/* Produse: pagina folosește toată lățimea, iar tabelul se strânge (antete pe două rânduri, spațiere mai mică)
   ca să încapă fără derulare laterală pe un ecran obișnuit de laptop/desktop. */
main.full { max-width: none; }
.data-table.compact th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.data-table.compact th, .data-table.compact td { padding: .55rem .45rem; }
.data-table.compact .product-cell { min-width: 180px; }
.data-table.compact .product-cell img { width: 36px; height: 36px; }
.data-table.compact .chip { padding: .12rem .45rem; }

/* Biblioteca de etichete: rolul fiecărui slot (pagina Etichete) */
.slot-rows { display: grid; gap: .5rem; margin: .75rem 0; }
.slot-row { display: grid; grid-template-columns: 9rem minmax(14rem, 26rem); gap: .2rem .75rem; align-items: center; }
.slot-row select { width: 100%; }
.slot-row .hint { margin: 0 0 .3rem; grid-column: 2; }
.slot-row .hint:empty { display: none; }
.params { display: grid; gap: .9rem; margin: .5rem 0 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.param { display: grid; gap: .3rem; }
.param > label { font-weight: 600; }
.param-input { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.param-input input[type="text"] { min-width: 14rem; }
input.narrow { width: 5rem; }
.params[hidden], .param[hidden] { display: none; }
@media (max-width: 760px) { .slot-row { grid-template-columns: 1fr; gap: .3rem; } .slot-row .hint { grid-column: 1; } }

/* Eticheta din filtru (pagina Produse) */
.count-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.count-row p { margin: 0; }
.small-dialog { width: min(560px, calc(100% - 2rem)); }
.small-dialog form { display: grid; gap: .8rem; padding: 1.25rem 1.5rem; }
.small-dialog h2 { margin: 0; }
.small-dialog label { display: grid; gap: .3rem; font-weight: 600; }
.small-dialog label .hint { font-weight: 400; }
.ok-text { color: var(--success); }

/* Rapoarte (SPEC § 15.1) */
.period { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.period .seg { border: 0; border-radius: 0; background: transparent; color: var(--navy); padding: .5rem .9rem; font-weight: 500; box-shadow: none; }
.period .seg:hover { background: var(--accent-soft); color: var(--accent-ink); }
.period .seg.active:hover { background: var(--navy); color: #fff; }
.period .seg + .seg { border-left: 1px solid var(--border); }
.period .seg.active { background: var(--navy); color: #fff; font-weight: 600; }
.source-strip { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 .4rem; }
.source-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .65rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--text-2); font-size: .82rem; }
.source-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.source-chip.ok .dot { background: var(--success); }
.source-chip.wait .dot { background: var(--warning); }
.source-chip .name { font-weight: 600; }
.source-chip .state { color: var(--muted); }
.section-title { margin: 2rem 0 .8rem; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1.1rem; }
.grid-2 > .card { margin: 0 0 1.1rem; }
.big-number { font-size: 2.2rem; font-weight: 500; letter-spacing: -.045em; line-height: 1.1; color: var(--accent-ink); font-variant-numeric: tabular-nums; margin: .2rem 0 .45rem; }
.big-number.muted { color: var(--faint); }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: .4rem 0; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.chart { width: 100%; height: auto; display: block; margin: .25rem 0 .5rem; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .tick.strong { fill: var(--text-2); font-weight: 600; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--navy); color: #fff; padding: .45rem .6rem; border-radius: var(--radius-sm); font-size: .8rem; line-height: 1.45; box-shadow: var(--shadow-lg); max-width: 320px; }
.chart-tip .tip-title { font-weight: 600; margin-bottom: .15rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 1.5rem; margin-bottom: 1rem; }
.progress-stat .label { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.progress-stat .value { font-size: 1.4rem; font-weight: 500; letter-spacing: -.04em; color: var(--navy); font-variant-numeric: tabular-nums; }
.progress-stat .value .muted { font-size: .85rem; font-weight: 400; letter-spacing: 0; }
.top-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem 1.5rem; }
.top-list h4 { margin-top: .5rem; }
.top-list ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.top-list li { display: grid; grid-template-columns: 36px 1fr auto; gap: .6rem; align-items: center; font-size: .86rem; }
.top-list li img, .top-list .img-ph { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.top-list li .link { text-align: left; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.top-list li .num { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.traffic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.traffic-box { border: 1px solid var(--border); border-radius: 10px; padding: .95rem 1.05rem; background: var(--surface-2); }
.traffic-box h4 { margin: 0 0 .5rem; }
.traffic-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.traffic-row .label { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.traffic-row .value { font-size: 1.35rem; font-weight: 500; letter-spacing: -.04em; color: var(--navy); font-variant-numeric: tabular-nums; }
.label-stats td.num { white-space: nowrap; }
.cell-bar { height: 4px; border-radius: 999px; background: var(--surface-2); margin-bottom: .25rem; overflow: hidden; }
.cell-bar span { display: block; height: 100%; background: var(--accent); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Listele din spatele cifrelor (Rapoarte) */
.list-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.list-actions + .list-actions { margin-top: .45rem; }
.list-top { margin: .25rem 0 .9rem; }
.list-viewport { max-height: calc(100vh - 16rem); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.list-viewport .data-table th { z-index: 2; }
.list-viewport .product-cell .img-ph { width: 36px; height: 36px; border-radius: 6px; background: var(--surface-2); flex: none; }

/* Ce faci cu stocul care nu se vinde (Rapoarte) */
.unsold-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .9rem; margin: 1rem 0; }
.unsold-group { border: 1px solid var(--border); border-top: 3px solid var(--accent-line); border-radius: 10px; padding: 1rem 1.1rem; background: var(--surface-2); display: flex; flex-direction: column; }
.unsold-group.g-sizes { border-top-color: #8eb3ee; }
.unsold-group.g-slowed { border-top-color: var(--accent); }
.unsold-group.g-stale { border-top-color: var(--navy-2); }
.unsold-group.g-never { border-top-color: var(--navy); }
.unsold-head { display: flex; justify-content: space-between; align-items: baseline; gap: .3rem 1rem; flex-wrap: wrap; }
.unsold-head h3 { font-size: .98rem; }
.unsold-figures { font-size: .86rem; font-variant-numeric: tabular-nums; }
.unsold-figures strong { color: var(--navy); font-weight: 600; }
.unsold-action { font-size: .88rem; color: var(--text-2); margin: .55rem 0 .2rem; flex: 1; }
.unsold-foot { display: flex; align-items: center; justify-content: space-between; gap: .3rem 1rem; flex-wrap: wrap; }
.unsold-foot .list-actions { margin-top: .5rem; }
.notice.tip { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.diag-cell { min-width: 260px; max-width: 360px; }
.diag-cell strong { color: var(--navy); font-weight: 600; font-size: .84rem; }
.diag-cell .reason.action { color: var(--muted); }
