/* Mysiteco CRM — aceeași identitate ca Mysiteco Analytics Mysiteco: Inter Tight (titluri) + Manrope (text), albastru închis #133477 și albastru electric #2A68FF */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/manrope-latin.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("../fonts/inter-tight-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("../fonts/inter-tight-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF; }

:root {
  --navy-950: #0B1F4A;
  --navy-900: #10295E;
  --navy: #133477;
  --navy-700: #294B84;
  --blue: #2A68FF;
  --blue-500: #4F7FFF;
  --blue-300: #7A9EFF;
  --blue-200: #AFC5FF;
  --blue-100: #E3EAFF;
  --blue-50: #F0F4FF;
  --canvas: #F5F6FB;
  --surface: #FFFFFF;
  --line: #E7E9F0;
  --line-strong: #DFE3EC;
  --text: #1B2642;
  --muted: #5C6880;
  --faint: #8C96AB;
  --red: #E0483B;
  --red-50: #FEF4F3;
  --green: #138A5A;
  --green-50: #EAF7F1;

  --f-head: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 11px;
  --rail: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-body); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--canvas); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 500; letter-spacing: -.022em; color: var(--navy-900); margin: 0; line-height: 1.15; }
h1 { font-size: clamp(1.6rem, 2.2vw, 2.05rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; letter-spacing: -.012em; }
p { margin: 0 0 .8em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; vertical-align: -.125em; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 22px 16px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; color: #fff; }
.rail-brand img { height: 26px; width: auto; display: block; }
.rail-brand span { font-family: var(--f-head); font-size: 13px; color: var(--blue-200); padding-left: 10px; border-left: 1px solid rgba(255,255,255,.2); line-height: 1; }
.rail-brand:hover { text-decoration: none; }

.site-switch { margin: 0 0 18px; }
.site-switch label { display: block; font-size: 12px; color: var(--blue-200); margin: 0 8px 6px; }
.site-switch select { width: 100%; appearance: none; background: rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23AFC5FF' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center / 11px;
  border: 1px solid rgba(255,255,255,.14); color: #fff; font: 600 14px var(--f-body); padding: 11px 36px 11px 14px; border-radius: var(--r-md); cursor: pointer; }
.site-switch select option { color: var(--text); }
.site-switch .add-site { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--blue-200); margin: 8px 8px 0; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: #D6E0FF; font-weight: 600; font-size: 14.5px; }
.nav a .ico { font-size: 16px; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--navy); }
.nav a[aria-current="page"] .ico { opacity: 1; color: var(--blue); }
.nav-sep { height: 1px; background: rgba(255,255,255,.12); margin: 14px 8px; }
.rail-foot { margin-top: auto; padding: 14px 8px 0; font-size: 13px; color: var(--blue-200); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail-foot button { background: none; border: 0; color: var(--blue-200); font: inherit; cursor: pointer; padding: 4px 0; }
.rail-foot button:hover { color: #fff; }

.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 64px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar .sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.mobile-bar { display: none; }

/* --------------------------------------------------------------- range */
.range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9999px; padding: 3px; }
.seg a { padding: 6px 13px; border-radius: 9999px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg a:hover { color: var(--navy); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--navy); color: #fff; }
.range details { position: relative; }
.range summary { list-style: none; cursor: pointer; padding: 7px 13px; border: 1px solid var(--line); border-radius: 9999px; background: var(--surface); font-weight: 600; font-size: 13px; color: var(--muted); }
.range summary::-webkit-details-marker { display: none; }
.range details[open] summary, .range summary.on { color: var(--navy); border-color: var(--blue-200); }
.range .pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: grid; gap: 10px; min-width: 240px; box-shadow: 0 18px 40px -18px rgba(19,52,119,.35); }

/* -------------------------------------------------------------- panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; min-width: 0; }
.panel + .panel, .grid + .panel, .panel + .grid, .grid + .grid { margin-top: 18px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 70ch; }
.panel-head .link { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 20px 24px 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }

/* ------------------------------------------------- hero: lead-uri pe canale */
.hero { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 28px 28px 24px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%;
  border: 64px solid rgba(42,104,255,.22); pointer-events: none; }
.hero-top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-label { color: var(--blue-200); font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.hero-figure { font-family: var(--f-head); font-weight: 500; font-size: clamp(3.4rem, 7vw, 5.6rem); line-height: .92; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.hero-figure small { font-size: .32em; letter-spacing: -.01em; color: var(--blue-200); margin-left: 10px; }
.hero-side { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-side div { min-width: 110px; }
.hero-side dt { color: var(--blue-200); font-size: 13px; }
.hero-side.light dt { color: var(--muted); }
.hero-side.light dd { color: var(--navy-900); }
.hero-side dd { margin: 2px 0 0; font-family: var(--f-head); font-size: 1.55rem; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.ribbon { display: flex; height: 20px; border-radius: 9999px; overflow: hidden; background: #fff; padding: 3px; margin: 26px 0 16px; position: relative; z-index: 1; gap: 2px; }
.ribbon span { display: block; height: 100%; min-width: 4px; }
.ribbon span:first-child { border-radius: 9999px 0 0 9999px; }
.ribbon span:last-child { border-radius: 0 9999px 9999px 0; }
.ribbon span:only-child { border-radius: 9999px; }
.ribbon.empty { background: rgba(255,255,255,.12); }
.ribbon.light { background: var(--canvas); margin: 6px 0 18px; height: 16px; padding: 0; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; position: relative; z-index: 1; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.legend b { font-weight: 700; font-variant-numeric: tabular-nums; }
.legend em { font-style: normal; color: var(--blue-200); font-variant-numeric: tabular-nums; }
.legend.dark em { color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.hero .dot { box-shadow: 0 0 0 1.5px #fff; }

/* ------------------------------------------------------------ KPI strip */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-top: 18px; }
.kpi { padding: 18px 22px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi dt { color: var(--muted); font-size: 13px; }
.kpi dd { margin: 4px 0 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kpi .v { font-family: var(--f-head); font-size: 1.7rem; font-weight: 500; letter-spacing: -.025em; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.delta { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--faint); }

/* ---------------------------------------------------------------- chart */
.chart-box { position: relative; height: 280px; }
.chart-box.short { height: 220px; }
.chart-legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.t th a { color: inherit; }
.t th a[aria-sort] { color: var(--navy); }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #FAFBFE; }
.t .num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t td:first-child, .t th:first-child { padding-left: 24px; }
.t td:last-child, .t th:last-child { padding-right: 24px; }
.panel:not(.flush) .t td:first-child, .panel:not(.flush) .t th:first-child { padding-left: 0; }
.panel:not(.flush) .t td:last-child, .panel:not(.flush) .t th:last-child { padding-right: 0; }
.cell-main { font-weight: 600; color: var(--navy-900); }
.cell-sub { font-size: 12.5px; color: var(--muted); max-width: 52ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.truncate { max-width: 44ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.bar-cell { position: relative; }
.bar-cell .bar { position: absolute; left: 0; top: 7px; bottom: 7px; background: var(--blue-50); border-radius: 6px; z-index: 0; }
.bar-cell > *:not(.bar) { position: relative; z-index: 1; }
tr.group td { background: var(--canvas); font-weight: 700; color: var(--navy-900); }

/* ------------------------------------------------------------- elements */
.chan { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 9999px; font-size: 12px; font-weight: 700; background: var(--blue-50); color: var(--navy); white-space: nowrap; }
.tag.ai { background: var(--blue-100); color: var(--blue); }
.tag.lead { background: var(--green-50); color: var(--green); }
.tag.grey { background: var(--canvas); color: var(--muted); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 0 0 rgba(19,138,90,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(19,138,90,.45); } 70% { box-shadow: 0 0 0 9px rgba(19,138,90,0); } 100% { box-shadow: 0 0 0 0 rgba(19,138,90,0); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 9999px; border: 1px solid transparent; background: var(--blue); color: #fff;
  font: 700 14px var(--f-body); cursor: pointer; white-space: nowrap; transition: background-color .15s; }
.btn:hover { background: #1F57E6; text-decoration: none; }
.btn.navy { background: var(--navy); }
.btn.navy:hover { background: var(--navy-900); }
.btn.ghost { background: var(--surface); color: var(--navy); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--blue-200); background: var(--blue-50); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #C9362C; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--blue); font: 600 13.5px var(--f-body); cursor: pointer; }
.btn-link.danger { color: var(--red); }

.field { display: grid; gap: 6px; align-content: start; }
.field + .field { margin-top: 14px; }
.field label, .lbl { font-weight: 600; font-size: 13.5px; color: var(--navy-900); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 12.5px; color: var(--red); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; font: 500 14.5px var(--f-body); color: var(--text); padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42,104,255,.15); }
.has-err input { border-color: var(--red); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.check:first-of-type { border-top: 0; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex-shrink: 0; }
.check b { display: block; font-weight: 600; color: var(--navy-900); }
.check span { font-size: 13px; color: var(--muted); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row .field + .field { margin-top: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 180px; }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-md); margin-bottom: 16px; font-weight: 600; font-size: 14px; }
.flash.ok { background: var(--green-50); color: var(--green); }
.flash.error { background: var(--red-50); color: var(--red); }
.flash.info { background: var(--blue-50); color: var(--navy); }

.code { position: relative; background: var(--navy-950); color: #D6E0FF; border-radius: var(--r-md); padding: 18px 20px; font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; }
.code-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; flex-wrap: wrap; }
code.inline { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--canvas); padding: 2px 6px; border-radius: 6px; color: var(--navy); }

.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.status .dot { border-radius: 50%; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { margin-bottom: 6px; }
.empty .btn { margin-top: 10px; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.pager nav { display: flex; gap: 6px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 9999px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); }
.chip:hover { text-decoration: none; color: var(--navy); border-color: var(--blue-200); }
.chip[aria-current="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .count { font-variant-numeric: tabular-nums; opacity: .75; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mini-list li:first-child { border-top: 0; }
.mini-list .k { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mini-list .k span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .v { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy-900); }

.callout { border-left: 3px solid var(--blue); background: var(--blue-50); padding: 14px 16px; border-radius: 0 var(--r-md) var(--r-md) 0; font-size: 14px; color: var(--navy-900); }
.callout p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------- visitor page */
.profile { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.profile div { padding: 4px 18px; border-left: 1px solid var(--line); }
.profile div:first-child { border-left: 0; padding-left: 0; }
.profile dt { font-size: 12.5px; color: var(--muted); }
.profile dd { margin: 3px 0 0; font-weight: 600; color: var(--navy-900); }
.session { border-top: 1px solid var(--line); padding: 18px 0; }
.session:first-of-type { border-top: 0; padding-top: 4px; }
.session-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }
.steps { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--blue-100); }
.steps li { position: relative; padding: 6px 0 6px 14px; font-size: 14px; display: flex; gap: 12px; justify-content: space-between; }
.steps li::before { content: ""; position: absolute; left: -24px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--blue-300); }
.steps li.ev::before { border-color: var(--green); background: var(--green-50); }
.steps li.lead::before { background: var(--green); border-color: var(--green); }
.steps time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-side { background: var(--navy); color: #fff; padding: 44px clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; left: -180px; bottom: -220px; width: 560px; height: 560px; border-radius: 50%; border: 90px solid rgba(42,104,255,.2); }
.auth-side img { height: 30px; width: auto; position: relative; z-index: 1; }
.auth-pitch { position: relative; z-index: 1; max-width: 30rem; }
.auth-pitch h1 { color: #fff; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.05; letter-spacing: -.03em; margin-bottom: 18px; }
.auth-pitch p { color: var(--blue-200); font-size: 16px; }
.auth-sources { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.auth-sources span { padding: 6px 12px; border-radius: 9999px; border: 1px solid rgba(255,255,255,.2); font-size: 13px; color: #D6E0FF; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.8rem; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 26px; }
.auth-card fieldset { border: 0; padding: 0; margin: 22px 0 0; }
.auth-card legend { font-family: var(--f-head); font-weight: 500; color: var(--navy-900); font-size: 1.02rem; margin-bottom: 12px; padding: 0; }
.auth-alt { margin-top: 22px; font-size: 14px; color: var(--muted); }


/* ================================================================ CRM */
.bad { color: var(--red); font-weight: 700; }
.good { color: var(--green); }
.pad { padding: 4px 24px 22px; margin: 0; }
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.stack > .panel + .panel { margin-top: 0; }
.ph { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.ph .ico { color: var(--blue); font-size: .95em; }
.narrow { max-width: 760px; }
.prose { margin-top: 18px; font-size: 14.5px; max-width: 72ch; }
input[type=number], input[type=tel], input[type=url] { width: 100%; font: 500 14.5px var(--f-body); color: var(--text); padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; }
textarea { resize: vertical; line-height: 1.5; }
fieldset[disabled] input, fieldset[disabled] select { background: var(--canvas); color: var(--muted); }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }

/* rail */
.rail-new { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 18px; padding: 10px 14px; border-radius: 9999px;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 14px; }
.rail-new:hover { background: #1F57E6; text-decoration: none; }
.nav a span { flex: 1; }
.nav-badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 9999px; background: rgba(255,255,255,.14); color: #fff; font-size: 11.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.nav-badge.alert { background: var(--red); }
.nav a[aria-current="page"] .nav-badge { background: var(--blue-100); color: var(--navy); }
.nav a[aria-current="page"] .nav-badge.alert { background: var(--red); color: #fff; }
.rail-foot .who { display: flex; align-items: center; gap: 9px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #D6E0FF; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-100); color: var(--navy); font: 700 12px var(--f-body); font-style: normal;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: .02em; }
.rail .avatar { background: rgba(255,255,255,.14); color: #fff; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.who { display: inline-flex; align-items: center; gap: 10px; }
.who > span { display: grid; }

/* topbar */
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.crumb .ico { font-size: 10px; }
.crumb:hover { color: var(--blue); text-decoration: none; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* status pill: punct colorat + text, culoarea vine din --c */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 9999px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  color: var(--navy-900); background: color-mix(in srgb, var(--c) 14%, #fff); }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

.progress { display: inline-block; width: 96px; height: 7px; border-radius: 9999px; background: var(--blue-50); overflow: hidden; vertical-align: middle; }
.progress span { display: block; height: 100%; background: var(--blue); border-radius: 9999px; transition: width .3s ease; }

/* prezentare */
.hero-empty { position: relative; z-index: 1; color: var(--blue-200); margin: 0; }
.hero-empty a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.legend a { display: inline-flex; align-items: center; gap: 8px; color: #fff; }
.legend a:hover { text-decoration: none; opacity: .85; }
.kpi .v.bad { color: var(--red); }
.kpi dd a { font-weight: 600; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.board-list li:first-child { border-top: 0; padding-top: 0; }
.board-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.board-progress .progress { flex: 1; }
.board-list .cell-sub { grid-column: 1 / -1; white-space: normal; }

/* taskuri */
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 24px; border-top: 1px solid var(--line); }
.task-list .task:first-child { border-top: 0; }
.panel-head + .task-list .task:first-child, .quick-add + .task-list .task:first-child { border-top: 1px solid var(--line); }
.task:hover { background: #FAFBFE; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; color: transparent; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; padding: 0; font-size: 11px; transition: border-color .15s, background-color .15s; }
.tick:hover { border-color: var(--blue); color: var(--blue-300); }
.is-done .tick, .tick[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.task-title { font-weight: 600; color: var(--navy-900); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-done .task-title { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.task-meta:empty { display: none; }
.task-meta .ico { font-size: 10px; opacity: .7; }
.pri-high { color: var(--red); font-weight: 700; }
.task-side { display: flex; align-items: center; gap: 10px; }
.due { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.late { color: var(--red); }
.done-tasks summary { cursor: pointer; padding: 12px 24px; font-size: 13px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line); list-style: none; }
.done-tasks summary::-webkit-details-marker { display: none; }
.done-tasks summary:hover { color: var(--navy); }

.quick-add { display: flex; gap: 8px; padding: 0 24px 16px; flex-wrap: wrap; }
.quick-add input[type=text] { flex: 1 1 220px; }
.quick-add input[type=date] { flex: 0 0 150px; }
.quick-add select { flex: 0 1 150px; width: auto; }
.quick-task { padding: 16px; }
.quick-task .qt-title { font-size: 16px; padding: 13px 15px; border-color: transparent; background: var(--canvas); }
.quick-task .qt-title:focus { background: #fff; }
.qt-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.qt-row select { flex: 1 1 140px; width: auto; padding: 8px 11px; font-size: 13.5px; }
.qt-row input[type=date] { flex: 0 0 150px; padding: 8px 11px; font-size: 13.5px; }
.quick-task + .filters { margin-top: 18px; }

/* filtre */
.filters .search { margin-left: auto; position: relative; display: flex; align-items: center; }
.filters .search .ico { position: absolute; left: 13px; color: var(--faint); font-size: 13px; pointer-events: none; }
.filters .search input { padding: 7px 14px 7px 34px; border-radius: 9999px; width: 260px; font-size: 13.5px; }
.filters-end { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-select select { width: auto; padding: 7px 34px 7px 13px; border-radius: 9999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.warn:not([aria-current]) { color: var(--red); border-color: #F5C9C4; }
.chip .ico { font-size: 11px; }

/* activitate */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.feed li:first-child { border-top: 0; }
.feed-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-50); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.feed-note .feed-ico { background: #FFF4DE; color: #B7791F; }
.feed-invoice .feed-ico { background: var(--green-50); color: var(--green); }
.feed-offboarding .feed-ico { background: #FFF4DE; color: #B7791F; }
.feed .cell-sub { white-space: normal; margin-top: 2px; }
.note-text { background: #FFFBF2; border-radius: var(--r-sm); padding: 9px 12px; }
.note-form { display: grid; gap: 8px; margin-bottom: 14px; justify-items: start; }
.note-form textarea { width: 100%; }

/* fișa clientului: drumul clientului */
.journey { padding: 24px 24px 20px; }
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.track li { position: relative; display: grid; justify-items: center; gap: 9px; text-align: center; }
.track li::before { content: ""; position: absolute; top: 8px; right: 50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.track li:first-child::before { display: none; }
.track li.past::before, .track li.now::before { background: var(--navy); }
.track-dot { width: 19px; height: 19px; border-radius: 50%; background: #fff; border: 3px solid var(--line-strong); position: relative; z-index: 1; }
.track li.past .track-dot { background: var(--navy); border-color: var(--navy); }
.track li.now .track-dot { width: 19px; height: 19px; background: var(--c); border-color: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent); }
.track-label { font-size: 13px; font-weight: 600; color: var(--faint); }
.track li.past .track-label { color: var(--muted); }
.track li.now .track-label { color: var(--navy-900); font-family: var(--f-head); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.journey-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.journey-note { margin: 0; color: var(--muted); font-size: 14px; }
.journey-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.journey-list { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.journey-list h2 { margin-bottom: 12px; }

/* checklist */
.checklist-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.checklist-head .progress { flex: 1; max-width: 360px; height: 8px; }
.checklist-head b { color: var(--navy-900); }
.steps-check { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps-check li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.steps-check li:first-child { border-top: 0; }
.step-title { flex: 1; font-weight: 600; color: var(--navy-900); font-size: 14.5px; }
.steps-check li.is-done .step-title { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; font-weight: 500; }
.step-meta { font-size: 12px; color: var(--faint); white-space: nowrap; }
.step-del { opacity: 0; transition: opacity .15s; }
.steps-check li:hover .step-del, .step-del:focus-within { opacity: 1; }
.icon-btn { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; padding: 0; }
.icon-btn:hover { background: var(--canvas); color: var(--navy); }
.add-step { margin-top: 12px; }
.add-step input { flex: 1 1 240px; padding: 9px 12px; font-size: 14px; }

/* fișa clientului: detalii */
.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 600; color: var(--navy-900); overflow-wrap: anywhere; }
.mini-list .k .pill { margin-left: 4px; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { font-size: 1.05rem; }
details.fold[open] > summary { margin-bottom: 14px; }
.danger-zone { border-color: #F5C9C4; }
.danger-zone summary h2 { color: var(--red); }
form.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
form.danger-zone .ph { margin: 0; width: 100%; }

/* onboarding / offboarding */
.boarding-start .inline-form { align-items: flex-end; }
.boarding-start .inline-form .field { flex: 0 1 380px; }
.boarding-start p { margin: 12px 0 0; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; margin-top: 18px; }
.board-grid + .panel { margin-top: 18px; }
.board-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.board-card h2 a { color: var(--navy-900); }
.board-card header p { margin: 4px 0 0; }

/* formulare */
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row-4 { grid-template-columns: 2fr 1fr 1fr 1fr; }
.radio-cards { display: grid; gap: 8px; margin-bottom: 16px; }
.radio-cards legend { margin-bottom: 8px; }
.radio-cards label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; }
.radio-cards label:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }
.radio-cards input { margin-top: 3px; accent-color: var(--blue); width: 17px; height: 17px; flex-shrink: 0; }
.radio-cards span { font-size: 13px; color: var(--muted); }
.radio-cards b { display: block; color: var(--navy-900); font-size: 14px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--canvas) 70%, rgba(245,246,251,0)); padding: 18px 0 6px; margin-top: 4px; z-index: 5; }
.sm-input { width: auto !important; padding: 6px 10px !important; font-size: 13px !important; border-radius: 9999px !important; }

/* setări */
.tabs { margin-bottom: 18px; flex-wrap: wrap; }
.tpl-list { list-style: none; margin: 0 0 4px; padding: 0; }
.tpl-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.tpl-list li:first-child { border-top: 0; }
.tpl-n { width: 24px; height: 24px; border-radius: 50%; background: var(--blue-50); color: var(--navy); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tpl-title { flex: 1; font-weight: 600; color: var(--navy-900); }
.tpl-tools { display: flex; gap: 2px; }

/* facturi: formular */
.t.lines td { padding-top: 6px; padding-bottom: 6px; }
.t.lines input { padding: 8px 10px; font-size: 14px; }
.t.lines input.num { text-align: right; font-variant-numeric: tabular-nums; }
.t.lines .w-unit { width: 84px; } .t.lines .w-qty { width: 100px; } .t.lines .w-price { width: 130px; } .t.lines .w-vat { width: 84px; }
.t.lines td[data-net] { width: 120px; font-weight: 600; color: var(--navy-900); }
.lines-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding: 14px 24px 22px; border-top: 1px solid var(--line); }
.totals { margin: 0; min-width: 260px; display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; gap: 24px; font-size: 14px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--navy-900); }
.totals .grand { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 3px; }
.totals .grand dt { color: var(--navy-900); font-weight: 700; }
.totals .grand dd { font-family: var(--f-head); font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; }

/* facturi: documentul */
.doc-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.doc-actions form { display: flex; gap: 6px; align-items: center; }
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 52px); max-width: 900px; position: relative; overflow: hidden; }
.doc.is-draft::after, .doc.is-cancelled::after { content: "Ciornă"; position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg);
  font: 600 clamp(4rem, 12vw, 8rem) var(--f-head); letter-spacing: -.04em; color: rgba(19,52,119,.06); pointer-events: none; }
.doc.is-cancelled::after { content: "Anulată"; color: rgba(224,72,59,.09); }
.doc-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 26px; border-bottom: 3px solid var(--navy); }
.doc-logo { height: 30px; width: auto; }
.doc-title { text-align: right; }
.doc-title h2 { font-size: 2.2rem; letter-spacing: -.035em; }
.doc-no { margin: 4px 0 12px; font-weight: 700; color: var(--blue); }
.doc-title dl { margin: 0; display: grid; gap: 2px; font-size: 13.5px; }
.doc-title dl div { display: flex; justify-content: flex-end; gap: 10px; }
.doc-title dt { color: var(--muted); }
.doc-title dd { margin: 0; font-weight: 600; min-width: 84px; font-variant-numeric: tabular-nums; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 26px 0; font-size: 13.5px; }
.doc-parties h3 { font-family: var(--f-body); font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-bottom: 6px; }
.doc-parties p { margin: 0 0 2px; }
.party-name { font-family: var(--f-head); font-size: 1.1rem; font-weight: 600; color: var(--navy-900); margin-bottom: 6px !important; }
.doc-lines { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc-lines th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 9px 8px; border-bottom: 1px solid var(--line-strong); background: var(--canvas); }
.doc-lines td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-lines .c-no { width: 36px; color: var(--muted); }
.doc-lines .rate { display: block; font-size: 11px; color: var(--faint); }
.doc-foot { display: flex; justify-content: space-between; gap: 32px; margin-top: 22px; flex-wrap: wrap; }
.doc-notes { flex: 1 1 280px; font-size: 13px; color: var(--muted); }
.doc-totals { min-width: 300px; }
.doc-legal { max-width: 900px; margin-top: 12px; }

/* auth & installer */
.auth-flow { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; counter-reset: f; }
.auth-flow li { padding: 6px 14px; font-size: 13px; color: #D6E0FF; border: 1px solid rgba(255,255,255,.2); border-left: 0; }
.auth-flow li:first-child { border-left: 1px solid rgba(255,255,255,.2); border-radius: 9999px 0 0 9999px; }
.auth-flow li:last-child { border-radius: 0 9999px 9999px 0; }
.auth-flow li:nth-child(2) { background: var(--blue); border-color: var(--blue); color: #fff; }
.auth-card legend { margin-bottom: 4px; }
.auth-card fieldset .muted { margin-bottom: 12px; }
.advanced { margin-top: 20px; }
.advanced summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--blue); }
.advanced .field { margin-top: 12px; }

/* ============================================ formularul de onboarding */
.intake-check { border-top: 0; margin-top: 6px; padding: 12px 14px; background: var(--blue-50); border-radius: var(--r-md); }
.intake-panel { border-color: var(--blue-200); }
.intake-panel.is-submitted { border-color: #BFE3D2; }
.intake-state { display: grid; gap: 4px; margin: 0 0 14px; }
.copy-field { display: flex; gap: 8px; margin-bottom: 12px; }
.copy-field input { font-size: 13px; padding: 8px 11px; color: var(--muted); background: var(--canvas); }
.intake-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.intake-btns form { display: inline; }
.intake-rotate { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.intake-rotate .btn-link, .intake-btns .btn-link { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.answers-apply { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.answers dl { margin: 0; }
.answers dl > div { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(0, 5fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.answers dl > div:first-child { border-top: 0; padding-top: 0; }
.answers dt { color: var(--muted); font-size: 13.5px; }
.answers dd { margin: 0; color: var(--navy-900); font-weight: 600; overflow-wrap: anywhere; }
.answers .empty-answer dd { font-weight: 500; }
.file-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-size: 13.5px; font-weight: 600; }
.file-list li > span:first-of-type, .file-list li > a:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .ico { color: var(--blue); }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--canvas); flex-shrink: 0; }

body.public { min-height: 100vh; display: flex; flex-direction: column; }
.pub-bar { background: var(--navy); color: #fff; padding: 16px clamp(16px, 4vw, 40px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pub-bar img { height: 26px; width: auto; }
.pub-for { font-family: var(--f-head); font-size: 14px; color: var(--blue-200); }
.pub-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 32px) 56px; }
.pub-foot { text-align: center; color: var(--faint); font-size: 12.5px; padding: 0 16px 28px; }
.pub-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.pub-steps { position: sticky; top: 24px; }
.pub-steps-head { font-size: 13px; color: var(--muted); margin: 0 0 10px 4px; }
.pub-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pub-steps li > a, .pub-steps li > span { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; color: var(--faint); }
.pub-steps li > a { color: var(--muted); }
.pub-steps li > a:hover { background: #fff; text-decoration: none; color: var(--navy); }
.pub-steps .sn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0; background: #fff; }
.pub-steps li.past .sn { background: var(--navy); border-color: var(--navy); color: #fff; }
.pub-steps li.now a { background: #fff; color: var(--navy-900); box-shadow: 0 1px 0 var(--line); }
.pub-steps li.now .sn { background: var(--blue); border-color: var(--blue); color: #fff; }
.pub-progress { display: none; height: 5px; background: var(--line); border-radius: 9999px; overflow: hidden; }
.pub-progress span { display: block; height: 100%; background: var(--blue); }
.pub-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(22px, 4vw, 40px); min-width: 0; }
.pub-card h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 8px; }
.pub-intro { color: var(--muted); max-width: 62ch; margin-bottom: 18px; }
.pub-hello { background: var(--blue-50); color: var(--navy-900); border-radius: var(--r-md); padding: 12px 16px; font-size: 14px; margin-bottom: 24px; }
.pub-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; margin-top: 22px; }
.pub-fields .field + .field { margin-top: 0; }
.pub-fields .field.wide { grid-column: 1 / -1; }
.pub-fields .field[hidden] { display: none; }
.req { color: var(--red); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 9999px; font-size: 14px; font-weight: 600; color: var(--text); background: #fff; transition: border-color .15s, background-color .15s; }
.opt span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--line-strong); background: #fff; flex-shrink: 0; }
.opt input[type=radio] + span::before { border-radius: 50%; }
.opt:hover span { border-color: var(--blue-200); }
.opt input:checked + span { border-color: var(--blue); background: var(--blue-50); color: var(--navy-900); }
.opt input:checked + span::before { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 2px #fff; }
.opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.opt-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.opt-cards .opt span { border-radius: var(--r-md); padding: 22px 18px; font-family: var(--f-head); font-size: 1.05rem; font-weight: 600; color: var(--navy-900); width: 100%; height: 100%; }
.consent { border-top: 0; padding: 14px 16px; background: var(--canvas); border-radius: var(--r-md); }
.has-err .opt span, .has-err .drop { border-color: var(--red); }
.has-err textarea, .has-err select { border-color: var(--red); }
.drop { position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; padding: 20px; border: 2px dashed var(--line-strong); border-radius: var(--r-md); background: var(--canvas); cursor: pointer; color: var(--muted); font-size: 14px; }
.drop:hover, .drop.is-over { border-color: var(--blue); background: var(--blue-50); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop b { color: var(--blue); }
.drop-names { font-size: 13px; font-weight: 600; color: var(--navy-900); }
.drop-names:empty { display: none; }
.pub-nav { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.save-state { margin-right: auto; font-size: 12.5px; color: var(--faint); }
.access-help { margin-top: 6px; }
.access-steps { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 10px; font-size: 14.5px; max-width: 70ch; }
.access-steps b { color: var(--navy-900); }
.pub-center { max-width: 560px; margin: 40px auto; text-align: center; }
.pub-center h1 { margin-bottom: 12px; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--green-50); color: var(--green); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.done-mark svg { width: 26px; height: 26px; }
@media (max-width: 860px) {
  .pub-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pub-steps { position: static; }
  .pub-steps ol { display: none; }
  .pub-steps-head { margin: 0 0 8px; }
  .pub-progress { display: block; }
  .pub-fields { grid-template-columns: minmax(0, 1fr); }
  .opt-cards { grid-template-columns: minmax(0, 1fr); }
  .answers dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .grid-3-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .rail { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(11,31,74,.45); z-index: 40; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 30; }
  .mobile-bar img { height: 22px; }
  .mobile-bar button { background: none; border: 0; color: #fff; font-size: 22px; padding: 4px; cursor: pointer; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 28px 24px; gap: 28px; }
  .auth-pitch h1 { font-size: 1.8rem; }
  .profile { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .profile div:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 620px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(n) { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .hero { padding: 22px 20px; }
  .panel { padding: 18px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .form-row .field + .field { margin-top: 14px; }
  .t td:first-child, .t th:first-child { padding-left: 18px; }
  .t td:last-child, .t th:last-child { padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 1180px) {
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .form-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .filters .search { margin-left: 0; order: 10; width: 100%; }
  .filters .search input { width: 100%; }
  .filters-end { margin-left: 0; }
  .track-label { font-size: 11.5px; }
  .track li.now .track-label { font-size: 13px; }
  .doc-parties { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .kpis-3 { grid-template-columns: minmax(0, 1fr); }
  .kpis-3 .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .kpis-3 .kpi:first-child { border-top: 0; }
}
@media (max-width: 620px) {
  .task { padding: 11px 18px; grid-template-columns: auto minmax(0, 1fr); }
  .task-side { grid-column: 2; }
  .quick-add, .pad { padding-left: 18px; padding-right: 18px; }
  .form-row-4 { grid-template-columns: minmax(0, 1fr); }
  .track { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
  .doc-head { flex-direction: column; }
  .doc-title { text-align: left; }
  .doc-title dl div { justify-content: flex-start; }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .board-grid { grid-template-columns: minmax(0, 1fr); }
  .lines-foot { padding: 14px 18px 18px; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .rail, .mobile-bar, .top-actions, .flash, .no-print, .doc-toolbar, .crumb { display: none !important; }
  .answers { break-inside: avoid; border: 0; padding: 0 0 12px; }
  .shell { display: block; }
  .main { padding: 0; }
  .doc { border: 0; padding: 0; max-width: none; border-radius: 0; }
  .doc-lines th { background: #F5F6FB !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-head { border-bottom-color: #133477; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.intake-panel h2 { display: flex; align-items: center; gap: 9px; }
.intake-panel h2 .ico { color: var(--blue); font-size: .9em; }
.intake-panel.wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 28px; align-items: start; margin-bottom: 18px; }
.intake-panel.wide .panel-head { margin-bottom: 8px; }
.intake-panel.wide > .panel-head, .intake-panel.wide > .intake-state, .intake-panel.wide > p { grid-column: 1; }
.intake-panel.wide > .copy-field, .intake-panel.wide > .intake-btns, .intake-panel.wide > .intake-rotate, .intake-panel.wide > form { grid-column: 2; }
.intake-panel.wide > .copy-field { grid-row: 1; margin-bottom: 0; }
.intake-panel.wide > .intake-btns { grid-row: 2; }
.intake-panel.wide > .intake-rotate { grid-row: 3; margin-top: 6px; padding-top: 0; border-top: 0; }
.intake-panel.wide > .intake-create { grid-row: 1 / span 2; align-self: center; justify-self: start; }
@media (max-width: 900px) { .intake-panel.wide { grid-template-columns: minmax(0, 1fr); } .intake-panel.wide > * { grid-column: 1 !important; grid-row: auto !important; } }
