/* Turnkey · powered by Eva Build — design system (mobile-first) */
:root {
  --navy: #1B1464;
  --navy-2: #2A2080;
  --red: #E30613;
  --bg: #F4F5F9;
  --card: #FFFFFF;
  --text: #1C1D26;
  --muted: #6A6E80;
  --line: #E4E6EE;
  --ok: #0F6E56;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(27, 20, 100, .08), 0 4px 14px rgba(27, 20, 100, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; padding-bottom: 76px; /* loc pt bara de jos */
}

/* ===== Header ===== */
header {
  background: var(--navy); color: #fff;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
header .brand { display: flex; flex-direction: column; line-height: 1.1; }
header .brand b { font-size: 19px; letter-spacing: 2px; }
header .brand span { font-size: 10.5px; opacity: .75; }
header .proiect {
  margin-left: auto; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 12.5px; padding: 6px 12px; border-radius: 99px; white-space: nowrap;
  font-family: inherit; cursor: pointer;
}
header .proiect:active { transform: scale(.97); }
header .logo-dot { width: 34px; height: 34px; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; }
header .logo-dot img { width: 28px; height: 28px; object-fit: contain; }

/* ===== Navigație jos (mobile-first) ===== */
nav.bara {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 6px 0 calc(10px + env(safe-area-inset-bottom, 0px)); /* nu intră sub home indicator pe iPhone */
  box-shadow: 0 -4px 16px rgba(27,20,100,.07);
}
nav.bara a {
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 18px; border-radius: 12px; min-width: 84px;
}
nav.bara a .ic { font-size: 21px; }
nav.bara a.activ { color: var(--navy); background: #EEEDFB; }

/* ===== Conținut ===== */
main { padding: 16px; max-width: 1080px; margin: 0 auto; }
h2.titlu { font-size: 20px; color: var(--navy); margin: 4px 0 14px; }
.sub { color: var(--muted); font-size: 13px; }

/* ===== Carduri KPI ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 720px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  border-left: 4px solid var(--navy);
}
.kpi .val { font-size: 27px; font-weight: 800; color: var(--navy); }
.kpi .et { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.kpi.rosu { border-left-color: var(--red); } .kpi.rosu .val { color: var(--red); }
.kpi.verde { border-left-color: var(--ok); } .kpi.verde .val { color: var(--ok); }

/* ===== Card generic ===== */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3 { font-size: 14.5px; color: var(--navy); margin-bottom: 12px; letter-spacing: .2px; }

/* ===== Funnel ===== */
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.funnel-row .fr-et { flex: 0 0 132px; font-size: 12.5px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.funnel-row .fr-bara { flex: 1; height: 22px; background: #EFF0F6; border-radius: 7px; overflow: hidden; }
.funnel-row .fr-fill { height: 100%; border-radius: 7px; min-width: 2px; transition: width .5s; }
.funnel-row .fr-n { flex: 0 0 44px; text-align: right; font-weight: 800; font-size: 14px; }

/* ===== Progres per corp ===== */
.corp-row { margin-bottom: 12px; }
.corp-row .cr-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.corp-row .cr-top .pct { color: var(--ok); }
.corp-bara { height: 14px; background: #EFF0F6; border-radius: 7px; overflow: hidden; }
.corp-fill { height: 100%; background: linear-gradient(90deg, #1D9E75, #0F6E56); border-radius: 7px; min-width: 2px; }

/* ===== Aging ===== */
.aging-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 4px;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; flex-wrap: wrap;
}
.aging-item:last-child { border-bottom: 0; }
.aging-item .zile { font-weight: 800; color: var(--red); font-size: 15px; flex: 0 0 66px; }
.aging-item .cine { margin-left: auto; }
.aging-item .aging-sub { flex: 0 0 100%; font-size: 11.5px; font-weight: 700; color: var(--red); padding-left: 76px; }

/* ===== Badge de stare ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap;
}

/* ===== Lista apartamente ===== */
.filtre { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; scrollbar-width: none; }
.filtre::-webkit-scrollbar { display: none; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--muted);
  font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 99px; cursor: pointer; white-space: nowrap;
}
.chip.activ { background: var(--navy); border-color: var(--navy); color: #fff; }
.cauta {
  width: 100%; padding: 12px 14px; font-size: 15px; border: 1.5px solid var(--line);
  border-radius: 12px; margin-bottom: 10px; background: var(--card); outline: none;
}
.cauta:focus { border-color: var(--navy); }
.ap-item {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow);
  text-decoration: none; color: inherit; border-left: 4px solid transparent;
}
.ap-item .cod { font-weight: 800; font-size: 15.5px; color: var(--navy); flex: 0 0 74px; }
.ap-item .det { font-size: 12px; color: var(--muted); flex: 1; }
.ap-item .badge { margin-left: auto; }
.numar-rez { font-size: 12.5px; color: var(--muted); margin: 4px 2px 10px; }

/* ===== Fișa apartamentului ===== */
.fisa-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.fisa-head .cod-mare { font-size: 30px; font-weight: 900; color: var(--navy); }
.inapoi { text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 700; display: inline-block; margin-bottom: 10px; }
.stare-panou { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.stare-panou .sp-nume { font-size: 17px; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.stare-panou .sp-desc { font-size: 13px; margin-top: 4px; opacity: .85; }
.stare-panou .sp-zile { font-size: 12.5px; font-weight: 700; margin-top: 6px; }
.actiuni { display: flex; flex-direction: column; gap: 10px; }
.btn {
  border: 0; border-radius: 12px; padding: 15px 16px; font-size: 15px; font-weight: 700;
  cursor: pointer; text-align: left; width: 100%;
  background: var(--navy); color: #fff; box-shadow: var(--shadow);
}
.btn.secundar { background: #EEEDFB; color: var(--navy); }
.btn.rosu { background: #FCEBEB; color: var(--red); border: 1.5px solid #F7C1C1; }
.card.pericol { border: 1.5px solid #F7C1C1; }
.card.pericol h3 { color: var(--red); }
.btn.discret { background: transparent; color: var(--muted); box-shadow: none; font-size: 13px; padding: 8px 4px; }
.btn:active { transform: scale(.985); }
.detalii-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detalii-grid .dg { font-size: 13px; }
.detalii-grid .dg b { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }

/* ===== Timeline istoric ===== */
.tl { list-style: none; }
.tl li { position: relative; padding: 0 0 16px 26px; border-left: 2px solid var(--line); margin-left: 8px; }
.tl li:last-child { padding-bottom: 2px; border-left-color: transparent; }
.tl li::before {
  content: ''; position: absolute; left: -7px; top: 1px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--navy); border: 2.5px solid #fff; box-shadow: 0 0 0 1.5px var(--line);
}
.tl .tl-ce { font-size: 13.5px; font-weight: 700; }
.tl .tl-cand { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tl .tl-nota { font-size: 12.5px; margin-top: 3px; background: #F6F7FB; border-radius: 8px; padding: 6px 10px; }

/* ===== Setări ===== */
.camp { margin-bottom: 14px; }
.camp label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.camp input {
  width: 100%; padding: 12px 14px; font-size: 15px; border: 1.5px solid var(--line);
  border-radius: 12px; outline: none; background: #fff;
}

/* ===== Dialog tranziție ===== */
dialog {
  border: 0; border-radius: 16px; padding: 20px; width: min(92vw, 420px);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(27,20,100,.35); }
dialog h4 { color: var(--navy); font-size: 16px; margin-bottom: 10px; }
dialog textarea {
  width: 100%; min-height: 76px; padding: 10px 12px; font-size: 14px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 10px; outline: none; resize: vertical; margin-bottom: 12px;
}
dialog .d-btns { display: flex; gap: 10px; }
dialog .d-btns .btn { flex: 1; text-align: center; }

/* ===== Elemente apăsabile în dashboard ===== */
.apasabil { cursor: pointer; }
.apasabil:active { transform: scale(.985); }
.kpi .mini { font-size: 10.5px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.sub.vedere { margin: -8px 0 12px; }
.sub.hint { margin-bottom: 10px; }
.btn-ghid {
  border: 1.5px solid var(--line); background: #fff; color: var(--navy);
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; cursor: pointer;
  margin-left: 8px; vertical-align: middle;
}

/* ===== Explicația din dialog ===== */
.dlg-explic {
  font-size: 12.5px; color: var(--muted); background: #F6F7FB;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; line-height: 1.4;
}

/* ===== Sertarul-ghid (bottom sheet) ===== */
dialog.sheet {
  width: 100vw; max-width: 100vw; margin: 0; padding: 0;
  position: fixed; bottom: 0; top: auto; left: 0; right: 0;
  border-radius: 20px 20px 0 0; max-height: 78vh; overflow: hidden;
}
dialog.sheet .sheet-corp { padding: 18px 18px calc(26px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; max-height: 78vh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h4 { color: var(--navy); font-size: 16px; }
.sheet-inchide {
  border: 0; background: #EFF0F6; color: var(--muted); font-size: 15px; font-weight: 700;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
}
.ghid-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ghid-item:last-child { border-bottom: 0; }
.gi-titlu { font-size: 14px; font-weight: 800; margin-bottom: 3px; }
.gi-desc { font-size: 13px; color: var(--text); line-height: 1.45; }
@media (min-width: 720px) {
  dialog.sheet { max-width: 520px; left: 50%; transform: translateX(-50%); border-radius: 20px; bottom: 24px; }
}

/* ===== Toast ===== */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 20px; border-radius: 99px; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 100; max-width: 88vw; text-align: center;
}
#toast.arata { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Footer semnătură (nedetașabilă) ===== */
.powered { text-align: center; font-size: 11px; color: var(--muted); padding: 18px 0 6px; }
.powered b { color: var(--red); }

@media (min-width: 900px) {
  nav.bara { position: sticky; top: 58px; bottom: auto; justify-content: flex-start; gap: 6px; padding: 8px 16px; }
  body { padding-bottom: 20px; }
  #toast { bottom: 30px; }
}
