/* Dumar App – stil comun pentru toate modulele portalului. */
:root {
  --bg: #f2f4f3;
  --surface: #ffffff;
  --ink: #16201c;
  --ink-2: #3b4743;
  --muted: #66736e;
  --line: #dce2df;
  --line-2: #e9edeb;
  --brand: #0e6b57;
  --brand-hover: #0a5546;
  --brand-soft: #e3f1ed;
  --side: #10322b;
  --side-ink: #c9dcd5;
  --side-accent: #5bc2a6;
  --pos: #087443;  --pos-soft: #e5f4ec;
  --neg: #b42318;  --neg-soft: #fdeceb;
  --amb: #9a5a06;  --amb-soft: #fdf1df;
  --vio: #5a49b8;  --vio-soft: #eeebfa;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --focus: 0 0 0 3px rgba(14, 107, 87, .28);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

/* ---------- Structură ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.01em; padding: 0 8px 20px; }
.brand-mark { width: 30px; height: 30px; border-radius: var(--r); background: var(--side-accent); color: var(--side); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.nav-group { margin: 14px 8px 6px; font-size: 12px; font-weight: 600; color: #7fa398; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; margin: 1px 0; border-radius: var(--r);
  color: var(--side-ink); font-weight: 600; font-size: 14.5px; text-decoration: none;
  position: relative;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-accent); }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 8px 0; font-size: 13.5px; }
.side-foot .who { color: #fff; font-weight: 700; }
.side-foot .role { color: #7fa398; font-size: 12.5px; }
.side-foot a { color: var(--side-ink); display: inline-block; margin-top: 10px; font-weight: 600; }
.side-foot a:hover { color: #fff; }

.topbar { display: none; }
.main { min-width: 0; padding: 28px 32px 48px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.back { display: inline-block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }

/* ---------- Blocuri ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 20px; }
.panel > h2, .panel-head h2 { font-size: 17px; font-weight: 700; margin: 0 0 14px; letter-spacing: -.01em; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { margin-bottom: 14px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 18px 20px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.code { font-family: inherit; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* Indicatori */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-bottom: 20px; overflow: hidden; }
.stat { padding: 14px 18px; border-right: 1px solid var(--line-2); }
.stat:last-child { border-right: 0; }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.pos .v { color: var(--pos); }
.stat.neg .v { color: var(--neg); }
.stat.warn .v { color: var(--amb); }

/* ---------- Formulare ---------- */
.field { margin-bottom: 14px; }
label, .label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=search], input[type=number], input:not([type]), select, textarea {
  width: 100%; height: 44px; padding: 0 12px;
  font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; min-height: 80px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2366736e' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input::placeholder { color: #9aa6a1; }
.grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline > .field { flex: 1 1 180px; margin-bottom: 0; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; font-size: 15px; color: var(--ink); margin: 0 18px 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.choice-list { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: block; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-weight: 600; font-size: 14px; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); }
.choice input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Butoane ---------- */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  font: inherit; font-weight: 700; font-size: 14.5px;
  color: #fff; background: var(--brand);
  border: 1px solid var(--brand); border-radius: var(--r);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover, button:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; text-decoration: none; }
.btn.secondary, button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover, button.secondary:hover { background: var(--line-2); color: var(--ink); }
.btn.danger, button.danger { background: #fff; color: var(--neg); border-color: #f2c7c3; }
.btn.danger:hover, button.danger:hover { background: var(--neg-soft); }
.btn.sm, button.sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.block, button.block { width: 100%; }
button:disabled { opacity: .6; cursor: default; }

/* ---------- Mesaje ---------- */
.flash { padding: 12px 14px; border-radius: var(--r); margin-bottom: 16px; font-weight: 600; border: 1px solid; }
.flash.ok { background: var(--pos-soft); border-color: #bfe3cf; color: #075e37; }
.flash.err { background: var(--neg-soft); border-color: #f2c7c3; color: #8f1c13; }

/* ---------- Etichete de stare ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.badge.pos { background: var(--pos-soft); color: var(--pos); }
.badge.neg { background: var(--neg-soft); color: var(--neg); }
.badge.amb { background: var(--amb-soft); color: var(--amb); }
.badge.vio { background: var(--vio-soft); color: var(--vio); }
.badge.neutral { background: var(--line-2); color: var(--muted); }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfa; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .muted { font-size: 13px; }
td.num, th.num { text-align: right; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); display: block; }

/* Căutare produse */
.results { border: 1px solid var(--line); border-radius: var(--r); max-height: 280px; overflow: auto; margin-top: 6px; background: #fff; }
.results button { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.results button:hover, .results button:focus-visible { background: var(--brand-soft); }
.results .none { padding: 10px 12px; color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: var(--r); background: var(--brand-soft); font-size: 14px; font-weight: 600; }
.chip small { color: var(--muted); font-weight: 600; }
.chip button { all: unset; cursor: pointer; width: 24px; height: 24px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--ink-2); }
.chip button:hover { background: rgba(0, 0, 0, .07); }

/* ---------- Ecranul angajatului ---------- */
.count-list { display: grid; gap: 16px; max-width: 560px; }
.count-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.count-card .pname { font-size: 19px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.count-card .pmeta { color: var(--muted); font-size: 14px; margin: 4px 0 18px; }
.count-card .pmeta b { color: var(--ink-2); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; margin-bottom: 16px; }
.stepper button { height: 60px; padding: 0; font-size: 26px; font-weight: 600; background: #fff; color: var(--ink); border-color: var(--line); }
.stepper button:hover { background: var(--line-2); color: var(--ink); }
.stepper input { height: 60px; text-align: center; font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.photo-pick { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px dashed #b9c4bf; border-radius: var(--r); cursor: pointer; margin-bottom: 14px; background: #fbfcfb; }
.photo-pick:hover { border-color: var(--brand); }
.photo-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-pick .ph { width: 52px; height: 52px; border-radius: var(--r-sm); background: var(--line-2); display: grid; place-items: center; flex: none; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; }
.photo-pick .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick .t { display: block; font-weight: 700; font-size: 14.5px; }
.photo-pick .s { display: block; color: var(--muted); font-size: 13px; }
.photo-pick:focus-within { box-shadow: var(--focus); }

/* ---------- Autentificare ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.auth-box { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--r-lg); padding: 28px 24px; }
.auth-box .brand { color: var(--ink); padding: 0 0 22px; }
.auth-box .brand-mark { background: var(--brand); color: #fff; }
.auth-box h1 { font-size: 22px; margin: 0 0 4px; font-weight: 800; letter-spacing: -.02em; }
.auth-box p.muted { margin: 0 0 20px; }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  .shell { display: block; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
    background: var(--side); color: #fff; padding: 10px 16px; height: 56px;
  }
  .topbar .brand { padding: 0; font-size: 16px; }
  .topbar .brand-mark { width: 28px; height: 28px; font-size: 14px; }
  .menu-btn { all: unset; cursor: pointer; height: 36px; padding: 0 14px; display: grid; place-items: center; border-radius: var(--r); color: #fff; font-weight: 700; font-size: 14px; border: 1px solid rgba(255, 255, 255, .25); }
  .menu-btn:focus-visible { box-shadow: 0 0 0 3px rgba(91, 194, 166, .5); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 280px; height: auto; transform: translateX(-100%); transition: transform .2s ease; }
  .side .brand { display: none; }
  body.menu-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(10, 25, 21, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  .main { padding: 18px 16px 40px; }
  .page-head h1 { font-size: 22px; }
  .panel { padding: 16px; }
  .panel.flush .panel-head { padding: 16px 16px 0; }
  .stat { padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-right: 1px solid var(--line-2); }

  /* Tabelele devin carduri */
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt tr.head { display: none; }
  table.rt tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.rt tr:last-child { border-bottom: 0; }
  table.rt td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 110px 1fr; gap: 10px; justify-items: start; align-items: center; }
  table.rt td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; }
  table.rt td[data-label=""]::before, table.rt td.nolabel::before { content: none; }
  table.rt td.nolabel, table.rt td[data-label=""] { display: block; }
  table.rt td.lead { display: block; font-size: 15px; padding-bottom: 6px; }
  table.rt td.lead::before { content: none; }
  td.num { text-align: left; }
  .inline > .field { flex-basis: 100%; }
  .inline > .btn, .inline > button, .inline > .actions { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.filters { padding: 0 20px 16px; border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .filters { padding: 0 16px 16px; } }
.field.narrow { flex: 0 1 220px; }
@media (max-width: 860px) { .field.narrow { flex-basis: 100%; } .stats .stat:last-child:nth-child(odd) { grid-column: span 2; border-right: 0; } }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; background: #fff; border-radius: var(--r); padding: 9px 14px; line-height: 0; }
.logo svg, .logo img { height: 22px; width: auto; display: block; }
.side .logo { margin: 0 6px 18px; align-self: flex-start; }
.auth-box .logo { padding: 0 0 22px; }
.auth-box .logo svg, .auth-box .logo img { height: 30px; }

/* ---------- Liste lungi: selecție, acțiuni, pagini ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.bulk .check { margin: 0 6px 0 0; font-size: 14px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
th.pick, td.pick { width: 44px; padding-right: 0; }
td.pick .check { margin: 0; padding: 4px 0; }
.list-note { margin: -6px 20px 12px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); }
.pager-info { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.pager-go select { height: 34px; width: auto; font-size: 13.5px; }
.btn.is-off { opacity: .45; pointer-events: none; }
@media (max-width: 860px) {
  .side .logo { display: none; }
  .topbar .logo { padding: 6px 10px; }
  .topbar .logo svg, .topbar .logo img { height: 18px; }
  .list-note { margin: -6px 16px 12px; }
  .pager { padding: 12px 16px; }
  .pager-go { order: 3; width: 100%; }
  .pager-go select { width: 100%; height: 40px; }
  .bulk { width: 100%; }
  .bulk button { flex: 1 1 auto; }
  .row-actions { justify-content: flex-start; }
  table.rt td.pick { float: right; width: auto; padding: 0; margin-left: 10px; }
  table.rt td.pick .check { padding: 0; }
}
.count-list > .panel { margin-bottom: 0; }

/* ---------- Reclame TV ---------- */
.tv-linkbox { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tv-linkbox .label { margin-bottom: 2px; }
.tv-link { font-weight: 700; font-size: 16px; color: var(--ink); word-break: break-all; }
td .tv-link { font-size: 14px; }
.tv-thumb { display: block; width: 112px; aspect-ratio: 16 / 9; border-radius: var(--r-sm); border: 1px solid var(--line); background: #0d1512; overflow: hidden; }
.tv-thumb video, .tv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tv-table td { vertical-align: middle; }
.tv-table tr.off td:not(.nolabel) { opacity: .55; }
.pos-num { font-weight: 800; color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.btn-row form { margin: 0; }
.tv-drop { border: 1px dashed #b9c4bf; border-radius: var(--r); background: #fbfcfb; padding: 22px 16px; text-align: center; transition: border-color .15s, background .15s; }
.tv-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.tv-drop .t { font-weight: 700; font-size: 15px; }
.tv-drop .s { color: var(--muted); font-size: 13px; margin: 4px auto 14px; max-width: 520px; }
.tv-progress { display: grid; gap: 8px; text-align: left; }
.tv-progress:not(:empty) { margin-top: 14px; }
.tv-up { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; font-size: 14px; background: #fff; }
.tv-up .row { display: flex; justify-content: space-between; gap: 12px; }
.tv-up .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tv-up .pct { color: var(--muted); white-space: nowrap; font-weight: 600; }
.tv-bar { height: 4px; background: var(--line-2); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.tv-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.tv-up.done .tv-bar i { background: var(--pos); }
.tv-up.done .pct { color: var(--pos); }
.tv-up.err { border-color: #f2c7c3; background: var(--neg-soft); }
.tv-up.err .pct { color: var(--neg); white-space: normal; text-align: right; }
.tv-up.err .tv-bar { display: none; }
.tv-reload { justify-self: start; }
.tv-from-library { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.tv-from-library .choice-list { margin-bottom: 14px; }
.choice small { font-weight: 600; margin-left: 4px; }
.slug-field { display: flex; }
.slug-field .pre { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: var(--r) 0 0 var(--r); background: var(--line-2); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.slug-field input { border-radius: 0 var(--r) var(--r) 0; min-width: 0; }
.tv-danger { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.tv-rename { flex-wrap: nowrap; }
.tv-rename .field { flex: 1 1 auto; }
.tv-replace-progress { padding: 0 20px; }
.tv-replace-progress .tv-progress:not(:empty) { margin: 16px 0 0; }
.tv-note { padding: 12px 20px 16px; margin: 0; border-top: 1px solid var(--line-2); }
@media (max-width: 860px) {
  /* Pe telefon: card compact cu previzualizarea în stânga și butoanele dedesubt */
  table.rt.tv-table tr:not(.head) { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: start; }
  table.rt.tv-table td { display: block; padding: 0; }
  table.rt.tv-table td::before { content: none; }
  table.rt.tv-table td.tv-num, table.rt.tv-table td.tv-date { display: none; }
  table.rt.tv-table td.tv-prev { grid-column: 1; grid-row: 1 / span 3; }
  table.rt.tv-table td:not(.tv-prev) { grid-column: 2; }
  table.rt.tv-table td.nolabel { grid-column: 1 / -1; }
  table.rt.tv-table td.lead { font-size: 14.5px; line-height: 1.35; padding-bottom: 4px; }
  table.rt.tv-table td.tv-used { font-size: 13px; }
  table.rt.tv-table td.tv-used::before { content: "Pe: "; color: var(--muted); font-weight: 600; }
  table.rt.tv-table td.tv-used > div { display: inline; }
  .btn-row .sm { padding: 0 11px; }
  .tv-thumb { width: 96px; }
  .btn-row { justify-content: flex-start; padding-top: 6px; }
  .btn-row .sm { height: 38px; }
  .slug-field .pre { font-size: 13px; padding: 0 8px; }
  .tv-replace-progress { padding: 0 16px; }
  .tv-note { padding: 12px 16px 14px; }
  .tv-rename { flex-wrap: wrap; }
}
