/* PYMA OS — aliniat vizual cu PYMA Comenzi (aceleași culori/componente), touch-friendly. */
:root {
  --primary: #2E5339;
  --primary-dark: #1F3A28;
  --accent: #8B6F47;
  --bg-light: #F4ECD8;
  --bg-page: #FAF8F3;
  --text: #2A2A2A;
  --text-muted: #595959;
  --border: #D4C9B0;
  --success: #2E7D32;
  --warning: #F57C00;
  --danger: #C0392B;
  --info: #1F618D;
  --shadow: 0 2px 8px rgba(46,83,57,.08);
  --shadow-lg: 0 4px 16px rgba(46,83,57,.12);
  --radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Calibri, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
.loading { padding: 40px; text-align: center; color: var(--text-muted); }

/* ---------- LOGIN ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 16px; }
.login-logo { font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: .5px; }
.login-sub { color: var(--text-muted); margin-top: -10px; font-size: 14px; }
.login-card { background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.login-card input { font-size: 16px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); width: 100%; }
.login-err { color: var(--danger); font-size: 14px; min-height: 18px; }

/* ---------- BUTOANE ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: #fff; border: none;
  font-size: 15px; font-weight: 500; padding: 11px 18px; min-height: 44px;
  border-radius: var(--radius); cursor: pointer; font-family: inherit; transition: background .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(.99); }
.btn:disabled { background: #B0B0B0; cursor: not-allowed; }
.btn.secundar { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.secundar:hover { background: var(--bg-light); }
.btn.rosu { background: var(--danger); }
.btn.rosu:hover { background: #A02818; }
.btn.mic { padding: 7px 12px; font-size: 13px; min-height: 34px; }

/* ---------- HEADER + NAV ---------- */
header {
  background: var(--primary); color: #fff; padding: 13px 20px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow); position: sticky; top: 0; z-index: 20;
}
header .titlu { font-size: 19px; font-weight: 600; letter-spacing: .3px; }
header .cine { font-size: 13px; opacity: .92; text-align: right; }
header .cine a { color: #cfe3dd; }
nav.taburi {
  display: flex; background: #fff; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: thin; position: sticky; top: 51px; z-index: 19;
}
nav.taburi button {
  background: none; border: none; padding: 14px 18px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent;
  white-space: nowrap; font-family: inherit; transition: all .15s;
}
nav.taburi button:hover { background: var(--bg-light); color: var(--primary); }
nav.taburi button.activ { color: var(--primary); border-bottom-color: var(--primary); background: var(--bg-light); }

main { padding: 18px; max-width: 1100px; margin: 0 auto; }

/* ---------- FORMURI ---------- */
input[type=text], input[type=number], input[type=date], input:not([type]), select, textarea {
  border: 1px solid var(--border); padding: 10px 12px; border-radius: var(--radius);
  font-size: 15px; font-family: inherit; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,83,57,.15); }
label { font-size: 13px; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: 4px; }

/* ---------- FILTRE (bară albă ca la Comenzi) ---------- */
.filtre {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: #fff; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 18px;
}
.filtre input { flex: 1; min-width: 180px; }
.filtre select { min-width: 150px; width: auto; }

/* ---------- CARD ARTICOL / STOC ---------- */
.card-articol {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.card-articol.inactiv { opacity: .5; border-left-color: var(--text-muted); }
.ca-info { flex: 1; min-width: 0; }
.ca-den { font-weight: 600; font-size: 15px; color: var(--text); }
.ca-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.ca-sku { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--bg-light); border-radius: 4px; padding: 2px 7px; color: var(--primary); }
.badge { font-size: 11px; font-weight: 600; border-radius: 10px; padding: 1px 8px; background: var(--accent); color: #fff; }
.badge.fara-pret { background: #FFFBEB; color: var(--warning); border: 1px solid var(--warning); }
.badge.sub-min { background: #FFF5F5; color: var(--danger); border: 1px solid var(--danger); }
.ca-sold { font-size: 22px; font-weight: 600; color: var(--primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ca-sold span { font-size: 13px; font-weight: 500; color: var(--text-muted); }

/* ---------- MODAL ---------- */
.modal-fundal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 1000; padding: 0; }
.modal { background: #fff; border-radius: 14px 14px 0 0; width: 100%; max-width: 600px; max-height: 92vh; overflow-y: auto; padding: 22px; box-shadow: var(--shadow-lg); }
@media (min-width: 640px) { .modal-fundal { align-items: center; padding: 20px; } .modal { border-radius: var(--radius); } }
.modal h3 { color: var(--primary); margin-bottom: 16px; font-size: 18px; }
.camp { margin-bottom: 14px; }
.rand2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actiuni { display: flex; gap: 10px; margin-top: 18px; }
.modal-actiuni .btn { flex: 1; }

.gol { text-align: center; color: var(--text-muted); padding: 40px 16px; background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- TOAST (dreapta sus, ca la Comenzi) ---------- */
.toast {
  position: fixed; top: 76px; right: 20px; z-index: 2000;
  background: #fff; color: var(--text); padding: 12px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border-left: 4px solid var(--success); font-weight: 500; max-width: 90vw;
}
.toast.eroare { border-left-color: var(--danger); }
.sumar-import { background: #F0FDF4; border-left: 4px solid var(--success); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px; font-size: 14px; }

/* ---------- RECEPȚIE ---------- */
.rec-antet { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.rec-antet .camp { margin-bottom: 0; }
.cauta-prod { position: relative; margin-bottom: 4px; }
.rez-cautare { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 4px; overflow: hidden; box-shadow: var(--shadow-lg); }
.rez-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.rez-item:last-child { border-bottom: none; }
.rez-item:hover { background: var(--bg-light); }
.rez-gol { padding: 12px 14px; color: var(--text-muted); font-size: 14px; }
.linie-rec { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.lr-cap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.lr-den { font-weight: 600; }
.lr-x { border: none; background: #FFF5F5; color: var(--danger); border-radius: var(--radius); width: 32px; height: 32px; font-size: 15px; cursor: pointer; }
.lr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 560px) { .lr-grid { grid-template-columns: 1fr 1fr 1fr 1fr; } }
.lr-grid label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: flex; flex-direction: column; gap: 3px; }
.lr-motiv { width: 100%; margin-top: 8px; border: 1px solid var(--warning); background: #FFFBEB; }
.rec-jos { margin-top: 14px; }
.rec-jos .btn { width: 100%; margin-top: 8px; }
h3.sectiune { margin: 16px 0 8px; color: var(--primary); font-size: 17px; }

/* ---------- INVENTAR ---------- */
.grup-titlu {
  background: var(--bg-light); color: var(--primary); font-weight: 600; font-size: 13px;
  letter-spacing: .3px; padding: 8px 14px; border-radius: var(--radius);
  margin: 14px 0 6px; border: 1px solid var(--border);
}
.linie-inv {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.linie-inv.numarat { border-left-color: var(--success); }
.li-info { flex: 1; min-width: 0; }
.li-den { font-weight: 600; font-size: 15px; }
.li-input {
  width: 110px !important; font-size: 20px !important; font-weight: 600; text-align: center;
  padding: 10px 8px !important; font-variant-numeric: tabular-nums;
}
.bara-jos {
  position: sticky; bottom: 0; background: var(--bg-page); padding: 12px 0;
  border-top: 1px solid var(--border); margin-top: 12px;
}
.bara-jos .btn { width: 100%; }

/* ---------- NECESAR ---------- */
.validare { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 10px; font-size: 14px; border-left: 4px solid var(--info); background: #EFF6FF; }
.validare.ok { border-left-color: var(--success); background: #F0FDF4; }
.validare.warn { border-left-color: var(--warning); background: #FFFBEB; }
.ev-lista { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ev-chip { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 6px 12px; font-size: 13px; }

/* ---------- FIȘĂ EVENIMENT ---------- */
.lr-legenda { font-size: 12px; color: var(--text-muted); margin: 4px 2px 8px; }
.linie-ev {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow);
}
.le-den { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.le-rid, .le-fin { width: 92px !important; font-size: 17px !important; text-align: center; padding: 9px 6px !important; font-variant-numeric: tabular-nums; }
.le-rid { border-color: var(--accent) !important; }
.le-fin { border-color: var(--primary) !important; }

/* ---------- TIPĂRIT (liste de inventariere + etichete) ---------- */
/* Pe ecran zona de print e invizibilă; la window.print() se vede DOAR ea. */
#print-zona { display: none; }
@media print {
  body > *:not(#print-zona) { display: none !important; }
  #print-zona { display: block !important; background: #fff; color: #000; }
  @page { margin: 8mm; }
}
.pr-doc { font-family: Arial, sans-serif; font-size: 11px; color: #000; }
.pr-tabel { width: 100%; border-collapse: collapse; font-size: 10px; }
.pr-tabel th, .pr-tabel td { border: 0.4pt solid #000; padding: 3px 4px; text-align: center; vertical-align: middle; }
.pr-tabel th { background: #eee; font-weight: 700; }
.pr-tabel td.st, .pr-tabel th.st { text-align: left; }
.pr-tabel tr { page-break-inside: avoid; }
/* etichete: grilă A4, 3 coloane × 63,5×38,1 mm (Avery L7160 și compatibile) */
.pr-eti-grila { display: grid; grid-template-columns: repeat(3, 63.5mm); grid-auto-rows: 38.1mm; justify-content: center; }
.pr-eti { border: 0.3pt dashed #999; padding: 2mm 3mm; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1mm; page-break-inside: avoid; }
.pr-eti-den { font-size: 9pt; font-weight: 700; text-align: center; line-height: 1.15; max-height: 9mm; overflow: hidden; }
.pr-eti-cod { font-size: 8pt; letter-spacing: 1px; }
.pr-eti svg rect { fill: #000; }

/* ---- Poziții pe termene de valabilitate (inventar bucătărie, 30.09.2026) ---- */
.li-term {
  flex: none; width: 42px; height: 42px; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius); font-size: 15px; line-height: 1; cursor: pointer; color: var(--primary);
}
.li-term.activ { background: var(--bg-light); border-color: var(--primary); font-weight: 600; font-size: 13px; }
.li-input[readonly] { background: var(--bg-light); color: var(--primary); }
.li-poz:not(:empty) {
  margin: -2px 0 8px 12px; padding: 8px 10px; border-left: 3px solid var(--border);
  background: var(--bg-light); border-radius: 0 var(--radius) var(--radius) 0;
}
.poz-rand {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px dotted var(--border); font-size: 13px;
}
.poz-rand:last-of-type { border-bottom: none; }
.poz-rand > b { min-width: 46px; font-variant-numeric: tabular-nums; font-size: 15px; }
.poz-det { flex: 1; min-width: 0; color: #555; }
.poz-exp { font-weight: 600; color: var(--primary); }
.poz-exp.aproape { color: #b26a00; }
.poz-exp.expirat { color: #b3261e; }
.poz-exp.gol { color: #999; font-weight: 400; }
.poz-ed, .poz-del {
  flex: none; width: 30px; height: 30px; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius); cursor: pointer; font-size: 13px; line-height: 1;
}
.poz-del { color: #b3261e; }
.poz-add {
  width: 100%; margin-top: 6px; padding: 8px; border: 1px dashed var(--border); background: #fff;
  border-radius: var(--radius); cursor: pointer; font-size: 13px; color: var(--primary);
}
.poz-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.poz-form input, .poz-form select {
  flex: 1 1 130px; min-width: 0; padding: 9px 8px !important; font-size: 14px !important;
}
.poz-form .pf-cant { flex: 0 0 90px; text-align: center; font-weight: 600; }
.pf-btn { display: flex; gap: 6px; flex: 1 1 100%; }
.pf-btn button {
  flex: 1; padding: 9px; border-radius: var(--radius); border: 1px solid var(--primary);
  background: var(--primary); color: #fff; font-size: 14px; cursor: pointer;
}
.pf-btn .pf-x { background: #fff; color: var(--primary); }
.poz-rand.nesincronizat > b::after { content: ' 📴'; font-size: 11px; }
.poz-rand.nesincronizat { opacity: .85; }

/* ---- Della Nonna: vânzătorii (pagina agentului + filele din OS), 07.10.2026 ---- */
.dn-sub { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: thin; }
.dn-sub button {
  flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.dn-sub button.activ { background: var(--primary); border-color: var(--primary); color: var(--bg-light); }
.dn-sub .badge { margin-left: 4px; }
.dn-stare { display: inline-block; font-size: 11px; font-weight: 600; color: #fff; border-radius: 10px; padding: 1px 8px; vertical-align: middle; }
.dn-prod.dn-ales { border-left-color: var(--primary); background: #FBFAF5; }
.dn-gata { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 18px; text-align: center; box-shadow: var(--shadow); }
.dn-gata h3 { color: var(--primary); margin: 8px 0; }
.dn-tabel-wrap { overflow-x: auto; margin-bottom: 6px; }
.dn-tabel { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.dn-tabel th, .dn-tabel td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: right; white-space: nowrap; }
.dn-tabel th:first-child, .dn-tabel td:first-child { text-align: left; }
.dn-tabel th { background: var(--bg-light); color: var(--primary); font-weight: 600; }
.dn-click { cursor: pointer; }
.dn-click:hover { background: var(--bg-light); }
.dn-extras-ecran { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; overflow-x: auto; }
.dn-actiuni { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dn-cod { font-family: ui-monospace, Consolas, monospace; font-size: 15px; word-break: break-all; background: var(--bg-light);
  border: 1px dashed var(--primary); border-radius: var(--radius); padding: 10px; margin: 8px 0; }
/* comenzile cu livrare (fără expirare), comenzile clienților, „Necesar pe luni", 07.10.2026 seara */
.dn-stare.dn-de-la-client { background: var(--accent); }
.dn-peste { color: var(--warning); font-weight: 600; }
.dn-lipsa { color: var(--danger); font-weight: 600; font-size: 12px; }
.dn-necesar td { vertical-align: top; }
.dn-necesar td:first-child { white-space: normal; min-width: 140px; }
