/* Paleți încărcați la curier — telefon, o mână, butoane mari. */
:root {
  --bg: #f4f5f7; --card: #fff; --text: #1a1d21; --muted: #6b7280; --line: #e3e6ea;
  --accent: #b8860b; --accent-ink: #fff; --ok: #15803d; --warn: #b45309; --danger: #b91c1c;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }

.hdr {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #1a1d21; color: #fff; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
}
.hdr-titlu { font-weight: 700; font-size: 17px; }
.sync { border: 0; border-radius: 999px; padding: 5px 10px; font-size: 13px; background: #23402c; color: #bbf7d0; white-space: nowrap; }
.sync.asteapta { background: #4a3a12; color: #fde68a; }
.sync.eroare { background: #4c1d1d; color: #fecaca; }

.taburi { display: flex; background: #fff; border-bottom: 1px solid var(--line); }
.tab { flex: 1; border: 0; background: none; padding: 13px 0; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tab.activ { color: var(--text); border-bottom-color: var(--accent); }

main { padding: 16px; max-width: 560px; margin: 0 auto; }
.ecran { display: none; }
.ecran.activ { display: block; }
.indiciu { margin: 0 0 12px; color: var(--muted); }

/* 1. grila de curieri */
.grila { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.curier {
  --c: #64748b;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px;
  min-height: 92px; padding: 14px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-left: 8px solid var(--c); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.curier:active { transform: scale(.98); background: #fafafa; }
.curier-nume { font-weight: 700; font-size: 18px; }
.curier-azi { font-size: 13px; color: var(--muted); }

/* 2. paleții */
.curier-ales { --c: #64748b; margin: 12px 0 8px; padding: 12px 14px; border-radius: var(--radius); background: var(--c); color: #fff; font-weight: 800; font-size: 22px; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.contor { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; }
.numar { min-width: 120px; text-align: center; font-size: 72px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.eticheta-numar { text-align: center; color: var(--muted); margin: 4px 0 16px; }
.rapide { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 14px; font-weight: 600;
}
.btn.primar { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.pericol { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.fantoma { background: transparent; }
.btn.mare { display: flex; width: 100%; padding: 16px; font-size: 18px; border-radius: var(--radius); margin-top: 12px; }
.btn.mic { padding: 6px 10px; font-size: 14px; }
.btn.rotund { width: 64px; height: 64px; border-radius: 50%; font-size: 34px; padding: 0; }

.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 10px 0; font-weight: 700; font-size: 17px; }
.chip.activ { background: var(--text); border-color: var(--text); color: #fff; }

.inp { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }

/* 3. jurnalul */
.preseturi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preseturi .chip { font-size: 14px; padding: 8px 0; }
.interval { display: flex; gap: 8px; margin: 10px 0; }
.interval label { flex: 1; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.interval input { padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--text); min-width: 0; }
.jurnal-stare { font-size: 13px; color: var(--warn); margin: 6px 0; }
.jurnal-stare:empty { display: none; }
.gol { color: var(--muted); text-align: center; padding: 24px 0; }

.zi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.zi-cap { display: flex; justify-content: space-between; align-items: baseline; }
.zi-data { font-weight: 800; font-size: 17px; }
.zi-total { font-weight: 800; color: var(--accent); }
.totaluri { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.total-curier { background: #f3f4f6; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; }

.rand { border-top: 1px solid var(--line); padding: 10px 0 8px; }
.rand-sus { display: flex; gap: 10px; align-items: baseline; }
.rand-ora { color: var(--muted); font-variant-numeric: tabular-nums; }
.rand-curier { font-weight: 700; flex: 1; }
.rand-paleti { font-weight: 800; }
.rand-cine, .rand-nota { font-size: 13px; color: var(--muted); margin: 2px 0 4px; }
.rand-nota { color: var(--text); font-style: italic; }
.rand-motiv { font-size: 13px; color: var(--danger); }
.rand.anulat .rand-sus { text-decoration: line-through; color: var(--muted); }
.anulare { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* confirmarea */
.toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #1a1d21; color: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  max-width: 536px; margin: 0 auto;
}
.toast[hidden] { display: none; }
.toast .btn { background: #fff; color: #1a1d21; border-color: #fff; }

.subsol {
  position: fixed; left: 0; right: 0; bottom: 0; text-align: center; font-size: 12px; color: var(--muted);
  background: var(--bg); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
}
.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: 12px; }

/* identificarea */
.auth-ov { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.auth-box { background: #fff; border-radius: var(--radius); padding: 18px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.auth-titlu { font-weight: 800; font-size: 19px; }
.auth-sub { font-size: 13px; color: var(--muted); }
.auth-err { color: var(--danger); font-size: 13px; }
.auth-err[hidden] { display: none; }

@media (max-width: 340px) { .grila { grid-template-columns: 1fr; } }
.curier-alt { border-left-style: dashed; border-color: #cbd5e1; border-left-color: #94a3b8; background: #f8fafc; }
.curier-alt .curier-nume { color: #334155; }

/* runda 3 (12.10.2026): paleți dați / primiți înapoi + sold pe curier */
.curier-sold { font-size: 13px; font-weight: 700; color: var(--warn); }
.curier-sold.zero { color: var(--ok); }
.curier-sold.neg, .sold-pill.neg { color: var(--danger); }
.fel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 6px; }
.fel-btn { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 6px; font-weight: 700; font-size: 16px; }
.fel-btn.activ[data-fel="incarcare"] { border-color: var(--accent); background: #fdf6e3; }
.fel-btn.activ[data-fel="retur"] { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.sold-curier { text-align: center; font-size: 14px; color: var(--muted); min-height: 20px; }
.sold-curier.neg { color: var(--danger); }
.btn.primar.retur { background: #2563eb; border-color: #2563eb; }
.zi-primiti { color: #1d4ed8; }
.rand-fel { font-size: 15px; }
.rand.retur .rand-paleti { color: #1d4ed8; }

.sold-sus { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.sold-sus strong { font-size: 28px; color: var(--warn); font-variant-numeric: tabular-nums; }
.sold-card { background: var(--card); border: 1px solid var(--line); border-left: 8px solid var(--c, #64748b); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.sold-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sold-nume { font-weight: 800; font-size: 17px; }
.sold-pill { font-weight: 800; font-size: 22px; color: var(--warn); font-variant-numeric: tabular-nums; }
.sold-pill.zero { color: var(--ok); }
.sold-detalii { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.sold-avert { font-size: 13px; color: var(--danger); margin-bottom: 6px; }
.zi-dati { color: var(--muted); font-size: 13px; font-weight: 600; }
.rand-fel { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; border-radius: 6px; padding: 2px 6px; background: #fdf6e3; color: #8a6508; }
.rand-fel.fel-retur { background: #eff6ff; color: #1d4ed8; }
.rand-fel.fel-sold { background: #f1f5f9; color: #334155; }
.sold-card.fara { padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sold-card.fara .sold-nume { font-size: 15px; font-weight: 700; }
.sold-sectiune { font-size: 13px; color: var(--muted); margin: 14px 0 8px; }

/* ── Evidență paleți furnizor ── */
.cauta { margin-bottom: 10px; font-size: 17px; }
.lista-furnizori { display: flex; flex-direction: column; gap: 8px; }
.furnizor {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "nume sold" "azi sold"; gap: 2px 10px; align-items: center;
  text-align: left; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid #475569;
  border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.furnizor:active { transform: scale(.99); background: #fafafa; }
.furnizor-nume { grid-area: nume; font-weight: 700; font-size: 17px; }
.furnizor-azi { grid-area: azi; font-size: 13px; color: var(--muted); }
.furnizor-sold { grid-area: sold; font-size: 13px; font-weight: 700; text-align: right; max-width: 130px; }
.furnizor-nou { border-style: dashed; color: #334155; background: #f8fafc; }
.furnizor-ales { --c: #334155; }
.propunere { display: flex; flex-direction: column; gap: 8px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px; }
.propunere[hidden] { display: none; }
.fel-btn.activ[data-fel="primit"], .fel-btn.activ[data-dir="noi"] { border-color: #15803d; background: #f0fdf4; color: #166534; }
.fel-btn.activ[data-fel="dat"], .fel-btn.activ[data-dir="ei"] { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.btn.primar { background: #15803d; border-color: #15803d; }
.btn.primar.dat { background: #2563eb; border-color: #2563eb; }
/* sold: pozitiv = avem de-ai lor (de dat înapoi, portocaliu); negativ = au de-ai noștri (de recuperat, albastru) */
.noi { color: var(--warn); }
.ei { color: #1d4ed8; }
.zero { color: var(--ok); }
.sold-curier.noi { color: var(--warn); } .sold-curier.ei { color: #1d4ed8; }
.sold-sus2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.sold-sus2 > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.sold-sus2 strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.sold-sus2 > div:first-child strong { color: var(--warn); }
.sold-sus2 > div:last-child strong { color: #1d4ed8; }
.sold-card { background: var(--card); border: 1px solid var(--line); border-left: 8px solid #94a3b8; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.sold-card.noi { border-left-color: #d97706; } .sold-card.ei { border-left-color: #2563eb; } .sold-card.zero { border-left-color: #16a34a; }
.sold-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sold-nume { font-weight: 800; font-size: 17px; color: var(--text); }
.sold-pill { font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; }
.sold-situatie { font-size: 14px; font-weight: 700; margin: 2px 0; }
.sold-detalii { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.sold-card.fara { padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sold-card.fara .sold-nume { font-size: 15px; font-weight: 700; }
.sold-sectiune { font-size: 13px; color: var(--muted); margin: 14px 0 8px; }
.zi-total { color: var(--text); font-size: 14px; }
.rand-fel { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; border-radius: 6px; padding: 2px 6px; background: #f0fdf4; color: #166534; }
.rand-fel.fel-dat { background: #eff6ff; color: #1d4ed8; }
.rand-fel.fel-sold_noi, .rand-fel.fel-sold_ei { background: #f1f5f9; color: #334155; }
.rand.fel-dat .rand-paleti { color: #1d4ed8; }
.sold-card .btn, .furnizor .furnizor-nume { color: var(--text); }

/* număr scris de mână (runda 2): același aspect mare, dar câmp editabil */
input.numar {
  width: 150px; min-width: 0; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--text);
  font: inherit; font-size: 64px; font-weight: 800; line-height: 1.1; text-align: center; padding: 4px 0; -moz-appearance: textfield;
}
input.numar::-webkit-outer-spin-button, input.numar::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.numar:focus { outline: none; border-color: var(--accent); }
input.numar.invalid { border-color: var(--danger); color: var(--danger); }

/* facturați */
.tab { font-size: 15px; }
.rand-fel.fel-fact_ei, .rand-fel.fel-fact_noi { background: #f5f3ff; color: #6d28d9; }
.furnizor.fact .furnizor-azi { color: var(--muted); }
.form-fact-sold { font-size: 15px; font-weight: 700; }
