/* BNM šriftas — Inter (SIL OFL 1.1, fonts/LICENSE-Inter.txt); naudojamas visur CRM */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-700.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/inter-800.woff") format("woff"); }

/* BNM CRM. Darbo įrankis: tamsiai mėlyna viršutinė juosta, baltos kortelės ant vėsiai pilko fono.
   Visos spalvos — tik per žetonus žemiau (šviesi ir tamsi tema). */
:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --sunken: #e3e8ef;
  --sunken-2: #e9edf2;
  --border: #dde2e9;
  --border-strong: #c8d0da;
  --text: #17202c;
  --muted: #5d6677;
  --faint: #8f97a6;

  --brand: #0f2a4a;
  --brand-text: #ffffff;
  --brand-muted: rgba(255, 255, 255, .72);
  --brand-line: rgba(255, 255, 255, .28);
  --brand-hover: rgba(255, 255, 255, .08);
  --nav-active: #8db8ff;
  --seg-active: #0f2a4a;

  --accent: #2e66d6;
  --accent-hover: #2556b8;
  --accent-soft: #e7eefc;
  --accent-line: #c9d8f6;
  --accent-text: #2152b0;
  --on-accent: #ffffff;

  --ok: #17803d;
  --ok-soft: #e5f3e9;
  --ok-line: #c3e3cc;
  --ok-solid: #17803d;
  --warn: #9a5d0b;
  --warn-soft: #fbf0dc;
  --warn-line: #efd9ad;
  --warn-solid: #b7791f;
  --danger: #c0392b;
  --danger-soft: #fbe8e5;
  --danger-line: #f1c5bf;
  --danger-solid: #c0392b;
  --lost-solid: #7b8495;
  --violet: #6941c6;
  --violet-soft: #efe9fb;
  --teal: #0f766e;
  --teal-soft: #ddf2ef;

  --avatar-bg: #d6deea;
  --avatar-text: #2f405c;
  --stage-bg: #e2e6ed;
  --stage-text: #4a5566;
  --stage-done-bg: #c9d8f5;
  --stage-done-text: #1f4b9c;
  --row-hover: #f4f7fc;
  --card-hover: #b9c7e3;
  --backdrop: rgba(12, 20, 34, .34);
  --toast-bg: #1d2735;
  --toast-text: #ffffff;
  --toast-action: #8db8ff;
  --badge: #e5483d;
  --login-a: #1d4170;
  --login-b: #0f2a4a;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 14px 36px rgba(16, 24, 40, .20);

  --radius: 8px;
  --topbar-h: 52px;
  --fee-mrr: #2e66d6; --fee-once: #c8641a; --fee-untyped: #8f97a6;
  --font: "Inter", sans-serif;
}



/* Profilio meniu viršutinėje juostoje */
.profile-btn { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 9px 0 4px; border-radius: 16px; border: 1px solid var(--brand-line);
  background: transparent; color: var(--brand-text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.profile-btn:hover, .profile-btn.active, .profile-btn[aria-expanded="true"] { background: var(--brand-hover); }
.profile-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800;
  background: rgba(255, 255, 255, .16); color: var(--brand-text); }
.profile-gear { color: var(--brand-muted); font-size: 13px; }
.profile-caret { color: var(--brand-muted); font-size: 10px; }
/* Kontaktai: įmonės + žmonės */
.dir-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.dir-search { width: 420px; max-width: 100%; }
.dir-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.co-av { flex: none; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--accent-soft); color: var(--accent-text); }
.people-chips { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.person-chip, .company-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 220px; height: 24px; padding: 0 8px 0 3px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-chip:hover, .company-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }
.pc-av { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 8px; font-weight: 800; background: var(--avatar-bg); color: var(--avatar-text); }
.company-chip .pc-av { border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); }
.dir-table td { vertical-align: middle; }
.people-list { display: grid; gap: 4px; }
.people-row { display: flex; gap: 10px; align-items: center; text-align: left; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.people-row:hover { background: var(--row-hover); border-color: var(--accent-line); }

/* ---------------- Agentai (Karolina) ---------------- */
.ag-page .mail-split { min-height: 420px; }
.agent-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px 12px; margin-bottom: 12px;
  background-image: linear-gradient(110deg, var(--violet-soft) 0%, transparent 38%); }
.agent-head { display: flex; align-items: center; gap: 14px; }
.agent-avatar { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 20px;
  color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 2px 8px rgba(139, 92, 246, .35); }
.agent-avatar.xl { width: 64px; height: 64px; font-size: 28px; margin-bottom: 6px; }
.agent-dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--surface); background: var(--faint); }
.agent-dot.ok { background: var(--ok-solid); } .agent-dot.run { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.agent-dot.bad { background: var(--danger-solid); } .agent-dot.off { background: var(--faint); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(59, 111, 216, .25); } }
.agent-id { min-width: 0; }
.agent-name { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 16px; }
.agent-state { margin-left: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.agent-state.ok { background: var(--ok-soft); color: var(--ok); } .agent-state.run { background: var(--accent-soft); color: var(--accent-text); }
.agent-state.bad { background: var(--danger-soft); color: var(--danger); }
.agent-desc { max-width: 760px; margin-top: 2px; }
.agent-actions { display: flex; gap: 8px; flex: none; }
.agent-meta { margin: 8px 0 0 60px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.funnel { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.funnel-step { position: relative; padding: 9px 14px 9px 22px; background: var(--sunken); display: flex; flex-direction: column; min-width: 0;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); margin-right: -6px; }
.funnel-step:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 8px 0 0 8px; padding-left: 14px; }
.funnel-step b { font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.funnel-step span { font-size: 12px; font-weight: 600; }
.funnel-step small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-step.s2 { background: var(--surface-2); color: var(--muted); } .funnel-step.s2 b { color: var(--muted); }
.funnel-step.s3 { background: var(--ok-soft); } .funnel-step.s3 b { color: var(--ok); }
.funnel-step.s4 { background: var(--violet-soft); } .funnel-step.s4 b { color: var(--violet); }
.agent-alert { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--text); font-size: 13px; }
.agent-stage { margin-top: 10px; display: flex; align-items: center; gap: 6px; color: var(--muted); flex-wrap: wrap; }
.stage-pill { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 9px; border: 1px dashed var(--border-strong); color: var(--muted); }
.stage-pill.on { border: 1px solid var(--violet); background: var(--violet-soft); color: var(--violet); }
.stage-arrow { color: var(--faint); }
.input.sm { height: 30px; font-size: 13px; width: auto; }
.ag-search { width: 230px; }
.fit-badge { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--muted); }
.fit-badge.hot { background: var(--ok-solid); color: #fff; } .fit-badge.warm { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.fit-badge.unknown { background: var(--accent-soft); color: var(--accent-text); }
.ag-item { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.ag-item.dim .mi-main { opacity: .72; }
.fit-badge.muted { background: var(--surface-2); color: var(--faint); border: 1px dashed var(--border-strong); }
.fit-gauge.muted { border-color: var(--border-strong); border-style: dashed; } .fit-gauge.muted b { color: var(--faint); }
.src-chip { font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.src-chip.cvonline { background: #e9f1ff; color: #1d4ed8; } .src-chip.cvmarket { background: #fff1e6; color: #c2410c; }
.fit-gauge { flex: none; width: 58px; height: 58px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 4px solid var(--border-strong); background: var(--surface); }
.fit-gauge b { font-size: 19px; line-height: 1; } .fit-gauge span { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 2px; }
.fit-gauge.hot { border-color: var(--ok-solid); } .fit-gauge.hot b { color: var(--ok); }
.fit-gauge.warm { border-color: var(--warn-solid); } .fit-gauge.warm b { color: var(--warn); }
.fit-reasons { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.fit-reasons li { display: flex; gap: 8px; align-items: baseline; }
.fit-reasons b { flex: none; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.fit-reasons .plus b { color: var(--ok); } .fit-reasons .minus b { color: var(--danger); } .fit-reasons .minus { color: var(--muted); }
.posts { display: grid; gap: 8px; margin-top: 4px; }
.post { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; background: var(--surface); }
.post-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-title { font-weight: 600; margin: 4px 0 2px; }
.post-note { margin-top: 5px; padding: 5px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.post-desc summary { cursor: pointer; color: var(--muted); margin-top: 6px; }
.post-desc .mail-text { max-height: 260px; overflow: auto; margin-top: 6px; }
.role-chip { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: var(--violet-soft); color: var(--violet); }
.card-head-row { display: flex; align-items: center; gap: 8px; }
.contacts { display: grid; gap: 8px; margin-top: 6px; }
.pc { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--sunken); }
.pc-main { flex: 1; min-width: 0; }
.pc-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1px; }
.pc .icon-btn { opacity: .55; } .pc:hover .icon-btn { opacity: 1; }
.employer-box { border: 1px dashed var(--accent-line); border-radius: 8px; padding: 10px 12px; background: var(--accent-soft); }
.employer-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.employer-row .input { flex: 1; min-width: 180px; } .employer-row .code-input { flex: 0 0 150px; min-width: 120px; }
.crm-history { margin-top: 6px; }
.runs-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; min-height: 320px; }
.runs { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.run-item { display: flex; gap: 8px; align-items: flex-start; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 7px 9px; cursor: pointer; color: var(--text); font: inherit; }
.run-item:hover { background: var(--row-hover); } .run-item.active { background: var(--accent-soft); border-color: var(--accent-line); }
.run-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--ok-solid); }
.run-dot.partial { background: var(--warn-solid); } .run-dot.error { background: var(--danger-solid); } .run-dot.running { background: var(--accent); }
.run-log { max-height: 60vh; overflow: auto; }
.timeline-log { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 2px solid var(--border); }
.timeline-log li { position: relative; padding: 4px 0 8px 16px; font-size: 13px; display: flex; gap: 10px; }
.timeline-log li::before { content: ""; position: absolute; left: -6px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ok-solid); }
.timeline-log li.lv-warn::before { border-color: var(--warn-solid); } .timeline-log li.lv-error::before { border-color: var(--danger-solid); }
.timeline-log li.lv-error { color: var(--danger); }
.tl-time { flex: none; color: var(--faint); font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.src-list { display: grid; gap: 6px; }

/* ---------------- Agentų perjungiklis ir agentė Lina ---------------- */
.agent-switch { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--sunken); }
.agent-tab { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 9px; padding: 4px 12px 4px 4px; cursor: pointer;
  font: inherit; color: var(--muted); text-align: left; }
.agent-tab:hover { color: var(--text); background: var(--surface-2); }
.agent-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.agent-tab-txt { display: flex; flex-direction: column; line-height: 1.15; }
.agent-tab-txt b { font-size: 13px; } .agent-tab-txt small { font-size: 11px; color: var(--muted); }
.agent-avatar.sm { width: 28px; height: 28px; font-size: 13px; box-shadow: none; }
.agent-avatar.lina { background: linear-gradient(135deg, #0ea5a4, #2563eb); box-shadow: 0 2px 8px rgba(14, 165, 164, .3); }
.agent-avatar.sm.lina { box-shadow: none; }
.agent-hero.lina { background-image: linear-gradient(110deg, var(--teal-soft) 0%, transparent 40%); }
.agent-avatar.gedas { background: linear-gradient(135deg, #f59e0b, #e8452c); box-shadow: 0 2px 8px rgba(232, 69, 44, .3); }
.agent-avatar.sm.gedas { box-shadow: none; }
.agent-hero.gedas { background-image: linear-gradient(110deg, var(--warn-soft) 0%, transparent 40%); }
.agent-hero.gedas .stage-pill.on { border-color: var(--warn-solid); background: var(--warn-soft); color: var(--warn); }
.ln-page.gedas { --chart: var(--accent); --chart-soft: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.ln-page.gedas .seg-chip { background: var(--accent-soft); color: var(--accent-text); }
.plan-box { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--accent-line); background: var(--accent-soft); }
.plan-box.bnm { border-color: var(--border-strong); background: var(--surface-2); }
.plan-letter { flex: none; min-width: 40px; height: 40px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 18px;
  background: var(--accent); color: var(--on-accent); }
.plan-box.bnm .plan-letter { background: var(--brand); color: var(--brand-text); font-size: 12px; }
.plan-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.plan-price { color: var(--accent-text); font-weight: 700; }
.plan-chip { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.risk-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.risk-dot.red { background: var(--danger-solid); } .risk-dot.amber { background: var(--warn-solid); }
.fin-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fin-table th { text-align: right; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.fin-table td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.fin-table th:first-child, .fin-table td:first-child { text-align: left; }
.fin-table td.neg { color: var(--danger); }
.offer-card { border: 1px solid var(--accent-line); border-radius: 10px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.offer-card.sent { border-color: var(--ok-line); }
.offer-card .card-head-row .md-label { margin-bottom: 0; }
.offer-fields { display: flex; flex-direction: column; gap: 8px; }
.offer-fields .field { margin: 0; }
.offer-body { min-height: 260px; line-height: 1.5; font-size: 13.5px; }
.offer-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.offer-actions .btn { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.agent-hero.lina .stage-pill.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.ln-page { --chart: var(--teal); --chart-soft: color-mix(in srgb, var(--teal) 45%, var(--surface)); --chart-track: var(--sunken); }
.ln-page.dash { height: auto; }
.ln-chips { margin: -2px 0 10px; }
.ln-page .mail-toolbar .ag-search { width: 240px; }
.ln-viewbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ln-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ln-dash { display: flex; flex-direction: column; gap: 12px; padding-bottom: 24px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kpi b { font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi span { font-size: 12.5px; font-weight: 600; color: var(--text); }
.kpi small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.accent { box-shadow: inset 3px 0 0 var(--teal); }
.kpi.muted b, .kpi.muted span { color: var(--faint); }
.ln-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.ln-card { min-width: 0; }
.ln-card .panel-body { display: flex; flex-direction: column; gap: 10px; }
.ln-card:first-child { grid-row: span 2; }
.ln-card .btn.sm { align-self: flex-start; }
/* horizontali juostinė diagrama */
.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.barlist li { display: grid; grid-template-columns: var(--lw, 120px) minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 12.5px; }
.barlist li.zero { color: var(--faint); }
.bl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }
button.bl-label { border: 0; background: transparent; padding: 0; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
button.bl-label:hover { color: var(--accent-text); text-decoration: underline; }
.bl-track { height: 8px; border-radius: 0 4px 4px 0; background: var(--chart-track); position: relative; }
.bl-track i { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--chart); }
.bl-track:hover i { filter: brightness(1.12); }
.bl-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--text); }
/* stulpelinė diagrama */
.cols-chart, .runs-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; height: 150px; align-items: end; }
.runs-chart { gap: 4px; }
.cc-col, .rc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.cc-col b, .rc-col b { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text); min-height: 16px; }
.cc-bar { flex: 1; width: 100%; max-width: 44px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border-strong); }
.cc-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--chart); }
.cc-col:hover .cc-bar i, .rc-col:hover .cc-bar i { filter: brightness(1.12); }
.cc-col span, .rc-col span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rc-col b { font-size: 11px; }
/* piltuvas (log mastelis) */
.ln-funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ln-funnel li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px; gap: 10px; align-items: center; }
.lf-label { font-size: 12.5px; display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.lf-label small { font-size: 11px; color: var(--muted); }
.lf-bar { height: 12px; background: var(--chart-track); border-radius: 0 4px 4px 0; position: relative; }
.lf-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--chart-soft); }
.lf-bar i.hot { background: var(--chart); }
.ln-funnel b { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.ln-top { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; counter-reset: top; }
.ln-top li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 5px 0;
  border-top: 1px solid var(--border); counter-increment: top; }
.ln-top li:first-child { border-top: 0; }
.ln-top li::before { content: counter(top); grid-row: span 2; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.ln-top .link-btn { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ln-top .small { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-top .fit-badge { grid-column: 3; grid-row: 1 / span 2; width: 30px; height: 30px; font-size: 12px; }
.ln-params { grid-template-columns: 96px 1fr; }
/* sąrašas ir kortelė */
.seg-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 9px; background: var(--teal-soft); color: var(--teal); white-space: nowrap; line-height: 18px; }
.ln-sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ln-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.ln-fact { background: var(--sunken); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.ln-fact span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.ln-fact b { font-size: 16px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-fact small { font-size: 11.5px; color: var(--muted); }
.ln-fact.up small { color: var(--ok); } .ln-fact.down small { color: var(--danger); }
.ln-fact.bad { background: var(--danger-soft); } .ln-fact.bad b { color: var(--danger); font-size: 13px; white-space: normal; }
.ln-fact.good b { color: var(--ok); }
.ln-spark { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); }
.ln-spark .spark { color: var(--teal); }
.t-chips.wide { max-width: none; }
.mini-chip.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.mini-chip.accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
/* parametrai */
.ln-settings h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-top: 8px; }
.ln-segs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.ln-seg-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 64px 26px; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.ln-seg-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.input.w-num { width: 64px; }
.chip-group.wrap { flex-wrap: wrap; }
@media (max-width: 1400px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ln-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .agent-switch { width: 100%; } .agent-tab { flex: 1; }
  .ln-page .mail-toolbar .ag-search { width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ln-grid { grid-template-columns: minmax(0, 1fr); } .ln-card:first-child { grid-row: auto; }
  .ln-funnel li { grid-template-columns: 112px minmax(0, 1fr) 52px; gap: 8px; }
  .kpi b { font-size: 20px; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d131c; --surface: #151d29; --surface-2: #1a2331; --sunken: #111924; --sunken-2: #131b26;
    --border: #253043; --border-strong: #33415a; --text: #e5e9f0; --muted: #9ba5b7; --faint: #6b7588;
    --brand: #0a1828; --brand-text: #eef3fb; --brand-muted: rgba(238, 243, 251, .7); --brand-line: rgba(238, 243, 251, .22);
    --brand-hover: rgba(255, 255, 255, .06); --nav-active: #8db8ff; --seg-active: #2b3a52;
    --accent: #3f78e6; --accent-hover: #5287ec; --accent-soft: rgba(91, 143, 240, .15); --accent-line: rgba(91, 143, 240, .35);
    --accent-text: #9dbcf7; --on-accent: #ffffff;
    --ok: #4cc27a; --ok-soft: rgba(76, 194, 122, .14); --ok-line: rgba(76, 194, 122, .32); --ok-solid: #2f8f55;
    --warn: #e3a64a; --warn-soft: rgba(227, 166, 74, .14); --warn-line: rgba(227, 166, 74, .32); --warn-solid: #a86d17;
    --danger: #f07467; --danger-soft: rgba(240, 116, 103, .14); --danger-line: rgba(240, 116, 103, .34); --danger-solid: #c84a3c;
    --lost-solid: #5d6676; --violet: #b39cf2; --violet-soft: rgba(179, 156, 242, .14); --teal: #4fc9bc; --teal-soft: rgba(79, 201, 188, .14);
    --avatar-bg: #2a3850; --avatar-text: #c9d6ec; --stage-bg: #222c3c; --stage-text: #9ba5b7;
    --stage-done-bg: rgba(91, 143, 240, .22); --stage-done-text: #a9c4f7; --row-hover: #1b2534; --card-hover: #3a4d6e;
    --backdrop: rgba(0, 0, 0, .55); --toast-bg: #e5e9f0; --toast-text: #121a26; --toast-action: #2152b0; --badge: #e5483d;
    --login-a: #16335a; --login-b: #08131f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    --fee-mrr: #4f86ec; --fee-once: #cf7a30; --fee-untyped: #6b7588;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d131c; --surface: #151d29; --surface-2: #1a2331; --sunken: #111924; --sunken-2: #131b26;
  --border: #253043; --border-strong: #33415a; --text: #e5e9f0; --muted: #9ba5b7; --faint: #6b7588;
  --brand: #0a1828; --brand-text: #eef3fb; --brand-muted: rgba(238, 243, 251, .7); --brand-line: rgba(238, 243, 251, .22);
  --brand-hover: rgba(255, 255, 255, .06); --nav-active: #8db8ff; --seg-active: #2b3a52;
  --accent: #3f78e6; --accent-hover: #5287ec; --accent-soft: rgba(91, 143, 240, .15); --accent-line: rgba(91, 143, 240, .35);
  --accent-text: #9dbcf7; --on-accent: #ffffff;
  --ok: #4cc27a; --ok-soft: rgba(76, 194, 122, .14); --ok-line: rgba(76, 194, 122, .32); --ok-solid: #2f8f55;
  --warn: #e3a64a; --warn-soft: rgba(227, 166, 74, .14); --warn-line: rgba(227, 166, 74, .32); --warn-solid: #a86d17;
  --danger: #f07467; --danger-soft: rgba(240, 116, 103, .14); --danger-line: rgba(240, 116, 103, .34); --danger-solid: #c84a3c;
  --lost-solid: #5d6676; --violet: #b39cf2; --violet-soft: rgba(179, 156, 242, .14); --teal: #4fc9bc; --teal-soft: rgba(79, 201, 188, .14);
  --avatar-bg: #2a3850; --avatar-text: #c9d6ec; --stage-bg: #222c3c; --stage-text: #9ba5b7;
  --stage-done-bg: rgba(91, 143, 240, .22); --stage-done-text: #a9c4f7; --row-hover: #1b2534; --card-hover: #3a4d6e;
  --backdrop: rgba(0, 0, 0, .55); --toast-bg: #e5e9f0; --toast-text: #121a26; --toast-action: #2152b0; --badge: #e5483d;
  --login-a: #16335a; --login-b: #08131f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  --fee-mrr: #4f86ec; --fee-once: #cf7a30; --fee-untyped: #6b7588;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.ico { width: 1em; height: 1em; flex: none; vertical-align: -0.14em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .ico { width: 16px; height: 16px; vertical-align: middle; }
.mail-empty-icon .ico { width: 34px; height: 34px; stroke-width: 1.5; }
.btn .ico { width: 14px; height: 14px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.hidden { display: none !important; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* --- Karkasas: viršutinė juosta + slenkantis turinys --- */
#app { height: 100%; display: flex; flex-direction: column; }
#view { flex: 1; min-height: 0; overflow: auto; }

/* --- Mygtukai ir laukai --- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary.danger-solid { background: var(--danger-solid); border-color: var(--danger-solid); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 4px; color: var(--muted); line-height: 1; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.input, select.input, textarea.input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: var(--surface); outline: none; }
textarea.input { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }

.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px;
  font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag.blue { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.tag.green { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.tag.amber { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.tag.red { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.badge { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--badge);
  color: #ffffff; font-size: 11px; font-weight: 600; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }

/* --- Viršutinė juosta --- */
.topbar { height: var(--topbar-h); flex: none; background: var(--brand); color: var(--brand-text); display: flex; align-items: center;
  padding: 0 16px; gap: 20px; z-index: 20; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; font-size: 15px; color: inherit; flex: none; }
a.logo:hover { text-decoration: none; }
.bnm-logo { height: 18px; width: auto; display: block; }
.logo-crm { font-size: 12px; font-weight: 600; letter-spacing: 1px; padding-left: 10px; border-left: 1px solid var(--brand-line);
  color: var(--brand-muted); line-height: 18px; }
.logo-mark { height: 26px; padding: 0 6px; border-radius: 6px; background: var(--brand-text); color: var(--brand); display: grid;
  place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .5px; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a { color: var(--brand-muted); display: flex; align-items: center; gap: 6px; padding: 0 12px; font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--brand-text); text-decoration: none; background: var(--brand-hover); }
.nav a.active { color: var(--brand-text); border-bottom-color: var(--nav-active); }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--brand-muted); white-space: nowrap; }
.topbar .user .btn { height: 28px; background: transparent; color: var(--brand-text); border-color: var(--brand-line); }
.topbar .user .btn:hover { background: var(--brand-hover); }
.demo-chip { margin-left: auto; border: 1px dashed var(--brand-line); background: transparent; color: var(--brand-muted);
  border-radius: 12px; height: 24px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .4px; cursor: pointer;
  text-transform: uppercase; white-space: nowrap; }
.demo-chip:hover { color: var(--brand-text); background: var(--brand-hover); }
.demo-chip + .user { margin-left: 0; }

.page { padding: 16px; }
.page.fill { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 18px; margin-right: 8px; }

/* --- Lenta --- */
.board-wrap { display: flex; flex-direction: column; height: 100%; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px 8px; flex-wrap: wrap; }
.toolbar .input { height: 32px; width: auto; max-width: 150px; }
.toolbar .input.search { max-width: none; width: 220px; }
.view-btn .caret { font-size: 10px; color: var(--muted); }
.filter-toggle { display: none; }
.filter-toggle .badge { background: var(--accent); }
.popmenu-item.checked::before { content: "✓"; width: 14px; color: var(--accent-text); font-weight: 700; }
.popmenu-item[role="menuitemradio"]:not(.checked)::before { content: ""; width: 14px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 30px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--seg-active); color: var(--brand-text); }
.statsbar { display: flex; gap: 6px 18px; padding: 0 16px 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.statsbar b { color: var(--text); font-weight: 600; }
.board { flex: 1; min-height: 0; display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 16px; align-items: flex-start; }
.col { width: 272px; min-width: 272px; background: var(--sunken); border-radius: var(--radius); display: flex; flex-direction: column;
  max-height: 100%; }
.col.closed { background: var(--sunken-2); }
.col-head { padding: 10px 10px 8px; border-top: 3px solid var(--accent); border-radius: var(--radius) var(--radius) 0 0; }
.col-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.col-title .count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.col-sum { font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 16px; font-variant-numeric: tabular-nums; }
.col-body { padding: 0 8px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 60px; flex: 1; }
.col.drop-target .col-body { background: var(--accent-soft); outline: 2px dashed var(--accent-line); outline-offset: -4px; border-radius: 6px; }
.card { background: var(--surface); border-radius: 7px; box-shadow: var(--shadow-sm); padding: 9px 10px; cursor: pointer;
  border: 1px solid transparent; display: flex; flex-direction: column; gap: 5px; }
.card:hover { border-color: var(--card-hover); }
.card.dragging { opacity: .45; }
.card-title { font-weight: 600; font-size: 13px; line-height: 1.3; word-break: break-word; }
.card-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.card-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-foot .money { color: var(--text); font-weight: 600; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-text); display: inline-grid;
  place-items: center; font-size: 10px; font-weight: 700; flex: none; }
.age { margin-left: auto; }
.age.stale { color: var(--danger); font-weight: 600; }
.task-dot { color: var(--accent-text); font-weight: 600; }
.task-dot.overdue { color: var(--danger); }
.empty-col { text-align: center; font-size: 12px; color: var(--faint); padding: 14px 0; }

/* --- Šoninis langas (sandoris) --- */
.drawer-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1180px, 100vw); background: var(--bg); z-index: 41;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .16s ease-out;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
@keyframes slidein { from { transform: translateX(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer.static { animation: none; }
.drawer-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.drawer-title { font-size: 17px; font-weight: 600; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin-left: -7px;
  width: 100%; background: transparent; }
.drawer-title:hover { border-color: var(--border); }
.drawer-title:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.stagebar { display: flex; gap: 3px; flex-wrap: wrap; }
.stagebar button { flex: 1; min-width: 70px; border: 0; height: 26px; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--stage-text);
  background: var(--stage-bg); padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stagebar button:first-child { border-radius: 5px 0 0 5px; }
.stagebar button:last-child { border-radius: 0 5px 5px 0; }
.stagebar button.done { background: var(--stage-done-bg); color: var(--stage-done-text); }
.stagebar button.current { background: var(--accent); color: var(--on-accent); }
.stagebar button.current.won { background: var(--ok-solid); }
.stagebar button.current.lost { background: var(--lost-solid); }
.stagebar button.current.paused { background: var(--warn-solid); }
.stagebar button:hover:not(.current) { filter: brightness(.95); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.panel-body { padding: 12px 14px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entity-box .name { font-weight: 600; }
.entity-box .lines { display: flex; flex-direction: column; gap: 2px; font-size: 13px; margin-top: 4px; }

.composer { display: flex; flex-direction: column; gap: 8px; }
.composer-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.composer-tabs button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; height: 26px; padding: 0 10px;
  font-size: 12px; cursor: pointer; color: var(--muted); font-weight: 500; }
.composer-tabs button.active { background: var(--seg-active); border-color: var(--seg-active); color: var(--brand-text); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.tl-item:first-child { border-top: 0; }
.tl-item > div { min-width: 0; }
.tl-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--stage-bg); color: var(--stage-text); }
.tl-icon.email_in { background: var(--accent-soft); color: var(--accent-text); }
.tl-icon.email_out { background: var(--ok-soft); color: var(--ok); }
.tl-icon.task { background: var(--warn-soft); color: var(--warn); }
.tl-icon.stage { background: var(--violet-soft); color: var(--violet); }
.tl-icon.call, .tl-icon.meeting { background: var(--teal-soft); color: var(--teal); }
.tl-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-subject { font-weight: 600; margin-top: 2px; }
.tl-body { margin-top: 3px; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.tl-body.clamped { max-height: 120px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.tl-task-done { text-decoration: line-through; color: var(--muted); }

/* --- Modalai --- */
.modal-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 60; display: grid; place-items: start center;
  padding: 8vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); width: min(560px, 100%); }
.modal.wide { width: min(860px, 100%); }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 6px; padding: 8px 10px; font-size: 13px; }

/* --- Paieška su pasirinkimu --- */
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 6px; box-shadow: var(--shadow-lg); z-index: 70; max-height: 260px; overflow-y: auto; }
.picker-item { padding: 7px 10px; cursor: pointer; display: flex; flex-direction: column; }
.picker-item:hover, .picker-item.active { background: var(--accent-soft); }
.picker-item .sub { font-size: 12px; color: var(--muted); }
.picker-item.create { color: var(--accent-text); font-weight: 500; border-top: 1px solid var(--border); }

/* --- Lentelės --- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--row-hover); }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 2px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* --- Užklausų dėžutė --- */
.inbox { display: grid; grid-template-columns: 420px 1fr; gap: 14px; flex: 1; min-height: 0; }
.inbox-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-y: auto; min-height: 0; }
.inbox-item { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.inbox-item:hover { background: var(--row-hover); }
.inbox-item.active { background: var(--accent-soft); }
.inbox-item .from { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item .subj { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item .snip { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inbox-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-y: auto; padding: 16px 18px; min-height: 0; min-width: 0; }
.ai-box { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.mail-body { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 13px;
  white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow-y: auto; }
.empty { padding: 40px 20px; text-align: center; color: var(--faint); }

/* --- Nustatymai --- */
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.settings > .panel { min-width: 0; }
.settings .panel.full { grid-column: 1 / -1; }
.stage-row { display: grid; grid-template-columns: 1fr 120px 64px 92px 30px; gap: 6px; align-items: center; margin-bottom: 6px; }
.option-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }

/* --- Prisijungimas --- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 10%, var(--login-a), var(--login-b) 60%); }
.login-card { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(380px, 100%); padding: 28px 26px;
  display: flex; flex-direction: column; gap: 14px; }
.login-card .logo { color: var(--text); font-size: 18px; }
.login-card .bnm-logo { height: 26px; }
.login-card .logo-crm { color: var(--muted); border-left-color: var(--border-strong); font-size: 14px; line-height: 24px; }
.login-card .logo-mark { background: var(--brand); color: var(--brand-text); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.ms-btn { justify-content: center; height: 38px; }

/* --- Pranešimai --- */
#toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--toast-bg); color: var(--toast-text); padding: 9px 14px; border-radius: 8px; box-shadow: var(--shadow-lg);
  font-size: 13px; max-width: 90vw; word-break: break-word; pointer-events: auto; display: flex; align-items: center; gap: 14px;
  animation: toastin .15s ease-out; }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-action { border: 0; background: transparent; color: var(--toast-action); font-weight: 600; cursor: pointer; padding: 2px 4px;
  margin: -2px -6px -2px 0; border-radius: 4px; white-space: nowrap; }
.toast-action:hover { background: rgba(127, 127, 127, .18); }
.toast.error { background: var(--danger-solid); color: #ffffff; }

.loading { padding: 40px; text-align: center; color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  .drawer, .toast { animation: none; }
  .spinner { animation-duration: 2.4s; }
}

/* --- Greita paieška viršutinėje juostoje --- */
.search-btn { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 10px; border-radius: 7px;
  border: 1px solid var(--brand-line); background: var(--brand-hover); color: var(--brand-muted); cursor: pointer; min-width: 200px; }
.search-btn:hover { color: var(--brand-text); border-color: var(--brand-muted); }
.search-btn .lbl { flex: 1; text-align: left; font-size: 13px; }
.search-ico { font-size: 15px; line-height: 1; }
kbd { font: 600 10px/1 var(--font); padding: 3px 5px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--muted); white-space: nowrap; }
.search-btn kbd { background: transparent; border-color: var(--brand-line); color: var(--brand-muted); }

/* --- Lenta: dėmesio filtrai, kortelės būsena, suskleisti stulpeliai --- */
.attn { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.attn-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px;
  cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.attn-chip b { font-variant-numeric: tabular-nums; }
.attn-chip.red { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.attn-chip.amber { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.attn-chip.red-outline { color: var(--danger); border-color: var(--danger-line); }
.attn-chip.red b, .attn-chip.amber b, .attn-chip.red-outline b { color: inherit; }
.attn-chip.active { outline: 2px solid currentColor; outline-offset: 1px; }
.attn-chip:disabled { opacity: .45; cursor: default; color: var(--muted); background: var(--surface); border-color: var(--border); }
.col-rot { font-size: 10px; font-weight: 600; color: var(--faint); border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 5px;
  height: 16px; line-height: 14px; cursor: help; }
.col-fold { font-size: 16px; padding: 0 6px; height: 22px; }
.col.collapsed { width: 44px; min-width: 44px; border-top: 3px solid var(--accent); }
.col-collapsed-btn { border: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 10px 0; width: 100%; color: var(--muted); font-weight: 600; font-size: 12px; border-radius: 0 0 var(--radius) var(--radius); }
.col-collapsed-btn:hover { background: var(--row-hover); color: var(--text); }
.col-collapsed-btn .count { font-variant-numeric: tabular-nums; color: var(--text); }
.col-collapsed-name { writing-mode: vertical-rl; white-space: nowrap; max-height: 60vh; overflow: hidden; text-overflow: ellipsis; }
.card { position: relative; }
.card.rotting { border-color: var(--danger-line); box-shadow: inset 3px 0 0 var(--danger-solid), var(--shadow-sm); }
.card-top { display: flex; align-items: flex-start; gap: 6px; }
.card-top .card-title { flex: 1; min-width: 0; }
.card-menu-btn { border: 0; background: transparent; color: var(--faint); cursor: pointer; border-radius: 4px; width: 24px; height: 20px;
  margin: -2px -4px 0 0; font-size: 15px; line-height: 1; flex: none; opacity: .55; }
.card:hover .card-menu-btn, .card:focus-within .card-menu-btn, .card-menu-btn:focus-visible { opacity: 1; }
.card-menu-btn:hover { background: var(--surface-2); color: var(--text); }
.card-state { display: flex; gap: 4px; flex-wrap: wrap; }
.next-chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px 0 6px; border-radius: 10px; font-size: 11px;
  font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.next-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.next-chip.overdue { background: var(--danger-soft); color: var(--danger); }
.next-chip.overdue i { background: var(--danger-solid); }
.next-chip.today { background: var(--ok-soft); color: var(--ok); }
.next-chip.today i { background: var(--ok-solid); }
.next-chip.none { background: var(--warn-soft); color: var(--warn); }
.next-chip.none i { background: var(--warn-solid); border-radius: 1px; transform: rotate(45deg) scale(.85); }
.rot-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; font-weight: 600;
  color: var(--danger); border: 1px solid var(--danger-line); white-space: nowrap; }
.card-service { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; color: var(--faint); }
.card-foot .age { flex: none; }

/* --- Iššokantis meniu --- */
.popmenu { position: fixed; z-index: 90; min-width: 210px; max-height: 70vh; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.popmenu-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer;
  padding: 7px 10px; border-radius: 5px; font-size: 13px; }
.popmenu-item:hover, .popmenu-item:focus-visible { background: var(--accent-soft); outline: none; }
.popmenu-item.current { color: var(--faint); cursor: default; background: transparent; }
.popmenu-item.current::after { content: "dabar"; margin-left: auto; font-size: 11px; }
.popmenu-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.popmenu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.popmenu-head { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); padding: 6px 10px 2px; font-weight: 600; }

/* --- Kito veiksmo planavimas --- */
.row.wrap { flex-wrap: wrap; }
.schedule-form { display: flex; flex-direction: column; gap: 8px; }
.schedule-form .input[type="datetime-local"] { width: auto; flex: 0 1 200px; }
.due-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.due-chip { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 14px; height: 28px; padding: 0 10px;
  font-size: 12px; cursor: pointer; color: var(--muted); font-weight: 500; }
.due-chip:hover { color: var(--text); }
.due-chip.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

/* --- Sandorio langas: antraštė, faktai, du stulpeliai --- */
.drawer-head { padding: 12px 20px 14px; gap: 10px; }
.drawer-body { padding: 16px 20px 40px; }
.move-select { width: auto; height: 28px; font-size: 12px; max-width: 220px; }
.facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px 16px; }
.fact { min-width: 0; }
.fact-label { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 1px; }
.fact .ie-value { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.quick-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.drawer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.drawer-main, .drawer-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side-meta { padding: 0 2px; line-height: 1.6; }

/* Laukas, keičiamas paspaudus */
.ie { border-radius: 5px; padding: 3px 6px; margin: 0 -6px; cursor: text; min-height: 26px; display: flex; align-items: center;
  border: 1px solid transparent; min-width: 0; }
.ie:hover { background: var(--surface-2); border-color: var(--border); }
.ie.editing { padding: 0; margin: 0; border-color: transparent; background: transparent; }
.ie.editing .input { height: 30px; }
.ie.multiline { align-items: flex-start; }
.ie.multiline.editing { display: block; }
.ie.saving { opacity: .55; }
.ie-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ie.multiline .ie-value { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.ie-empty { color: var(--faint); font-weight: 400 !important; }
.detail-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13px; min-height: 30px; }
.detail-label { color: var(--muted); font-size: 12px; }
.details { display: flex; flex-direction: column; gap: 1px; }
.details .link-btn { margin-top: 6px; align-self: flex-start; }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--accent-text); cursor: pointer; text-align: left; font: inherit; }
.link-btn:hover { text-decoration: underline; }
.link-btn.small { font-size: 12px; }
.entity-box .link-btn.name { font-weight: 600; font-size: 14px; }
.entity-box .lines a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-row { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.related-row:last-child { border-bottom: 0; }
.kv.compact { grid-template-columns: 110px 1fr; font-size: 12px; }

/* Kitas veiksmas */
.next-card.is-empty { border-color: var(--warn-line); }
.next-card.is-empty .panel-head { background: var(--warn-soft); border-radius: var(--radius) var(--radius) 0 0; }
.next-empty { font-size: 13px; color: var(--muted); }
.next-empty b { color: var(--warn); }
.task-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 0;
  border-top: 1px solid var(--border); }
.task-row:first-child { border-top: 0; padding-top: 0; }
.task-row input[type="checkbox"] { width: 17px; height: 17px; margin: 1px 0 0; cursor: pointer; accent-color: var(--ok-solid); }
.task-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.task-subject { font-weight: 600; }
.task-snooze { display: flex; gap: 2px; }

/* Istorijos filtrai */
.tl-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.tl-filter { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; height: 26px; padding: 0 10px; font-size: 12px;
  cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.tl-filter:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); }
.tl-filter.active { background: var(--seg-active); border-color: var(--seg-active); color: var(--brand-text); }
.tl-filter:disabled { opacity: .45; cursor: default; }
.tl-count { font-size: 11px; font-variant-numeric: tabular-nums; opacity: .8; }
.tl-type { font-weight: 600; color: var(--text); }
label.tl-subject { gap: 6px; cursor: pointer; font-weight: 600; }
label.tl-subject input { margin: 0; accent-color: var(--ok-solid); }

/* --- Mano diena --- */
.myday-page { max-width: 1400px; }
.myday-page .page-head h1 { font-size: 20px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.tile:hover { border-color: var(--border-strong); }
.tile-n { font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--faint); }
.tile-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.tile.red { border-color: var(--danger-line); } .tile.red .tile-n { color: var(--danger); }
.tile.green { border-color: var(--ok-line); } .tile.green .tile-n { color: var(--ok); }
.tile.amber { border-color: var(--warn-line); } .tile.amber .tile-n { color: var(--warn); }
.md-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.md-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.md-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); scroll-margin-top: 12px; }
.md-group-head { display: flex; align-items: baseline; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.md-group-head h2 { font-size: 14px; }
.md-group-head .count { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.md-group.red .md-group-head h2 { color: var(--danger); }
.md-group.green .md-group-head h2 { color: var(--ok); }
.md-group.amber .md-group-head h2 { color: var(--warn); }
.md-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--border); }
.md-row:first-child { border-top: 0; }
.md-row:hover { background: var(--row-hover); }
.md-row input[type="checkbox"] { width: 17px; height: 17px; margin: 0; cursor: pointer; flex: none; accent-color: var(--ok-solid); }
.md-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.md-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-title .link-btn { font-weight: 600; color: var(--text); }
.md-sub { display: flex; gap: 4px 10px; flex-wrap: wrap; font-size: 12px; align-items: baseline; }
.md-sub .money { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.md-body { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-actions { display: flex; gap: 2px; flex: none; }
.md-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--warn-solid); }
.md-dot.rot { background: var(--danger-solid); }
.md-empty { padding: 14px; font-size: 13px; color: var(--faint); }
.md-more { margin: 4px 10px 10px; }
.md-hint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }

/* --- Greita paieška (Ctrl+K) --- */
.palette-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 80; display: flex; justify-content: center;
  align-items: flex-start; padding: 12vh 16px 16px; }
.palette { width: min(640px, 100%); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column; max-height: 70vh; border: 1px solid var(--border-strong); }
.palette-head { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.palette-icon { color: var(--faint); font-size: 18px; }
.palette-input { flex: 1; border: 0; outline: none; background: transparent; height: 50px; font-size: 16px; min-width: 0; }
.palette-list { overflow-y: auto; padding: 6px; flex: 1; }
.palette-group { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); font-weight: 600; padding: 8px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; min-width: 0; }
.palette-item.active { background: var(--accent-soft); }
.palette-kind { width: 18px; text-align: center; color: var(--faint); flex: none; font-size: 12px; }
.palette-label { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.palette-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
.palette-item kbd { margin-left: auto; }
.palette-empty { padding: 22px; text-align: center; color: var(--faint); font-size: 13px; }
.palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted);
  background: var(--surface-2); }
.palette-foot kbd { margin-right: 2px; }


/* --- Įmonės analizė --- */
.intel { display: flex; flex-direction: column; gap: 12px; }
.intel-loading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.intel-warn { font-size: 13px; color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 6px; padding: 8px 10px; }
.demo-note { font-size: 12px; color: var(--accent-text); background: var(--accent-soft); border: 1px dashed var(--accent-line); border-radius: 6px; padding: 7px 10px; }
.cand-list { display: flex; flex-direction: column; gap: 4px; }
.cand { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 7px 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 1px; }
.cand:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 9px 3px 4px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); line-height: 1.35; }
.flag i { font-style: normal; font-weight: 700; font-size: 10px; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--faint); color: var(--surface); flex: none; }
.flag.red { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.flag.red i { background: var(--danger-solid); color: #fff; }
.flag.amber { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.flag.amber i { background: var(--warn-solid); color: #fff; }
.flag.green { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.flag.green i { background: var(--ok-solid); color: #fff; }
.flag.info i { background: var(--accent); color: #fff; }
.intel-summary { margin: 0; font-size: 13.5px; line-height: 1.55; }
.sales-angle { font-size: 13px; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 8px 10px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.metric { border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; background: var(--surface-2); min-width: 0; }
.metric-label { font-size: 11px; color: var(--muted); font-weight: 500; }
.metric-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px;
  justify-content: space-between; white-space: nowrap; }
.metric-delta { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.metric.up .metric-delta, .metric.up .spark { color: var(--ok); }
.metric.down .metric-delta, .metric.down .spark { color: var(--danger); }
.metric.ok .metric-value { color: var(--ok); }
.metric.warn .metric-value { color: var(--warn); }
.metric.bad .metric-value { color: var(--danger); }
.spark { color: var(--accent); flex: none; }
.intel-kv { margin: 0; }
.intel-sub h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 4px; }
.intel-list { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.src-link { font-size: 11px; color: var(--faint); text-decoration: underline; text-underline-offset: 2px; }
.intel-fin summary { cursor: pointer; font-size: 12px; color: var(--accent-text); font-weight: 500; }
.intel-fin .table { margin-top: 6px; font-size: 12px; }
.intel-fin .table th, .intel-fin .table td { padding: 5px 8px; }
td.neg { color: var(--danger); }
.intel-sources { border-top: 1px solid var(--border); padding-top: 8px; }
.src-bad { color: var(--warn); }
.c-intel.risk-red { border-color: var(--danger-line); }
.c-intel.risk-red > .panel-head { box-shadow: inset 3px 0 0 var(--danger-solid); border-radius: var(--radius) 0 0 0; }
.c-intel.risk-amber > .panel-head { box-shadow: inset 3px 0 0 var(--warn-solid); border-radius: var(--radius) 0 0 0; }
.risk-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.risk-chip.red { background: var(--danger-solid); color: #fff; }
.risk-chip.amber { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }


/* --- Paštas (užklausų dėžučių stebėjimas) --- */
.mail-page .page-head { margin-bottom: 10px; }
.mail-updated { font-variant-numeric: tabular-nums; }
.mb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; margin-bottom: 10px; }
.mb-card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius);
  padding: 11px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mb-card.assist { border-top-color: var(--teal); }
.mb-card.filter { border-top-color: var(--violet); }
.mb-head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.mb-state { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--faint); }
.mb-state.ok { background: var(--ok-solid); box-shadow: 0 0 0 3px var(--ok-soft); }
.mb-state.bad { background: var(--danger-solid); box-shadow: 0 0 0 3px var(--danger-soft); }
.mb-state.warn { background: var(--warn-solid); box-shadow: 0 0 0 3px var(--warn-soft); }
.mb-addr { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mb-addr b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 6px; }
.mb-nums > div { display: flex; flex-direction: column; min-width: 0; }
.mb-nums b { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.mb-nums span { font-size: 11px; color: var(--muted); }
.mb-nums .lead b { color: var(--ok); }
.mb-nums .rej b { color: var(--muted); }
.mb-foot.bad { color: var(--danger); }
.mail-chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 8px; margin-bottom: 12px; }
.mc-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; }
.mc-legend { display: flex; gap: 12px; color: var(--muted); flex-wrap: wrap; }
.mc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mc-legend i, .mc-seg { background: var(--border-strong); }
.mc-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.mc-legend i.lead, .mc-seg.lead { background: var(--ok-solid); }
.mc-legend i.attached, .mc-seg.attached { background: var(--accent); }
.mc-legend i.review, .mc-seg.review { background: var(--warn-solid); }
.mc-legend i.rejected, .mc-seg.rejected { background: var(--border-strong); }
.mc-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; height: 74px; }
.mc-col { display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; min-width: 0; height: 100%; cursor: default; }
.mc-stack { display: flex; flex-direction: column-reverse; border-radius: 3px; overflow: hidden; min-height: 3px; background: var(--sunken); }
.mc-seg { min-height: 2px; }
.mc-day { font-size: 10px; text-align: center; color: var(--faint); font-variant-numeric: tabular-nums; }
.mc-day.wknd { opacity: .55; }
.mc-cats { margin-top: 6px; }
.mail-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.mail-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.tab-count { font-size: 11px; font-weight: 600; background: var(--sunken); color: var(--muted); border-radius: 9px; padding: 0 6px; min-width: 18px;
  text-align: center; line-height: 17px; font-variant-numeric: tabular-nums; }
.seg button.active .tab-count { background: rgba(255, 255, 255, .22); color: inherit; }
.mail-tabs button.attn .tab-count { background: var(--warn-solid); color: #ffffff; }
.chip-group { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 14px; height: 28px; padding: 0 12px; font-size: 12px;
  cursor: pointer; color: var(--muted); font-weight: 500; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--seg-active); color: var(--brand-text); border-color: var(--seg-active); }
.mail-search { width: 240px; }
.mail-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 410px minmax(0, 1fr); gap: 14px; }
.mail-list-wrap { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mail-list { overflow-y: auto; flex: 1; min-height: 0; outline: none; }
.mail-list:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.mail-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.mail-item:hover { background: var(--row-hover); }
.mail-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mail-item:has(.mi-dot.rejected):not(.active) .mi-main { opacity: .7; }
.mail-item.new { animation: newmail 3s ease-out; }
@keyframes newmail { from { background: var(--warn-soft); } to { background: transparent; } }
.mi-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #ffffff; margin-top: 1px; }
.mi-dot.lead { background: var(--ok-solid); }
.mi-dot.attached { background: var(--accent); }
.mi-dot.review { background: var(--warn-solid); }
.mi-dot.rejected { background: var(--stage-bg); color: var(--stage-text); }
.mi-dot.error { background: var(--danger-solid); }
.mi-main { min-width: 0; }
.mi-top { display: flex; gap: 8px; align-items: baseline; }
.mi-from { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.mi-time { font-size: 11px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mi-subj { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item.needs .mi-subj { font-weight: 600; }
.mi-clip { margin-right: 4px; font-size: 11px; }
.mi-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.mi-snip { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.mi-fix { font-size: 10px; color: var(--violet); border: 1px solid currentColor; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.verdict { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 9px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.verdict.lead { background: var(--ok-soft); color: var(--ok); }
.verdict.attached { background: var(--accent-soft); color: var(--accent-text); }
.verdict.review { background: var(--warn-soft); color: var(--warn); }
.verdict.error { background: var(--danger-soft); color: var(--danger); }
.brand-chip { font-size: 10px; font-weight: 700; letter-spacing: .3px; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; white-space: nowrap; }
.brand-chip.finance, .chip.finance.active { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.brand-chip.assist, .chip.assist.active { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }
.kbd-hint { border-top: 1px solid var(--border); padding: 6px 12px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; background: var(--surface-2); }
.mail-empty { padding: 30px 20px; text-align: center; color: var(--faint); font-size: 13px; }
.mail-empty.big { margin: auto; max-width: 380px; display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--muted); }
.mail-empty-icon { font-size: 36px; opacity: .35; }
.mi-form { font-size: 11px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border-strong, var(--border)); color: var(--muted); }
.md-back { display: none; margin-bottom: 8px; }
.mail-detail { overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px 30px;
  min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.md-head h2 { font-size: 18px; line-height: 1.3; margin-bottom: 10px; }
.md-people { display: flex; gap: 10px; align-items: center; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.md-from { min-width: 0; word-break: break-word; }
.decision { border-radius: 10px; border: 1px solid var(--border); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.decision.lead { background: var(--ok-soft); border-color: var(--ok-line); }
.decision.review { background: var(--warn-soft); border-color: var(--warn-line); }
.decision.attached { background: var(--accent-soft); border-color: var(--accent-line); }
.decision.error { background: var(--danger-soft); border-color: var(--danger-line); }
.decision-top { display: flex; gap: 12px; align-items: flex-start; }
.decision-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #ffffff; flex: none; background: var(--lost-solid); }
.decision.lead .decision-icon { background: var(--ok-solid); }
.decision.review .decision-icon { background: var(--warn-solid); }
.decision.attached .decision-icon { background: var(--accent); }
.decision.error .decision-icon { background: var(--danger-solid); }
.decision-main { flex: 1; min-width: 0; }
.decision-title { font-weight: 700; font-size: 15px; }
.decision-why { font-size: 13px; margin-top: 2px; }
.decision-meta { color: var(--muted); margin-top: 4px; }
.decision-deal { margin-top: -4px; }
.conf { width: 104px; flex: none; text-align: right; }
.decision.lead .conf { color: var(--ok); }
.decision.review .conf { color: var(--warn); }
.decision.rejected .conf { color: var(--muted); }
.conf-num { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.conf-bar { height: 6px; background: rgba(127, 127, 127, .22); border-radius: 3px; overflow: hidden; margin: 3px 0; }
.conf-bar i { display: block; height: 100%; background: currentColor; }
.conf-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.decision-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.md-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; margin-bottom: 7px; }
.md-label .faint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.md-summary { font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.lead-form { gap: 8px 12px; }
.lead-form .field > label { font-size: 11px; }
.mail-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.6; max-width: 78ch; }
.mail-text.quoted { color: var(--muted); border-left: 3px solid var(--border-strong); padding-left: 12px; margin-top: 8px; font-size: 13px; }
.setup-card { background: var(--surface); border: 1px dashed var(--warn-line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.setup-title { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.setup-steps { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
code { font: 500 12px/1.4 var(--font); font-variant-numeric: tabular-nums; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); }

@media (max-width: 1250px) {
  .profile-name { display: none; }
  .mail-split { grid-template-columns: 340px minmax(0, 1fr); }
}

@media (max-width: 1100px) {
  /* Vienas stulpelis: svarbiausia viršuje — kitas veiksmas, kontaktas, įmonė, tada įrašymas ir istorija */
  .drawer-grid { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
  .drawer-main, .drawer-side { display: contents; }
  .next-card { order: 1; } .c-intel { order: 2; } .c-contact { order: 3; } .c-company { order: 4; } .c-composer { order: 5; }
  .c-timeline { order: 6; } .c-details { order: 7; } .c-desc { order: 8; } .c-related { order: 9; } .c-extra { order: 10; } .c-meta { order: 11; }
  .md-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1500px) {
  .topbar .user > span { display: none; }
}
@media (max-width: 1240px) {
  .search-btn { min-width: 0; }
  .search-btn .lbl, .search-btn kbd { display: none; }
}

@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; flex: none; }
  .inbox-list { max-height: 45vh; }
  .page.fill { height: auto; }
  .settings, .two-cols { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .kv { grid-template-columns: 120px 1fr; }
  .toolbar .input.search { width: 100%; }
  .topbar { gap: 10px; }
  .topbar .user > span, .topbar .logo-crm { display: none; }
  .topbar .bnm-logo { height: 14px; }
  .nav { overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
  .nav a { padding: 0 8px; white-space: nowrap; font-size: 13px; }
  .demo-chip { display: none; }
  .topbar .user { margin-left: 0; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
  .drawer-head, .drawer-body { padding-left: 14px; padding-right: 14px; }
  .move-select { max-width: 150px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-row { flex-wrap: wrap; }
  .md-main { flex-basis: calc(100% - 40px); }
  .md-actions { margin-left: auto; }
  .task-row { grid-template-columns: 20px minmax(0, 1fr); }
  .task-snooze { grid-column: 2; }
  .stage-row { grid-template-columns: 1fr 100px 56px 64px 28px; }
  .palette-backdrop { padding-top: 8vh; }
  .palette-foot { display: none; }
  .filter-toggle { display: inline-flex; }
  .toolbar .filter-sel { display: none; }
  .toolbar.show-filters .filter-sel { display: block; flex: 1 1 calc(50% - 4px); max-width: none; width: auto; }
  .toolbar.show-filters .input.search { flex-basis: 100%; }
  .toolbar .btn.primary { margin-left: auto; }
  .toolbar .seg { order: -1; flex-basis: 100%; }
  .toolbar .seg button { flex: 1; }
  /* Mobiliame slenka visas langas, kad antraštė neužimtų pusės ekrano */
  .drawer { overflow-y: auto; }
  .drawer-body { flex: none; overflow: visible; }
  .quick-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  .quick-actions .btn { flex: none; }
  .mail-split { grid-template-columns: minmax(0, 1fr); flex: none; }
  .mail-list { max-height: 52vh; }
  .mail-detail { overflow: visible; padding: 16px; }
  .md-back { display: inline-flex; }
  .agent-head { flex-wrap: wrap; } .agent-actions { width: 100%; } .agent-actions .btn { flex: 1; }
  .agent-meta { margin-left: 0; }
  .funnel { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; scrollbar-width: none; }
  .ag-search { width: 100%; } .ag-role { flex: 1; }
  .runs-wrap { grid-template-columns: minmax(0, 1fr); } .runs { flex-direction: row; overflow-x: auto; max-height: none; }
  .run-item { flex: none; }
  .mail-detail { scroll-margin-top: 64px; }
  .mail-search { width: 100%; }
  .mail-toolbar .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .mail-toolbar .seg button { flex: none; white-space: nowrap; }
  /* Telefone būsena — slenkama juosta, grafikas paslėptas, kad sąrašas būtų arčiau */
  .mb-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -14px 10px; padding: 0 14px; }
  .mb-card { flex: 0 0 84%; scroll-snap-align: start; }
  .mail-chart { display: none; }
  .nav { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
  .mc-bars { gap: 3px; height: 60px; }
  .decision-top { flex-wrap: wrap; }
  .conf { width: 100%; text-align: left; display: flex; align-items: center; gap: 8px; }
  .conf-bar { flex: 1; }
}

/* --- Įmonių pirkimas ------------------------------------------------------ */
.acq-figs { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.acq-price { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; font-weight: 600; }
.acq-price i { font-style: normal; font-weight: 500; color: var(--muted); font-size: 11px; }
.acq-price .offer { color: var(--ok); }
.acq-price .offer i { color: var(--ok); opacity: .8; }
.acq-meta { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11px; color: var(--muted); }
.acq-meta span { padding: 0 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); line-height: 17px; }
.acq-meta .acq-mult { background: var(--violet-soft); border-color: transparent; color: var(--violet); font-weight: 600; }
.acq-meta .acq-dd { background: var(--teal-soft); border-color: transparent; color: var(--teal); }
.tag.acq-tag { background: var(--violet-soft); border-color: transparent; color: var(--violet); }
.fact-hint { font-size: 11px; color: var(--violet); font-weight: 600; margin-top: 1px; }
.val-box { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; display: grid; gap: 6px; background: var(--surface-2); }
.mult-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.mult-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 3px 7px; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; }
.mult-chip b { color: var(--violet); }
.mult-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.mult-chip.active { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); cursor: default; }
.acq-link { display: flex; align-items: center; gap: 8px; min-width: 0; }
.acq-link .ie { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-progress { display: flex; align-items: center; gap: 10px; }
.dd-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.dd-bar i { display: block; height: 100%; background: var(--teal); border-radius: 3px; transition: width .2s; }
.dd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dd-q { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.dd-q.done { border-color: var(--ok-line); }
.dd-text { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; font-size: 13px; line-height: 1.4; margin-bottom: 4px; }
.dd-num { width: 20px; height: 20px; border-radius: 50%; background: var(--sunken); color: var(--muted); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dd-q.done .dd-num { background: var(--ok-soft); color: var(--ok); }
.dd-q .ie { margin-left: 28px; font-size: 13px; }
.form-sub { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
@media (max-width: 700px) { .dd-q .ie { margin-left: 0; } }

/* --- Įmonių pirkimas: išplėstinė lentelė ----------------------------------- */
.view-seg button { min-width: 64px; }
.acq-area { display: flex; flex-direction: column; min-height: 0; flex: 1; gap: 8px; padding: 0 16px 12px; }
.acq-area .statsbar { padding-left: 0; padding-right: 0; }
.acq-tbar { flex-wrap: wrap; row-gap: 6px; }
.acq-tbar .filter-sel { max-width: 200px; }
.debt-sum { color: var(--danger); }
.debt-sum b { color: var(--danger); }
.acq-scroll { overflow: auto; flex: 1; min-height: 240px; max-height: calc(100vh - 210px); border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.acq-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.acq-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border-bottom: 1px solid var(--border-strong); text-align: left; padding: 0; white-space: nowrap; }
.acq-table th.num { text-align: right; }
.th-btn { all: unset; box-sizing: border-box; display: flex; gap: 4px; align-items: center; width: 100%; padding: 8px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); cursor: pointer; }
th.num .th-btn { justify-content: flex-end; }
.th-btn:hover { color: var(--text); }
.th-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.th-arrow { font-size: 9px; color: var(--accent-text); }
.acq-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: top; background: var(--surface); }
.acq-table td.num { text-align: right; }
.acq-table tbody tr { cursor: pointer; }
.acq-table tbody tr:hover td { background: var(--row-hover); }
.acq-table tbody tr:focus-visible td { background: var(--accent-soft); outline: none; }
.acq-table .c-name { position: sticky; left: 0; z-index: 1; min-width: 210px; max-width: 280px; white-space: normal; box-shadow: 1px 0 0 var(--border); }
.acq-table th.c-name { z-index: 3; }
.t-name { font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.t-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.t-sub.warn { color: var(--warn); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.acq-table tr.debt-row td { background: var(--danger-soft); }
.acq-table tr.debt-row td.c-name { box-shadow: inset 4px 0 0 var(--danger-solid), 1px 0 0 var(--border); }
.acq-table tr.debt-row:hover td { background: var(--danger-line); }
.acq-table tr.had-row td.c-name { box-shadow: inset 4px 0 0 var(--warn-solid), 1px 0 0 var(--border); }
.acq-table tr.closed-row td { color: var(--muted); }
.debt-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--danger-solid); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
.debt-badge { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--danger-solid); color: #fff; font-weight: 700; font-size: 12px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.debt-was { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.debt-none { color: var(--ok); font-weight: 700; }
.mini-chip { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.t-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 300px; white-space: normal; }
.acq-table td.neg { color: var(--danger); font-weight: 700; }
.acq-table td.offer { color: var(--ok); font-weight: 600; }
.delta { font-size: 10.5px; margin-left: 4px; font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.rating { display: inline-block; min-width: 26px; text-align: center; padding: 0 5px; border-radius: 5px; font-weight: 700; font-size: 11.5px; }
.rating.good { background: var(--ok-soft); color: var(--ok); } .rating.mid { background: var(--surface-2); color: var(--muted); } .rating.bad { background: var(--danger-soft); color: var(--danger); }
.acq-mult-t { color: var(--violet); font-weight: 700; }
.st-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.st-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.acq-table .c-code a { color: var(--accent-text); }
.acq-foot { padding: 0 2px 6px; }
@media (max-width: 700px) {
  .acq-scroll { max-height: none; }
  .acq-table .c-name { min-width: 150px; max-width: 170px; }
  .acq-tbar .filter-sel { max-width: none; flex: 1 1 100%; }
}

/* ---------------------------------------------------------------------------
   Prieigos teisės: tik peržiūra, skyriai, matrica
   --------------------------------------------------------------------------- */
.ro-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.ro-tag .ico { width: 14px; height: 14px; }
.seg .seg-ro { width: 13px; height: 13px; margin-left: 5px; opacity: .65; vertical-align: -2px; }
.empty-state { max-width: 460px; margin: 12vh auto 0; text-align: center; }
.empty-state .empty-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.empty-state .empty-icon .ico { width: 26px; height: 26px; }
.empty-state h2 { margin: 0 0 6px; font-size: 18px; }
.drawer.readonly :is(.quick-actions, .c-composer, .schedule-form, .task-snooze, .drawer-body .btn, .drawer-body .icon-btn, .mult-chip, .task-row input[type=checkbox]) { display: none !important; }
.drawer.readonly .drawer-title { cursor: default; }
.drawer.readonly .ie.ro { cursor: default; }
.drawer.readonly .ie.ro:hover { background: none; box-shadow: none; }
.drawer.readonly .stagebar button:disabled { cursor: default; opacity: 1; }
.scope-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.scope-note .ico { width: 16px; height: 16px; flex: none; }
.panel-head .head-note { margin-left: 10px; font-weight: 400; }
.users-table .input.sm { height: 28px; padding: 2px 6px; min-width: 128px; }
.users-table tr.inactive td { color: var(--faint); }
.user-add { grid-template-columns: 1.3fr 1fr .9fr .8fr 1fr auto; align-items: end; }
.dept-sel.dept-manager { color: var(--violet); font-weight: 600; }
.acc-table { min-width: 620px; }
.acc-table th.acc-area, .acc-table td.acc-area { width: 34%; }
.acc-table th.acc-dept { text-align: center; font-weight: 600; }
.acc-table th.acc-dept.mgr { color: var(--violet); }
.acc-people { display: inline-flex; align-items: center; gap: 3px; color: var(--faint); font-weight: 400; margin-top: 2px; }
.acc-people .ico { width: 12px; height: 12px; }
.acc-table tr.acc-group th { background: var(--surface-2); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; color: var(--muted); padding-top: 7px; padding-bottom: 7px; }
.acc-cell { text-align: center; position: relative; }
.acc-cell.changed { background: var(--accent-soft); }
.acc-cell .lv-sel { height: 28px; padding: 2px 6px; width: 118px; font-weight: 600; }
.acc-custom { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.lv { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; padding: 1px 7px; border-radius: 999px; }
.lv .ico { width: 12px; height: 12px; }
.lv-none { color: var(--faint); }
.lv-view { color: var(--accent-text); }
.lv-edit { color: var(--ok); }
b.lv.lv-none { background: var(--surface-2); }
b.lv.lv-view { background: var(--accent-soft); }
b.lv.lv-edit, .acc-cell.locked .lv { background: var(--ok-soft); }
select.lv-sel.lv-none { color: var(--faint); }
select.lv-sel.lv-view { color: var(--accent-text); border-color: var(--accent-line); }
select.lv-sel.lv-edit { color: var(--ok); border-color: var(--ok-line); }
.acc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.acc-legend { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .user-add { grid-template-columns: 1fr 1fr; }
  .panel-head .head-note { display: none; }
}

/* ---------------------------------------------------------------------------
   Mokesčių tipai: abonentinis (mėlyna) ir vienkartinis (oranžinė); Bitrix suma be tipo (pilka)
   --------------------------------------------------------------------------- */
.fee-mrr::before, .fee-once::before, .fee-untyped::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.fee-mrr::before { background: var(--fee-mrr); }
.fee-once::before { background: var(--fee-once); }
.fee-untyped::before { background: var(--fee-untyped); }
.col-sum .fee-mrr::before, .col-sum .fee-once::before, .col-sum .fee-untyped::before { width: 6px; height: 6px; margin-right: 3px; vertical-align: 1px; }
.card .money.untyped { color: var(--muted); font-weight: 500; }
.untyped-fee { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn.xs { height: 22px; padding: 0 7px; font-size: 11px; border-radius: 5px; }
.fee-f.dim { opacity: .45; }
.fee-f.dim:focus-within { opacity: 1; }
.fee-hint:empty { display: none; }
.bill-sel { height: 30px; width: 180px; flex: none; }
.fees-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 24px; }
.fees-grid h4 { margin: 0 0 8px; font-size: 13px; }
.bill-list { display: flex; flex-direction: column; gap: 4px; }
.bill-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.bill-tag { font-size: 12px; font-weight: 600; }
.bill-tag.recurring { color: var(--fee-mrr); }
.bill-tag.one_time { color: var(--fee-once); }
.bill-tag.both { color: var(--muted); }
@media (max-width: 760px) { .fees-grid { grid-template-columns: 1fr; } .bill-sel { width: 130px; } }

/* ---------------------------------------------------------------------------
   Naujoviškas viršus (body.ui-v2): šviesi juosta, piliulių navigacija, KPI kortelės lentoje
   --------------------------------------------------------------------------- */
.nav-ico, .new-btn, .profile-sub { display: none; }
.profile-txt { display: contents; }
body.ui-v2 { --topbar-h: 60px; }
body.ui-v2 .topbar { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  color: var(--text); border-bottom: 1px solid var(--border); gap: 14px; padding: 0 20px; }
body.ui-v2 .topbar .logo { color: var(--text); }
body.ui-v2 .topbar .logo-crm { color: var(--muted); border-left-color: var(--border-strong); }
body.ui-v2 .nav { height: auto; background: var(--sunken-2); border: 1px solid var(--border); padding: 3px; border-radius: 12px; gap: 2px; }
body.ui-v2 .nav a { height: 34px; padding: 0 12px; border-radius: 9px; border-bottom: 0; color: var(--muted); font-weight: 500; gap: 7px; }
body.ui-v2 .nav a:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); }
body.ui-v2 .nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
body.ui-v2 .nav-ico { display: inline-flex; color: var(--faint); }
body.ui-v2 .nav-ico .ico { width: 16px; height: 16px; }
body.ui-v2 .nav a.active .nav-ico { color: var(--accent); }
body.ui-v2 .search-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--faint); height: 36px; border-radius: 10px; min-width: 220px; margin-left: auto; }
body.ui-v2 .search-btn:hover { border-color: var(--border-strong); color: var(--muted); }
body.ui-v2 .search-btn kbd { border-color: var(--border-strong); color: var(--muted); background: var(--surface); }
body.ui-v2 .new-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px; border-radius: 10px; border: 0;
  background: var(--accent); color: var(--on-accent); font: 600 13px var(--font); cursor: pointer; flex: none; }
body.ui-v2 .new-btn:hover { background: var(--accent-hover); }
body.ui-v2 .new-btn .ico { width: 16px; height: 16px; stroke-width: 2.4; }
body.ui-v2 .demo-chip { margin-left: 0; border-color: var(--border-strong); color: var(--muted); }
body.ui-v2 .demo-chip:hover { background: var(--surface-2); color: var(--text); }
body.ui-v2 .topbar .user { margin-left: 0; color: var(--muted); }
body.ui-v2 .profile-btn { border-color: transparent; color: var(--text); height: 42px; padding: 0 8px 0 4px; border-radius: 12px; gap: 9px; }
body.ui-v2 .profile-btn:hover, body.ui-v2 .profile-btn.active, body.ui-v2 .profile-btn[aria-expanded="true"] { background: var(--surface-2); }
body.ui-v2 .profile-av { width: 32px; height: 32px; font-size: 11px; color: #fff; background: linear-gradient(135deg, #2e66d6, #0f2a4a); }
body.ui-v2 .profile-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
body.ui-v2 .profile-name { font-weight: 600; }
body.ui-v2 .profile-sub { display: block; font-size: 11px; color: var(--muted); }
body.ui-v2 .profile-gear, body.ui-v2 .profile-caret { color: var(--faint); }
/* Lentos antraštė: lentos kaip skirtukai, KPI kortelės */
body.ui-v2 .toolbar { padding: 14px 20px 10px; gap: 10px; }
body.ui-v2 .board-wrap .toolbar > .seg:first-child { flex-basis: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent;
  overflow-x: auto; scrollbar-width: none; margin-bottom: 4px; }
body.ui-v2 .board-wrap .toolbar > .seg:first-child button { height: 40px; padding: 0 2px; margin-right: 22px; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; font-size: 15px; font-weight: 600; color: var(--muted); background: transparent; white-space: nowrap; }
body.ui-v2 .board-wrap .toolbar > .seg:first-child button:hover { color: var(--text); }
body.ui-v2 .board-wrap .toolbar > .seg:first-child button.active { color: var(--text); border-bottom-color: var(--accent); background: transparent; }
body.ui-v2 .toolbar .input, body.ui-v2 .toolbar .btn { border-radius: 9px; }
body.ui-v2 .statsbar { padding: 2px 20px 12px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 10px; flex-basis: 100%; order: -1; margin-bottom: 6px; }
.kpi-tile { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 10px 16px; overflow: hidden; min-width: 0; }
.kpi-tile::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--border-strong); }
.kpi-tile.mrr::before { background: var(--fee-mrr); }
.kpi-tile.once::before { background: var(--fee-once); }
.kpi-tile.untyped::before { background: var(--fee-untyped); }
.kpi-tile.won::before { background: var(--ok-solid); }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.25; white-space: nowrap; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.ui-v2 .page-head h1 { font-size: 22px; letter-spacing: -.01em; }
body.ui-v2 .panel { border-radius: 12px; }
@media (max-width: 1100px) {
  body.ui-v2 .nav .lbl { display: none; }
  body.ui-v2 .nav a { padding: 0 10px; }
  body.ui-v2 .search-btn { min-width: 0; }
}
@media (max-width: 760px) {
  body.ui-v2 .topbar { padding: 0 10px; gap: 8px; }
  body.ui-v2 .nav { flex: 1; min-width: 0; overflow-x: auto; }
  body.ui-v2 .new-btn .lbl, body.ui-v2 .profile-txt { display: none; }
  body.ui-v2 .new-btn { padding: 0 10px; }
  body.ui-v2 .toolbar, body.ui-v2 .statsbar { padding-left: 12px; padding-right: 12px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 18px; }
}

/* ---------------------------------------------------------------------------
   Ataskaitos
   --------------------------------------------------------------------------- */
.reports-head .seg button { height: 30px; }
.reports-head .input.sm { height: 32px; width: auto; }
.rep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rep-kpi { text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rep-kpi:hover { border-color: var(--border-strong); }
.rep-kpi.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rk-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.rk-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rk-value small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.rk-bar { height: 5px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.rk-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.rk-bar.ok i { background: var(--ok-solid); } .rk-bar.warn i { background: var(--warn-solid); } .rk-bar.bad i { background: var(--danger-solid); }
.rk-sub, .rk-proj { font-size: 12px; color: var(--muted); }
.rk-pct { font-weight: 700; }
.rk-pct.ok { color: var(--ok); } .rk-pct.warn { color: var(--warn); } .rk-pct.bad { color: var(--danger); }
.rep-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.reports-page > .panel { margin-bottom: 14px; }
.rep-chart .unit { font-weight: 400; }
.seg.sm button { height: 26px; font-size: 12px; padding: 0 10px; }
.chart-wrap { display: flex; flex-direction: column; gap: 6px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }
.sw.act { background: var(--accent); }
.sw.fc { background: repeating-linear-gradient(45deg, var(--accent-soft) 0 2px, var(--accent-line) 2px 4px); border: 1px solid var(--accent-line); }
.sw.plan { height: 2px; background: var(--text); border-radius: 1px; }
.chart-box { position: relative; }
.rep-svg { width: 100%; height: auto; display: block; overflow: visible; }
.rep-svg .grid { stroke: var(--border); stroke-width: 1; }
.rep-svg .grid.base { stroke: var(--border-strong); }
.rep-svg .ylab, .rep-svg .xlab { fill: var(--faint); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.rep-svg .xlab.current { fill: var(--text); font-weight: 700; }
.rep-svg .b-act { fill: var(--accent); }
.rep-svg .b-fc { fill: url(#hatch); stroke: var(--accent-line); stroke-width: 1; }
.rep-svg .hatch-bg { fill: var(--accent-soft); }
.rep-svg .hatch-line { stroke: var(--accent-line); stroke-width: 3; }
.rep-svg .plan-line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.rep-svg .hit { fill: transparent; cursor: default; outline: none; }
.rep-svg .hit.on, .rep-svg .hit:focus { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12px; pointer-events: none; min-width: 160px; z-index: 2; display: flex; flex-direction: column; gap: 3px; }
.chart-tip div { display: flex; align-items: center; gap: 6px; }
.chart-tip.hidden { display: none; }
.fc-panel { gap: 12px; }
.fc-projs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fc-proj { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.fc-big { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-pipe { display: flex; flex-direction: column; gap: 8px; }
.fc-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fc-nums div { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.fc-nums b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-nums span { font-size: 11px; color: var(--muted); }
.fc-nums .hl { background: var(--accent-soft); }
.fc-table td, .fc-table th { padding: 5px 6px; }
.fc-table .warn-row td { color: var(--warn); }
.fc-top { display: flex; flex-direction: column; gap: 4px; }
.fc-top-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fc-top-row .link-btn { max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pm-table { font-size: 12px; }
.pm-table th, .pm-table td { padding: 6px 7px; }
.pm-table .pm-name { text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.pm-table th.current, .pm-table td.current { box-shadow: inset 0 0 0 1px var(--accent-line); }
.pm-cell .pm-v { font-weight: 600; }
.pm-cell .pm-p, .pm-tot .pm-p { color: var(--faint); font-size: 11px; }
.pm-cell.future .pm-v { color: var(--muted); font-style: italic; font-weight: 500; }
.pm-cell.ok { background: color-mix(in srgb, var(--ok) 9%, transparent); }
.pm-cell.warn { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pm-cell.bad { background: color-mix(in srgb, var(--danger) 9%, transparent); }
.pm-pct.ok { color: var(--ok); font-weight: 700; } .pm-pct.warn { color: var(--warn); font-weight: 700; } .pm-pct.bad { color: var(--danger); font-weight: 700; }
.pm-table tr.inactive .pm-name { color: var(--faint); }
.pm-table tfoot tr.team th, .pm-table tfoot tr.team td { border-top: 2px solid var(--border-strong); font-weight: 700; }
.slice-ctl { gap: 8px; align-items: flex-end; }
.slice-ctl .field { margin: 0; }
.slice-ctl .field label { font-size: 11px; }
.slice-ctl .input.sm { height: 30px; }
.slice-table td, .slice-table th { padding: 6px 8px; }
.slice-table tfoot th, .slice-table tfoot td { border-top: 2px solid var(--border-strong); font-weight: 700; }
.bar-col { width: 22%; min-width: 120px; }
.hbar { display: flex; gap: 2px; height: 10px; }
.hbar i { display: block; height: 100%; border-radius: 3px; min-width: 0; }
.hbar i.m { background: var(--fee-mrr); } .hbar i.o { background: var(--fee-once); } .hbar i.u { background: var(--fee-untyped); }
.rep-note { margin: 0 0 16px; }
.modal.xwide { width: min(1180px, calc(100vw - 32px)); max-width: none; }
.plan-table th, .plan-table td { padding: 4px 3px; }
.plan-inp { width: 74px; height: 30px; padding: 2px 6px; text-align: right; }
.plan-tot { min-width: 70px; font-weight: 600; }
@media (max-width: 1000px) { .rep-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .rep-kpis { grid-template-columns: 1fr 1fr; }
  .rk-value { font-size: 18px; }
  .fc-nums { grid-template-columns: 1fr 1fr; }
  .reports-head .seg { order: 5; }
}
.table th.num, .table td.num { text-align: right; }
.chart-tip div { white-space: nowrap; }
.plan-inp { width: 66px; }
.users-table td { vertical-align: middle; }
.rep-chart .panel-head { flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
  /* Telefone: viršutinė juosta dviem eilutėmis — logotipas ir veiksmai, po jais visa navigacija */
  body.ui-v2 .topbar { height: auto; flex-wrap: wrap; row-gap: 6px; padding: 8px 10px 6px; }
  body.ui-v2 .topbar .logo-crm { display: none; }
  body.ui-v2 .search-btn { margin-left: auto; height: 34px; width: 38px; padding: 0; justify-content: center; }
  body.ui-v2 .nav { order: 10; flex: 1 1 100%; overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  body.ui-v2 .nav .lbl { display: inline; }
  body.ui-v2 .nav a { padding: 0 10px; flex: none; }
  .chart-box { overflow-x: auto; }
  .rep-svg { min-width: 560px; }
}
.reports-page > .scope-note { margin-bottom: 10px; }
.pm-cell .pm-v.zero { color: var(--faint); font-weight: 400; }
.pm-toggle { margin-top: 8px; }
@media (max-width: 1500px) {
  body.ui-v2 .search-btn { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  body.ui-v2 .search-btn .lbl, body.ui-v2 .search-btn kbd { display: none; }
}
body.ui-v2 .search-btn { flex: none; }
.drawer.readonly .move-select { display: none; }
@media (max-width: 1500px) {
  body.ui-v2 .topbar { gap: 10px; }
  body.ui-v2 .topbar .logo-crm, body.ui-v2 .profile-gear { display: none; }
  body.ui-v2 .nav a { padding: 0 10px; }
  body.ui-v2 .demo-chip { padding: 0 8px; letter-spacing: .2px; }
}
@media (max-width: 1360px) { body.ui-v2 .profile-txt { display: none; } }
@media (max-width: 1220px) { body.ui-v2 .nav .lbl { display: none; } }
@media (max-width: 760px) { body.ui-v2 .nav .lbl { display: inline; } }

/* ---------------------------------------------------------------------------
   Nuotraukos, profilis, nustatymų puslapiai
   --------------------------------------------------------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.avatar.has-img, .profile-av.has-img { padding: 0; overflow: hidden; background: var(--sunken); }
.avatar.has-img img, .profile-av.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
body.ui-v2 .profile-av.has-img { background: var(--sunken); }
.pf-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.pf-card .panel-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 22px 18px; }
.pf-photo { width: 136px; height: 136px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #2e66d6, #0f2a4a); overflow: hidden; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); transition: box-shadow .15s; }
.pf-photo.has-img { background: var(--sunken); }
.pf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-photo.drop { box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--accent); }
.pf-name { font-size: 18px; font-weight: 700; margin-top: 6px; }
.pf-actions { justify-content: center; margin: 6px 0 2px; }
.pf-main { gap: 14px; min-width: 0; }
.pf-opt { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; padding: 4px 0; }
.pf-pw { grid-template-columns: repeat(3, 1fr); }
.pf-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; }
.pf-perm { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.settings-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-nav { position: sticky; top: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav .sn-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; padding: 10px 10px 4px; }
.settings-nav .sn-group:first-child { padding-top: 6px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.settings-nav a .ico { width: 16px; height: 16px; flex: none; }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.settings-nav a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.settings-main { min-width: 0; }
.set-head { margin: 2px 0 12px; }
.set-head h2 { margin: 0 0 4px; font-size: 18px; }
.set-head p { margin: 0; max-width: 760px; }
.settings-main > .panel > .panel-body { padding: 16px; }
@media (max-width: 860px) {
  .settings-layout, .pf-grid { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 4px; }
  .settings-nav .sn-group { display: none; }
  .settings-nav a { flex: none; white-space: nowrap; }
  .pf-pw { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Darbuotojų paštas (Outlook)
   --------------------------------------------------------------------------- */
.tl-src { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.tl-src .ico { width: 11px; height: 11px; }
.tl-to { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.tl-icon.sm { width: 22px; height: 22px; font-size: 10px; flex: none; }
.ra-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ra-item { border-top: 1px solid var(--border); }
.ra-item:first-child { border-top: 0; }
.ra-item summary { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; list-style: none; min-width: 0; }
.ra-item summary::-webkit-details-marker { display: none; }
.ra-item summary:hover { background: var(--row-hover); }
.ra-subj { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.ra-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.ra-date { white-space: nowrap; }
.ra-body { padding: 0 12px 8px 40px; max-height: 260px; overflow: auto; }
.ra-item > .link-btn { margin: 0 0 8px 40px; }
.mm-empty, .mm-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mm-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.mm-ico .ico { width: 20px; height: 20px; }
.mm-ico.ok { background: var(--accent-soft); color: var(--accent-text); }
.mm-empty .btn svg { margin-right: 6px; }
.mm-num { display: flex; flex-direction: column; align-items: flex-end; }
.mm-num b { font-size: 22px; font-variant-numeric: tabular-nums; }
.mm-num span { font-size: 11px; color: var(--muted); }
.mm-skip { margin-top: 8px; }
.mm-actions { margin: 12px 0; gap: 8px; }
.mm-settings { margin-top: 4px; align-items: start; }
.mm-excl { min-height: 64px; }
.mm-rules { margin-top: 12px; font-size: 13px; }
.mm-rules summary { cursor: pointer; color: var(--accent-text); font-weight: 600; }
.mm-rules ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.mail-flash { padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.mail-flash.ok { background: var(--ok-soft); color: var(--ok); }
.mail-flash.warn { background: var(--warn-soft); color: var(--warn); }
.mail-flash.bad { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 760px) { .ra-who { display: none; } .mm-num { align-items: flex-start; } }

/* ---------------------------------------------------------------------------
   Platformos moduliai: perjungiklis, HR, ERP, Support
   --------------------------------------------------------------------------- */
.mod-switch { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 8px 0 4px; border-radius: 9px; border: 1px solid var(--brand-line);
  background: transparent; color: var(--brand-text); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; flex: none; margin-left: -8px; }
.mod-switch:hover:not(:disabled) { background: var(--brand-hover); }
.mod-switch:disabled { cursor: default; opacity: 1; }
.mod-switch .mod-ico, .mod-menu .mod-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--mc, var(--accent)) 16%, transparent); color: var(--mc, var(--accent)); }
.mod-switch .mod-ico .ico { width: 15px; height: 15px; }
.mod-switch .mod-caret { display: inline-flex; color: var(--brand-muted); }
.mod-switch .mod-caret .ico { width: 14px; height: 14px; }
body.ui-v2 .mod-switch { border-color: var(--border); background: var(--surface); color: var(--text); height: 36px; border-radius: 10px; }
body.ui-v2 .mod-switch:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
body.ui-v2 .mod-switch .mod-caret { color: var(--faint); }
.mod-menu { min-width: 280px; padding: 4px; }
.mod-menu .popmenu-item { padding: 7px 8px; border-radius: 8px; gap: 10px; }
.mod-menu .mod-ico .ico { width: 16px; height: 16px; }
.mod-menu .mod-ico { width: 32px; height: 32px; border-radius: 9px; }
.mod-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mod-txt b { font-size: 13.5px; }
.mod-txt small { font-size: 12px; color: var(--muted); }
.mod-menu .popmenu-item.checked::before { order: 9; margin-left: auto; }
.mod-menu .popmenu-item[role="menuitemradio"]:not(.checked)::before { order: 9; margin-left: auto; }

.mod-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
button.kpi-tile { text-align: left; font: inherit; cursor: pointer; }
button.kpi-tile:hover { border-color: var(--border-strong); background: var(--surface-2); }
.kpi-tile.late::before { background: var(--danger-solid); }
.kpi-tile.late .kpi-value { color: var(--danger); }
.field.inline { flex-direction: row; align-items: center; gap: 6px; }
.field.inline > label { white-space: nowrap; }
.modal.xwide { width: min(1080px, calc(100vw - 32px)); }
.muted-row td { opacity: .6; }
td.center { text-align: center; }

/* Bendra istorija (events) */
.ev-list { margin-top: 4px; }
.ev-list .tl-item { padding: 8px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
.ev-list .tl-item:last-child { border-bottom: 0; }
.ev-list .tl-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.ev-list .tl-body { white-space: pre-wrap; font-size: 13px; }

/* HR */
.hr-page { display: flex; flex-direction: column; }
.hr-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.hr-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 8px; }
.hr-side-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 8px; font-size: 13px; }
.hr-vac { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "t n b" "s s s"; gap: 0 6px; text-align: left; border: 0; background: transparent;
  padding: 7px 8px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.hr-vac:hover { background: var(--row-hover); }
.hr-vac.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.hr-vac.closed { color: var(--faint); }
.hr-vac-title { grid-area: t; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-vac > .small { grid-area: s; }
.hr-vac-n { grid-area: n; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hr-vac .badge { grid-area: b; }
.hr-main { min-width: 0; }
.hr-vac-info { margin-bottom: 8px; }
.hr-board { padding: 0 0 12px; min-height: 360px; }
.hr-board .col { width: auto; flex: 1 0 178px; min-width: 178px; max-width: 280px; }
.hr-board .col.collapsed { flex: none; width: 44px; min-width: 44px; }
.hr-card .card-title { font-weight: 600; }
.hr-card .age { margin-left: auto; }
.stars { color: #e0a100; letter-spacing: 1px; font-size: 12px; }
.rating-pick { display: inline-flex; gap: 1px; }
.rating-pick .star { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--border-strong); cursor: pointer; padding: 0 1px; }
.rating-pick .star.on { color: #e0a100; }
.rating-pick .star:disabled { cursor: default; }
.cand-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; }
.cand-side { border-left: 1px solid var(--border); padding-left: 18px; }
.cand-side h4 { margin: 0; }
.cand-head { align-items: center; }
.cand-head .input.sm { width: auto; }

/* ERP */
.erp-table td { vertical-align: middle; }
.erp-back { margin-bottom: 6px; font-size: 13px; }
.erp-head { align-items: center; flex-wrap: wrap; gap: 12px; }
.erp-head h1 { margin: 0; }
.erp-avatar { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--ok-soft); color: var(--ok); flex: none; }
.erp-head .input.sm { width: auto; min-width: 140px; }
.erp-tabs { margin-bottom: 12px; }
.erp-tabs .tab-count { margin-left: 6px; }
.tab-count.red { background: var(--danger-soft); color: var(--danger); }
.erp-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.svc-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, .8fr) 30px; gap: 6px; align-items: center; }
.erp-group { margin-bottom: 14px; }
.erp-group-head { font-weight: 600; font-size: 13px; padding: 4px 2px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.erp-group-head.red { color: var(--danger); }
.erp-task { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.erp-task:last-child { border-bottom: 0; }
.erp-task input[type="checkbox"] { width: 16px; height: 16px; flex: none; accent-color: var(--ok-solid); }
.erp-task .et-main { flex: 1; min-width: 0; font-size: 13px; }
.erp-task.closed .et-main b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); font-weight: 500; }
.erp-task.overdue { box-shadow: inset 3px 0 0 var(--danger-solid); padding-left: 10px; }
.et-client { font-weight: 600; }
.auth-chip { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; flex: none; }
.erp-task-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.time-form, .doc-form { display: grid; grid-template-columns: 110px 150px minmax(0, 1.2fr) minmax(0, 1.5fr) auto; gap: 8px; align-items: end; }
.doc-form { grid-template-columns: minmax(0, 1.4fr) 150px minmax(0, 1.6fr) 150px auto; }
.doc-list { display: flex; flex-direction: column; }
.doc-row { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.doc-row:last-child { border-bottom: 0; }
.obl-table .input.sm { min-width: 0; }
.obl-table .num-in { width: 64px; }
.obl-table td { vertical-align: top; }
.obl-table td:nth-child(1) { width: 32%; }
.obl-table td:nth-child(2) { width: 13%; }
.obl-table td:nth-child(3) { width: 14%; }

/* Skyriai */
.dept-panel { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.dept-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dept-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 4px 4px 4px 10px; background: var(--surface-2); font-size: 13px; }
.dept-chip .small { display: inline-flex; align-items: center; gap: 3px; }
.dept-chip .icon-btn { width: 24px; height: 24px; }
.dept-add .input { max-width: 280px; }

/* Support */
.sup-item { grid-template-columns: 12px minmax(0, 1fr); }
.prio-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--border-strong); }
.prio-dot.high { background: var(--warn-solid); }
.prio-dot.urgent { background: var(--danger-solid); box-shadow: 0 0 0 3px var(--danger-soft); }
.prio-dot.low { background: transparent; border: 1.5px solid var(--border-strong); }
.sup-item.needs .mi-subj { font-weight: 700; }
.sup-item .mi-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.sup-item .mi-meta .avatar { width: 20px; height: 20px; font-size: 9px; }
.sup-page .mail-detail { display: flex; flex-direction: column; gap: 12px; }
.sup-meta { gap: 10px 14px; margin: 8px 0 4px; }
.sup-meta .input.sm { width: auto; }
.sup-who { color: var(--muted); }
.sup-who b { color: var(--text); }
.sup-thread { display: flex; flex-direction: column; gap: 10px; }
.sup-msg { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); max-width: 92%; }
.sup-msg.out { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent-line); }
.sup-msg.note { align-self: stretch; max-width: none; background: var(--warn-soft); border-color: var(--warn-line); border-style: dashed; }
.sup-msg-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.sup-msg-body .mail-text { font-size: 13.5px; }
.sup-composer { border-top: 1px solid var(--border); padding-top: 10px; }
.sup-composer .input.sm { width: auto; }
.sup-related { padding-top: 6px; border-top: 1px dashed var(--border); }

@media (max-width: 1100px) {
  .hr-layout, .erp-grid, .cand-grid { grid-template-columns: 1fr; }
  .hr-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .hr-side-head { flex-basis: 100%; }
  .hr-vac { flex: 1 1 200px; }
  .cand-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 12px; }
  .time-form, .doc-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .mod-switch .mod-name { display: none; }
  .mod-switch { margin-left: 0; padding: 0 6px 0 4px; }
  .erp-head .field.inline { flex: 1 1 100%; }
  .svc-row { grid-template-columns: 1fr 1fr; }
  .sup-msg { max-width: 100%; }
}

/* ERP: apskaitos kokybė, grupavimas, skolininkai */
.score-badge { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 7px; border-radius: 12px; font-weight: 700; font-size: 12.5px;
  font-variant-numeric: tabular-nums; background: var(--sunken); color: var(--muted); border: 1px solid var(--border); }
.score-badge.good { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.score-badge.fair { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.score-badge.poor { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.score-badge.none { color: var(--faint); }
.team-chips { display: inline-flex; align-items: center; gap: 4px; }
.team-chips .avatar { width: 24px; height: 24px; font-size: 10px; margin-left: -4px; box-shadow: 0 0 0 2px var(--surface); }
.team-chips .avatar:first-child { margin-left: 0; }
.team-btn { border: 0; background: transparent; padding: 2px 4px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 6px; }
.team-btn:hover:not(:disabled) { background: var(--row-hover); }
.team-btn:disabled { cursor: default; }
.erp-team-line { margin: -4px 0 10px 56px; display: flex; align-items: center; gap: 4px; }
.team-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px; max-height: 55vh; overflow: auto; margin-top: 8px; }
.team-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.team-row:hover { background: var(--row-hover); }
.group-row td { background: var(--surface-2); cursor: pointer; padding-top: 8px; padding-bottom: 8px; }
.group-row:hover td { background: var(--row-hover); }
.group-row .row { gap: 10px; }
.grp-caret { display: inline-flex; color: var(--faint); transition: transform .15s; }
.grp-caret.closed { transform: rotate(-90deg); }
.warn-text { color: var(--danger); }
.ok-text { color: var(--ok); }
tr.hl td { background: var(--accent-soft); }
tr.late-row td { background: color-mix(in srgb, var(--danger-soft) 60%, transparent); }
tr.attn-row td:first-child { box-shadow: inset 3px 0 0 var(--warn-solid); }
.table.compact td, .table.compact th { padding-top: 5px; padding-bottom: 5px; font-size: 12.5px; }
.acct-top { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.acct-top .mod-kpis { margin-bottom: 0; }
.acct-score .row { gap: 12px; align-items: center; }
.acct-score .score-badge { min-width: 52px; height: 40px; font-size: 18px; border-radius: 12px; }
.flag-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.flag-list li { font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--warn-soft); border: 1px solid var(--warn-line); display: flex; gap: 8px; align-items: baseline; }
.flag-list li.sev2 { background: var(--danger-soft); border-color: var(--danger-line); }
.flag-grp { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); flex: none; }
.flag-chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin: 1px 3px 1px 0; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); white-space: nowrap; }
.flag-chip.sev2 { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.flags-cell { max-width: 340px; }
.mbars-wrap { display: flex; flex-direction: column; gap: 6px; }
.mbars { display: flex; align-items: stretch; gap: 6px; padding-bottom: 18px; position: relative; border-bottom: 1px solid var(--border); }
.mbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; min-width: 0; }
.mbar-stack { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.mbar { display: block; width: 40%; max-width: 22px; min-height: 1px; border-radius: 4px 4px 0 0; }
.mbar.s1, .lg.s1 { background: var(--accent); }
.mbar.s2, .lg.s2 { background: var(--teal); }
.mbar-lbl { position: absolute; bottom: -17px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.mbars-legend { display: flex; gap: 14px; }
.mbars-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.people-row.static { cursor: default; }
.people-row.static:hover { background: transparent; border-color: var(--border); }
.qual-toolbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; flex-wrap: wrap; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--accent-text); }
.qual-table td { vertical-align: middle; }
.table.heat td { text-align: right; font-variant-numeric: tabular-nums; }
.table.heat td:first-child { text-align: left; white-space: nowrap; }
td.link { color: var(--accent-text); }
.rem-rules { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.rem-list { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 1100px) {
  .acct-top { grid-template-columns: 1fr; }
  .rem-rules { grid-template-columns: 1fr 1fr; }
  .erp-team-line { margin-left: 0; }
}
.small.accent, span.accent { color: var(--accent-text); }

/* Skola BNM klientų sąraše */
td.debt-cell { white-space: nowrap; }
td.debt-cell .tag { margin-top: 3px; font-size: 11px; padding: 1px 6px; }

/* --- TM: laiko apskaita ------------------------------------------------------ */
.tm-page { --chart: var(--teal); --chart-track: var(--sunken); }
.avatar.xs { width: 18px; height: 18px; font-size: 8px; }
.set-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 10px 0 0; }
.tm-toolbar .seg { flex: none; }
.tm-toolbar input[type=search] { width: 200px; }
.tm-cli-sel { max-width: 220px; }
.tm-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 14px; }
.tm-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
@media (max-width: 900px) { .tm-grid { grid-template-columns: minmax(0, 1fr); } }
.tm-src-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tm-src-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tm-src-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.tm-src-dot.ok { background: var(--ok); }
.tm-src-dot.err { background: var(--danger); }
.tm-src-dot.wait { background: var(--warn); }
.tm-bulk { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px;
  border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.tm-bulk .tm-cli-in { width: 240px; }
.tm-table td, .tm-table th { vertical-align: top; }
.tm-table tr.sel td { background: var(--accent-soft); }
.tm-ck { width: 28px; padding-right: 0 !important; }
.tm-act { min-width: 180px; max-width: 480px; }
.tm-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px; }
.tm-client { min-width: 140px; }
.tm-sheet th, .tm-sheet td { padding-left: 6px; padding-right: 6px; }
.tm-sheet .tm-name { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; }
.tm-sheet .d { text-align: right; min-width: 34px; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.tm-sheet th.d { font-weight: 600; line-height: 1.2; }
.tm-sheet .we { background: var(--surface-2); color: var(--faint); }
.tm-sheet .today { box-shadow: inset 0 -2px 0 var(--accent); }
.tm-sheet td.miss { color: var(--danger); background: var(--danger-soft); }
.tm-sheet td.low { color: var(--warn); }
.tm-sheet tfoot th { border-top: 1px solid var(--border); }
.tm-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.tm-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.tm-legend .lg.miss { background: var(--danger-soft); border: 1px solid var(--danger-line); }
.tm-legend .lg.low { background: var(--warn-soft); border: 1px solid var(--warn-line); }
.tm-avs { display: inline-flex; gap: 2px; align-items: center; }
.tm-erp-link { margin-left: 6px; }
.tm-actions .btn, .tm-actions .icon-btn { margin: 2px 4px 2px 0; }
.tm-err { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-howto summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.tm-howto .stack { margin-top: 8px; }
.tm-code { font: 500 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.tm-token { word-break: break-all; max-width: 420px; }
.tm-days.dense { gap: 3px; }
.tm-days.dense .cc-col b { min-height: 0; }
.tm-days .cc-col.we span { color: var(--faint); }
@media (max-width: 640px) {
  .tm-toolbar .seg { max-width: 100%; overflow-x: auto; }
  .tm-toolbar .seg button { white-space: nowrap; flex: none; }
  .tm-toolbar select { max-width: 100%; }
  .tm-toolbar input[type=search], .tm-cli-sel, .tm-bulk .tm-cli-in { width: 100%; max-width: none; }
  .tm-act { min-width: 140px; }
}
