:root {
  --navy: #0b1530;
  --navy-2: #111f42;
  --navy-3: #1a2b57;
  --navy-line: #24376a;
  --bg: #eef2f9;
  --card: #ffffff;
  --line: #e3e8f2;
  --text: #0f1b33;
  --muted: #5d6b86;
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --blue-soft: #e8efff;
  --green: #16a34a;
  --green-soft: #e3f7ea;
  --orange: #d97706;
  --orange-soft: #fff3df;
  --purple: #7c3aed;
  --purple-soft: #f1eaff;
  --red: #dc2626;
  --red-soft: #fde8e8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 51, .06), 0 6px 18px rgba(15, 27, 51, .06);
  --dock-w: 360px;
  --side-w: 236px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--navy); font-size: 15px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr var(--dock-w); height: 100vh; }
.sidebar { background: var(--navy); color: #c9d4ee; display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 19px; padding: 4px 6px; }
.brand small { display: block; font-size: 11.5px; color: #8fa0c7; letter-spacing: .02em; }
.logo { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); display: grid; place-items: center; color: #fff; }
.logo .ic { width: 24px; height: 24px; }
#nav { display: flex; flex-direction: column; gap: 4px; }
#nav a em { display: none; font-style: normal; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #c9d4ee; font-weight: 500; }
#nav a:hover { background: var(--navy-2); color: #fff; }
#nav a.active { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
.side-voice { margin-top: auto; display: flex; gap: 12px; align-items: center; text-align: left; background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: var(--radius); padding: 12px; color: #fff; cursor: pointer; }
.side-voice small { display: block; color: #8fa0c7; font-size: 12px; }
.side-voice.live { border-color: #22c55e; background: #0f2a2a; }
.side-voice.live small { color: #86efac; }
.mic-dot { width: 40px; height: 40px; border-radius: 50%; background: var(--navy-3); display: grid; place-items: center; }
.side-voice.live .mic-dot { background: #16a34a; }

.workspace { background: var(--bg); display: flex; flex-direction: column; min-width: 0; border-radius: 18px 0 0 18px; overflow: hidden; }
.topbar { display: flex; gap: 12px; align-items: center; padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; max-width: 620px; color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; padding: 10px 0; outline: none; color: var(--text); }
.search:focus-within { border-color: var(--blue); background: #fff; }
.ai-toggle { display: none; }
main { flex: 1; overflow: auto; padding: 24px; outline: none; }

/* ---------- Componente ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: #c5cfe2; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 11px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 8px; cursor: pointer; color: inherit; display: inline-grid; place-items: center; }
.icon-btn:hover { background: rgba(127, 140, 170, .15); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 17px; }
h1 { font-size: 24px; margin: 0 0 4px; }
.page-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; } /* tabelele lungi derulează în card, nu lățesc pagina */
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.stat { display: flex; gap: 14px; align-items: center; }
.stat .bubble { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat b { font-size: 24px; display: block; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13.5px; }
.b-blue { background: var(--blue-soft); color: var(--blue); }
.b-green { background: var(--green-soft); color: var(--green); }
.b-orange { background: var(--orange-soft); color: var(--orange); }
.b-purple { background: var(--purple-soft); color: var(--purple); }
.two { grid-template-columns: minmax(0, 1fr) 260px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; padding: 16px 8px; font-weight: 600; font-size: 13.5px; text-align: center; }
.quick .ic { width: 26px; height: 26px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { border: 1px solid var(--line); background: #fff; padding: 6px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }

table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.list td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tr.click { cursor: pointer; }
.list tr.click:hover td { background: #f6f8fd; }
.list .num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st-primit { background: #eef1f6; color: #475569; }
.st-lucru { background: var(--orange-soft); color: #b45309; }
.st-piese { background: var(--purple-soft); color: var(--purple); }
.st-gata { background: var(--green-soft); color: #15803d; }
.st-predat { background: var(--blue-soft); color: var(--blue-2); }
.st-rau { background: var(--red-soft); color: var(--red); }

.progress { height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; width: 70px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.progress i { display: block; height: 100%; background: var(--green); }

/* Detalii fișă */
.detail-head { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: start; }
.detail-head .who { display: flex; gap: 12px; }
.detail-head .who > .ic { width: 34px; height: 34px; color: var(--blue); }
.kv .ic { width: 15px; height: 15px; vertical-align: -2px; }
.detail-head b { font-size: 16.5px; }
.kv { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.totals { display: grid; grid-template-columns: auto auto; gap: 4px 20px; background: #f6f8fd; border-radius: 12px; padding: 14px 16px; min-width: 230px; align-self: start; }
.totals span:nth-child(even) { text-align: right; font-weight: 600; }
.totals .big { font-size: 17px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 6px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
.history li { margin-bottom: 8px; }
.history small { color: var(--muted); }
.tag-voce { font-size: 11px; background: var(--purple-soft); color: var(--purple); padding: 1px 7px; border-radius: 999px; font-weight: 700; }

/* Formulare */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
/* În formulare: căsuțele de pe același rând stau pe aceeași linie, chiar dacă eticheta are două rânduri */
.form-grid > label:not(.check-line) { justify-content: flex-end; }
.form-grid > label > small { font-weight: 400; line-height: 1.35; }
input, select, textarea { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; font-weight: 400; color: var(--text); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
textarea { resize: vertical; min-height: 64px; }
.wide { grid-column: 1 / -1; }
.edit-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.edit-table th { font-size: 12px; color: var(--muted); text-align: left; padding: 4px; }
.edit-table input, .edit-table select { width: 100%; padding: 7px 8px; }
.edit-table .n { width: 34px; color: var(--muted); padding-top: 14px; }
.section { margin-top: 16px; }
.sticky-actions { position: sticky; bottom: -24px; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 20px; display: flex; gap: 10px; justify-content: flex-end; }
.client-pick { position: relative; }
.suggest { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 240px; overflow: auto; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; cursor: pointer; }
.suggest button:hover { background: var(--blue-soft); }
.chosen { display: flex; justify-content: space-between; align-items: center; background: var(--blue-soft); border-radius: 10px; padding: 10px 12px; }

/* ---------- Asistent AI ---------- */
.dock { background: var(--navy); color: #e4eaf8; display: flex; flex-direction: column; border-left: 1px solid var(--navy-line); min-height: 0; }
.dock-head { display: flex; gap: 12px; align-items: center; padding: 18px; border-bottom: 1px solid var(--navy-line); }
.dock-head b { font-size: 16.5px; }
.dock-head small { display: flex; align-items: center; gap: 6px; color: #8fa0c7; }
.bot-face { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #3b82f6, #1e3a8a); display: grid; place-items: center; color: #fff; box-shadow: 0 0 0 4px rgba(59, 130, 246, .2); }
.bot-face .ic { width: 26px; height: 26px; }
.close-dock { margin-left: auto; display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #22c55e; }
.dot.off { background: #64748b; }
.dot.wait { background: #f59e0b; }
.dock-log { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 13px; border-radius: 12px; max-width: 92%; font-size: 14px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--navy-3); }
.msg.ai { align-self: flex-start; background: #15265a; border: 1px solid var(--navy-line); }
.msg.sys { align-self: center; background: transparent; color: #8fa0c7; font-size: 12.5px; text-align: center; }
.msg.tool { align-self: flex-start; background: transparent; color: #8fa0c7; font-size: 12.5px; padding: 2px 4px; }
.msg.err { align-self: stretch; background: #3b1620; color: #fecaca; }
.dock-intro { color: #8fa0c7; font-size: 13.5px; }
.dock-intro ul { padding-left: 18px; margin: 8px 0; }
#dock-pending:empty { display: none; }
.pending { margin: 0 14px 10px; background: #f8fafc; color: var(--text); border-radius: 12px; padding: 14px; max-height: 45vh; overflow: auto; }
.pending h4 { margin: 0 0 8px; font-size: 14.5px; }
.pending ul { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; }
.pending .old { color: var(--red); text-decoration: line-through; }
.pending .new { color: var(--green); font-weight: 600; }
.dock-type { display: flex; gap: 8px; padding: 0 14px 10px; }
.dock-type input { flex: 1; background: var(--navy-2); border-color: var(--navy-line); color: #fff; }
.dock-type input::placeholder { color: #8fa0c7; }
.dock-foot { padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; border-top: 1px solid var(--navy-line); }
.mic-big { width: 74px; height: 74px; border-radius: 50%; border: 2px solid #3b82f6; background: radial-gradient(circle, #1e3a8a, #0b1530); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 8px rgba(59, 130, 246, .12); transition: transform .15s; }
.mic-big .ic { width: 32px; height: 32px; }
.mic-big:hover { transform: scale(1.04); }
.mic-big.live { border-color: #22c55e; background: radial-gradient(circle, #15803d, #0b1530); animation: pulse 1.6s infinite; }
.mic-big.connecting { border-color: #f59e0b; }
.mic-big.muted { border-color: #64748b; background: #1e293b; animation: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 6px rgba(34, 197, 94, .18); } 50% { box-shadow: 0 0 0 14px rgba(34, 197, 94, .06); } }
.mic-label { font-size: 13px; color: #8fa0c7; text-align: center; }
.ghost-dark { background: transparent; color: #c9d4ee; border-color: var(--navy-line); }

/* Notificări + dialog */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: #0f1b33; color: #fff; padding: 11px 18px; border-radius: 10px; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--red); }
dialog { border: 0; border-radius: var(--radius); padding: 20px; max-width: 420px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(11, 21, 48, .5); }
.login { position: fixed; inset: 0; background: var(--navy); display: grid; place-items: center; z-index: 40; }
.login form { width: min(340px, 90vw); display: flex; flex-direction: column; gap: 14px; }
.err { color: var(--red); margin: 0; min-height: 1em; }

/* ---------- Deviz printabil ---------- */
.doc { background: #fff; max-width: 820px; margin: 0 auto; padding: 36px 40px; box-shadow: var(--shadow); color: #111; }
.doc h1 { font-size: 22px; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.doc th, .doc td { border: 1px solid #cfd6e3; padding: 6px 8px; text-align: left; }
.doc .num { text-align: right; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 14px; }
.doc .sign { display: flex; justify-content: space-between; margin-top: 50px; }
.doc .sign div { border-top: 1px solid #111; padding-top: 4px; width: 40%; font-size: 13px; }
.doc .note { font-size: 12px; color: #555; }
.doc .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 10px; font-size: 14px; }
.doc .parties h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; color: #555; letter-spacing: .04em; }
.doc .inv-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; margin-left: auto; width: min(360px, 100%); font-size: 14px; }
.doc .inv-totals b { text-align: right; }
.doc .inv-totals .big { font-size: 16px; font-weight: 800; border-top: 1px solid #111; padding-top: 4px; }
@media (max-width: 680px) { .doc .parties { grid-template-columns: 1fr; } }
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .dock, .no-print, #toast, .fab, #install-bar, .suggest-float, .cmd-bar { display: none !important; }
  .app { display: block; height: auto; }
  .workspace { border-radius: 0; overflow: visible; background: #fff; }
  main { padding: 0; overflow: visible; }
  .doc { box-shadow: none; padding: 0; max-width: none; }
}

/* ---------- Ecrane mai mici ---------- */
@media (max-width: 1280px) {
  .app { grid-template-columns: 76px 1fr var(--dock-w); }
  .brand span:last-child, #nav a span, .side-voice span:last-child { display: none; }
  .brand, #nav a, .side-voice { justify-content: center; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .app { grid-template-columns: 76px 1fr; }
  .dock { position: fixed; right: 0; top: 0; bottom: 0; width: min(var(--dock-w), 100vw); transform: translateX(100%); transition: transform .2s; z-index: 30; }
  .app.dock-open .dock { transform: none; box-shadow: -10px 0 30px rgba(0, 0, 0, .3); }
  .ai-toggle, .close-dock { display: inline-grid; }
  .two, .detail-head, .split { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; height: 100dvh; }
  .sidebar { order: 2; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
  .dock { width: 100vw; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  input, select, textarea { font-size: 16px; } /* iPhone nu mai face zoom la atingerea câmpurilor */
  .app { grid-template-columns: minmax(0, 1fr); }
  #nav a { font-size: 10.5px; padding: 6px 2px; min-width: 0; flex: 1; align-items: center; }
  #nav a span { display: none !important; }
  #nav a em { display: block; white-space: nowrap; }
  .side-voice { display: none; } /* pe telefon, asistentul se deschide din butonul din dreapta sus */
  .stat { gap: 10px; }
  .stat .bubble { width: 36px; height: 36px; }
  .stat .bubble .ic { width: 18px; height: 18px; }
  .stat b { font-size: 17px; }
  .stat span, .stat small { font-size: 12px; }
  .period-tabs .range { margin-left: 0; width: 100%; }
  .period-tabs .range input { flex: 1; min-width: 0; }
  .brand { display: none; }
  #nav { flex-direction: row; flex: 1; justify-content: space-around; gap: 0; min-width: 0; }
  #nav a { flex-direction: column; gap: 2px; padding: 6px 1px; font-size: 10.5px; min-width: 0; flex: 1; }
  #nav a span { display: block; }
  .side-voice { margin: 0; padding: 6px; border: 0; background: transparent; }
  .workspace { border-radius: 0; }
  .topbar { padding: 10px 12px; }
  .topbar .btn.primary span { display: none; }
  main { padding: 16px; }
  .stats { gap: 10px; }
  .stat b { font-size: 20px; }
  .card { padding: 14px; }
  .list .hide-m { display: none; }
  .doc { padding: 18px; }
}
.two-eq { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.pick-list { max-height: 50vh; overflow: auto; margin: 12px 0; display: flex; flex-direction: column; gap: 4px; }
.pick-list button { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.pick-list button:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); }
.pick-list button:disabled { opacity: .5; cursor: not-allowed; }
.tag-stoc { font-size: 11px; background: var(--blue-soft); color: var(--blue-2); padding: 1px 7px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.low-list { list-style: none; padding: 0; margin: 6px 0; font-size: 14px; }
.low-list li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }
.section h3 { display: flex; gap: 6px; align-items: center; font-size: 15px; margin: 0; }
@media (max-width: 1000px) { .two-eq { grid-template-columns: 1fr; } }
.stock-warn { background: var(--red-soft); color: #991b1b; padding: 10px 12px; border-radius: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chart { position: relative; margin-top: 8px; }
.chart .bar { fill: #2a78d6; }
.chart .grid-line { stroke: #e7eaf0; stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit.on { fill: rgba(42, 120, 214, .07); }
.chart-tip { position: absolute; top: 0; width: 150px; background: #0f1b33; color: #fff; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; pointer-events: none; }
.period-tabs { align-items: center; }
.period-tabs .range { gap: 6px; margin-left: auto; }
.period-tabs .range input { padding: 6px 8px; }
.sum-row td { border-top: 2px solid var(--line); }
.stat-link { color: inherit; display: block; }
.stat-link .card:hover { box-shadow: 0 0 0 2px var(--orange-soft), var(--shadow); }
.debt-card { border-left: 4px solid var(--red); }
.debt-table td { vertical-align: top; }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.theme-opt { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px; cursor: pointer; display: grid; gap: 4px; color: var(--text); }
.theme-opt.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.theme-opt small { color: var(--muted); }
.sw { display: flex; height: 46px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 4px; }
.sw i:first-child { width: 30%; } .sw i:last-child { flex: 1; }
.sw-clasic i:first-child { background: #0b1530; } .sw-clasic i:last-child { background: linear-gradient(#eef2f9 60%, #2563eb 60% 70%, #eef2f9 70%); }
.sw-aerisit i:first-child { background: #ffffff; border-right: 1px solid #e6eaec; } .sw-aerisit i:last-child { background: linear-gradient(#f6f8f8 60%, #1f6f78 60% 66%, #f6f8f8 66%); }
.sw-grafit i:first-child { background: #262b30; } .sw-grafit i:last-child { background: linear-gradient(#f3f4f5 60%, #3d6a99 60% 66%, #f3f4f5 66%); }
.danger-zone { border: 1px solid #f5c2c2; }
.debt-card + .card { margin-top: 16px; }
.det-form textarea { min-height: 0; }
.intake h2 { display: flex; align-items: center; gap: 8px; }
.intake-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
#stale, #upd-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 8px 16px; box-shadow: 0 10px 30px rgba(15, 30, 40, .15); font-size: 14px; max-width: calc(100vw - 32px); }
@media (max-width: 680px) { #stale, #upd-bar { bottom: calc(76px + env(safe-area-inset-bottom)); } }
/* Instalare ca aplicație */
.install-steps { padding-left: 22px; line-height: 1.9; }
#install-bar { position: fixed; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); z-index: 70; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px 10px 10px; box-shadow: 0 10px 30px rgba(15, 30, 40, .15); font-size: 14px; }
#install-bar img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
#install-bar span { flex: 1; min-width: 0; line-height: 1.3; }
#install-bar small { color: var(--muted); }
/* Preț de cumpărare pe fișă și avertismentul de la Bani */
.cost-in { width: 100px; text-align: right; padding: 5px 8px; }
.cost-in.missing { border-color: #e0a447; background: #fff8ec; }
.cost-bar { margin-top: 10px; gap: 12px; flex-wrap: wrap; }
.warn { color: #b26a00; font-weight: 500; }
.cost-warn { background: #fff8ec; border: 1px solid #f0d3a2; border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; }
.cost-warn a { color: var(--blue); }
.voice-usage { background: var(--bg); border-radius: 10px; padding: 8px 12px; font-size: 14px; }

/* Bani: lista pieselor pe fișe */
.parts-detail { margin: 12px 0 4px; }
.parts-detail summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.parts-detail tr.suspect td { background: color-mix(in srgb, var(--amber, #d97706) 12%, transparent); }
.ctot { color: var(--muted, #6b7a80); white-space: nowrap; }
.ctot .warn { white-space: normal; }
.open-line { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent, #1f6f78) 7%, transparent); line-height: 1.5; }
.inv-cancelled { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, #c0392b 10%, transparent); border: 1px solid color-mix(in srgb, #c0392b 35%, transparent); }
.doc.invoice.cancelled { position: relative; opacity: .75; }
.doc.invoice.cancelled::after { content: 'ANULATĂ'; position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 84px; font-weight: 800; letter-spacing: 6px; color: rgba(192, 57, 43, .28); border: 6px solid rgba(192, 57, 43, .28); padding: 4px 24px; border-radius: 12px; pointer-events: none; }
.btn.danger-outline { color: #c0392b; border-color: color-mix(in srgb, #c0392b 45%, transparent); }

/* Vânzări injectoare */
table.sales .age { color: var(--accent, #1f6f78); font-weight: 600; white-space: nowrap; }
table.sales .serials { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.sale-proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.sale-proof > div { padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--green, #1a7f4b) 9%, transparent); display: flex; flex-direction: column; gap: 2px; }
.sale-proof.expired > div:nth-child(2) { background: color-mix(in srgb, #c0392b 11%, transparent); }
.sale-proof span { font-size: 12.5px; color: var(--muted, #6b7a80); }
.sale-proof b { font-size: 21px; line-height: 1.25; }
.sale-proof small { color: var(--muted, #6b7a80); }
.sale-sum { grid-column: 1 / -1; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent, #1f6f78) 7%, transparent); line-height: 1.5; }
@media (max-width: 680px) { .sale-proof { grid-template-columns: 1fr; } .sale-proof b { font-size: 19px; } #nav a { font-size: 9.5px; } }

/* Vânzare: sus clientul, dedesubt un rând pe injector */
.sale-form { display: flex; flex-direction: column; gap: 12px; }
.sale-form h2 { margin: 6px 0 0; }
.sale-top { display: grid; grid-template-columns: 170px 190px 1fr 220px; gap: 12px 14px; }
table.sale-items td { padding: 7px 6px; vertical-align: middle; }
table.sale-items td.nr { width: 30px; color: var(--muted, #6b7a80); }
table.sale-items input, table.sale-items select { width: 100%; min-width: 0; }
table.sale-items td.num input { text-align: right; }
table.sale-items th.num { width: 112px; white-space: nowrap; } table.sale-items th:nth-child(4) { width: 168px; } table.sale-items th:nth-child(7) { width: 96px; }
table.sale-items input, table.sale-items select { padding-left: 9px; padding-right: 9px; }
table.sale-items td.x { width: 40px; } table.sale-items td.x .btn { color: var(--red, #b0443a); padding: 6px; }
table.sale-items td.w-state { white-space: nowrap; }
table.sale-items tfoot td { border-bottom: 0; }
.btn.dashed { border: 1px dashed var(--accent, #1f6f78); color: var(--accent, #1f6f78); background: none; white-space: nowrap; }
@media (max-width: 900px) {
  .sale-top { grid-template-columns: 1fr 1fr; }
  /* pe telefon fiecare injector devine un cartonaș, cu numele câmpului lângă */
  table.sale-items thead, table.sale-items tfoot { display: none; }
  table.sale-items, table.sale-items tbody { display: block; }
  table.sale-items tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--line, #e3e9ea); position: relative; }
  table.sale-items td { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; }
  table.sale-items td[data-l]::before { content: attr(data-l); font-size: 12px; font-weight: 600; color: var(--muted, #6b7a80); }
  table.sale-items td.num { text-align: left; }
  table.sale-items td.nr { width: auto; grid-column: 1 / -1; font-weight: 700; display: block; } table.sale-items td.nr::before { content: 'Injector '; }
  table.sale-items td.x { position: absolute; right: 0; top: 6px; width: auto; }
  table.sale-items td.num input { text-align: left; }
}
table.sales .serials .hit { background: #fff1a8; border-radius: 4px; padding: 0 3px; font-weight: 700; }
table.sales td { vertical-align: top; }
tr.more-row { display: none; }
.more-btn { margin-top: 8px; color: var(--accent, #1f6f78); }

/* Verificare rapidă */
.no-client { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; border: 1px dashed var(--accent, #1f6f78); background: color-mix(in srgb, var(--accent, #1f6f78) 6%, transparent); }
.no-client .row { gap: 8px; flex-wrap: wrap; } .no-client input { width: 190px; }
form.qcheck label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; } form.qcheck label.check input { width: auto; }
form.qcheck { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 680px) { .no-client input { width: 100%; } .no-client .row, .no-client .btn { width: 100%; } }

/* Pompă pe fișă */
.tag-pump { display: block; font-size: 10px; font-weight: 700; letter-spacing: .4px; color: #8a5a00; background: #ffe9b8; border-radius: 4px; padding: 1px 4px; margin-top: 2px; width: max-content; }
tr.pump td { background: color-mix(in srgb, #ffb020 6%, transparent); }

/* Anunță clientul (fișă gata de predare) */
.notify-bar { margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; border: 1px solid color-mix(in srgb, #25a244 40%, transparent); background: color-mix(in srgb, #25a244 6%, transparent); }
.notify-bar .nb-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notify-bar .nb-text { padding: 10px 12px; border-radius: 10px; background: var(--card, #fff); border: 1px solid var(--line, #e3e9ea); white-space: pre-wrap; }
.notify-bar .row { gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.wa { background: #25a244; border-color: #25a244; color: #fff; }

/* Lucrătorul nu vede prețuri de cumpărare, profit și acțiunile administratorului */
body[data-role="lucrator"] .adm, body[data-role="lucrator"] #nav a[data-page="statistici"] { display: none !important; }
#nav a[data-page="vanzari"] { display: none !important; } /* registrul de vânzări e pentru atelierul de injectoare */
.who-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; }
body[data-role="platforma"] #nav, body[data-role="platforma"] .side-voice, body[data-role="platforma"] #fab,
body[data-role="platforma"] .cmd-bar, body[data-role="platforma"] #global-search, body[data-role="platforma"] #appt-btn, body[data-role="platforma"] .topbar .btn.primary { display: none !important; }
body[data-role="platforma"] .top-actions, body[data-role="platforma"] #ai-toggle, body[data-role="platforma"] a[href="#/fisa/noua"] { display: none !important; }
.st-exp { background: var(--red-soft); color: var(--red); }
.sub-banner { background: var(--orange-soft); color: #92400e; padding: 9px 18px; font-size: 14px; font-weight: 600; text-align: center; }
.sub-banner.bad { background: var(--red-soft); color: var(--red); }
body[data-role="platforma"] #dock { display: none !important; }
body[data-role="platforma"] .app, body[data-role="platforma"] .workspace { grid-template-columns: 1fr !important; margin-right: 0 !important; }
/* Referalul: același ecran simplu ca platforma */
body[data-role="referal"] #nav, body[data-role="referal"] .side-voice, body[data-role="referal"] #fab, body[data-role="referal"] #dock,
body[data-role="referal"] .cmd-bar, body[data-role="referal"] #global-search, body[data-role="referal"] #appt-btn, body[data-role="referal"] .topbar .btn.primary,
body[data-role="referal"] .top-actions, body[data-role="referal"] #ai-toggle, body[data-role="referal"] a[href="#/fisa/noua"] { display: none !important; }
body[data-role="referal"] .app, body[data-role="referal"] .workspace { grid-template-columns: 1fr !important; margin-right: 0 !important; }
/* Venituri: indicatori și grafic */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 14px; }
.kpi { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.kpi small { color: var(--muted); font-size: 12.5px; }
.kpi b { font-size: 22px; font-weight: 700; }
.card .kpis .kpi { background: var(--bg); border: 0; }
.rev-chart { width: 100%; height: auto; display: block; }
.rev-chart text { font-size: 11px; fill: var(--muted); }
.rev-chart .gl { stroke: var(--line); stroke-width: 1; }
.rev-chart .b-net, .rev-legend .b-net { fill: #16a34a; background: #16a34a; }
.rev-chart .b-ref, .rev-legend .b-ref { fill: #fdba74; background: #fdba74; }
.rev-legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.rev-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
dialog.lang-pick { border: 0; border-radius: 16px; padding: 28px; max-width: 440px; text-align: center; }
dialog.lang-pick::backdrop { background: rgba(15, 23, 42, .55); }
dialog.lang-pick h2 { margin: 0 0 18px; font-size: 20px; }
.lp-row { display: flex; gap: 12px; justify-content: center; margin-bottom: 12px; }
.lp-row .btn { min-width: 150px; justify-content: center; font-size: 17px; padding: 14px 18px; }
.login-lang { text-align: center; margin: 10px 0 0; font-size: 14px; }
.login-lang .link { background: none; border: 0; color: var(--brand, #1f6f78); cursor: pointer; font: inherit; padding: 2px 4px; }
/* Cine e logat + Ieși */
.who-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-chip[hidden] { display: none !important; }
.who-chip .wc-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.08); flex: none; }
.who-chip .wc-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; overflow: hidden; }
.who-chip .wc-txt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-chip .wc-txt small { font-size: 11.5px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-chip .wc-out { flex: none; }
.who-chip .wc-out { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; border: 1px solid currentColor; border-radius: 8px; background: none; color: inherit; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; opacity: .85; }
.who-chip .wc-out:hover { opacity: 1; }
.who-chip .wc-out .ic { width: 16px; height: 16px; }
.sidebar .who-chip { padding: 10px 8px; border-top: 1px solid rgba(255,255,255,.1); margin-top: auto; }
.sidebar .who-chip + .side-voice { margin-top: 0; }
.who-top { display: none !important; }
@media (max-width: 1280px) and (min-width: 1001px) { .sidebar .who-chip .wc-txt, .sidebar .who-chip .wc-out span { display: none; } .sidebar .who-chip { flex-direction: column; } .sidebar .who-chip .wc-out { margin: 0; } }
@media (max-width: 1000px) {
  .sidebar .who-chip { display: none !important; }
  .who-top:not([hidden]) { display: flex !important; margin-left: auto; color: var(--text); }
  .who-top .wc-ic { background: var(--navy-2, #eef1f6); }
}
@media (max-width: 680px) { .who-top .wc-txt small, .who-top .wc-out span { display: none; } .who-top .wc-txt b { max-width: 90px; } }
.sec-head { align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 18px; }
.sec-head h2 { margin: 0; }
.sec-head .row { flex-wrap: wrap; gap: 8px; }
/* Piese și manoperă pe telefon: fiecare poziție e o cartelă, nu un rând înghesuit */
@media (max-width: 680px) {
  #item-box .edit-table thead { display: none; }
  #item-box .edit-table, #item-box .edit-table tbody { display: block; }
  #item-box .edit-table tr.it-row { display: grid; grid-template-columns: 28px 1fr 1fr 40px; gap: 8px 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
  #item-box .edit-table tr.it-row td { display: block; width: auto !important; padding: 0; border: 0; }
  #item-box .c-n { grid-column: 1; grid-row: 1; } #item-box .c-kind { grid-column: 2 / 4; grid-row: 1; } #item-box .c-rm { grid-column: 4; grid-row: 1; justify-self: end; }
  #item-box .c-name { grid-column: 1 / -1; }
  #item-box .c-qty { grid-column: 1 / 3; } #item-box .c-price { grid-column: 3 / 5; }
  #item-box .c-cost { grid-column: 1 / 3; } #item-box .c-sup { grid-column: 3 / 5; } #item-box .c-val { grid-column: 1 / -1; text-align: right; font-weight: 600; }
  #item-box .c-val::before { display: inline !important; margin-right: 6px; }
  #item-box td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; text-align: left; font-weight: 400; }
  #item-box .c-kind select, #item-box .c-name input, #item-box td[data-l] input { width: 100%; }
}
.code-tag { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--navy-2, #eef1f6); padding: 1px 6px; border-radius: 5px; margin-left: 4px; }
@media (max-width: 680px) { #item-box .c-code { grid-column: 1 / -1; } }
.qty-unit { display: flex; gap: 4px; }
.qty-unit input { min-width: 0; flex: 1; }
.qty-unit select { width: auto; flex: none; padding-left: 6px; padding-right: 22px; }
.mi-mech { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.mi-mech .ic { width: 13px; height: 13px; }
.t-mech { float: right; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; background: var(--blue-soft, #e6f0f1); color: var(--blue-2, #1f6f78); font-size: 11.5px; font-weight: 700; }
.mech-badge { display: inline-flex; align-items: center; gap: 5px; }
.mech-badge .ic { width: 14px; height: 14px; }
.pct-in { display: inline-flex; align-items: center; gap: 4px; }
.pct-in input { width: 74px; padding: 6px 8px; }
@media (max-width: 680px) { body[data-role="admin"] #nav a[data-page="castiguri"] { display: none !important; } }
label.check-line { display: flex !important; flex-direction: row !important; align-items: center; justify-content: flex-start; gap: 10px; margin: 10px 0 14px; font-weight: 500; text-align: left; cursor: pointer; }
label.check-line input { width: 18px !important; height: 18px; margin: 0; flex: none; }
/* ---------- Corecturi de design (verificare 0.6.5) ---------- */
/* numele mecanicului pe fișă (lucrător): fără punctul de status */
.mech-badge::before { display: none !important; }
/* cine e logat: nu se strânge din cauza meniului (ex. în rusă meniul e mai lung) */
.who-chip { flex: none; }
.who-chip .wc-txt b { max-width: 170px; }
@media (max-width: 1500px) { html[data-layout="simplu"] #nav a { padding: 7px 9px; } }
@media (max-width: 1280px) { .sidebar .who-chip .wc-txt small { display: none; } }
/* spațiu între secțiunile din Setări (Aspect / Structură) */
#theme-pick + h3, .theme-pick + h3 { margin-top: 18px; }

@media (max-width: 680px) {
  .desk-only, .desk-only + #layout-pick { display: none !important; }
  /* cifrele mari din Bani / Câștiguri încap pe telefon */
  .grid.stats .stat b { font-size: 19px; word-break: keep-all; white-space: nowrap; }
  .grid.stats .stat span { font-size: 12.5px; }
  /* butoanele de pe fișă: statusul și mecanicul pe tot rândul, restul câte două */
  .rep-actions { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .rep-actions select { grid-column: 1 / -1; width: 100%; }
  .rep-actions .btn { justify-content: center; width: 100%; }
  .rep-actions .mech-badge { grid-column: 1 / -1; justify-self: start; }
  /* piesele și manopera de pe fișă: cartele, nu tabel tăiat */
  .items-view thead { display: none; }
  .items-view, .items-view tbody { display: block; }
  .items-view tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .items-view td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }
  .items-view .v-n { display: none; }
  .items-view .v-name { grid-column: 1 / -1; font-weight: 600; }
  .items-view .v-kind { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
  .items-view td[data-l]::before { content: attr(data-l); display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
  .items-view .v-cost input { width: 100%; }
  .table-wrap:has(.items-view) { overflow: visible; }
  /* formularul: căsuța „Cod piesă” goală (la manoperă) nu mai apare */
  #item-box .c-code.empty, #item-box .c-sup.empty { display: none !important; }
}
@media (max-width: 680px) {
  /* butonul rotund al asistentului nu acoperă „Salvează” din bara de jos a formularului */
  .sticky-actions { padding-right: 78px !important; }
  .sticky-actions .btn { min-width: 0; }
  .sticky-actions .btn.primary { flex: 1; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 680px) {
  /* tabele care pe telefon devin cartele cu etichete */
  .cards-m thead { display: none; }
  .cards-m, .cards-m tbody { display: block; }
  .cards-m tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .cards-m td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }
  .cards-m td.cm-wide { grid-column: 1 / -1; }
  .cards-m td[data-l]::before { content: attr(data-l); display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; font-weight: 400; }
  .table-wrap:has(.cards-m) { overflow: visible; }
}
/* Căutare pe loc */
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(15, 23, 42, .16); max-height: min(70vh, 560px); overflow: auto; padding: 6px; min-width: 340px; }
.suggest[hidden] { display: none; }
.sg-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 10px 4px; }
.sg-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.sg-item:hover, .sg-item.on { background: var(--bg); }
.sg-item.on { outline: 2px solid var(--brand, #1f6f78); outline-offset: -2px; }
.sg-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sg-main { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-item small { color: var(--muted); white-space: nowrap; } .sg-item small.neg { color: var(--red); }
.suggest mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.sg-all { display: block; padding: 10px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.sg-empty { padding: 14px 12px; color: var(--muted); font-size: 14px; }
@media (max-width: 680px) { .suggest { position: fixed; left: 8px; right: 8px; top: calc(62px + env(safe-area-inset-top)); min-width: 0; } }
.search input:focus, .search input:focus-visible { outline: none !important; box-shadow: none !important; border: 0 !important; background: transparent !important; }
.search:focus-within { border-color: var(--brand, #1f6f78); box-shadow: 0 0 0 3px rgba(31, 111, 120, .12); }
.suggest.suggest-float { position: fixed; top: 0; left: 0; right: auto; min-width: 0; z-index: 2000; max-height: 340px; }
@media (max-width: 680px) { .suggest.suggest-float { right: auto; } }
.pick-list button.on { outline: 2px solid var(--brand, #1f6f78); outline-offset: -2px; background: var(--bg); }
.pick-list mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Setări pe secțiuni ---------- */
.set-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 16px; }
.set-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card, #fff); color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.set-nav a .ic { width: 17px; height: 17px; }
.set-nav a:hover { color: var(--text, #111); border-color: #c9d3e6; }
.set-nav a.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.count-pill { display: inline-block; min-width: 22px; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); font-size: 12.5px; font-weight: 600; vertical-align: middle; text-align: center; }
.lab-help { margin: 6px 0 0; padding-left: 18px; }
.lab-help li { margin: 2px 0; }
.lab-q { max-width: 280px; }
.lab-group { margin-top: 14px; }
.lab-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 4px; }
.lab-table td { vertical-align: middle; }
.lab-table td:first-child input { width: 100%; min-width: 220px; }
.lab-table td:nth-child(2) input { width: 150px; }
.lab-val { display: inline-flex; align-items: center; gap: 5px; }
.lab-val input { width: 80px; padding: 6px 8px; }
.lab-vc small { display: block; margin-top: 2px; }
@media (max-width: 680px) {
  .set-nav { flex-wrap: nowrap; overflow-x: auto; margin: -4px -14px 14px; padding: 0 14px 4px; scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav a { padding: 8px 12px; font-size: 13.5px; }
  .lab-q { max-width: none; width: 100%; }
  .lab-table td:first-child input, .lab-table td:nth-child(2) input { width: 100%; min-width: 0; }
  .lab-table td.num { grid-column: 1 / -1; justify-self: end; }
}
.sup-line { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ---------- Plăți și rate ---------- */
.pay-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 12px; }
.pay-stats > div { background: var(--bg); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.pay-stats span { font-size: 12.5px; color: var(--muted); }
.pay-stats b { font-size: 20px; }
.pay-stats .ok, .ok { color: var(--green); } .owe { color: var(--red); }
.pay-bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.pay-bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.pay-h { font-size: 14px; margin: 16px 0 6px; }
.pay-table td { vertical-align: top; }
.inst-list { display: flex; flex-wrap: wrap; gap: 6px; }
.inst { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 3px 9px; border-radius: 8px; background: var(--bg); color: var(--muted); white-space: nowrap; text-decoration: none; }
.inst .ic { width: 13px; height: 13px; }
.inst-ok { background: #e7f5ec; color: #1d6b3d; }
.inst-soon { background: #fdf3dc; color: #8a5a00; }
.inst-late { background: #fde8e8; color: #a12828; font-weight: 600; }
.pay-form { grid-template-columns: 1fr 1fr; }
.plan-gen { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: 10px; margin-bottom: 10px; }
.plan-gen label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.plan-gen select, .plan-gen input { width: auto; }
.plan-row { display: grid; grid-template-columns: 22px 1fr 110px auto 32px; gap: 8px; align-items: center; margin-bottom: 6px; }
.danger-text { color: var(--red) !important; }
@media (max-width: 680px) {
  .pay-stats { grid-template-columns: 1fr 1fr; } .pay-stats > div:first-child { grid-column: 1 / -1; }
  .pay-stats b { font-size: 17px; }
  .pay-form { grid-template-columns: 1fr; }
  .plan-row { grid-template-columns: 18px 1fr 90px 28px; } .plan-row > span:nth-of-type(2) { display: none; }
}

/* ---------- Logo pe documente: cutie fixă, poza se micșorează în ea ---------- */
.doc-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.doc-logo { flex: none; display: flex; align-items: center; justify-content: flex-start; overflow: hidden; }
.doc-logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.doc-logo.lg-mic { width: 120px; height: 40px; }
.doc-logo.lg-mediu { width: 180px; height: 60px; }
.doc-logo.lg-mare { width: 240px; height: 80px; }
@media (max-width: 680px) { .doc-brand { flex-wrap: wrap; } .doc-logo.lg-mare { width: 180px; height: 60px; } }
.logo-prev { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; color: #111; margin: 10px 0; }
.logo-prev .doc-head { margin: 0; border-bottom-width: 1.5px; }
.logo-prev h1 { font-size: 18px; margin: 0; }
.lab-table .lab-ru { margin-top: 4px; font-size: 13px; color: var(--muted); padding-top: 5px; padding-bottom: 5px; }

/* ---------- Programări ---------- */
.appt-btn { position: relative; }
.appt-btn.active { border-color: var(--blue); color: var(--blue); }
.appt-n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--orange, #d97706); color: #fff; font-size: 12px; font-weight: 700; margin-left: 2px; }
.ap-nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 14px; }
.ap-nav .btn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.ap-nav input[type=date] { width: auto; padding: 6px 10px; }
.ap-list { padding-top: 6px; padding-bottom: 6px; }
.ap-card { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.ap-card:last-child { border-bottom: 0; }
.ap-time { display: flex; flex-direction: column; } .ap-time b { font-size: 18px; } .ap-time small { color: var(--muted); }
.ap-who b { font-size: 15px; } .ap-works { margin-top: 3px; } .ap-note { margin-top: 3px; font-size: 13.5px; }
.ap-clash { margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; background: #fdf3dc; color: #8a5a00; border-radius: 8px; padding: 4px 10px; font-size: 13px; }
.ap-clash .ic { width: 14px; height: 14px; }
.ap-remind { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ap-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ap-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ap-mech { display: inline-flex; align-items: center; gap: 4px; background: var(--blue-soft); color: var(--blue-2); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.ap-mech .ic { width: 13px; height: 13px; }
.ap-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ap-anulat, .ap-neprezentat { opacity: .6; }
.ap-anulat .ap-who b { text-decoration: line-through; }
.st-anulat { background: #f1f1f1; color: #666; }
.ap-day { padding: 6px 0 10px; border-bottom: 1px solid var(--line); } .ap-day:last-child { border-bottom: 0; }
.ap-day h2 { font-size: 15px; margin: 8px 0 2px; } .ap-day h2 a { color: inherit; text-decoration: none; }
.ap-flabel { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.ap-item { display: grid; grid-template-columns: 1fr 120px 130px 32px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ap-iqty { display: flex; align-items: center; gap: 4px; } .ap-iqty input { min-width: 0; padding: 6px 8px; } .ap-iqty small { color: var(--muted); white-space: nowrap; }
#ap-items:not(:empty) { margin-bottom: 8px; }
.set-sub { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.set-sub h3 { font-size: 14px; margin: 0 0 4px; }
@media (max-width: 680px) {
  .ap-card { grid-template-columns: 52px 1fr; }
  .ap-side { grid-column: 1 / -1; align-items: stretch; }
  .ap-tags, .ap-acts { justify-content: flex-start; }
  .ap-item { grid-template-columns: 1fr 1fr 32px; } .ap-iname { grid-column: 1 / -1; }
  .appt-btn span { display: none; }
}
.ap-form { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .ap-form { grid-template-columns: 1fr; } }
#ap-q { width: 100%; }
.time24 { display: flex; align-items: center; gap: 6px; }
.time24 select { flex: 1; min-width: 0; text-align: center; }
.time24 b { color: var(--muted); }
.ap-iqty input { width: 100%; }
.ap-done { padding: 12px 0 4px; text-align: center; font-size: 14px; }

/* Lucrătorul: fără stoc, fără Bobiță */
body[data-role="lucrator"] #nav a[data-page="stoc"], body[data-role="lucrator"] #side-voice, body[data-role="lucrator"] #ai-toggle,
body[data-role="lucrator"] .fab, body[data-role="lucrator"] #dock, body[data-role="lucrator"] .cmd-bar, body[data-role="lucrator"] [data-action="voice"] { display: none !important; }

/* Lucrătorul nu creează fișe */
body[data-role="lucrator"] a[href^="#/fisa/noua"], body[data-role="lucrator"] .intake { display: none !important; }

/* Acasă: cât a mai rămas din abonament */
.sub-cd { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 18px 0 22px; padding: 16px 20px; border-radius: 16px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa); border: 1px solid #a7f3d0; }
.sub-cd.warn { background: linear-gradient(135deg, #fff7ed, #fffbeb); border-color: #fed7aa; }
.sub-cd.bad { background: linear-gradient(135deg, #fef2f2, #fff1f2); border-color: #fecaca; }
.cd-head { display: flex; align-items: center; gap: 12px; }
.cd-head b { display: block; font-size: 15.5px; }
.cd-head small { color: var(--muted); font-size: 13px; }
.cd-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #10b981; color: #fff; flex: none; }
.sub-cd.warn .cd-ic { background: #f59e0b; } .sub-cd.bad .cd-ic { background: var(--red); }
.cd-ic .ic { width: 22px; height: 22px; }
.cd-grid { display: flex; gap: 8px; }
.cd-cell { min-width: 64px; padding: 8px 6px 6px; border-radius: 12px; background: #fff; text-align: center; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.cd-cell b { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; color: #047857; }
.sub-cd.warn .cd-cell b { color: #b45309; } .sub-cd.bad .cd-cell b { color: var(--red); }
.cd-cell small { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 600px) { .sub-cd { padding: 14px; } .cd-grid { width: 100%; } .cd-cell { flex: 1; min-width: 0; } .cd-cell b { font-size: 22px; } }

/* Manopere: status pe fiecare rând și progresul lucrării */
.lab-prog { margin: 0 0 12px; font-size: 14px; }
.lab-prog .lp-bar { height: 6px; border-radius: 4px; background: var(--line); margin-top: 6px; overflow: hidden; }
.lab-prog .lp-bar i { display: block; height: 100%; background: #16a34a; border-radius: 4px; transition: width .3s; }
.lab-st { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; min-width: 110px; }
.lab-st.ls-de_facut { background: var(--bg); color: var(--muted); }
.lab-st.ls-in_lucru { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.lab-st.ls-facut { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.lab-st.ls-anulat { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
tr.it-cancel .v-name, tr.it-cancel .v-qty, tr.it-cancel .v-price, tr.it-cancel .v-val { text-decoration: line-through; color: var(--muted); }
/* Admini online */
.on-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.on-dot.on { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.on-dot.off { background: #dc2626; }
.on-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.on-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 14px; border: 1px solid var(--line); background: var(--card, #fff); }
.on-pill b { font-size: 17px; }
.on-pill.on { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.on-pill.off { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.st-cell { display: inline-flex; align-items: center; gap: 8px; }
#adm tr:not(.is-on) .st-txt { color: #b91c1c; font-weight: 600; } #adm tr.is-on .st-txt { color: #047857; }
.notice-line { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.nl-body { white-space: pre-wrap; }
.nl-to { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nl-to .rd { color: #047857; } .nl-to .ic { width: 14px; height: 14px; vertical-align: -2px; }
/* Notificarea primită de administratorul service-ului */
#notice-box { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 9000; width: min(520px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 10px; }
.notice-card { background: #fff; border: 1px solid #fcd34d; border-left: 5px solid #f59e0b; border-radius: 14px; padding: 14px 16px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); animation: nc-in .25s ease-out; }
.notice-card p { margin: 8px 0 10px; white-space: pre-wrap; font-size: 15px; }
.nc-head { display: flex; gap: 10px; align-items: center; }
.nc-head small { display: block; color: var(--muted); font-size: 12px; }
.nc-head b { display: block; font-size: 16px; }
.nc-ic { width: 36px; height: 36px; border-radius: 10px; background: #fef3c7; color: #b45309; display: grid; place-items: center; flex: none; }
@keyframes nc-in { from { opacity: 0; transform: translateY(-8px); } }
/* Fișa: Cu TVA / Fără TVA */
.vat-tog { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; padding: 3px; background: var(--bg); gap: 3px; }
.vat-tog button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.vat-tog button .ic { width: 16px; height: 16px; }
.vat-tog button.on[data-vat="1"] { background: #fff; color: var(--primary, #1f6f78); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.vat-tog button.on[data-vat="0"] { background: #fff; color: #b45309; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.feat-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.feat-list .feat { font-size: 15px; }

/* Dialogul de ștergere: avertisment clar */
.erase-dlg .ed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.erase-dlg .ed-head b { font-size: 17px; color: #b91c1c; }
.erase-dlg .ed-ic { width: 38px; height: 38px; border-radius: 10px; background: #fee2e2; color: #b91c1c; display: grid; place-items: center; flex: none; }
.erase-dlg .ed-warn { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 10px; padding: 10px 12px; font-weight: 600; margin: 4px 0 14px; }

/* Formular fișă: denumirea are loc; la manoperă ocupă și coloana „Cod piesă” */
#item-box .edit-table td.c-name { min-width: 220px; }
#item-box .edit-table td.c-kind { min-width: 128px; }

/* Deviz / factură: grupele Piese și Manoperă */
.doc tr.grp td { background: #f3f5f6; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 12.5px; padding-top: 8px; padding-bottom: 8px; }
.doc tr.grp-sum td { font-weight: 700; border-top: 1.5px solid #333; }
@media print { .doc tr.grp td { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.pl-ws { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); max-height: 180px; overflow: auto; }

/* Diagnostic server */
.diag-list { display: flex; flex-direction: column; gap: 8px; }
.diag { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; }
.diag.ok { background: #ecfdf5; color: #065f46; } .diag.warn { background: #fff7ed; color: #9a3412; }
.diag-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; background: rgba(255,255,255,.7); }
.diag-ic .ic { width: 14px; height: 14px; }
#item-box tr.it-locked td { opacity: .6; } #item-box tr.it-locked input { text-decoration: line-through; }
