/* NexHubCRM — identitate vizuală „Pasul următor” (v1.5.4.2)
   Cerneală #111827 · Albastru #2563EB · Albastru deschis #60A5FA · Fundal brand #F9FAFB, fundal pagini #F0F1F2 (v1.5.4.3) · font DM Sans (local) */
@font-face {
  font-family: "DM Sans"; font-style: normal; font-display: swap; font-weight: 100 1000;
  src: url("fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans"; font-style: normal; font-display: swap; font-weight: 100 1000;
  src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --ground: #F0F1F2;
  --surface: #FFFFFF;
  --surface-2: #F3F4F6;
  --line: #E5E7EB;
  --line-soft: #F3F4F6;
  --line-strong: #D1D5DB;
  --ink: #111827;
  --muted: #4B5563;
  --rail: #111827;
  --rail-hover: #1F2937;
  --rail-icon: #9CA3AF;
  --accent: #2563EB;
  --accent-ink: #1D4ED8;
  --accent-soft: #EFF6FF;
  --accent-light: #60A5FA;
  --amber-bg: #FFF1DB; --amber-ink: #8A4B00;
  --green-bg: #E2F4EA; --green-ink: #12613D;
  --red-bg: #FDE6E4;   --red-ink: #9A1C12;
  --violet-bg: #EDE7FB; --violet-ink: #5132A8;
  --blue-bg: #EFF6FF;  --blue-ink: #1D4ED8;
  --grey-bg: #F3F4F6;  --grey-ink: #374151;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--ground); font-size: 15px; line-height: 1.45;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: #1E3A8A; }
h1, h2, h3 { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid #60A5FA; outline-offset: 2px; }

/* Cadru */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.rail {
  flex: 0 0 72px; width: 72px; background: var(--rail); display: flex; flex-direction: column;
  align-items: stretch; gap: 6px; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: flex-basis .18s ease, width .18s ease;
}
.rail .logo { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.rail .logo svg { width: 30px; height: 30px; transition: transform .15s ease; }
.rail a, .rail .nav-btn, .rail .logo-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 10px;
  border-radius: 12px; color: var(--rail-icon); background: none; border: 0; cursor: pointer; position: relative;
  font: inherit; font-size: 14px; font-weight: 600; text-align: left; white-space: nowrap;
}
.rail .logo-btn { padding: 0 2px; margin-bottom: 14px; min-height: 48px; }
.rail .logo-btn:hover .logo svg { transform: scale(1.06); }
.rail a svg, .rail .nav-btn svg { flex-shrink: 0; }
.rail a:hover, .rail .nav-btn:hover { background: var(--rail-hover); color: #fff; }
.rail a.on { background: var(--accent); color: #fff; }
.rail .lbl { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rail .brand { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.rail .brand .crm { color: var(--accent-light); font-weight: 500; }
.rail .badge {
  position: absolute; top: 3px; left: 28px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: #F2994A; color: #1A1206; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.rail .spacer { flex-grow: 1; }
.rail .me-link { padding: 0 2px; min-height: 52px; margin-top: 4px; }
.rail .me-link.on { background: var(--rail-hover); }
.rail .me {
  width: 40px; height: 40px; border-radius: 99px; background: #DBEAFE; color: #1E3A8A; flex-shrink: 0;
  font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.rail .me-name { display: block; color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.rail .me-role { display: block; color: var(--rail-icon); font-size: 12.5px; font-weight: 500; }

/* Meniu deschis: apar denumirile */
.nav-open .rail { flex-basis: 232px; width: 232px; }
.nav-open .rail .lbl { display: block; }
.nav-open .rail .badge { position: static; margin-left: auto; }
.content { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 22px; }
/* Conținutul ocupă tot ecranul rămas lângă meniu, fie că meniul e restrâns sau deschis */
.content > * { width: 100%; }

/* Antet de pagină */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.page-head .title { flex: 1 1 280px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.back { font-size: 14px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

/* Butoane și câmpuri */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #D1D5DB; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1D4ED8; color: #fff; }
.btn.sm { height: 38px; padding: 0 12px; border-radius: 11px; font-size: 14px; }
.btn.danger { color: var(--red-ink); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 0; cursor: pointer;
}
.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 0 16px; height: 48px; flex: 1 1 320px; max-width: 460px; color: var(--muted);
}
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font: inherit; color: var(--ink); background: transparent; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.field .help { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 13px; color: var(--red-ink); font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password],
input[type=search].input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 10px 12px; min-height: 44px; width: 100%;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px #DBEAFE; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters select { width: auto; min-width: 160px; }

/* Carduri */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.card.pad { padding: 22px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { font-size: 18px; font-weight: 700; }
.card-head a { font-size: 14px; font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row.stretch { align-items: stretch; }
.col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* Indicatori */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { padding: 20px; }
.kpi .lbl { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi .ic { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.kpi .val { font-size: 32px; font-weight: 700; margin-top: 10px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 16px; font-weight: 600; color: var(--muted); }
.kpi .sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.kpi.hero { background: var(--accent); border-color: var(--accent); color: #fff; }
.kpi.hero .lbl, .kpi.hero .sub { color: rgba(255,255,255,.92); }

/* Etichete */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill-blue { background: var(--blue-bg); color: var(--blue-ink); }
.pill-amber { background: var(--amber-bg); color: var(--amber-ink); }
.pill-green { background: var(--green-bg); color: var(--green-ink); }
.pill-red { background: var(--red-bg); color: var(--red-ink); }
.pill-violet { background: var(--violet-bg); color: var(--violet-ink); }
.pill-grey { background: var(--grey-bg); color: var(--grey-ink); }

/* Liste de alerte */
.alert-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.alert-item:last-child { border-bottom: 0; }
.alert-item .body { flex: 1; min-width: 0; }
.alert-item .who { font-weight: 700; font-size: 15px; color: var(--ink); }
.alert-item .what { font-size: 14px; color: var(--muted); margin-top: 3px; }
.alert-item .hint { font-size: 13.5px; color: var(--ink); margin-top: 4px; }
.alert-item .actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Grafic */
.bars { display: flex; align-items: flex-end; gap: 18px; height: 240px; padding-top: 8px; border-bottom: 1px solid var(--line-strong); }
.bars .b {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end;
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer; border-radius: 10px 10px 0 0;
}
.bars .b span { font-size: 12.5px; color: var(--muted); min-height: 16px; }
.bars .b div { width: 100%; max-width: 48px; background: #BFDBFE; border-radius: 10px 10px 4px 4px; min-height: 3px; transition: background .15s; }
.bars .b:hover div { background: #93C5FD; }
.bars .b.now span { font-weight: 700; color: var(--ink); }
.bars .b.now div { background: var(--accent); }
.bars.dense { gap: 4px; }
.bars.dense .b div { border-radius: 4px 4px 2px 2px; }
.bar-labels { display: flex; gap: 18px; margin-top: 8px; }
.bar-labels.dense { gap: 4px; }
.bar-labels span { flex: 1; min-width: 0; text-align: center; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: visible; }
.bar-labels span.now { font-weight: 700; color: var(--ink); }
.period-select { width: auto; min-height: 38px; padding: 6px 10px; font-size: 14px; font-weight: 600; }
.sales-sum .big { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.sales-pick {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: center;
  margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px;
}
.sales-pick a { font-weight: 700; }
a.kpi.link { color: inherit; }
a.kpi.link:hover { border-color: #D1D5DB; box-shadow: 0 2px 0 #D1D5DB; }
a.kpi.link:hover .val { color: var(--accent-ink); }

/* Tabele */
.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; }
table.data th {
  font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: left; padding: 12px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { font-size: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.wrap { white-space: normal; min-width: 220px; }
table.data td.r, table.data th.r { text-align: right; }
table.data a.strong { color: var(--ink); font-weight: 600; }
table.data a.strong:hover { color: var(--accent-ink); }
.card > .card-head.in { padding: 20px 22px 0; }
.card > .table-wrap { margin-top: 8px; }

/* Fișa clientului */
.client-head { padding: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.avatar {
  width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; font-size: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.client-head .info { flex: 1 1 320px; min-width: 0; }
.client-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.client-head .meta { margin: 8px 0 0; font-size: 14.5px; color: var(--muted); }
.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 16px;
  background: #FFF4E2; border: 1px solid #F5D7A8; color: #5A3300;
}
.banner.red { background: #FFF6F5; border-color: #F6CFCB; color: #6E160E; }
.banner.green { background: #EFFAF3; border-color: #BFE6CF; color: #0E4A2F; }
.banner .txt { flex: 1 1 300px; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 14px; background: var(--surface-2); }
.stat dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat dd { margin: 6px 0 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.good { background: #E9F7EF; } .stat.good dd { color: var(--green-ink); }
.stat.warn dd { color: #A35A00; }
.meter { height: 8px; border-radius: 99px; background: var(--line-soft); margin-top: 6px; }
.meter div { height: 100%; border-radius: 99px; background: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: flex; gap: 12px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.timeline .h { font-size: 14px; font-weight: 600; }
.timeline .t { font-size: 14px; color: var(--muted); margin-top: 2px; white-space: pre-line; }
.ticket { padding: 14px; border-radius: 14px; border: 1px solid #F6CFCB; background: #FFF6F5; }
.ticket.done { border-color: var(--line); background: var(--surface-2); }
.ticket + .ticket { margin-top: 10px; }
details.inline-form { border-top: 1px solid var(--line-soft); margin-top: 14px; padding-top: 14px; }
details.inline-form summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); list-style: none; }
details.inline-form summary::-webkit-details-marker { display: none; }
details.inline-form form { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }

/* Comandă nouă */
.lines { display: flex; flex-direction: column; gap: 10px; }
.line {
  display: grid; grid-template-columns: minmax(260px, 2.6fr) 100px minmax(150px, 1.3fr) 150px 44px; gap: 10px; align-items: center;
  padding: 12px; border-radius: 14px; background: var(--surface-2);
}
.line .price { text-align: right; }
.line .price strong { display: block; font-size: 15px; }
.line .price small { color: var(--muted); font-size: 12.5px; }
.line .why { font-size: 12.5px; color: var(--green-ink); font-weight: 600; }
.line .why.none { color: var(--muted); font-weight: 500; }
.line .manual { grid-column: 1 / -1; display: none; gap: 10px; grid-template-columns: 160px 1fr; }
.line.show-manual .manual { display: grid; }
.line-head { display: grid; grid-template-columns: minmax(260px, 2.6fr) 100px minmax(150px, 1.3fr) 150px 44px; gap: 10px; padding: 0 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.totals { display: flex; flex-direction: column; gap: 10px; }
.totals .t-row { display: flex; justify-content: space-between; font-size: 15px; }
.totals .t-row.big { font-size: 22px; font-weight: 700; padding-top: 10px; border-top: 1px solid var(--line); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); font-weight: 600; cursor: pointer; font-size: 13.5px; }
.sticky { position: sticky; top: 20px; }

/* Mesaje */
.messages { display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 12px 16px; border-radius: 14px; background: var(--green-bg); color: var(--green-ink); font-weight: 600; border: 1px solid #BFE6CF; }
.msg.error { background: var(--red-bg); color: var(--red-ink); border-color: #F6CFCB; }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* Autentificare */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 0; padding: 24px; }
.auth-brand { display: none; }
@media (min-width: 900px) {
  .auth { padding: 0; align-items: stretch; }
  .auth-brand {
    flex: 0 0 44%; background: var(--ink); color: #fff; display: flex; flex-direction: column;
    justify-content: space-between; padding: 48px 56px;
  }
  .auth .auth-brand .wordmark { color: #fff; font-size: 30px; }
  .auth .auth-brand .wordmark svg { width: 42px; height: 42px; }
  .auth .auth-brand .wordmark .crm { color: var(--accent-light); }
  .auth-claim { margin: 0; font-size: clamp(32px, 3.4vw, 48px); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
  .auth-foot { margin: 0; color: #9CA3AF; font-size: 13px; }
  .auth > .card { align-self: center; margin: 24px auto; }
  .auth > .card > .wordmark { display: none; }
}
.auth .card { width: 100%; max-width: 420px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.auth .wordmark { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.auth .wordmark svg { width: 36px; height: 36px; flex-shrink: 0; }
.auth .wordmark .crm { color: var(--accent); font-weight: 500; }
.auth .tagline { margin: -6px 0 0; color: var(--muted); font-size: 14px; }

/* Telefon: vezi secțiunea v1.6.3 de la finalul fișierului */
@media (max-width: 720px) {
  .line, .line-head { grid-template-columns: 1fr 90px; }
  .line-head { display: none; }
  .line .price { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Contul meu: conturi bancare */
.banks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bank-row {
  display: grid; grid-template-columns: minmax(140px, 1fr) minmax(250px, 1.7fr); gap: 10px 12px; align-items: start;
  padding: 14px; border-radius: 14px; background: var(--surface-2);
}
.bank-opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.bank-opts select { width: 104px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bank-row.removing { opacity: .45; }
.bank-row.removing input[type=text] { text-decoration: line-through; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-height: 44px; white-space: nowrap; }
.check input { width: 18px; height: 18px; }
.check.del { color: var(--red-ink); }
.bank-ro { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.auth .link-row { font-size: 14px; text-align: center; }
@media (max-width: 720px) { .bank-row { grid-template-columns: 1fr; } }

.date-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.date-filter input { width: auto; }
.rail .brand .ver { display: block; color: var(--rail-icon); font-size: 11.5px; font-weight: 500; }

/* Obiective */
.late { color: var(--red-ink); font-weight: 700; }
.meter.big { height: 12px; margin: 8px 0 16px; }
.goal-pct { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.goal-facts { margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
.goal-facts div { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.goal-facts dt { color: var(--muted); }
.goal-facts dd { margin: 0; font-weight: 700; }

/* Produs: variante */
.variants { display: flex; flex-direction: column; gap: 10px; }
.variant-row {
  display: grid; grid-template-columns: minmax(130px, 1.2fr) minmax(110px, 1fr) repeat(3, minmax(90px, 1fr)); gap: 10px; align-items: start;
  padding: 12px; border-radius: 14px; background: var(--surface-2);
}
.variant-row.removing { opacity: .45; }
.variant-opts { grid-column: 1 / -1; display: flex; gap: 20px; }
.form-grid .check.wide { grid-column: 1 / -1; }
@media (max-width: 720px) { .variant-row { grid-template-columns: 1fr 1fr; } }

/* Comandă nouă: căutare produs */
.picker { position: relative; min-width: 0; }
.picker.chosen .js-search { font-weight: 600; border-color: #D1D5DB; }
.picker-list {
  position: absolute; z-index: 20; left: 0; min-width: min(440px, 86vw); top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; max-height: 320px; overflow-y: auto;
  box-shadow: 0 12px 28px rgba(17, 24, 39, .14);
}
.picker-list li { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.picker-list li[aria-selected="true"], .picker-list li:hover { background: var(--accent-soft); }
.picker-list .p-name { font-weight: 600; font-size: 14px; }
.picker-list .p-meta { font-size: 12.5px; color: var(--muted); }
.picker-list .picker-empty { cursor: default; color: var(--muted); font-size: 14px; }

/* Obiective: istoric note */
.note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.note-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.note-history .h .pill { margin-left: 6px; padding: 2px 8px; font-size: 12px; }
.row-off td { opacity: .6; }

/* Pagini în dezvoltare */
.soon-notice { padding: 14px 18px; border-radius: 14px; background: var(--amber-bg); color: #5A3300; border: 1px solid #F5D7A8; font-size: 15px; }
.soon-stage { min-height: 420px; display: flex; align-items: center; justify-content: center; }
.soon-icon { color: var(--accent); opacity: .6; display: inline-flex; }
.integration-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.integration { padding: 22px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.integration h2 { font-size: 17px; font-weight: 700; }
.integration p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.int-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cal-head h2 { font-size: 20px; font-weight: 700; min-width: 200px; text-align: center; }
.cal-grid { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.cal-grid th { font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-grid td { height: 84px; vertical-align: top; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-grid td.weekend { background: #F3F4F6; }
.cal-grid td.other { background: none; color: #9CA3AF; }
.cal-grid td.today { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
@media (max-width: 720px) { .cal-grid { border-spacing: 3px; } .cal-grid td { height: 52px; padding: 6px; font-size: 13px; } }

/* Vânzări per agent */
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.hb-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; margin-bottom: 6px; }
.hb-head span { color: var(--muted); font-size: 13.5px; }
.hb-track { height: 14px; border-radius: 99px; background: var(--line-soft); }
.hb-track div { height: 100%; border-radius: 99px; background: var(--accent); min-width: 6px; }

/* Canale de vânzare */
.pie-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.pie { width: 180px; height: 180px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.pie-hole { width: 100px; height: 100px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pie-hole strong { font-size: 26px; font-weight: 700; line-height: 1; }
.pie-hole small { color: var(--muted); font-size: 12.5px; }
.pie-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 200px; display: flex; flex-direction: column; gap: 12px; }
.pie-legend li { display: grid; grid-template-columns: 14px 1fr auto; column-gap: 10px; align-items: center; }
.pie-legend .sw { width: 14px; height: 14px; border-radius: 4px; }
.pie-legend .lg-name { font-weight: 600; font-size: 14.5px; }
.pie-legend .lg-num { font-weight: 700; font-size: 14px; }
.pie-legend .lg-sub { grid-column: 2 / -1; color: var(--muted); font-size: 12.5px; }

/* v1.5.4.1 · Reducere pe comandă și adresă de livrare */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--grey-bg); border-radius: 12px; margin-bottom: 14px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 16px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(17, 24, 39, .12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.od-presets { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.od-error { margin: 10px 0 0; color: var(--red-ink); background: var(--red-bg); padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.delivery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.delivery-grid .span-2 { grid-column: span 2; }
@media (max-width: 720px) { .delivery-grid { grid-template-columns: 1fr 1fr; } }
.totals .t-row.sub { font-size: 13px; margin-top: -6px; }
.addr-block { margin: 0; line-height: 1.6; }

/* v1.5.4.3 · Plan / abonament */
.plan-grid { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-start; }
.plan-main { flex: 0 0 240px; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 14px; background: var(--ink); color: #fff; }
.plan-name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.plan-name .crm { color: var(--accent-light); font-weight: 500; margin-right: 6px; }
.plan-facts { flex: 1 1 420px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; }
.plan-facts dt { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.plan-facts dd { margin: 0; }
.plan-note { font-size: 13px; margin: 16px 0 0; }

/* v1.5.4.4 · Comutator TVA și Sumar comandă */
.vat-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: -8px 0 -6px; font-size: 14px; }
.vat-bar .seg { margin: 0; background: var(--surface); border: 1px solid var(--line); }
.vat-bar .seg input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.summary-lines { list-style: none; margin: 0; padding: 0 0 4px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.summary-lines li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 14px; }
.summary-lines .s-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.summary-lines .s-meta { color: var(--muted); font-size: 12.5px; }
.summary-lines .s-net { text-align: right; font-weight: 600; }
.summary-lines .s-gross { text-align: right; color: var(--muted); font-size: 12.5px; }
.summary-empty { margin: 0; color: var(--muted); font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.totals .t-row.gross { font-size: 18px; font-weight: 700; }
.totals .t-row.big + .t-row.gross { margin-top: -4px; }
.totals h2 { font-size: 18px; }
[hidden] { display: none !important; }
.line .price .js-unit { white-space: pre-line; }

/* v1.5.4.5 · Administrare echipe și activități */
.av { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 99px;
  background: #DBEAFE; color: #1E3A8A; font-weight: 700; letter-spacing: .02em; }
.av-sm { width: 28px; height: 28px; font-size: 11.5px; }
.av-md { width: 36px; height: 36px; font-size: 13px; }
table.data .who { display: flex; align-items: center; gap: 10px; }
.assignee { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.chip-sm { display: inline-block; padding: 2px 9px; margin: 2px 4px 2px 0; border-radius: 99px; background: var(--grey-bg); color: var(--grey-ink); font-size: 12.5px; font-weight: 600; }
.region-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; }
.region-list > li { border-bottom: 1px solid var(--line-soft); }
.region-list summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; cursor: pointer; list-style: none; }
.region-list summary::-webkit-details-marker { display: none; }
.region-list summary::after { content: "Editează"; color: var(--accent-ink); font-size: 13px; font-weight: 600; margin-left: auto; padding-left: 12px; }
.region-list details[open] summary::after { content: "Închide"; }
.region-list summary > span:first-child { min-width: 0; }
.region-form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.4fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.region-form.add { margin: 0; }
@media (max-width: 720px) { .region-form { grid-template-columns: 1fr; } }
.region-del { margin: 0 0 12px; }
.danger-link { color: var(--red-ink); }
.matrix th.c, .matrix td.c { text-align: center; }
.matrix .ok { color: var(--green-ink); display: inline-flex; }
.check-grid { display: flex; flex-wrap: wrap; gap: 0 20px; }
.label-like { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.type-seg { margin-bottom: 18px; }
.field.is-off { opacity: .5; }
table.data.compact th, table.data.compact td { padding-left: 10px; padding-right: 10px; }
table.data.compact th:first-child, table.data.compact td:first-child { padding-left: 16px; }

/* v1.5.4.6 · Activitate: editare cu creion și cardul Detalii */
.pen { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; flex-shrink: 0; }
.pen:hover { color: var(--accent-ink); border-color: var(--accent); }
.title-view { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-input { display: none; align-items: center; gap: 8px; flex-wrap: wrap; }
.title-input input { flex: 1 1 360px; font-size: 22px; font-weight: 700; padding: 8px 12px; }
.title-input .err { flex-basis: 100%; }
.title-edit.editing .title-view { display: none; }
.title-edit.editing .title-input { display: flex; }
.type-view { display: flex; align-items: center; gap: 10px; }
.type-pick .type-seg { display: none; margin: 14px 0 0; }
.type-pick.editing .type-view + .type-seg { margin-top: 14px; }
.type-pick:not(:has(.type-view)) .type-seg { margin-top: 0; }
.type-pick.editing .type-seg { display: inline-flex; }
.detail-owner { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.detail-owner .assignee strong { display: block; }
.d-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.d-sub { display: block; font-size: 12.5px; }
.detail-owner .field { margin: 0; }

/* v1.5.4.8 · Formular client pe 3 coloane fixe; import clienți */
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.three .field:has(#id_owner) { grid-column: 1 / span 1; }
@media (max-width: 860px) { .form-grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .form-grid.three { grid-template-columns: 1fr; } }
.filters .push-right { margin-left: auto; }
.steps { list-style: none; display: flex; gap: 8px; margin: -6px 0 0; padding: 0; counter-reset: st; flex-wrap: wrap; }
.steps li { counter-increment: st; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--muted); }
.steps li::before { content: counter(st); width: 24px; height: 24px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; background: var(--grey-bg); font-size: 12.5px; }
.steps li.now { color: var(--ink); border-color: var(--accent); }
.steps li.now::before { background: var(--accent); color: #fff; }
.steps li.done::before { content: "✓"; background: var(--green-bg); color: var(--green-ink); }
.verdict { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.verdict.ok { background: var(--green-bg); color: var(--green-ink); }
.verdict.warn { background: var(--amber-bg); color: var(--amber-ink); }
.verdict.bad { background: var(--red-bg); color: var(--red-ink); }
.err-list { margin: 0; padding-left: 20px; color: var(--red-ink); }
.import-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; margin: 0 0 14px; }
.import-facts dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.import-facts dd { margin: 2px 0 0; font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.confirm-box { margin-top: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--accent); background: var(--accent-soft); }
.confirm-box p { margin: 0 0 12px; font-size: 16px; }
.hint-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* v1.5.4.9 · Ștergere client */
.delete-box { max-width: 720px; }
.delete-box .q { font-size: 17px; margin: 0 0 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn.danger-solid { background: var(--red-ink); border-color: var(--red-ink); color: #fff; }
.btn.danger-solid:hover { background: #7A150D; }
.btn.danger-solid:disabled { opacity: .45; cursor: not-allowed; }

/* v1.5.5.0 · Securitate: avertizare sesiune, jurnal de audit */
.session-warn { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.session-warn .card { max-width: 420px; width: 100%; box-shadow: 0 20px 40px rgba(17, 24, 39, .25); }
.session-warn h2 { font-size: 19px; margin: 0 0 8px; }
.audit-changes { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.audit-changes li { overflow-wrap: anywhere; }
.audit-changes .k { color: var(--muted); }
.audit-filters { flex-wrap: wrap; }
.audit-filters input[type=date] { max-width: 170px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; }
.immutable-note { display: inline-flex; align-items: center; gap: 8px; color: var(--green-ink); font-weight: 600; font-size: 13.5px; }

/* v1.5.5.2 · Taburi Activități */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: -6px; }
.tabs .tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-weight: 700; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--grey-bg); color: var(--grey-ink);
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.tabs .tab.on .tab-count { background: var(--accent-soft); color: var(--accent-ink); }
.impact { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.btn.icon-only { padding: 0 10px; }

/* v1.5.5.3 */
.vat-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; }
.tier-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.tier-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.3fr) auto; gap: 10px; align-items: end; }
.tier-row.removing { opacity: .45; }
@media (max-width: 720px) { .tier-row { grid-template-columns: 1fr; } }
.tier { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px; }
.tier-0 { background: var(--ink); color: #fff; }
.tier-1 { background: #FEF3C7; color: #92400E; }
.tier-2 { background: #E5E7EB; color: #374151; }
.tier-3, .tier-4, .tier-5 { background: var(--accent-soft); color: var(--accent-ink); }
.client-warning { display: flex; gap: 10px; align-items: flex-start; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; min-width: 96px; }

/* Rapoarte (v1.5.5.4) */
.r-dates { display: inline-flex; align-items: center; gap: 6px; }
.r-dates[hidden] { display: none; }
.r-dates input { width: auto; }
.r-period { margin: 14px 0 0; font-size: 14px; }
.chg { display: inline-block; font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--line-soft); color: var(--muted); }
.chg.up { background: #DCFCE7; color: #166534; }
.chg.down { background: #FEE2E2; color: #991B1B; }
.rchart { display: flex; align-items: flex-end; gap: 10px; height: 240px; padding-top: 8px; border-bottom: 1px solid var(--line-strong); }
.rchart.dense { gap: 3px; }
.rcol { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.rbar { width: 100%; max-width: 48px; min-height: 3px; background: #BFDBFE; border-radius: 8px 8px 3px 3px; transition: height .2s, background .15s; }
.rchart.dense .rbar { border-radius: 3px 3px 1px 1px; }
.rcol:hover .rbar { background: #93C5FD; }
.rcol.now .rbar { background: var(--accent); }
.rlabels { display: flex; gap: 10px; margin-top: 8px; }
.rlabels.dense { gap: 3px; }
.rlabels span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: visible; }

/* v1.6 · Activități: taburi mari, obiective pe echipă, bifă rapidă */
.act-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.act-tab { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--surface);
  border: 2px solid var(--line); color: var(--ink); transition: border-color .15s, background .15s; }
.act-tab:hover { border-color: var(--accent); }
.act-tab .act-ic { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--grey-bg); color: var(--muted); flex: none; }
.act-tab .act-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.act-tab .act-txt strong { font-size: 18px; }
.act-tab .act-txt small { color: var(--muted); font-size: 13px; }
.act-tab .act-count { display: flex; flex-direction: column; align-items: flex-end; font-size: 22px; font-weight: 700; line-height: 1.1; }
.act-tab .act-count small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.act-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .25); }
.act-tab.on .act-ic { background: rgba(255, 255, 255, .18); color: #fff; }
.act-tab.on .act-txt small, .act-tab.on .act-count small { color: rgba(255, 255, 255, .85); }
.team-av { background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.lbl-plain { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.assign-seg { margin-bottom: 4px; }
.assign-seg span { padding: 7px 12px; font-size: 13.5px; }
table.contrib { margin-top: 10px; }
table.data th.c, table.data td.c { text-align: center; }
.done-check { width: 20px; height: 20px; accent-color: var(--green-ink); cursor: pointer; }
.done-check:disabled { cursor: default; }
dialog.confirm { border: none; border-radius: 18px; padding: 24px; max-width: 440px; width: calc(100% - 32px);
  box-shadow: 0 20px 50px rgba(17, 24, 39, .25); }
dialog.confirm::backdrop { background: rgba(17, 24, 39, .45); }
dialog.confirm h2 { font-size: 19px; margin: 0 0 8px; }
dialog.confirm p { margin: 0 0 18px; color: var(--muted); }

/* v1.6.2 · Planuri */
.plan-required { max-width: 560px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.plan-required h1 { font-size: 24px; margin: 0; }
.plan-required p { margin: 0; }
.plan-pill { font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); }

/* v1.6.2.1 · Comutatorul TVA din Panoul de control: jumătate din înălțimea de dinainte (~46px → ~23px) */
.vat-bar { font-size: 12px; gap: 8px; }
.vat-bar .seg { padding: 2px; gap: 2px; border-radius: 8px; }
.vat-bar .seg span { padding: 1px 9px; font-size: 12px; line-height: 1.3; border-radius: 6px; }
.vat-bar .vat-note { font-size: 12px; padding: 3px 10px; gap: 6px; }
.vat-bar .vat-note svg { width: 13px; height: 13px; }


/* ==========================================================================
   v1.6.3 · Varianta pentru telefon (ecrane până la 720px)
   Bară de sus cu titlul paginii · meniu glisant din stânga · liste ca fișe · filtre pliabile ·
   buton flotant pentru „nou” · bară fixă de salvare · câmpuri de 16px (fără zoom automat pe iPhone).
   ========================================================================== */
.m-top, .m-scrim, .m-filter-btn, .rail-foot, .me-org { display: none; }
.m-only, .m-icon.m-close, .m-icon.sheet-close { display: none !important; }
.rail-top { display: contents; }
.m-search-row { display: contents; }
.m-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 0; border-radius: 12px; background: none; color: inherit; cursor: pointer; }

/* Alegere prin butoane (Tip caz) și termen rapid – pe toate ecranele */
.choice-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-field legend { padding: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 14.5px; color: var(--grey-ink); text-align: center; }
.choice input:checked + span { background: var(--accent-soft); border-color: #93B4F5; color: var(--accent-ink); }
.choice input:focus-visible + span { outline: 3px solid #60A5FA; outline-offset: 2px; }
.due-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.due-chips .chip { min-height: 36px; padding: 6px 12px; font-size: 13.5px; color: var(--grey-ink); }
.due-chips .chip[aria-pressed="true"] { background: var(--accent-soft); border-color: #93B4F5; color: var(--accent-ink); }
.sheet-form { display: flex; flex-direction: column; gap: 14px; }

/* Avatare colorate diferit pe persoană */
.av-t1 { background: #DCFCE7; color: #166534; }
.av-t2 { background: #EDE7FB; color: #5132A8; }
.av-t3 { background: #FFF1DB; color: #8A4B00; }
.av-t4 { background: #FCE7F3; color: #9D174D; }
.av-none { background: var(--grey-bg); color: var(--muted); }

/* Fișe de caz */
.tcards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.tc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tc-title { font-size: 16.5px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.tc-client { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 700; font-size: 14px; }
.tc-client a { color: var(--ink); }
.tc-desc { margin: 0; color: var(--muted); font-size: 14px; }
.tc-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.tc-due { flex: 1; min-width: 0; font-size: 13.5px; }
.tc-actions { display: flex; gap: 6px; margin: 0; }
.due-late { color: var(--red-ink); font-weight: 600; }
.due-soon { color: #B45309; font-weight: 600; }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.pill-red.dot { background: #FEECEB; color: #C0261A; }
.kind { display: inline-flex; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.kind-livrare { background: var(--blue-bg); color: var(--blue-ink); }
.kind-calitate { background: var(--violet-bg); color: var(--violet-ink); }
.kind-pret { background: #FEF3C7; color: #92400E; }
.kind-altele { background: var(--grey-bg); color: var(--grey-ink); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }

@media (max-width: 720px) {
  .tcards.m-only { display: flex !important; }
  .btn.m-only { display: inline-flex !important; }
  .d-only, .m-hide { display: none !important; }

  /* Bara de sus */
  .m-top { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30;
    min-height: 56px; padding: env(safe-area-inset-top) 12px 0 4px; background: var(--rail); color: #fff; }
  .m-logo { display: inline-flex; flex: none; }
  .m-logo svg { width: 26px; height: 26px; }
  .m-title { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-me { width: 36px; height: 36px; flex: none; border-radius: 99px; background: #DBEAFE; color: #1E3A8A;
    font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
  .m-me:hover { color: #1E3A8A; }

  /* Meniul glisant */
  .shell { display: block; min-height: 0; }
  .rail, .nav-open .rail {
    position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(304px, 84vw); height: auto; flex-direction: column;
    gap: 2px; padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain; transform: translateX(-102%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s; box-shadow: 8px 0 30px rgba(0, 0, 0, .25);
  }
  .m-drawer .rail { transform: none; visibility: visible; transition: transform .22s ease; }
  .m-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(17, 24, 39, .55); }
  html.m-drawer, html.m-sheet { overflow: hidden; }
  .rail-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; order: -2; margin-bottom: 10px; }
  .rail .logo-btn { margin: 0; flex: 1; width: auto; }
  .rail .brand .ver { display: none; }
  .m-icon.m-close { display: inline-flex !important; color: var(--rail-icon); }
  .rail .lbl, .nav-open .rail .lbl { display: block; }
  .rail a, .rail .nav-btn { min-height: 46px; padding: 0 12px; gap: 14px; font-size: 16px; }
  .rail a.on { background: rgba(255, 255, 255, .08); color: #fff; }
  .rail a.on svg { color: var(--accent-light); }
  .rail .badge, .nav-open .rail .badge { position: static; margin-left: auto; min-width: 24px; height: 24px; background: #FEE2E2; color: #B91C1C; font-size: 12.5px; }
  .rail .me-link { order: -1; min-height: 64px; margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: #1F2937; }
  .rail .me-link.on { background: #273244; }
  .rail .me-name { font-size: 16px; }
  .me-org { display: inline; }
  .rail .me-role { white-space: normal; overflow-wrap: anywhere; }
  .rail .spacer { flex: none; height: 1px; margin: 10px 4px; background: rgba(255, 255, 255, .1); }
  .rail .logout-form { order: 2; margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
  .rail .logout-form .nav-btn { color: #F87171; }
  .rail-foot { display: block; order: 3; margin: 8px 0 0; padding: 0 12px; color: var(--rail-icon); font-size: 12.5px; overflow-wrap: anywhere; }

  /* Pagina */
  body { font-size: 15px; }
  .content { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); gap: 16px; }
  .page-head { gap: 10px; }
  .page-head h1 { font-size: 22px; }
  .page-head h1.m-dup { display: none; }
  .page-head .title:not(:has(> :not(h1.m-dup))) { display: none; }
  .page-head p { margin: 0; font-size: 14px; }
  .client-head h1 { font-size: 22px; }
  .client-head { padding: 18px; gap: 14px; }
  .avatar { width: 52px; height: 52px; font-size: 18px; border-radius: 14px; }
  .card.pad, .kpi, .integration { padding: 16px; }
  .card > .card-head.in { padding: 16px 16px 0; }
  .card-head h2 { font-size: 17px; }

  /* Câmpuri și butoane: ținte de atingere de 44–48px, text de 16px */
  input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password],
  input[type=search], select, textarea { font-size: 16px; min-height: 48px; }
  .search input { min-height: 0; }
  .btn { height: auto; min-height: 48px; white-space: normal; text-align: center; line-height: 1.2; padding-top: 6px; padding-bottom: 6px; }
  .btn.sm { min-height: 40px; }
  .search { flex: 1 1 auto; max-width: none; height: 48px; }

  /* Filtre pliabile */
  .filters { gap: 10px; }
  .m-search-row { display: flex; gap: 10px; flex: 1 1 100%; min-width: 0; }
  .m-filter-btn { display: inline-flex; position: relative; width: 48px; height: 48px; flex: none; align-items: center; justify-content: center;
    border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink); cursor: pointer; }
  .m-filter-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
  .m-filter-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
    background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
  .filters.m-collapsible:not(.m-open) > :not(.m-search-row) { display: none !important; }
  .filters > select, .filters .date-filter { flex: 1 1 100%; width: 100%; min-width: 0; }
  .filters .date-filter input { flex: 1; }
  .filters > .btn { flex: 1 1 auto; }
  .filters .push-right { margin-left: 0; }

  /* Butonul flotant „nou” */
  .content > .fab, .fab { position: fixed; z-index: 40; width: auto; left: auto; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); min-height: 56px; padding: 0 22px;
    border-radius: 99px; font-size: 16px; box-shadow: 0 10px 24px rgba(37, 99, 235, .35); }
  .fab svg { width: 20px; height: 20px; }

  /* Bara fixă de salvare */
  .form-actions { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; margin: 0 !important; display: flex; gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .form-actions .btn { flex: 1 1 0; min-height: 52px; margin: 0 !important; font-size: 16px; }
  .form-actions .btn:not(.primary) { flex: 0 1 auto; }

  /* Tabele → fișe */
  .table-wrap:has(> table.m-stack) { overflow: visible; }
  .card > .table-wrap { margin-top: 0; }
  table.m-stack, table.m-stack tbody { display: block; }
  table.m-stack thead { display: none; }
  table.m-stack tr { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.m-stack tr:last-child { border-bottom: 0; }
  table.m-stack td { display: block; flex: 1 1 calc(50% - 8px); min-width: 0; padding: 0 !important; border: 0; white-space: normal;
    text-align: left !important; font-size: 14px; overflow-wrap: anywhere; }
  table.m-stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
  table.m-stack td:first-child { flex-basis: 100%; font-size: 15.5px; }
  table.m-stack td:first-child::before { display: none; }
  table.m-stack td.m-full, table.m-stack td:has(.row-actions) { flex-basis: 100%; }
  table.m-stack td:has(.row-actions)::before { display: none; }
  table.m-stack td.wrap { min-width: 0 !important; }
  table.m-stack .m-off { display: none; }
  /* Statusul stă sus, în dreapta titlului */
  table.m-stack tr:has(> .m-badge) > td:first-child { flex: 1 1 0; order: 1; }
  table.m-stack td.m-badge { flex: none; order: 2; }
  table.m-stack td.m-badge::before { display: none; }
  table.m-stack tr:has(> .m-badge)::after { content: ""; flex-basis: 100%; order: 2; height: 0; margin-top: -10px; }
  table.m-stack tr:has(> .m-badge) > td:not(:first-child):not(.m-badge) { order: 3; }
  table.m-stack .row-actions, table.m-stack .ticket-actions { justify-content: flex-start; }
  table.m-stack .empty { padding: 20px 0; }
  table.data.keep th, table.data.keep td { padding: 10px 12px; }

  /* Indicatori pe două coloane */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi.hero { grid-column: 1 / -1; }
  .kpi .lbl { font-size: 13px; gap: 8px; }
  .kpi .val { font-size: 24px; margin-top: 6px; }
  .kpi .sub { font-size: 12.5px; }
  .kpi .ic { width: 28px; height: 28px; }

  /* Activități: taburi compacte */
  .act-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .act-tab { padding: 12px; gap: 10px; }
  .act-tab .act-ic { display: none; }
  .act-tab .act-txt strong { font-size: 16px; }
  .act-tab .act-txt small { display: none; }
  .act-tab .act-count { font-size: 20px; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs .tab { white-space: nowrap; padding: 10px 12px; }

  /* Alerte și liste */
  .alert-item { flex-wrap: wrap; gap: 8px 12px; }
  .alert-item .body { flex: 1 1 calc(100% - 100px); }
  .alert-item > .pill { order: -1; }

  /* Grafice și calendar */
  .bars, .rchart { gap: 4px; height: 180px; }
  .bar-labels, .rlabels { gap: 4px; }
  .bar-labels span, .rlabels span { font-size: 10.5px; }
  .pie { width: 140px; height: 140px; }
  .pie-hole { width: 80px; height: 80px; }
  .cal-head h2 { min-width: 0; flex: 1; font-size: 17px; }
  .vat-bar { justify-content: flex-start; margin: 0; flex-wrap: wrap; }
  .steps li { font-size: 13px; }
  .row-actions { justify-content: flex-start; }

  /* Formular în foaie pe tot ecranul (Caz nou) */
  .sheet { display: none; }
  .sheet.open { display: block; position: fixed; inset: 0; z-index: 70; margin: 0; border: 0; border-radius: 0; overflow-y: auto;
    padding: 0 16px calc(100px + env(safe-area-inset-bottom)); }
  .sheet .sheet-head { position: sticky; top: 0; z-index: 2; margin: 0 -16px 8px; padding: env(safe-area-inset-top) 12px 0 4px; min-height: 60px;
    background: var(--surface); border-bottom: 1px solid var(--line); justify-content: flex-start; flex-wrap: nowrap; gap: 6px; }
  .sheet .sheet-head h2 { font-size: 19px; }
  .m-icon.sheet-close { display: inline-flex !important; color: var(--ink); }
  .sheet-form .field label, .sheet-form .label-like { font-size: 15px; color: var(--ink); font-weight: 700; }
}
@media (max-width: 720px) {
  .done-check { width: 26px; height: 26px; }
  .tc-actions .btn.ghost { padding: 0 8px; }
  .tc-due { line-height: 1.3; }
}

/* v1.6.4 · Rezoluția unui caz închis */
.resolution { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; padding: 6px 10px; border-radius: 10px;
  background: var(--green-bg, #E9F7EF); color: var(--green-ink, #166534); font-size: 13px; line-height: 1.4; }
.resolution svg { flex: none; margin-top: 2px; }
dialog.confirm .field textarea { width: 100%; }

/* ==========================================================================
   v1.6.4 · Calendar: sarcini și obiective la data țintă
   ========================================================================== */
.cal-head { flex-wrap: wrap; }
.cal-count { margin-left: auto; font-size: 13.5px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -6px 0 10px; font-size: 12.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-grid td { height: 112px; padding: 6px 6px 8px; font-weight: 400; }
.cal-day { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; }
.cal-num { font-weight: 600; color: inherit; padding: 0 4px; }
a.cal-num:hover { color: var(--accent-ink); }
.cal-grid td.today .cal-num { display: inline-flex; min-width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 99px; background: var(--accent); color: #fff; }
.cal-add { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 8px; color: var(--muted); opacity: 0; }
.cal-grid td:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--accent-soft); color: var(--accent-ink); }
.cal-grid td.other .cal-add { display: none; }
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ev { display: block; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid; }
.ev-sarcina { background: var(--blue-bg); color: var(--blue-ink); border-color: #3B82F6; }
.ev-obiectiv { background: var(--violet-bg); color: var(--violet-ink); border-color: #7C5CD6; }
.ev.ev-late { background: #FEECEB; color: #B42318; border-color: #E5483B; }
.ev.ev-done { background: var(--grey-bg); color: var(--muted); border-color: #C9CDD3; text-decoration: line-through; }
.ev:hover { filter: brightness(.96); }
.ev-more-item { display: none; }
td.ev-open .ev-more-item { display: list-item; }
.ev-more { margin-top: 3px; padding: 1px 6px; border: 0; background: none; color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; border-radius: 6px; }
.ev-more:hover { background: var(--accent-soft); }
.ev-dots { display: none; }
.ev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; }
.ev-dot.ev-sarcina { background: #3B82F6; }
.ev-dot.ev-obiectiv { background: #7C5CD6; }
.ev-dot.ev-late { background: #E5483B; }
.ev-dot.ev-done { background: #C9CDD3; }
.cal-agenda { flex-direction: column; gap: 16px; }
.agenda-day h3 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.agenda-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.agenda-bar { align-self: stretch; width: 4px; border-radius: 4px; background: #3B82F6; flex: none; }
.agenda-item.ev-obiectiv .agenda-bar { background: #7C5CD6; }
.agenda-item.ev-late .agenda-bar { background: #E5483B; }
.agenda-item.ev-done { opacity: .65; }
.agenda-item.ev-done strong { text-decoration: line-through; }
.agenda-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agenda-body strong { font-size: 15px; overflow-wrap: anywhere; }
.agenda-body small { color: var(--muted); font-size: 13px; }
@media (max-width: 720px) {
  .cal-agenda.m-only { display: flex !important; }
  .cal-count { flex-basis: 100%; margin: 0; text-align: center; }
  .cal-grid td { height: 52px; padding: 4px; text-align: center; }
  .cal-day { justify-content: center; margin: 0; }
  .cal-add, .ev-list, .ev-more { display: none !important; }
  .ev-dots { display: flex; justify-content: center; gap: 3px; margin-top: 4px; }
  .ev-dot { width: 6px; height: 6px; }
  .cal-legend { justify-content: center; }
  .agenda-day { scroll-margin-top: 70px; }
}
