/* Oportunități Morami */
:root {
  --ink: #23301f;
  --ink-2: #5b675a;
  --ink-3: #8f9a8b;
  --line: #e1e5dc;
  --line-2: #cfd5c9;
  --bg: #f4f5f1;             /* fond deschis, odihnitor */
  --card: #ffffff;
  --panel: #eef0ea;
  --brand: #2e6b2a;          /* verde Morami */
  --accent: #f59b00;         /* portocaliu Horticola, doar pe acțiunea principală */
  --accent-ink: #7a4b00;
  /* rolurile, tonurile din fișa Word și registrul Excel */
  --asm: #e2efda;  --asm-line: #8fc36f;  --asm-ink: #2f5a1f;
  --dv:  #ddebf7;  --dv-line:  #7fb3e0;  --dv-ink:  #1f4e79;
  --mpmt:#fce4d6;  --mpmt-line:#f2a06c;  --mpmt-ink:#843c0c;
  --danger: #b3261e;
  --radius: 10px;
  --tabs-h: 62px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
}
.hidden { display: none !important; }
a { color: var(--dv-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 1.45rem; font-weight: 650; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 1.4rem 0 .5rem; }
p { margin: .4rem 0; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }

/* antet */
.top {
  position: sticky; top: 0; z-index: 20; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--brand); }
.brand-mark { width: 14px; height: 18px; background: var(--brand); border-radius: 2px 2px 3px 3px; position: relative; }
.brand-mark::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent); border-radius: 2px 2px 0 0; }
.top-right { display: flex; align-items: center; gap: .7rem; font-size: .9rem; }
.whoami { color: var(--ink-2); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.netdot { width: 10px; height: 10px; border-radius: 50%; background: #7ed37e; display: inline-block; }
.netdot.off { background: #c9c9c9; }
.pending {
  background: var(--accent); color: #1e1400; border: 0; border-radius: 999px;
  padding: .15rem .6rem; font-weight: 650; font-size: .85rem; cursor: pointer;
}

/* conținut */
.view { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 1.5rem; }
@media (min-width: 900px) { .view { max-width: 1040px; } }

/* bara de secțiuni */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--line);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--ink-3); font-size: .74rem; font-weight: 600; }
.tabs a.on { color: var(--brand); }
.tabs .tab-ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
@media (min-width: 900px) {
  .tabs { position: sticky; top: 0; bottom: auto; height: auto; grid-template-columns: repeat(4, max-content); justify-content: center; gap: 2rem; padding: 0; border-top: 0; border-bottom: 1px solid var(--line); }
  .tabs a { flex-direction: row; align-items: center; gap: .45rem; padding: .7rem .2rem; font-size: .9rem; border-bottom: 3px solid transparent; }
  .tabs a.on { border-bottom-color: var(--accent); }
  .tabs .tab-ic { width: 18px; height: 18px; }
  body { padding-bottom: 1rem; }
  .top { position: static; }
}
.tabs { background: #fff; }

/* formulare */
.field { display: flex; flex-direction: column; gap: .25rem; margin: 0 0 .85rem; }
.field label { font-size: .84rem; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--ink-3); font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-width: 0; padding: .62rem .7rem; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; min-height: 44px;
  -webkit-appearance: none; appearance: none;
}
input[type=date] { display: block; text-align: left; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b675a' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.2rem; }
.field > * { min-width: 0; }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(46,107,42,.15); }
button:focus-visible, .tabs a:focus-visible { outline: 3px solid rgba(46,107,42,.35); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .8rem; align-items: end; }
.row2 > * { min-width: 0; }
@media (max-width: 480px) { .row2.stack { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: .4rem; }
.checks label { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .9rem; cursor: pointer; }
.checks input { margin: 0; }
.checks label:has(input:checked) { border-color: var(--asm-line); background: var(--asm); color: var(--asm-ink); }
.checks input { accent-color: var(--brand); }

/* secțiunile fișei: banda din stânga spune cine completează, ca în fișa tipărită */
.sec { border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: var(--radius); padding: .9rem 1rem .3rem; margin: 0 0 .9rem; background: var(--card); }
.sec > h2 { margin: 0 0 .8rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sec > h2 .who { font-size: .72rem; font-weight: 650; padding: .15rem .55rem; border-radius: 999px; background: var(--panel); color: var(--ink-2); white-space: nowrap; }
.sec.asm  { border-left-color: var(--asm-line); }
.sec.dv   { border-left-color: var(--dv-line); }
.sec.mpmt { border-left-color: var(--mpmt-line); }
.sec.asm > h2 .who { background: var(--asm); color: var(--asm-ink); } .sec.dv > h2 .who { background: var(--dv); color: var(--dv-ink); } .sec.mpmt > h2 .who { background: var(--mpmt); color: var(--mpmt-ink); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .8rem; color: var(--ink-2); margin: .3rem 0 1rem; }
.legend { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .8rem; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.legend .l-asm::before { background: var(--asm); border: 1px solid var(--asm-line); }
.legend .l-dv::before { background: var(--dv); border: 1px solid var(--dv-line); }
.legend .l-mpmt::before { background: var(--mpmt); border: 1px solid var(--mpmt-line); }

/* butoane */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 650; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1e1400; }
.btn.brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary { box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.btn.danger { color: var(--danger); border-color: #e7b9b6; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }
.actions.sticky { margin-top: .4rem; }

/* registru */
.filters { display: grid; grid-template-columns: 1fr; gap: .5rem; margin: 0 0 1rem; }
@media (min-width: 640px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.filters input, .filters select { min-height: 40px; padding: .4rem .6rem; }
.list { display: grid; gap: .6rem; }
@media (min-width: 900px) { .list { grid-template-columns: 1fr 1fr; } }
.card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .95rem; background: var(--card); }
.card:active { background: var(--panel); }
.card .c-top { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.card .c-client { font-weight: 650; font-size: 1.02rem; }
.card .c-nr { color: var(--ink-3); font-size: .8rem; white-space: nowrap; }
.card .c-meta { color: var(--ink-2); font-size: .86rem; margin-top: .2rem; }
.card .c-foot { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; align-items: center; }
.card .c-val { margin-left: auto; font-weight: 650; }
.card.local { border-style: dashed; border-color: var(--accent); background: #fffaf0; }
.chip { display: inline-block; white-space: nowrap; padding: .12rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--panel); color: var(--ink-2); }
.chip.st-Identificată { background: #eef0ea; } .chip.st-În\ discuție { background: var(--dv); color: var(--dv-ink); }
.chip.st-Ofertată { background: var(--mpmt); color: var(--mpmt-ink); } .chip.st-Câștigată { background: var(--asm); color: var(--asm-ink); }
.chip.st-Pierdută { background: #f3dedd; color: var(--danger); } .chip.st-Amânată { background: #f1ecdc; color: #6b5a1a; }
.chip.warn { background: #fff1d6; color: var(--accent-ink); }
.empty { text-align: center; color: var(--ink-2); padding: 2.5rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); }

/* detaliu fișă */
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: .35rem .8rem; font-size: .95rem; margin-bottom: .6rem; }
.kv dt { color: var(--ink-2); font-size: .84rem; font-weight: 650; }
.kv dd { margin: 0; white-space: pre-wrap; }
.kv dd:empty::before { content: "—"; color: var(--ink-3); }
.hist { font-size: .84rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: .5rem; }
.hist li { margin: .2rem 0; }
.back { display: inline-block; margin-bottom: .6rem; font-size: .9rem; }

/* sinteză */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .6rem 0 1rem; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem; background: var(--card); }
.stat b { display: block; font-size: 1.5rem; font-weight: 650; letter-spacing: -.02em; }
.stat span { font-size: .8rem; color: var(--ink-2); }
.stat.dv { background: var(--dv); border-color: var(--dv-line); } .stat.mpmt { background: var(--mpmt); border-color: var(--mpmt-line); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; margin: .3rem 0 1rem; }
table.t th, table.t td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
table.t td:last-child, table.t th:last-child { text-align: right; }
table.t th { font-size: .8rem; color: var(--ink-2); font-weight: 650; }

/* login */
.login { max-width: 380px; margin: 8vh auto 0; }
.login h1 { font-size: 1.6rem; }
.notice { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; font-size: .92rem; }
.notice.warn { background: #fff1d6; color: var(--accent-ink); }
.notice.err { background: #f8e3e1; color: var(--danger); }

/* admin */
.urow { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.urow .u-n { font-weight: 650; } .urow .u-m { font-size: .84rem; color: var(--ink-2); }
.urow.inactive { opacity: .5; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 999px; font-size: .92rem; max-width: 92vw; text-align: center; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* registru: carduri pe telefon, tabel pe desktop */
.only-desktop { display: none; }
@media (min-width: 900px) {
  .only-desktop { display: block; }
  .list.only-mobile { display: none; }
  .view.wide { max-width: 1400px; }
}
table.reg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: .9rem; }
table.reg th { background: var(--panel); position: sticky; top: 0; white-space: nowrap; padding: .55rem .6rem; }
table.reg td { padding: .65rem .6rem; vertical-align: middle; border-bottom: 1px solid var(--line); }
table.reg th { vertical-align: middle; }
table.reg tr:last-child td { border-bottom: 0; }
table.reg tbody tr { cursor: pointer; }
table.reg tbody tr:hover td { background: #f8f9f5; }
table.reg tbody tr:focus-visible { outline: 3px solid rgba(46,107,42,.35); outline-offset: -3px; }
table.reg td:last-child, table.reg th:last-child, table.reg .num { text-align: right; white-space: nowrap; }
table.reg .sub { color: var(--ink-2); font-size: .8rem; }
table.reg .wrap { max-width: 22rem; }
table.reg .late { color: var(--danger); font-weight: 650; }

/* sinteză */
.titlebar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.stat.good { background: var(--asm); border-color: var(--asm-line); }
.grid3 { display: grid; grid-template-columns: 1fr; gap: .7rem; margin: .8rem 0; }
@media (min-width: 720px) { .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .95rem; min-width: 0; }
.panel h3 { margin: 0 0 .6rem; font-size: .95rem; font-weight: 650; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.panel h3 b { font-size: 1.25rem; }
.panel.dv { border-left: 5px solid var(--dv-line); } .panel.mpmt { border-left: 5px solid var(--mpmt-line); } .panel.late { border-left: 5px solid #e3a5a1; }
.panel.late h3 b { color: var(--danger); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(40px, 1fr) 2ch auto; gap: .5rem; align-items: center; font-size: .88rem; padding: .22rem 0; }
.bar-row.zero { color: var(--ink-3); }
.bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; background: var(--panel); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar-row.zero .bar i { display: none; }
.bar-n { text-align: right; font-weight: 650; }
.bar-v { color: var(--ink-2); font-size: .8rem; min-width: 5.5ch; text-align: right; }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { padding: .25rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mini li:last-child { border-bottom: 0; }
.mini a { color: var(--ink); font-weight: 600; text-decoration: none; }