/* Emerald Company — Control Operațional
   Mobil întâi: oamenii completează de pe telefon, în picioare, cu o mână. */

:root {
  --bg: #0f1512;
  --surface: #18201c;
  --surface-2: #1f2a24;
  --line: #2b3a32;
  --text: #e8f0eb;
  --muted: #93a89c;
  --brand: #10b981;
  --brand-dim: #0d8f68;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --tap: 52px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ───────────────────────────────────────────── structură */
.wrap { max-width: 780px; margin: 0 auto; padding: 12px 14px 90px; }
.wrap-narrow { max-width: 520px; margin: 0 auto; padding: 24px 16px 60px; }
.wrap-wide { max-width: 1240px; margin: 0 auto; padding: 12px 16px 60px; }

header.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, #141c18 0%, #131b17 100%);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.topbar .brand { font-weight: 700; letter-spacing: .3px; }
.topbar .brand span { color: var(--brand); }
.topbar .who { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); line-height: 1.3; }
.topbar .who b { display: block; color: var(--text); font-size: 13px; }

nav.tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface);
  scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a {
  white-space: nowrap; padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 500;
}
nav.tabs a.active { background: var(--brand); color: #06120d; }

h1 { font-size: 22px; margin: 18px 0 6px; }
h2 { font-size: 17px; margin: 26px 0 10px; color: var(--text); }
h3 { font-size: 14px; margin: 20px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
p.lead { color: var(--muted); margin-top: 0; }

/* ───────────────────────────────────────────── carduri */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.card.tight { padding: 10px 12px; }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-row .grow { flex: 1; min-width: 0; }
.card h4 { margin: 0 0 4px; font-size: 15px; }
.card .sub { color: var(--muted); font-size: 13px; }

.tile-list a.tile {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
  color: var(--text); text-decoration: none;
}
.tile-list a.tile:active { background: var(--surface-2); }
.tile .icon {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px;
  background: var(--surface-2); display: grid; place-items: center; font-size: 20px;
}
.tile .grow { flex: 1; min-width: 0; }
.tile .title { font-weight: 600; font-size: 15px; }
.tile .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tile .chev { color: var(--muted); font-size: 20px; }

/* ───────────────────────────────────────────── etichete de stare */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .2px; white-space: nowrap;
}
.badge.ok    { background: rgba(52,211,153,.16); color: var(--ok); }
.badge.warn  { background: rgba(251,191,36,.16); color: var(--warn); }
.badge.bad   { background: rgba(248,113,113,.16); color: var(--bad); }
.badge.grey  { background: var(--surface-2); color: var(--muted); }
.badge.brand { background: rgba(16,185,129,.18); color: var(--brand); }

.alert { padding: 12px 14px; border-radius: 12px; margin: 12px 0; font-size: 14.5px; border: 1px solid; }
.alert.ok   { background: rgba(52,211,153,.10); border-color: rgba(52,211,153,.35); color: #b8f0d8; }
.alert.warn { background: rgba(251,191,36,.10); border-color: rgba(251,191,36,.35); color: #f7e0aa; }
.alert.bad  { background: rgba(248,113,113,.10); border-color: rgba(248,113,113,.35); color: #f7c3c3; }
.alert.info { background: var(--surface-2); border-color: var(--line); color: var(--muted); }

/* ───────────────────────────────────────────── formulare */
label { display: block; margin: 14px 0 0; font-size: 14px; color: var(--muted); }
label small { display: block; margin-top: 4px; font-size: 12px; color: #7d8f86; }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=tel], select, textarea {
  width: 100%; margin-top: 6px; padding: 12px 13px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 11px; color: var(--text); font-size: 16px; font-family: inherit;
  min-height: var(--tap);
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-dim); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 13px 20px; border: 0; border-radius: 12px;
  background: var(--brand); color: #05130d; font-weight: 700; font-size: 15.5px;
  cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); color: #2a0a0a; }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: 13.5px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-row .btn { flex: 1; }

/* ───────────────────────────────────────────── ecranul de completare */
.progress-bar { height: 5px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 10px 0 4px; }
.progress-bar i { display: block; height: 100%; background: var(--brand); transition: width .25s ease; }
.progress-txt { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }

.step { display: none; }
.step.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step .section-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--brand); margin-bottom: 8px;
}
.step .q { font-size: 20px; font-weight: 650; line-height: 1.35; margin: 0 0 8px; }
.step .help { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.step .surprise-tag {
  display: inline-block; background: rgba(251,191,36,.16); color: var(--warn);
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}

.yn { display: flex; gap: 10px; margin: 6px 0 4px; }
.yn button {
  flex: 1; min-height: 62px; border-radius: 13px; font-size: 16px; font-weight: 700;
  border: 2px solid var(--line); background: var(--surface-2); color: var(--text);
  cursor: pointer; font-family: inherit;
}
.yn button.sel-ok  { border-color: var(--ok);  background: rgba(52,211,153,.16);  color: var(--ok); }
.yn button.sel-nok { border-color: var(--bad); background: rgba(248,113,113,.16); color: var(--bad); }

.photo-slot {
  border: 2px dashed var(--line); border-radius: 13px; padding: 18px;
  text-align: center; color: var(--muted); margin: 12px 0; cursor: pointer;
  background: var(--surface-2);
}
.photo-slot.filled { border-style: solid; border-color: var(--brand-dim); padding: 8px; }
.photo-slot .cam { font-size: 30px; display: block; margin-bottom: 6px; }
.photo-slot img { width: 100%; border-radius: 9px; display: block; }
.photo-slot .again { font-size: 13px; margin-top: 8px; color: var(--brand); }
.photo-required { color: var(--warn); font-size: 13px; margin-top: -4px; }

.uploading { font-size: 13.5px; color: var(--warn); margin-top: 8px; }

.nav-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: linear-gradient(180deg, rgba(15,21,18,.7), var(--bg) 40%);
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; border-top: 1px solid var(--line);
}
.nav-bottom .btn { flex: 1; }
.nav-bottom .btn.back { flex: 0 0 88px; }

/* ───────────────────────────────────────────── tabele (desktop) */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.grid th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
table.grid tr:hover td { background: var(--surface); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); }
.table-scroll table.grid th:first-child, .table-scroll table.grid td:first-child { padding-left: 14px; }

.matrix td.cell { text-align: center; padding: 6px 4px; }
.dot { display: inline-block; width: 26px; height: 26px; line-height: 26px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.dot.done { background: rgba(52,211,153,.18); color: var(--ok); }
.dot.late { background: rgba(251,191,36,.18); color: var(--warn); }
.dot.miss { background: rgba(248,113,113,.14); color: var(--bad); }
.dot.na   { background: var(--surface-2); color: #4d5c54; }

/* ───────────────────────────────────────────── galerie poze */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photo-grid a { display: block; position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-grid img { width: 100%; height: 120px; object-fit: cover; display: block; }
.photo-grid .flag {
  position: absolute; top: 5px; right: 5px; background: rgba(248,113,113,.92);
  color: #2a0a0a; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
}

.answer-line { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.answer-line:last-child { border-bottom: 0; }
.answer-line .st { flex: 0 0 26px; font-size: 16px; text-align: center; }
.answer-line .txt { flex: 1; min-width: 0; }
.answer-line .txt .lbl { font-size: 14.5px; }
.answer-line .txt .val { font-size: 13px; color: var(--muted); margin-top: 2px; }
.answer-line .thumb img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; }
.kpi .n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.kpi .l { font-size: 12px; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .4px; }
.kpi.ok .n { color: var(--ok); }
.kpi.warn .n { color: var(--warn); }
.kpi.bad .n { color: var(--bad); }

ul.checks { list-style: none; padding: 0; }
ul.checks li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
ul.checks li.ok { color: var(--ok); }
ul.checks li.bad { color: var(--bad); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.nowrap { white-space: nowrap; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { margin: 0; flex: 1 1 150px; }
.filters .btn { margin-top: 0; }

body.plain { background: var(--bg); }

/* login */
.login-logo { text-align: center; margin: 40px 0 26px; }
.login-logo .mark { font-size: 40px; }
.login-logo h1 { font-size: 24px; margin: 10px 0 2px; }
.login-logo p { color: var(--muted); margin: 0; font-size: 14px; }
.pin-input { letter-spacing: 8px; font-size: 22px; text-align: center; }

@media (min-width: 760px) {
  .yn button { min-height: 56px; }
  .step .q { font-size: 22px; }
}
@media print {
  body { background: #fff; color: #000; }
  header.topbar, nav.tabs, .nav-bottom, .btn { display: none !important; }
  .card { border-color: #ccc; }
}

/* ── modulul Bani ────────────────────────────────────────────── */
.bani-row { display: flex; gap: 12px; flex-wrap: wrap; }
.bani-row > label { flex: 1 1 190px; margin: 0; }
.bani-calc { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; }
.bani-calc .r { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; font-size: 15px; }
.bani-calc .sep { border-top: 1px solid var(--line); margin: 6px 0; }

/* ── Banda de mod test ──────────────────────────────────────────────────────
   Dungi galbene, lățime întreagă, fără buton de închidere. Adminul completează
   checklist-uri de probă ca să vadă ce simt oamenii din locație; singura greșeală
   scumpă e să nu-ți dai seama în ce mod ești. */
.testbar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  font-size: 13px; font-weight: 700; letter-spacing: .3px;
  color: #1a1400;
  background: repeating-linear-gradient(
    135deg, var(--warn), var(--warn) 14px, #e0a800 14px, #e0a800 28px);
}
.testbar span { flex: 1; min-width: 0; }
.testbar a {
  flex: none; padding: 5px 12px; border-radius: 999px;
  background: rgba(0,0,0,.72); color: #ffe9a3; font-weight: 600; font-size: 12px;
}
