/* 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; }
