/* ==========================================================================
   Biessen CRM — Biessen Pharma
   Identitate: orange #F8981D, light blue #26C2F2, dark blue #003F5C.
   Fonturi: Montserrat pentru text, Google Sans Flex pentru titluri.

   NOTĂ: politica CSP nu permite CDN-uri, deci fonturile trebuie servite local.
   Pune fișierele .woff2 în /assets/fonts/ și decomentează blocurile @font-face.
   Până atunci se folosește stiva de sistem, care rămâne lizibilă și rapidă.
   ========================================================================== */

/*
@font-face { font-family: "Montserrat"; src: url("/assets/fonts/montserrat-400.woff2") format("woff2");
             font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/assets/fonts/montserrat-600.woff2") format("woff2");
             font-weight: 600; font-display: swap; }
@font-face { font-family: "Google Sans Flex"; src: url("/assets/fonts/google-sans-flex.woff2") format("woff2");
             font-weight: 400 700; font-display: swap; }
*/

:root {
  --orange:      #F8981D;
  --orange-dark: #D97F0B;
  --blue-light:  #26C2F2;
  --blue-dark:   #003F5C;

  --ink:         #10222E;
  --ink-soft:    #4A5C68;
  --ink-faint:   #7C8B95;
  --line:        #DCE4E9;
  --line-soft:   #EDF2F5;
  --bg:          #F4F7F9;
  --surface:     #FFFFFF;

  --ok:          #1F7A4D;
  --ok-bg:       #E6F4EC;
  --warn:        #8A5200;
  --warn-bg:     #FDF1DC;
  --danger:      #A32121;
  --danger-bg:   #FBEAEA;

  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 1px 2px rgba(16, 34, 46, .06), 0 4px 16px rgba(16, 34, 46, .05);

  --font-text:   "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head:   "Google Sans Flex", "Montserrat", "Segoe UI", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }
a { color: var(--blue-dark); text-decoration-color: color-mix(in srgb, var(--blue-dark) 35%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--orange-dark); }
code, .mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; font-size: .92em; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--surface); padding: .5rem .75rem; border-radius: var(--radius-sm); }

/* ---------- Topbar ---------- */
.topbar { background: var(--blue-dark); color: #fff; box-shadow: var(--shadow); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--orange) 0 55%, var(--blue-light) 55% 100%); }
.brand-text { font-family: var(--font-head); font-weight: 600; letter-spacing: .01em; display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: .68rem; font-weight: 400; opacity: .7; letter-spacing: .04em; text-transform: uppercase; }

.mainnav { display: flex; gap: .25rem; margin-right: auto; flex-wrap: wrap; }
.mainnav a { color: rgba(255,255,255,.82); text-decoration: none; padding: .35rem .7rem; border-radius: var(--radius-sm); font-size: .9rem; }
.mainnav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.mainnav a.is-active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }

/* v0.6.1: „Administrare" (doar admin) — <details> nativ, lista se deschide sub buton. */
.navmenu { position: relative; }
.navmenu > summary { list-style: none; cursor: pointer; color: rgba(255,255,255,.82); padding: .35rem .7rem;
  border-radius: var(--radius-sm); font-size: .9rem; user-select: none; }
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu > summary::after { content: " ▾"; font-size: .75em; }
.navmenu > summary:hover, .navmenu[open] > summary { background: rgba(255,255,255,.1); color: #fff; }
.navmenu > summary:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; }
.navmenu-list { position: absolute; top: calc(100% + .35rem); left: 0; z-index: 50; min-width: 11rem;
  display: flex; flex-direction: column; gap: .1rem; padding: .35rem;
  background: var(--blue-dark); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.navmenu-list a { white-space: nowrap; }

/* Contul, in dreapta: identitatea sus, actiunile dedesubt, ambele aliniate la dreapta.
   margin-left:auto (v0.6.1): daca randul tot se rupe, contul ramane in dreapta, nu sare la stanga. */
.userbox { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; font-size: .85rem; flex: 0 0 auto; margin-left: auto; }
.userbox-id, .userbox-actions { display: flex; align-items: center; gap: .6rem; }
.userbox-name { font-weight: 600; white-space: nowrap; }
.userbox-actions { gap: .85rem; }
.userbox-link { color: rgba(255,255,255,.8); text-decoration: none; font-size: .82rem; }
.userbox-link:hover { color: #fff; text-decoration: underline; }

/* Rolul: pe bara inchisa la culoare are nevoie de contrast propriu (inainte era
   albastru inchis pe albastru inchis, deci invizibil). */
.topbar .badge-role { background: rgba(255,255,255,.14); color: #fff; }

/* Iesi: contur discret pe fundal inchis, nu bloc alb. Prefixat cu .topbar ca sa
   castige in fata regulii .btn (definita mai jos, cu border scurt care ar reseta culoarea). */
.topbar .btn-logout { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.topbar .btn-logout:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }

/* Contorul de notificari: [hidden] trebuie sa castige in fata display:flex. */
.bell-count[hidden] { display: none; }

/* Sub ~1120 px, sigla + meniul complet (admin, 8 linkuri) + contul nu mai incap pe
   un rand. Meniul trece atunci pe randul lui, sub sigla si cont, in loc sa se rupa
   in interiorul randului de sus. */
@media (max-width: 1120px) {
  .mainnav { order: 3; width: 100%; margin-right: 0; }
  .userbox { order: 2; margin-left: auto; }
}

/* ---------- Layout ---------- */
.page { max-width: 100%; margin: 0 auto; padding: 1.5rem 1rem 3rem; } /* v0.22.1: toată lățimea — tabelele late nu-și mai pierd ultima coloană */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { margin: 0; max-width: 62ch; }

.footer { max-width: 1180px; margin: 0 auto; padding: 1rem; display: flex; justify-content: space-between; gap: 1rem;
          flex-wrap: wrap; font-size: .8rem; color: var(--ink-faint); border-top: 1px solid var(--line); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.panel-narrow { max-width: 620px; }
.panel-danger { border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }
.panel-info { border-left: 3px solid var(--blue-light); }

/* ---------- Auth ---------- */
body.bare { background: linear-gradient(160deg, var(--blue-dark) 0%, #012a3d 100%); min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-shell { width: 100%; max-width: 440px; }
.auth-card { background: var(--surface); border-radius: var(--radius); padding: 1.75rem; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line-soft); }
.auth-brand strong { font-family: var(--font-head); display: block; line-height: 1.1; }
.auth-brand small { color: var(--ink-faint); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.auth-title { font-size: 1.3rem; }
.auth-sub { color: var(--ink-soft); font-size: .9rem; }
.auth-help { font-size: .84rem; color: var(--ink-soft); margin-top: 1rem; }
.auth-cancel { margin-top: .75rem; text-align: center; }
.auth-note { text-align: center; color: rgba(255,255,255,.55); font-size: .78rem; margin-top: 1rem; }

/* ---------- Forme ---------- */
.field { display: block; margin-bottom: 1rem; }
.field-label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .3rem; }
.field-hint { display: block; font-size: .78rem; color: var(--ink-faint); margin-top: .25rem; }
.field-error { color: var(--danger); font-size: .82rem; margin: .3rem 0 0; }
.field-inline { margin-bottom: 0; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=url], select, textarea {
  width: 100%; padding: .55rem .7rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue-light); outline-offset: 2px;
}
input:disabled { background: var(--line-soft); color: var(--ink-faint); }
.input-code { font-family: ui-monospace, monospace; font-size: 1.35rem; letter-spacing: .3em; text-align: center; }

fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { padding: 0; }
.radio, .check { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .4rem; cursor: pointer; }
.radio:hover, .check:hover { border-color: var(--blue-light); background: var(--line-soft); }
.radio input, .check input { margin-top: .25rem; flex: 0 0 auto; }
.radio small, .check small { display: block; font-size: .8rem; line-height: 1.4; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1rem; }
.form-grid .check, .form-grid .actions { grid-column: 1 / -1; }
.filters { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; background: var(--surface);
           border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.inline { display: inline; }

/* ---------- Butoane ---------- */
.btn { display: inline-block; font: inherit; font-weight: 600; padding: .5rem .95rem; border-radius: var(--radius-sm);
       border: 1px solid transparent; cursor: pointer; text-decoration: none; text-align: center; line-height: 1.3; }
.btn-primary { background: var(--orange); color: #1b1200; }
.btn-primary:hover { background: var(--orange-dark); color: #1b1200; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue-light); color: var(--blue-dark); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: .3rem .6rem; font-size: .82rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Carduri ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card-warn { border-left: 3px solid var(--orange); }
.card-label { display: block; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.card-value { display: block; font-family: var(--font-head); font-size: 1.9rem; line-height: 1.1; margin: .25rem 0 .35rem; }
.card-note { display: block; font-size: .78rem; color: var(--ink-soft); }
.card-link { font-size: .82rem; }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .65rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.table thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); background: var(--line-soft); white-space: nowrap; }
.table thead th a { color: inherit; text-decoration: none; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--blue-light) 5%, transparent); }
.table-compact th, .table-compact td { padding: .45rem .6rem; }
.row-muted { opacity: .55; }
.row-current { background: color-mix(in srgb, var(--ok) 6%, transparent); }
/* v0.14.1: vânzările ratate în tabelul comenzilor pe stare. */
.row-ratata { background: var(--danger-bg); }
/* v0.29.0 — stocuri: BBD sub 180 de zile (galben), expirat (roșu) */
.row-stoc-atentie { background: #fff2c2; }
.row-stoc-expirat { background: var(--danger-bg); }
.ratate-total { margin: .6rem 0 .2rem; padding: .5rem .75rem; border-left: 3px solid var(--danger); background: var(--danger-bg); border-radius: var(--radius-sm); }
.ta-c { text-align: center; }
/* v0.17.0: tabelul lunar de marketing — mult mai lat decât ecranul: luna rămâne pe loc la derulare. */
.table-lunar { width: auto; min-width: 100%; }
.table-lunar td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-lunar thead tr:last-child th { white-space: normal; min-width: 6.5rem; max-width: 9rem; vertical-align: bottom; text-transform: none; letter-spacing: 0; font-size: .74rem; }
.table-lunar th[scope="row"], .table-lunar thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); white-space: nowrap; text-align: left; box-shadow: 1px 0 0 var(--line); }
.table-lunar thead th:first-child { background: var(--line-soft); z-index: 2; }
.table-lunar .grup-start { border-left: 2px solid var(--line); }
.table-lunar tfoot th, .table-lunar tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: var(--line-soft); }
/* v0.15.0: alegerea celui de-al doilea factor la activarea contului. */
.choice-list { display: grid; gap: .9rem; margin: 1rem 0; }
.choice-card { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; background: var(--surface); }
.choice-card h2 { margin: 0 0 .35rem; }
.choice-card p { margin: 0 0 .7rem; }

/* ---------- Badge-uri ---------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .12rem .45rem; border-radius: 99px; white-space: nowrap; }
.badge-role { background: color-mix(in srgb, var(--blue-dark) 10%, transparent); color: var(--blue-dark); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-off { background: var(--line); color: var(--ink-soft); }

/* ---------- Mesaje ---------- */
.flash { border-radius: var(--radius-sm); padding: .7rem .9rem; margin-bottom: 1rem; font-size: .88rem; border-left: 3px solid; }
.flash-success { background: var(--ok-bg); border-color: var(--ok); color: #14532d; }
.flash-error   { background: var(--danger-bg); border-color: var(--danger); color: #7f1d1d; }
.flash-warning { background: var(--warn-bg); border-color: var(--orange); color: #7c3a00; }
.flash-info    { background: color-mix(in srgb, var(--blue-light) 12%, #fff); border-color: var(--blue-light); color: #0b4f66; }

/* ---------- Diverse ---------- */
.muted { color: var(--ink-soft); }
.small { font-size: .82rem; }
.ta-r { text-align: right; }
.ta-c { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; }
.break { word-break: break-all; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.kv dt { font-weight: 600; color: var(--ink-soft); font-size: .85rem; }
.kv dd { margin: 0; }

.steps { padding-left: 1.2rem; color: var(--ink-soft); font-size: .88rem; }
.steps li { margin-bottom: .35rem; }

.secret-box { background: var(--line-soft); border-radius: var(--radius-sm); padding: .8rem; margin: 1rem 0; text-align: center; }
.secret-label { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); margin-bottom: .3rem; }
.secret { font-family: ui-monospace, monospace; font-size: 1.05rem; letter-spacing: .08em; word-break: break-all; display: block; margin-bottom: .5rem; }

.codes { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .4rem; }
.codes code { display: block; background: var(--line-soft); padding: .45rem; border-radius: var(--radius-sm); text-align: center; letter-spacing: .06em; }

.details { margin: .75rem 0; font-size: .84rem; }
.details summary { cursor: pointer; color: var(--blue-dark); }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: .6rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--line-soft); font-size: .88rem; }
.checks li:last-child { border-bottom: 0; }
.check-mark { font-weight: 700; flex: 0 0 1rem; }
.check-ok .check-mark { color: var(--ok); }
.check-bad .check-mark { color: var(--danger); }

.admin-actions { display: grid; gap: .9rem; }
.admin-actions form { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

.kvpair { display: inline-block; background: var(--line-soft); border-radius: var(--radius-sm); padding: .05rem .35rem; margin: 0 .2rem .2rem 0; font-size: .78rem; }

.pager { display: flex; gap: .5rem; justify-content: center; }

@media (max-width: 720px) {
  .topbar-inner { gap: .75rem; }
  .page-head { flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .mainnav a, input, select { transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
}

/* ==========================================================================
   Faza 2 — materiale, comentarii, adnotări, claim-uri
   ========================================================================== */

/* ---------- Layout pe două coloane ---------- */
.layout-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.layout-main { min-width: 0; }
.layout-side { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.head-side { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 .75rem; }
.section-head h2 { margin: 0; }
.panel-tight { padding: 1rem; margin-bottom: 0; }
.panel-decision { border-left: 3px solid var(--orange); }
.mb-sm { margin-bottom: .5rem; }

@media (max-width: 1000px) {
  .layout-split { grid-template-columns: 1fr; }
  .layout-side { position: static; }
}

/* ---------- Materialul: fișier în stânga, observații în dreapta ---------- */
.material-row {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; overflow: hidden;
}
.material-file { padding: 1rem; border-right: 1px solid var(--line); min-width: 0; }
.material-comments { padding: 1rem; background: color-mix(in srgb, var(--blue-light) 3%, var(--surface)); min-width: 0; }
.material-file-head { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; margin-bottom: .75rem; }
.material-name { word-break: break-word; }
.material-file-head p { margin: .2rem 0 0; }
.material-file-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line-soft); }
.material-comments-title { font-size: .95rem; margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; }

@media (max-width: 860px) {
  .material-row { grid-template-columns: 1fr; }
  .material-file { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Previzualizare și adnotare ---------- */
.material-preview img, .material-preview video { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
.anno-wrap { position: relative; display: inline-block; max-width: 100%; touch-action: none; cursor: crosshair; }
.anno-layer { position: absolute; inset: 0; }
.anno-marker, .anno-draft { position: absolute; border: 2px solid var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); border-radius: 3px; }
.anno-marker { text-decoration: none; }
.anno-marker:hover { background: color-mix(in srgb, var(--orange) 28%, transparent); }
.anno-marker.anno-blocant { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }
.anno-marker.anno-major { border-color: var(--warn); }
.anno-marker.is-resolved { border-style: dashed; opacity: .5; }
.anno-draft { border-style: dashed; pointer-events: none; }
.anno-hint { margin-top: .4rem; }

.file-placeholder { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: 1.25rem; background: var(--line-soft); border-radius: var(--radius-sm); }
.file-ext { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--blue-dark); letter-spacing: .04em; }

/* ---------- Zona de încărcare ---------- */
.upload-zone { margin-bottom: 1.25rem; }
.upload-drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: center;
  background: var(--surface); cursor: pointer;
}
.upload-drop:hover, .upload-drop:focus-visible, .upload-drop.is-over { border-color: var(--blue-light); background: color-mix(in srgb, var(--blue-light) 6%, var(--surface)); }
.upload-drop.is-replacing { border-color: var(--orange); }
.upload-drop p { margin: 0 0 .35rem; }
.upload-list { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .4rem; }
.upload-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; align-items: center;
               background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .7rem; font-size: .85rem; }
.upload-name { font-weight: 600; word-break: break-all; }
.upload-meta { color: var(--ink-soft); font-size: .8rem; text-align: right; }
.upload-bar { grid-column: 1 / -1; height: 4px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.upload-bar-fill { display: block; height: 100%; width: 0; background: var(--blue-light); transition: width .2s ease; }
.upload-item[data-state="done"] .upload-bar-fill { background: var(--ok); }
.upload-item[data-state="warn"] .upload-bar-fill { background: var(--orange); }
.upload-item[data-state="error"] .upload-bar-fill { background: var(--danger); }
.upload-item[data-state="error"] .upload-meta { color: var(--danger); }

/* ---------- Comentarii ---------- */
.comment { border-left: 3px solid var(--line); padding: .6rem 0 .6rem .7rem; margin-bottom: .8rem; }
.comment-info { border-color: var(--line); }
.comment-minor { border-color: var(--blue-light); }
.comment-major { border-color: var(--orange); }
.comment-blocant { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 4%, transparent); }
.comment.is-resolved { opacity: .62; }
.comment-head { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .35rem; }
.comment-body { font-size: .9rem; }
.comment-body p { margin: 0 0 .4rem; }
.comment-body ul, .comment-body ol { margin: 0 0 .4rem 1.1rem; padding: 0; }
.comment-anchor { font-size: .78rem; color: var(--orange-dark); margin: 0 0 .3rem; font-weight: 600; }
.comment-resolved { font-size: .78rem; color: var(--ok); margin: .3rem 0 0; }
.comment-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.comment-replies { margin: .6rem 0 0 .8rem; padding-left: .6rem; border-left: 1px solid var(--line-soft); }
.comment-edit-form { margin-top: .5rem; }

.badge-sev { font-size: .68rem; }
.badge-sev-info { background: var(--line); color: var(--ink-soft); }
.badge-sev-minor { background: color-mix(in srgb, var(--blue-light) 18%, transparent); color: #0b4f66; }
.badge-sev-major { background: var(--warn-bg); color: var(--warn); }
.badge-sev-blocant { background: var(--danger-bg); color: var(--danger); }

/* ---------- Editor restrâns ---------- */
.editor { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: .6rem; }
.editor-toolbar { display: flex; align-items: center; gap: .15rem; padding: .3rem; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.editor-toolbar button { font: inherit; font-size: .85rem; min-width: 1.9rem; padding: .2rem .4rem; background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.editor-toolbar button:hover { background: var(--line-soft); border-color: var(--line); }
.editor-hint { font-size: .72rem; color: var(--ink-faint); margin-left: auto; }
.editor-area { min-height: 76px; padding: .55rem .7rem; font-size: .9rem; outline: none; }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--ink-faint); }
.editor-area:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blue-light) 40%, transparent); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

.comment-form-row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.comment-form-row .field { margin-bottom: 0; }
.reply-indicator { font-size: .8rem; color: var(--orange-dark); margin: 0 0 .4rem; }
.severity-note { margin-top: .4rem; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-dark); text-decoration: underline; cursor: pointer; }

/* ---------- Claim-uri ---------- */
.claim-list { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .6rem; }
.claim-item { padding: .55rem .7rem; background: var(--line-soft); border-radius: var(--radius-sm); border-left: 3px solid var(--blue-light); }
.claim-item.claim-mismatch { border-left-color: var(--orange); background: var(--warn-bg); }
.claim-text { margin: 0 0 .25rem; font-size: .88rem; }
.claim-used { margin: .3rem 0 0; font-size: .82rem; font-style: italic; color: var(--warn); }
.claim-actions { display: flex; gap: .35rem; margin-top: .35rem; }
.claim-add { border-top: 1px solid var(--line-soft); padding-top: .75rem; }
.claim-results { border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 230px; overflow-y: auto; margin-top: .3rem; background: var(--surface); }
.claim-option { display: block; width: 100%; text-align: left; padding: .45rem .6rem; background: none; border: 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; font: inherit; }
.claim-option:hover { background: color-mix(in srgb, var(--blue-light) 8%, transparent); }
.claim-option-text { display: block; font-size: .84rem; }
.claim-option-meta { display: block; font-size: .74rem; }
.claim-chosen { font-size: .82rem; background: var(--ok-bg); color: var(--ok); padding: .35rem .5rem; border-radius: var(--radius-sm); margin: .3rem 0; }
.legal-mention { font-size: .85rem; font-weight: 600; background: var(--surface); padding: .45rem .6rem; border-radius: var(--radius-sm); margin-bottom: .4rem; }

/* ---------- Statusuri ---------- */
.badge-lg { font-size: .82rem; padding: .25rem .7rem; }
.badge-ciorna { background: var(--line); color: var(--ink-soft); }
.badge-in_analiza { background: color-mix(in srgb, var(--blue-light) 20%, transparent); color: #0b4f66; }
.badge-aprobat { background: var(--ok-bg); color: var(--ok); }
.badge-aprobat_cu_observatii { background: var(--warn-bg); color: var(--warn); }
.badge-respins { background: var(--danger-bg); color: var(--danger); }
.badge-retras { background: var(--line); color: var(--ink-faint); }

/* ---------- Timeline, liste, clopoțel ---------- */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.timeline li { padding-left: .8rem; border-left: 2px solid var(--line); }
.timeline li strong { font-size: .88rem; }
.timeline li p { margin: .1rem 0 0; }
.timeline-override { border-left-color: var(--orange); }

.compact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.compact-list li { display: grid; gap: .1rem; }

.cards-compact .card-value { font-size: 1.45rem; }
.card-link-block { text-decoration: none; color: inherit; display: block; }
.card-link-block:hover { border-color: var(--blue-light); color: inherit; }
.card-active { border-color: var(--orange); }

.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
        border-radius: 50%; color: rgba(255,255,255,.7); text-decoration: none; }
.bell:hover { background: rgba(255,255,255,.12); color: #fff; }
.bell.has-unread { color: var(--orange); }
.bell-icon { font-size: .7rem; }
.bell-count { position: absolute; top: -2px; right: -4px; background: var(--orange); color: #1b1200;
              font-size: .62rem; font-weight: 700; min-width: 15px; height: 15px; border-radius: 99px;
              display: flex; align-items: center; justify-content: center; padding: 0 3px; }

.notif-list { list-style: none; padding: 0; margin: 0; }
.notif { border-bottom: 1px solid var(--line-soft); }
.notif:last-child { border-bottom: 0; }
.notif a { display: block; padding: .6rem .2rem; text-decoration: none; color: inherit; }
.notif a:hover { background: var(--line-soft); }
.notif.is-unread { border-left: 3px solid var(--orange); padding-left: .5rem; }
.notif p { margin: .15rem 0; }

.check-inline { border: 0; padding: 0; background: none; align-items: center; }
.check-inline:hover { background: none; }
textarea { font: inherit; resize: vertical; min-height: 60px; }

/* v0.8.0 — biblioteca de claim-uri administrată în CRM */
.row-group th { background: var(--line-soft); color: var(--blue-dark); font-size: .8rem; text-transform: none; letter-spacing: 0; }
.claim-item.claim-retired { border-left-color: var(--line); opacity: .7; }
.claim-actions { align-items: flex-start; flex-wrap: wrap; }
.claim-actions details { flex: 1 1 260px; }
.claim-actions details[open] form { margin-top: .5rem; }
.panel details form.panel-tight { border-top: 1px solid var(--line-soft); margin-top: .75rem; }

/* v0.8.1 — propunerile de claim-uri */
.mt { margin-top: 1.5rem; }

/* v0.8.2 — documentele de referință și editorul lor */
.doc-editor { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.doc-editor-bar { display: flex; flex-wrap: wrap; gap: .3rem; padding: .4rem; border-bottom: 1px solid var(--line-soft); background: var(--line-soft); }
.doc-editor-area { min-height: 260px; max-height: 70vh; overflow-y: auto; padding: .8rem 1rem; outline: none; }
.doc-editor-area:focus { box-shadow: inset 0 0 0 2px var(--blue-light); }
.document-text h2 { font-size: 1.2rem; margin: 1rem 0 .4rem; }
.document-text h3 { font-size: 1.05rem; margin: .9rem 0 .35rem; }
.document-text h4 { font-size: .95rem; margin: .8rem 0 .3rem; }
.document-text table { border-collapse: collapse; margin: .6rem 0; width: 100%; }
.document-text th, .document-text td { border: 1px solid var(--line); padding: .35rem .5rem; vertical-align: top; text-align: left; }
.document-text th { background: var(--line-soft); }

/* v0.10.0 — landing page-urile campaniei, pe setul de materiale */
.links-list { margin: .25rem 0 .5rem 1.25rem; padding: 0; }
.links-list li { margin: .2rem 0; }
.links-edit { display: grid; gap: .4rem; margin: .5rem 0 .25rem; }
.link-row { display: flex; gap: .5rem; align-items: center; }
.link-row input { flex: 1 1 auto; min-width: 0; }
.link-row.has-error input { border-color: var(--danger, #b42318); box-shadow: 0 0 0 1px var(--danger, #b42318); }
[data-link-add][hidden] { display: none; }

/* v0.11.0 — accesul lui Claude Desktop (token personal) și eticheta „prin Claude" */
.h3 { font-size: 1rem; }
.badge-claude { background: color-mix(in srgb, #6d28d9 12%, transparent); color: #5b21b6; }
.secret.small { font-size: .8rem; letter-spacing: 0; text-align: left; }
.older-version { margin-top: .9rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.older-version-title { font-size: .9rem; margin: 0 0 .4rem; }

/* v0.13.0 - butonul „Înapoi sus", pe toate paginile. Apare după un ecran de derulare
   (JavaScript); fără JavaScript e mereu vizibil și duce la #main. */
.back-to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60;
               display: inline-flex; align-items: center; gap: .35rem; padding: .6rem .95rem;
               border-radius: 999px; background: var(--blue-dark); color: #fff; font-weight: 600;
               font-size: .9rem; text-decoration: none; box-shadow: 0 4px 14px rgba(0, 63, 92, .28); }
.back-to-top:hover { background: #002B40; color: #fff; }
.back-to-top:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.back-to-top.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(.5rem); }
@media (prefers-reduced-motion: no-preference) {
  .back-to-top { transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background-color .12s ease; }
}
@media (max-width: 720px) {
  .back-to-top { right: .75rem; bottom: .75rem; padding: .55rem .8rem; }
}
@media print {
  .back-to-top { display: none; }
}

/* v0.14.0 - raportul de vânzări și marketing: variațiile față de perioada comparată */
.text-ok { color: var(--ok); }
.text-danger { color: var(--danger); }
.filters input[type="week"], .filters input[type="month"], .filters input[type="date"], .filters input[type="number"] { min-width: 9rem; }
/* v0.15.0 - filtrul de perioada din /marketing: app.js ascunde campurile altor tipuri de perioada. */
.filters [data-pentru][hidden] { display: none; }
/* v0.18.1 - „Schimbă drepturile" unui token Claude, sub butonul Revocă. */
.mt-sm { margin-top: .5rem; }
.token-drepturi { max-width: 26rem; }
.token-drepturi > summary { list-style: none; cursor: pointer; display: inline-block; }
.token-drepturi > summary::-webkit-details-marker { display: none; }
.token-drepturi[open] { padding: .5rem; border: 1px solid var(--border, #d0d7de); background: #fff; }

/* v0.18.2 - secțiunea „Rapoarte": file, carduri, grafice SVG (culorile Biessen), Markdown randat, calendar. */
.rap-file { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.25rem; border-bottom: 2px solid #003F5C; }
.rap-file a { padding: .45rem .9rem; text-decoration: none; color: #003F5C; font-weight: 600; }
.rap-file a.is-active { background: #003F5C; color: #fff; }
.rap-carduri { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.rap-card { border: 1px solid #DDE3E8; border-top: 4px solid #003F5C; padding: 1rem 1.1rem; background: #fff; }
.rap-card h2 { font-size: 1rem; margin: 0 0 .5rem; color: #003F5C; }
.rap-card.accent { border-top-color: #F8981D; }
.rap-card.info { border-top-color: #26C2F2; }
.rap-card ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.rap-cifra { font-size: 1.6rem; font-weight: 700; color: #003F5C; line-height: 1.1; }
.rap-grafice { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.25rem; }
.rap-grafic { border: 1px solid #DDE3E8; padding: .9rem 1rem; background: #fff; }
.rap-grafic h3 { font-size: .95rem; margin: 0 0 .5rem; color: #003F5C; }
svg.grafic { width: 100%; height: auto; display: block; font-family: inherit; }
.grafic-legenda { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; }
.grafic-culoare { display: inline-block; width: .8rem; height: .8rem; margin-right: .35rem; vertical-align: -1px; }
.gc0 { background: #003F5C; } .gc1 { background: #F8981D; } .gc2 { background: #26C2F2; }
.gc3 { background: #5B6B78; } .gc4 { background: #2F9E44; } .gc5 { background: #B02A37; }
.md-continut { max-width: 60rem; line-height: 1.55; }
.md-continut h2 { font-size: 1.25rem; margin-top: 1.5rem; } .md-continut h3 { font-size: 1.05rem; margin-top: 1.2rem; }
.md-continut pre { background: #F3F5F7; padding: .75rem; overflow-x: auto; }
.md-continut blockquote { border-left: 4px solid #26C2F2; margin: .75rem 0; padding: .25rem .9rem; color: #33434F; }
.md-continut .md-table { display: block; overflow-x: auto; }
.stare-propus { background: #FFF4E0; color: #7A4B00; } .stare-aprobat { background: #E3F2FA; color: #00435F; }
.stare-implementat, .stare-aplicat { background: #E6F4EA; color: #1E5E2E; } .stare-respins { background: #F3F5F7; color: #5B6B78; }
.rap-calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rap-calendar th, .rap-calendar td { border: 1px solid #DDE3E8; vertical-align: top; padding: .3rem; height: 5.5rem; font-size: .8rem; }
.rap-calendar th { height: auto; padding: .45rem .3rem; background: #F3F5F7; color: #003F5C; }
.rap-calendar td.alta-luna { background: #F7F8FA; color: #9AA5AE; }
.rap-calendar .ziua { font-weight: 700; color: #003F5C; }
.rap-calendar .ev { display: block; margin-top: .2rem; padding: .1rem .25rem; background: #FFF4E0; border-left: 3px solid #F8981D; }
.rap-propunere { border: 1px solid #DDE3E8; border-left: 4px solid #F8981D; padding: 1rem; margin-bottom: 1rem; background: #fff; }
.rap-propunere h3 { margin: 0 0 .35rem; color: #003F5C; }
.rap-canal { white-space: pre-wrap; background: #F7F8FA; padding: .5rem .7rem; margin: .25rem 0 .6rem; }

/* v0.21.0 — vizualurile propunerilor organice (textul aprobat → agentul creează imaginea 1440×1440) */
.stare-generat { background: #FFF4E0; color: #7A4B00; }
.rap-text-aprobat { background: #E6F4EA; color: #1E5E2E; padding: .45rem .7rem; margin: .5rem 0; }
.rap-vizuale { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; margin: .6rem 0; }
.rap-vizual { border: 1px solid #DDE3E8; padding: .6rem; background: #F7F8FA; }
.rap-vizual img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; border: 1px solid #DDE3E8; }
.rap-verificari { list-style: none; padding: 0; margin: .4rem 0; font-size: .85rem; }
.rap-verificari li::before { content: "● "; }
.rap-verificari .ver-ok { color: #1E5E2E; }
.rap-verificari .ver-nu { color: #A4262C; font-weight: 600; }
/* v0.30.0: text cu rândurile noi păstrate (propunerile Ads). */
.pre-wrap { white-space: pre-wrap; }

/* v0.33.0 — etapele proiectului și „Gata de campanie".
   Portocaliul de brand (#F8981D) pe alb are contrast 2,2:1 — sub WCAG AA pentru text; conturul rămâne portocaliul de brand,
   textul folosește o nuanță închisă a lui (#9A5300, ~5,5:1). Verde: alb pe --ok (#1F7A4D), ~5,4:1. */
.gata { display: inline-block; font-size: .8rem; font-weight: 700; padding: .22rem .7rem; border-radius: 99px; white-space: nowrap; border: 2px solid transparent; }
.gata-off { background: #fff; border-color: var(--orange); color: #9A5300; }
.gata-on { background: var(--ok); border-color: var(--ok); color: #fff; }
.gata-sm { font-size: .7rem; padding: .08rem .45rem; border-width: 1px; margin-top: .2rem; }
.head-bm { display: inline-flex; align-items: center; gap: .4rem; margin: 0; flex-wrap: wrap; }
.head-bm .check { margin: 0; }
.badge-impl { background: #FFF4E0; color: #7A4B00; border: 1px solid var(--orange); }

.etape { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem; }
.etape ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; counter-reset: none; }
.etapa { display: flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--ink-faint); position: relative; padding: .3rem .4rem; border-radius: var(--radius-sm); }
.etapa-nr { flex: 0 0 auto; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; background: var(--line-soft); color: var(--ink-soft); border: 2px solid var(--line); }
.etapa-gata { color: var(--ok); }
.etapa-gata .etapa-nr { background: var(--ok); border-color: var(--ok); color: #fff; }
.etapa-acum { color: var(--ink); font-weight: 700; background: color-mix(in srgb, var(--orange) 10%, transparent); }
.etapa-acum .etapa-nr { background: #fff; border-color: var(--orange); color: #9A5300; }
.etape-text { margin: .6rem 0 0; font-size: .9rem; color: var(--ink); }
.etape-retras { opacity: .6; }
@media (max-width: 720px) {
  .etape ol { grid-template-columns: 1fr; }
}

/* v0.37.0 — codul din Registrul MatPub pe fiecare material */
.material-cod { margin: 0 0 .75rem; }
.material-cod p { margin: 0 0 .35rem; }
.material-cod form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.material-cod select { flex: 1 1 16rem; width: auto; min-width: 0; }
