/* tamigo sales hub – vzhled „Teplé sklo“ v barvách tamiga (Brand & Design Guidelines v6.0, docs/brand/).
   Teplé pískové pozadí s rozmazanými koulemi (Vibrant Orange, Sunlight Yellow, Light Shade Blue),
   aplikace jako jeden průsvitný skleněný panel, mléčné karty se zaoblením 24 px, velká lehká čísla.
   Vždy světlý, i když má systém tmavý režim. Písmo DM Sans (podobné GT Walsheim), záloha Arial. */

:root {
  color-scheme: light;
  /* Brand paleta (přesné hodnoty z manuálu) */
  --brand-orange: #ff6e5a;        /* Vibrant Orange – barva tamiga */
  --brand-orange-2: #ff8273;
  --brand-navy: #16216a;          /* Dark Shade Blue */
  --brand-blue: #414ba5;          /* Light Shade Blue */
  --brand-blue-2: #6e78b9;
  --brand-purple: #b44677;        /* Daylight Purple */
  --brand-purple-dark: #690046;   /* Cloudy Purple */
  --brand-sunrise: #ffa046;       /* Sunrise Yellow */
  --brand-sunlight: #ffb969;      /* Sunlight Yellow */
  --brand-sunlight-2: #ffca91;
  --clouds-light: #ebebeb;
  --clouds-medium: #dcdcdc;
  --clouds-dark: #646464;         /* text */
  --traffic-red: #ff3f21;
  --traffic-yellow: #f0dd6d;
  --traffic-green: #52b77e;

  /* Role v aplikaci – směr „Teplé sklo“: teplé pozadí s rozmazanými koulemi v barvách tamiga,
     průsvitný skleněný panel aplikace, mléčné karty, velká lehká čísla. */
  --bg: #f4ece3;                  /* teplá pískově béžová */
  --panel: rgba(255, 255, 255, .42);
  --panel-line: rgba(255, 255, 255, .7);
  --side: transparent;
  --surface: rgba(255, 255, 255, .66);   /* mléčné sklo karet */
  --surface-solid: #fffaf6;              /* plovoucí okna a nabídky */
  --surface-line: rgba(255, 255, 255, .85);
  --soft: rgba(60, 40, 20, .05);
  --softer: rgba(255, 255, 255, .45);
  --track: rgba(60, 40, 20, .08);  /* podklad přepínačů a ukazatelů */
  --line: rgba(60, 40, 20, .08);
  --line-strong: rgba(60, 40, 20, .15);
  --text: var(--clouds-dark);
  --strong: #1d2238;              /* inkoustová, ztmavená Dark Shade Blue */
  --muted: #80776e;
  --coral: var(--brand-orange);
  --coral-ink: #c63c28;
  --coral-soft: rgba(255, 110, 90, .13);
  --indigo: var(--brand-blue);
  --indigo-hover: #363f92;
  --indigo-soft: rgba(65, 75, 165, .1);
  --indigo-ink: #2f3790;
  --primary: var(--strong);
  --primary-hover: #2b3152;
  --on-primary: #ffffff;
  --peach: var(--brand-sunlight);
  --peach-soft: rgba(255, 185, 105, .2);
  --peach-ink: #8f4c00;
  --orange: var(--brand-sunrise);
  --berry: var(--brand-purple);
  --berry-soft: rgba(180, 70, 119, .1);
  --green: #2f8656;
  --green-soft: rgba(82, 183, 126, .16);
  --red-soft: rgba(255, 63, 33, .1);
  --on-indigo: #ffffff;
  --seg-other: #d9cfc4;
  --orb-1: .55; --orb-2: .6; --orb-3: .12;
  --shadow-sm: 0 1px 1px rgba(80, 50, 20, .03);
  --shadow: 0 1px 1px rgba(80, 50, 20, .04), 0 18px 40px -12px rgba(120, 70, 30, .18);
  --shadow-lg: 0 2px 6px rgba(80, 50, 20, .06), 0 30px 70px -20px rgba(120, 70, 30, .32);
  --radius: 14px;
  --radius-lg: 24px;
}
/* Jen světlý vzhled „Teplé sklo“ (návrh A), bez ohledu na tmavý režim systému. */
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.6 "DM Sans", "GT Walsheim Pro", Arial, system-ui, sans-serif; overflow-x: clip; -webkit-font-smoothing: antialiased; text-align: left; }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--brand-orange) 22%, transparent); }

/* ================= Rozvržení ================= */
/* Světlý postranní panel splývá s pozadím; aktivní položka je bílá „pilulka“, ikona v oranžové tamigo. */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 30px; padding: 30px 16px 20px; background: var(--side); overflow-y: auto; }
.brand { display: flex; align-items: baseline; gap: 9px; padding: 0 12px; color: var(--muted); font-size: 13px; font-weight: 500; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 25px; width: auto; }
.side nav { display: flex; flex-direction: column; gap: 22px; }
.group { display: flex; flex-direction: column; gap: 2px; }
.group-label { padding: 0 14px 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.side nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 999px; color: var(--text); font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s, box-shadow .15s; }
.side nav a:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--strong); text-decoration: none; }
.side nav a.active { background: var(--surface); color: var(--strong); box-shadow: var(--shadow-sm); }
.side nav svg { flex: none; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s; }
.side nav a:hover svg { stroke: var(--strong); }
.side nav a.active svg { stroke: var(--brand-orange); }
.pill { margin-left: auto; min-width: 22px; padding: 1px 8px; border-radius: 999px; background: var(--coral-soft); color: var(--coral-ink); font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.side nav a.active .pill { background: var(--brand-orange); color: #fff; }
.side-note { margin: auto 14px 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
/* Hlavní obsah: nadpis sekce nahoře, pod ním přepínač záložek, pak obsah. */
main { width: 100%; max-width: 1320px; padding: 40px clamp(16px, 3.4vw, 48px) 80px clamp(16px, 2vw, 24px); display: flex; flex-direction: column; }
main > * { order: 3; }
main > .crumbs { order: 0; }
main > .section-head, main > .hero, main > .deal-head { order: 1; }
main > .tabs, main > .flash { order: 2; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  main { padding: 24px 16px 64px; }
}

/* ================= Typografie a hlavičky ================= */
h1 { margin: 0; font-size: clamp(28px, 2.8vw, 36px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 500; color: var(--strong); }
h2 { margin: 32px 0 12px; font-size: 16px; letter-spacing: -0.01em; font-weight: 600; color: var(--strong); display: flex; align-items: center; gap: 8px; }
h3 { margin: 0; font-weight: 600; color: var(--strong); }
p { margin: 0 0 12px; }
.lead { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; max-width: 72ch; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.sub { color: var(--muted); font-size: 13px; }
.strong { font-weight: 600; color: var(--strong); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.right { margin-left: auto; font-variant-numeric: tabular-nums; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.count { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--track); padding: 1px 8px; border-radius: 999px; }

.section-head { display: flex; gap: 16px 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 28px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crumbs { margin: 0 0 12px; font-size: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--strong); }
.dotsep { font-size: 14px; }

/* Záložky jako segmentový přepínač */
.tabs { align-self: flex-start; display: inline-flex; gap: 2px; max-width: 100%; margin: -8px 0 28px; padding: 4px; background: var(--track); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 7px 16px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; transition: color .15s, background .15s, box-shadow .15s; }
.tabs a:hover { color: var(--strong); text-decoration: none; }
.tabs a.active { background: var(--surface); color: var(--strong); box-shadow: 0 1px 3px rgba(60, 45, 30, .1); }

/* ================= Karty, panely, mřížky ================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px 26px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.card > h2:first-child, .card > header + h2 { margin-top: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 20px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; margin-bottom: 20px; }
.cols > .card { margin-bottom: 0; }
.cols.wide-left { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.stack-gap { display: grid; gap: 20px; align-content: start; }
.stack-gap > .card { margin: 0; }
@media (max-width: 960px) { .cols, .cols.wide-left { grid-template-columns: minmax(0, 1fr); } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { padding: 16px 18px; border-radius: var(--radius); background: var(--softer); border: 1px solid var(--line); }
.stat b { display: block; font-size: 26px; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; color: var(--strong); font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.stat span { font-size: 13.5px; color: var(--muted); }

/* Přehled: viz „Čistý vzhled“ na konci souboru. */

/* ================= Tabulky ================= */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--softer); padding-top: 10px; padding-bottom: 10px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--softer); }
tr.dim td { color: var(--muted); }
tr.dim .strong, tr.dim b { color: var(--muted); }
.check-col { width: 44px; padding-right: 0; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--indigo); margin: 2px 0 0; }

/* ================= Formuláře a tlačítka ================= */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 18px; border: 1px solid transparent; border-radius: 9px; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
button:hover, .btn:hover { background: var(--primary-hover); text-decoration: none; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--indigo-soft); outline-offset: 2px; }
button.secondary, .btn.secondary { background: var(--surface); color: var(--strong); border-color: var(--line-strong); }
button.secondary:hover, .btn.secondary:hover { background: var(--soft); }
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { background: var(--soft); color: var(--strong); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
.grid .wide, .grid .actions { grid-column: 1 / -1; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; gap: 10px; align-items: center; margin: 2px 0 16px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.actions.end { justify-content: flex-end; }
.actions.sticky { position: sticky; bottom: 0; z-index: 2; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 14px 0; margin-top: -8px; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline input, .inline select { width: auto; flex: 1 1 170px; }
.filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filters input { flex: 3 1 240px; width: auto; }
.filters select { flex: 1 1 160px; width: auto; }
form.tiny, .tiny-form { display: inline-flex; margin: 0; }
form.tiny button { min-height: 0; padding: 4px 10px; font-size: 12.5px; font-weight: 500; }
.stack-form { display: grid; gap: 10px; }
.danger { margin-top: 28px; }
.danger button { background: transparent; color: var(--berry); border-color: color-mix(in srgb, var(--berry) 45%, transparent); min-height: 36px; padding: 6px 14px; font-weight: 500; }
.danger button:hover { background: var(--berry-soft); }

/* ================= Hlášky a prázdné stavy ================= */
.flash { display: flex; gap: 10px; align-items: center; background: var(--green-soft); color: var(--strong); padding: 11px 16px; border-radius: var(--radius); margin-bottom: 22px; font-size: 14px; }
.flash::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.note { background: var(--indigo-soft); color: var(--strong); padding: 11px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; }
.warn { background: var(--berry-soft); color: var(--strong); padding: 11px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; }
.empty { color: var(--muted); padding: 26px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; font-size: 14px; background: var(--softer); }
.empty-state { padding: 80px 0; }
.error-page { max-width: 640px; margin: 80px auto; padding: 0 16px; }

/* ================= Štítky a skóre ================= */
.badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; font-weight: 500; line-height: 1; padding: 5px 9px; border-radius: 999px; background: var(--soft); color: var(--text); vertical-align: middle; }
.badge-lead, .badge-pending, .badge-task, .badge-post-draft { background: var(--peach-soft); color: var(--peach-ink); }
.badge-qualified, .badge-meeting, .badge-post-approved { background: var(--indigo-soft); color: var(--indigo-ink); }
.badge-customer, .badge-approved, .badge-post-published { background: var(--green-soft); color: var(--green); }
.badge-lost, .badge-rejected, .badge-duplicate, .badge-post-rejected { background: var(--soft); color: var(--muted); }
.badge-do_not_contact, .badge-blocked { background: var(--berry-soft); color: var(--berry); }
.badge-call, .badge-email { background: var(--coral-soft); color: var(--coral-ink); }
.score { display: inline-grid; place-items: center; width: 40px; height: 28px; border-radius: 8px; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; cursor: help; }
.score-high { background: var(--green-soft); color: var(--green); }
.score-mid { background: var(--peach-soft); color: var(--peach-ink); }
.score-low { background: var(--soft); color: var(--muted); }
.why { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.status-on { color: var(--green); } .status-on::before { background: var(--green); }

/* ================= CRM detail ================= */
dl { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 9px 16px; margin: 0 0 20px; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; color: var(--strong); }
.people { list-style: none; padding: 0; margin: 0 0 6px; }
.people li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.people li:first-child { padding-top: 0; }
.avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--coral-soft); color: var(--coral-ink); font-weight: 600; }
.list { list-style: none; padding: 0; margin: 0 0 14px; }
.list li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.deal-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer { display: grid; grid-template-columns: 150px minmax(0, 1fr) 170px; gap: 10px; }
.composer textarea { grid-column: 1 / -1; }
.composer button { justify-self: start; }
@media (max-width: 640px) { .composer { grid-template-columns: minmax(0, 1fr); } }
.timeline { list-style: none; padding: 0; margin: 18px 0 0; }
.timeline li { padding: 13px 0; border-top: 1px solid var(--line); }
.timeline.compact { margin: 0; } .timeline.compact li:first-child { border-top: 0; padding-top: 0; }
.timeline.compact li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.timeline.compact li > .badge { flex: none; }
.timeline.compact li > span:not(.badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.timeline.compact li > a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.timeline.compact small { float: none; margin-left: auto; white-space: nowrap; }
.timeline small { float: right; margin-left: 12px; color: var(--muted); font-size: 12px; }
.timeline p { margin: 6px 0 0; white-space: pre-wrap; }
details summary { cursor: pointer; color: var(--indigo); margin: 10px 0 12px; font-weight: 500; font-size: 14px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; }
details[open] summary::before { content: "− "; }

.task-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.task-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.tick button { width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line-strong); }
.tick button:hover { border-color: var(--green); background: var(--green-soft); }
.due { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.overdue .due { color: var(--berry); font-weight: 500; }

/* ================= Pipeline ================= */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(148px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.column { display: flex; flex-direction: column; background: var(--softer); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 8px 8px; min-height: 220px; transition: border-color .15s, background .15s; }
.column.over { border-color: var(--indigo); background: var(--indigo-soft); }
.col-head { padding: 0 4px 12px; }
.col-head h3 { font-size: 14.5px; margin: 0; letter-spacing: -0.005em; }
.col-sum { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-weighted { margin: 2px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--strong); font-weight: 500; font-variant-numeric: tabular-nums; }
.col-prob { font-size: 11.5px; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: rgba(255, 110, 90, .12); color: var(--brand-orange); text-decoration: none; }
a.col-prob:hover { background: rgba(255, 110, 90, .22); }
.col-progress { display: block; height: 3px; margin-top: 10px; border-radius: 2px; background: var(--line); overflow: hidden; }
.col-progress i { display: block; height: 100%; border-radius: 2px; background: var(--coral); }
.col-cards { display: grid; gap: 8px; min-height: 8px; }
.deal-card { display: flex; flex-direction: column; gap: 2px; padding: 11px 11px 9px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--text); cursor: grab; transition: border-color .15s, box-shadow .15s, transform .15s; }
.deal-card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); }
.deal-card:active { cursor: grabbing; }
.pipeline-board .deal-card, .project-kanban .deal-card { touch-action: pan-x pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Plynulé přetahování: karta v ruce, místo pro puštění, zvýraznění sloupce */
.deal-ghost, .deal-card.deal-ghost { position: fixed; z-index: 1000; margin: 0; pointer-events: none; cursor: grabbing; will-change: transform; box-shadow: 0 18px 40px rgba(26, 31, 54, .22), 0 4px 10px rgba(26, 31, 54, .10) !important; transition: none !important; }
.deal-placeholder { border: 2px dashed color-mix(in srgb, var(--brand-orange) 55%, transparent); background: color-mix(in srgb, var(--brand-orange) 8%, transparent); border-radius: 16px; animation: dnd-ph-in .18s ease-out; }
@keyframes dnd-ph-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
html.dnd-active, html.dnd-active * { cursor: grabbing !important; -webkit-user-select: none !important; user-select: none !important; }
html.dnd-active .deal-card:hover { transform: none; }
.kanban.dnd-board { scroll-snap-type: none !important; }
.pipeline-board .column.over, .project-kanban .column.over { border-color: transparent; }
.column { transition: border-color .18s, background .18s, box-shadow .18s; }
.dnd-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 1001; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 999px; background: var(--strong, #1a1f36); color: #fff; font-size: 14px; box-shadow: var(--shadow); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.dnd-toast.show { opacity: 1; transform: translate(-50%, 0); }
.dnd-toast.bad { background: var(--berry, #b4234a); }
@media (max-width: 760px) { .dnd-toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.deal-title { font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--strong); }
.deal-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; white-space: nowrap; }
.deal-foot b { font-weight: 600; color: var(--strong); font-variant-numeric: tabular-nums; }
.deal-foot .deal-flag { margin-left: auto; }
.deal-flag { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: -4px; }
.flag-planned { background: var(--soft); border: 1.5px solid var(--line-strong); }
.flag-planned::after { content: ""; width: 5px; height: 5px; border-right: 1.5px solid var(--muted); border-top: 1.5px solid var(--muted); transform: translateX(-1px) rotate(45deg); }
.flag-none { border-radius: 0; background: var(--peach); clip-path: polygon(50% 4%, 100% 92%, 0 92%); }
.flag-overdue { background: var(--coral-ink); color: #fff; }
.col-add { margin-top: 6px; }
.col-add > summary { display: flex; justify-content: center; margin: 0; padding: 6px; border-radius: var(--radius); color: var(--muted); font-size: 20px; font-weight: 400; line-height: 1.2; transition: background .15s, color .15s; }
.col-add > summary::before, .col-add[open] > summary::before, .lost-pop[open] > summary::before { content: none; }
.col-add[open] > summary::after { content: ""; position: fixed; inset: 0; z-index: 29; background: rgba(29, 29, 34, .28); cursor: default; }
.col-add > summary:hover { background: var(--surface); color: var(--strong); }
.col-add > summary span { display: inline-block; transition: transform .15s; }
.col-add[open] > summary span { transform: rotate(45deg); }
.col-add form { position: fixed; z-index: 30; left: 50%; top: max(8vh, 24px); transform: translateX(-50%); width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 22px 22px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 24px 64px rgba(29, 29, 34, .22); }
.col-add form h3 { margin: 0 0 4px; font-size: 18px; letter-spacing: -0.01em; }
.col-add form .form-sub { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.col-add form .actions { display: flex; gap: 10px; }
.col-add .field { margin-bottom: 10px; }
.pipe-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.pipe-legend .deal-flag { margin-left: 8px; }
.pipe-legend .deal-flag:first-child { margin-left: 0; }
.dot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot-1 { background: var(--peach); } .dot-2 { background: var(--orange); } .dot-3 { background: var(--coral); }
.dot-4 { background: var(--berry); } .dot-5 { background: var(--indigo); } .dot-6 { background: var(--indigo-ink); }
.dot-7 { background: var(--green); } .dot-8 { background: var(--line-strong); }

/* ================= Karta dealu ================= */
.ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.deal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.deal-head .lead { margin-top: 8px; }
.deal-head .head-actions { align-items: center; }
.deal-head form { margin: 0; }
.owner-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; color: var(--strong); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--coral-soft); color: var(--coral-ink); font-weight: 600; font-size: 13px; }
button.btn-won { background: var(--green); color: #fff; }
button.btn-won:hover { background: color-mix(in srgb, var(--green) 88%, #000); }
.btn-lost, button.btn-lost { background: var(--surface); color: var(--berry); border: 1px solid color-mix(in srgb, var(--berry) 45%, transparent); }
.btn-lost:hover, button.btn-lost:hover { background: var(--berry-soft); }
.lost-pop { position: relative; }
.lost-pop > summary { margin: 0; font-weight: 600; }
.lost-pop > summary::before { content: none; }
.lost-pop .pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; width: 290px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(29, 29, 34, .14); }
.lost-pop .pop button { width: 100%; }

.stage-track { list-style: none; display: flex; gap: 3px; padding: 0; margin: 0 0 24px; overflow-x: auto; }
.stage-step { flex: 1 1 0; min-width: 118px; }
.stage-step form { margin: 0; height: 100%; }
.stage-step button { width: 100%; height: 100%; min-height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px 18px; border: 0; border-radius: 0; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.25; white-space: normal; text-align: center; clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%, 11px 50%); }
.stage-step:first-child button { clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%); border-radius: 10px 0 0 10px; }
.stage-step:last-child button { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 11px 50%); border-radius: 0 10px 10px 0; }
.stage-step button small { font-size: 11.5px; font-weight: 500; opacity: .85; }
.stage-step.todo button:hover { background: var(--line); color: var(--strong); }
.stage-step.done button { background: var(--indigo-soft); color: var(--indigo-ink); }
.stage-step.done button:hover { background: color-mix(in srgb, var(--indigo-soft) 70%, var(--indigo) 12%); }
.stage-step.current button { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.stage-step button:disabled { cursor: default; }
.stage-track.is-closed .stage-step button { opacity: .65; }

.deal-layout { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1000px) { .deal-layout { grid-template-columns: minmax(0, 1fr); } }
.deal-side .card { margin-bottom: 16px; }
.facts { grid-template-columns: 92px minmax(0, 1fr); gap: 11px 12px; margin-bottom: 16px; }
.facts dd .sub { margin-top: 2px; }
.labels { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.label { padding: 2px 9px; border-radius: 999px; background: var(--peach-soft); color: var(--peach-ink); font-size: 12.5px; font-weight: 500; }
.text-berry { color: var(--berry); font-weight: 500; }
.edit-details > summary { margin-bottom: 4px; }

.card.composer-card { padding: 0; overflow: hidden; }
.composer-tabs { display: flex; gap: 2px; padding: 4px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.composer-tabs a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 12px 10px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.composer-tabs a:hover { color: var(--strong); text-decoration: none; }
.composer-tabs a.active { color: var(--strong); border-bottom-color: var(--coral); }
.composer-tabs a.active .ico { color: var(--coral); }
.composer-form { display: grid; gap: 10px; padding: 16px 18px 18px; }
.composer-form textarea { min-height: 86px; }
.when { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.when > label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.when input[type=date], .when input[type=time] { width: auto; }
.when .check { display: flex; margin: 0 0 11px; font-size: 14px; color: var(--text); }
.when .check input { width: 17px; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; }

.deal-block h2 { margin-top: 28px; }
.nudge { padding: 14px 16px; border-radius: var(--radius-lg); background: var(--peach-soft); border: 1px dashed color-mix(in srgb, var(--peach) 70%, transparent); font-size: 14px; color: var(--text); }
.nudge b { color: var(--peach-ink); }
.plan-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.plan-list li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.plan-list li:last-child { border-bottom: 0; }
.plan-list .tick { margin-top: 4px; }
.plan-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--muted); }
.plan-ico.ico-meeting { background: var(--indigo-soft); color: var(--indigo); }
.plan-ico.ico-call { background: var(--coral-soft); color: var(--coral-ink); }
.plan-ico.ico-task { background: var(--green-soft); color: var(--green); }
.plan-body b { color: var(--strong); }
.plan-body .sub { margin-top: 2px; }
.plan-body p { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; }
li.late .plan-body .sub { color: var(--berry); }
.tag-late, .tag-today { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; vertical-align: 1px; }
.tag-late { background: var(--berry); color: #fff; }
.tag-today { background: var(--green-soft); color: var(--green); }

.pill-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.pill-tabs a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.pill-tabs a:hover { color: var(--strong); text-decoration: none; border-color: var(--line-strong); }
.pill-tabs a span { margin-left: 6px; font-size: 12px; opacity: .8; }
.pill-tabs a.active { background: var(--indigo-soft); border-color: transparent; color: var(--indigo-ink); }
.history { position: relative; list-style: none; margin: 0; padding: 0; }
.history::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 1.5px; background: var(--line); }
.ev { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding-bottom: 12px; }
.ev-ico { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.ev-stage .ev-ico { background: var(--indigo-soft); border-color: transparent; color: var(--indigo); }
.ev-won .ev-ico { background: var(--green-soft); border-color: transparent; color: var(--green); }
.ev-lost .ev-ico { background: var(--berry-soft); border-color: transparent; color: var(--berry); }
.ev-note .ev-ico, .ev-note-row .ev-ico { color: var(--peach-ink); }
.ev-body { padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ev-body.ev-note { background: var(--peach-soft); border-color: color-mix(in srgb, var(--peach) 35%, transparent); }
.ev-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ev-head b { color: var(--strong); font-weight: 600; font-size: 14px; }
.ev-head small { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ev-body p { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; }
.ev-body .sub { margin-top: 4px; }

/* ================= Znalostní mozek ================= */
.search-bar { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-sm); }
.search-bar:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.search-bar svg { flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; }
.search-bar input { border: 0; box-shadow: none; padding: 8px 0; background: transparent; }
.search-bar input:focus { box-shadow: none; }
.kb-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 18px; align-items: start; }
.kb-group h2 { margin-top: 26px; }
.kb-grid { display: grid; gap: 12px; }
.kb-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.kb-card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); }
.kb-card b { color: var(--strong); }
.kb-card p { margin: 0; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card .sub { margin-top: auto; font-size: 12px; }
#novy { margin-top: 32px; scroll-margin-top: 20px; }

/* ================= Agenti a chat ================= */
.agent-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .agent-layout { grid-template-columns: minmax(0, 1fr); } }
.chat { display: flex; flex-direction: column; padding: 0; margin: 0; overflow: hidden; min-height: 520px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.agent-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font-weight: 700; color: #fff; }
.agent-sales { background: linear-gradient(135deg, var(--coral), var(--orange)); }
.agent-marketing { background: linear-gradient(135deg, var(--berry), var(--coral)); }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 20px; max-height: 460px; min-height: 260px; overflow-y: auto; background: var(--softer); }
.chat-empty { margin: auto; max-width: 340px; text-align: center; color: var(--muted); font-size: 14px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg a { font-weight: 600; white-space: nowrap; }
.msg-user { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.msg-assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-assistant a { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 0; }
.chip { min-height: 0; padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); font-weight: 500; font-size: 13px; white-space: normal; text-align: left; }
.chip:hover { background: var(--coral-soft); border-color: var(--coral); color: var(--strong); }
.chat-input { display: flex; gap: 8px; padding: 12px 16px 16px; }
.chat-input button { width: 44px; padding: 0; flex: none; }
.chat-input svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.seq-list { list-style: none; padding: 0; margin: 0; }
.seq-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.seq-list li:last-child { border-bottom: 0; }
.seq-list a { display: flex; flex-direction: column; color: var(--strong); }
.seq-list a:hover { text-decoration: none; }
.seq-list a:hover b { color: var(--indigo); }
.seq-status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ================= Obsahový kalendář ================= */
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-head h2 { margin: 0; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot-draft { background: var(--peach); } .dot-approved { background: var(--indigo); } .dot-published { background: var(--green); }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 6px; min-width: 680px; }
.cal-dow { padding: 0 6px 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.cal-day { min-height: 92px; padding: 8px; border-radius: 10px; background: var(--softer); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.cal-day.past { opacity: .55; }
.cal-day.today { border-color: var(--coral); background: var(--coral-soft); }
.cal-date { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.today .cal-date { color: var(--coral-ink); font-weight: 600; }
.cal-post { display: block; padding: 5px 7px; border-radius: 6px; font-size: 12px; line-height: 1.3; color: var(--strong); background: var(--surface); border-left: 3px solid var(--peach); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; box-shadow: var(--shadow-sm); max-height: calc(2.6em + 10px); }
.cal-post:hover { text-decoration: none; background: var(--soft); }
.post-approved { border-left-color: var(--indigo); } .post-published { border-left-color: var(--green); }
.post-list { list-style: none; padding: 0; margin: 0 0 12px; }
.post-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: start; }
.post-date { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 10px; background: var(--softer); border: 1px solid var(--line); line-height: 1.1; }
.post-date b { font-size: 18px; color: var(--strong); }
.post-date span { font-size: 12px; color: var(--muted); }
.post-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 0; }
@media (max-width: 560px) { .post-list li { grid-template-columns: 44px minmax(0, 1fr); } .post-actions { grid-column: 2; align-items: flex-start; flex-direction: row; } }

/* ================= Ke schválení ================= */
.approval-group { margin-bottom: 26px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.group-head > div { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.group-head b a { color: var(--strong); }
.agent-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.agent-dot.agent-sales { background: var(--coral); } .agent-dot.agent-marketing { background: var(--berry); }
.approval { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.approval header { display: flex; justify-content: space-between; gap: 12px; }
.approval h3 { font-size: 15.5px; margin: 4px 0 2px; }
.approval .kind { font-size: 12.5px; font-weight: 600; color: var(--coral-ink); }
.approval .step { font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.approval details summary { margin: 10px 0 0; }
.approval details[open] summary { margin-bottom: 10px; }
.approval-approved { border-left: 3px solid var(--green); } .approval-rejected { opacity: .6; }
.approval footer { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.approval footer button, .approval footer .btn { min-height: 36px; padding: 6px 14px; font-size: 14px; }
pre.draft { margin: 0; padding: 16px 18px; background: var(--softer); border: 1px solid var(--line); border-radius: var(--radius); font: 14px/1.6 inherit; font-family: inherit; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--strong); }
.sources { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.editor textarea { font-size: 14.5px; line-height: 1.6; }

/* ================= Nastavení ================= */
.settings-form { padding: 6px 24px 20px; }
.settings-row { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 10px 32px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.settings-row h2 { margin: 0 0 4px; }
.settings-row .grid { gap: 0 14px; }
.settings-form .actions { padding-top: 18px; }
@media (max-width: 760px) { .settings-row { grid-template-columns: minmax(0, 1fr); } }
.integrations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.integrations .card { margin: 0; }
@media (max-width: 860px) { .integrations { grid-template-columns: minmax(0, 1fr); } }
.integration header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.integration header h2 { margin: 0 0 2px; }
.integration.soon { background: var(--softer); box-shadow: none; }
.logo-tile { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--indigo-soft); color: var(--indigo-ink); font-weight: 700; }
.soon .logo-tile { background: var(--soft); color: var(--muted); }
.howto { margin: 12px 0 0; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }
.stage-editor { display: grid; gap: 8px; }
.stage-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 100px 120px 90px; gap: 12px; align-items: center; }
.prob-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.prob-cell input { width: 76px; text-align: right; }
.prob-cell input:disabled { opacity: .6; cursor: not-allowed; }
.stage-row.head { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stage-row.new input { border-style: dashed; }
@media (max-width: 560px) { .stage-row { grid-template-columns: 64px minmax(0, 1fr) 104px; } .stage-row > :nth-child(3), .stage-row > :nth-child(5) { display: none; } }
.role-list { list-style: none; padding: 0; margin: 0 0 14px; }
.role-list li { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--line); }

/* ================= Mobil ================= */
@media (max-width: 600px) {
  table { font-size: 13.5px; }
  th, td { padding: 10px 10px; }
  .kanban { grid-auto-columns: minmax(230px, 82%); }
  dl { grid-template-columns: 96px minmax(0, 1fr); }
  .card { padding: 18px 16px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .section-head { align-items: flex-start; }
  .msg { max-width: 94%; }
  .calendar { gap: 4px; min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-dow { padding: 0 2px 2px; font-size: 11.5px; }
  .cal-day { min-height: 52px; padding: 5px; gap: 3px; border-radius: 8px; }
  .cal-date { font-size: 11.5px; }
  .cal-post { font-size: 0; padding: 0; height: 6px; max-height: 6px; border-left: 0; border-radius: 3px; background: var(--peach); box-shadow: none; }
  .cal-post.post-approved { background: var(--indigo); } .cal-post.post-published { background: var(--green); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 600px) { .timeline.compact li { flex-wrap: wrap; row-gap: 4px; } .timeline.compact li > a { max-width: none; flex: 1 1 0; min-width: 0; } .timeline.compact li > span:not(.badge) { order: 3; flex-basis: 100%; } }

/* ================= Prospecting: zadání větou a filtry MERKu ================= */
.ask-card { background: linear-gradient(135deg, var(--indigo-soft), var(--surface) 70%); border-color: color-mix(in srgb, var(--indigo) 22%, var(--line)); }
.ask-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.ask-head h2 { margin: 0 0 2px; }
.ask-head p { margin: 0; }
.ask-icon { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-size: 16px; }
.asked .ask-icon { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; margin-right: 6px; vertical-align: -5px; }
.ask-row { display: flex; gap: 10px; }
.ask-row input { flex: 1 1 auto; }
.ask-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ask-examples .chip { padding: 4px 11px; font-size: 12.5px; color: var(--muted); }

.prospect-form { padding: 0; overflow: visible; }
.pf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.pf-head h2 { margin: 0 0 2px; }
.pf-head p { margin: 0; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fgroup { padding: 18px 24px 6px; border-bottom: 1px solid var(--line); }
.fgroup:nth-child(odd) { border-right: 1px solid var(--line); }
.fgroup h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 14px; }
.pf-actions { padding: 16px 24px 20px; margin: 0; }
.hint { display: block; margin: 6px 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.field > .hint { margin-bottom: 0; }

.seg-switch { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); flex: none; }
.seg-switch label { position: relative; }
.seg-switch input { position: absolute; opacity: 0; pointer-events: none; }
.seg-switch span { display: block; padding: 6px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg-switch input:checked + span { background: var(--surface); color: var(--strong); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg-switch input:focus-visible + span { outline: 3px solid var(--indigo-soft); }

.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
button.preset { min-height: 0; padding: 4px 10px; border-radius: 999px; background: var(--softer); color: var(--text); border: 1px dashed var(--line-strong); font-size: 12.5px; font-weight: 500; }
button.preset:hover { background: var(--coral-soft); border-color: var(--coral); color: var(--strong); }
button.preset.used { border-style: solid; background: var(--coral-soft); border-color: transparent; color: var(--coral-ink); }

.picker { position: relative; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); cursor: text; transition: border-color .15s, box-shadow .15s; }
.picked:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.picked .picker-q { flex: 1 1 160px; width: auto; border: 0; padding: 4px 6px; box-shadow: none; background: transparent; font-size: 14.5px; }
.picked .picker-q:focus { box-shadow: none; }
.pick { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo-ink); font-size: 13px; font-weight: 500; line-height: 1.3; max-width: 100%; }
button.pick-x { min-height: 0; width: 20px; height: 20px; padding: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 15px; line-height: 1; opacity: .7; }
button.pick-x:hover { background: color-mix(in srgb, var(--indigo) 18%, transparent); opacity: 1; }
.picker-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 290px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 30px rgba(29, 29, 34, .14); }
button.picker-opt { display: flex; width: 100%; justify-content: space-between; gap: 10px; min-height: 0; padding: 8px 10px; border-radius: 7px; background: transparent; color: var(--text); font-weight: 400; font-size: 14px; text-align: left; white-space: normal; }
button.picker-opt small { color: var(--muted); font-size: 12px; white-space: nowrap; }
button.picker-opt:hover, button.picker-opt.on { background: var(--soft); color: var(--strong); }
.picker-empty { padding: 10px; color: var(--muted); font-size: 13.5px; }

.toggles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tog { position: relative; display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; user-select: none; transition: background .15s, border-color .15s; }
.tog input { position: absolute; opacity: 0; pointer-events: none; }
.tog:hover { border-color: var(--indigo); }
.tog:has(input:checked) { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tog:has(input:focus-visible) { outline: 3px solid var(--indigo-soft); }
.trend-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.trend-row .toggles { margin: 0; }
.trend-row .tog { padding: 3px 10px; font-size: 12.5px; }
.near { display: flex; gap: 10px; }
.near > div { flex: 1 1 auto; }
.km { display: flex; align-items: center; gap: 6px; flex: 0 0 120px; }
.km span { color: var(--muted); font-size: 14px; }

.filter-summary { padding: 16px 20px; }
.asked { margin: 0 0 12px; color: var(--strong); font-weight: 500; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { padding: 4px 11px; border-radius: 999px; background: var(--soft); color: var(--strong); font-size: 13px; font-weight: 500; }
.fs-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn.small-btn { min-height: 34px; padding: 5px 13px; font-size: 13.5px; }

@media (max-width: 860px) {
  .pf-grid { grid-template-columns: minmax(0, 1fr); }
  .fgroup:nth-child(odd) { border-right: 0; }
}
@media (max-width: 600px) {
  .pf-head { flex-direction: column; padding: 18px 16px 14px; }
  .fgroup { padding: 16px 16px 4px; }
  .pf-actions { padding: 14px 16px 18px; }
  .ask-row { flex-direction: column; }
  .near { flex-wrap: wrap; }
  .trend-row { flex-wrap: wrap; row-gap: 6px; }
}

/* ================= Klienti, podobné firmy a nové firmy z webu ================= */
.ask-icon.alt { background: var(--coral); color: #fff; font-weight: 700; }
#lookalike .toggles { margin-bottom: 10px; }
/* Hledat konkrétní společnost (jedno IČO) nahoře ve filtrech */
.pf-company { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--softer); }
.pf-company-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 280px; }
.pf-company-txt b { color: var(--strong); font-weight: 600; }
.pf-company-row { display: flex; gap: 8px; flex: 0 1 380px; }
.pf-company-row input { flex: 1 1 auto; min-width: 0; }
.pf-company-row button { white-space: nowrap; }
@media (max-width: 600px) { .pf-company { padding: 14px 16px; } .pf-company-row { flex: 1 1 100%; } }
.client-picker { max-width: 640px; margin-bottom: 12px; }
.pick-all { padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--strong); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pick-all[hidden] { display: none; }
.pick[hidden] { display: none; }
button.pick-more { min-height: 0; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--strong); font-size: 13px; font-weight: 500; }
button.pick-more[hidden] { display: none; }
.pick.pick-group { background: var(--coral-soft); color: var(--coral-ink); }
.inline-checks { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 6px; }
.inline-checks .check { margin: 0 0 10px; }
.lead-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 20px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--indigo-soft), var(--surface) 75%); border: 1px solid color-mix(in srgb, var(--indigo) 22%, var(--line)); color: var(--strong); }
.lead-banner:hover { text-decoration: none; border-color: var(--indigo); }
.lead-banner .ask-icon { width: 30px; height: 30px; font-size: 14px; }
.lead-banner .arrow { margin-left: auto; color: var(--indigo); font-weight: 600; }
.lead-list { display: grid; gap: 16px; margin: 16px 0 24px; }
.lead-card { margin: 0; }
.lead-card.dim { opacity: .75; }
.lead-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.lead-head h3 { font-size: 17px; margin-bottom: 2px; }
.lead-event { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--coral); background: var(--coral-soft); border-radius: 0 8px 8px 0; color: var(--strong); font-weight: 500; }
.lead-why { margin-bottom: 10px; }
.lead-why b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.lead-why p { margin: 0; white-space: pre-line; }
.lead-sources { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; font-size: 14px; }
.lead-sources li::before { content: "↗"; color: var(--indigo); margin-right: 6px; }
.lead-pitch { margin: 4px 0 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--softer); }
.lead-pitch summary { cursor: pointer; font-weight: 500; color: var(--strong); }
.lead-pitch p { margin: 10px 0 0; white-space: pre-line; }
.lead-card footer.actions { margin-top: 6px; }
.import-manual summary { cursor: pointer; font-weight: 600; color: var(--strong); }
.import-manual form { margin-top: 14px; }
.import-manual textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ================= Rychlé rozhodnutí o firmách ================= */
.tone-indigo b { color: var(--indigo-ink); }
a.stat-link { color: inherit; transition: border-color .15s, box-shadow .15s; }
a.stat-link:hover { text-decoration: none; border-color: var(--indigo); box-shadow: var(--shadow); }
a.stat-link span { color: var(--indigo); font-weight: 500; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions button { min-height: 32px; padding: 4px 12px; font-size: 13px; }
button.btn-ok { background: var(--green); color: #fff; }
button.btn-ok:hover { background: color-mix(in srgb, var(--green) 86%, #000); }
@media (max-width: 600px) { .row-actions { flex-direction: column; align-items: stretch; } }
@media (max-width: 600px) {
  table.candidates thead { display: none; }
  table.candidates, table.candidates tbody { display: block; }
  table.candidates tr { display: grid; grid-template-columns: 26px 46px minmax(0, 1fr); gap: 6px 10px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
  table.candidates td { display: block; padding: 0; border: 0; }
  table.candidates td:nth-child(4), table.candidates td:nth-child(5) { grid-column: 3; }
  table.candidates .row-actions { flex-direction: row; }
  table.candidates .row-actions button { flex: 1 1 0; min-height: 38px; }
}

/* Nové firmy: „Hledat teď“ */
.search-now { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(135deg, var(--indigo-soft), var(--surface) 70%); border-color: color-mix(in srgb, var(--indigo) 22%, var(--line)); }
.search-now h2 { margin: 0 0 4px; }
.search-now > div { min-width: 0; }
.search-now p { margin: 4px 0 0; }
.search-now form button { min-width: 140px; }
.search-now.is-waiting { background: linear-gradient(135deg, var(--peach-soft, var(--indigo-soft)), var(--surface) 70%); }
@media (max-width: 640px) { .search-now { flex-direction: column; align-items: stretch; } .search-now form button { width: 100%; } }

/* ================= Teplé sklo: rám aplikace =================
   Za aplikací svítí rozmazané koule (oranžová, Sunlight, modrá). Aplikace je jeden skleněný panel
   se zaoblením 32 px; rozmazání nese pseudo-prvek, aby plovoucí okna (position: fixed) fungovala dál. */
body { background: var(--bg); }
.orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orbs i { position: absolute; border-radius: 50%; filter: blur(70px); }
.orbs i:nth-child(1) { width: 46vw; height: 46vw; right: -10vw; top: -14vw; opacity: var(--orb-1); background: radial-gradient(circle at 40% 40%, #ff8a6e, var(--brand-orange) 45%, transparent 70%); }
.orbs i:nth-child(2) { width: 38vw; height: 38vw; left: -12vw; bottom: -16vw; opacity: var(--orb-2); background: radial-gradient(circle, #ffc37f, transparent 70%); }
.orbs i:nth-child(3) { width: 30vw; height: 30vw; left: 38vw; top: 30vh; opacity: var(--orb-3); background: radial-gradient(circle, #8f97e0, transparent 70%); }

.shell { position: relative; z-index: 1; isolation: isolate; grid-template-columns: 240px minmax(0, 1fr); max-width: 1480px; min-height: calc(100vh - 36px); margin: 18px auto; width: calc(100% - 2 * max(2vw, 16px)); border-radius: 32px; border: 1px solid var(--panel-line); box-shadow: var(--shadow); }
.shell::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--panel); backdrop-filter: blur(30px) saturate(1.3); -webkit-backdrop-filter: blur(30px) saturate(1.3); }
.side { top: 18px; height: calc(100vh - 36px); align-self: start; padding: 28px 16px 22px; background: transparent; border-right: 1px solid var(--line); gap: 26px; }
.brand { padding: 0 10px; font-size: 12.5px; }
.brand img { height: 24px; }
.side nav { gap: 18px; }
.group-label { padding: 0 12px 6px; }
.side nav a { padding: 9px 12px; border-radius: 14px; color: var(--muted); }
.side nav a:hover { background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--strong); }
.side nav a.active { background: var(--surface); color: var(--strong); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.side nav svg { stroke: currentColor; }
.side nav a.active svg { stroke: var(--brand-orange); }
.pill { background: var(--brand-orange); color: #fff; }
.side-note { margin: auto 10px 0; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--surface-line); }
main { max-width: none; padding: 34px clamp(18px, 2.8vw, 40px) 56px; }

/* ================= Typografie ================= */
h1 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 400; }
h2 { font-size: 15.5px; font-weight: 500; letter-spacing: -0.005em; }
h3 { font-weight: 500; }
.lead { font-size: 16px; margin-top: 10px; }
.lead b { color: var(--strong); font-weight: 500; }
.section-head { margin-bottom: 26px; }

/* Záložky: skleněný segmentový přepínač */
.tabs { background: var(--surface); border: 1px solid var(--surface-line); }
.tabs a.active { background: var(--strong); color: var(--bg); box-shadow: none; }

/* ================= Karty a plochy ================= */
.card, .panel, .approval, .task-list, .plan-list, .kb-card, .ev-body, .stat, .deal-card, .integration { background: var(--surface); border: 1px solid var(--surface-line); box-shadow: var(--shadow-sm); }
.card, .panel { border-radius: var(--radius-lg); }
.card { position: relative; padding: 24px 26px; }
.card:focus-within { z-index: 3; }
.card.chat, .card.composer-card, .prospect-form { padding: 0; }
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.card-head h2 { margin: 0; }
.card-sub { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.link-more { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.link-more:hover { color: var(--strong); text-decoration: none; }
.cols, .stack-gap { gap: 18px; }
.ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.col-add form, .lost-pop .pop, .picker-list { background: var(--surface-solid); border-color: var(--line); box-shadow: var(--shadow-lg); border-radius: 20px; }

.stats { gap: 14px; margin-bottom: 22px; }
.stat { padding: 18px 20px; border-radius: 20px; }
.stat b { font-size: 34px; font-weight: 300; letter-spacing: -0.04em; margin-bottom: 6px; }
a.stat:hover, a.stat-link:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); }
.stat, a.stat-link { transition: transform .25s, box-shadow .25s; }

/* ================= Tlačítka a pole ================= */
input, select, textarea { padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: color-mix(in srgb, var(--surface-solid) 70%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--strong) 25%, transparent); }
input:focus, select:focus, textarea:focus { border-color: var(--brand-orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-orange) 16%, transparent); background: var(--surface-solid); }
input[type=checkbox] { accent-color: var(--brand-orange); }
button, .btn { min-height: 42px; padding: 10px 22px; border-radius: 999px; font-weight: 500; font-size: 14.5px; transition: background .15s, border-color .15s, color .15s, transform .2s, box-shadow .2s; }
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px var(--brand-orange); }
button:active, .btn:active { transform: scale(.98); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-orange) 45%, transparent); outline-offset: 2px; }
button.secondary, .btn.secondary { background: var(--surface); color: var(--strong); border-color: var(--surface-line); }
button.secondary:hover, .btn.secondary:hover { background: var(--surface-solid); border-color: var(--line-strong); box-shadow: var(--shadow); }
button.ghost, button.pick-x, button.picker-opt, button.preset, .tick button, .stage-step button, .chip { box-shadow: none; transform: none; }
button.ghost:hover, button.pick-x:hover, button.picker-opt:hover, button.preset:hover, .tick button:hover, .stage-step button:hover, .chip:hover { box-shadow: none; transform: none; }
.btn.accent, button.accent { background: var(--brand-orange); color: var(--brand-navy); }
form.tiny button, .row-actions button, .approval footer button, .approval footer .btn { min-height: 34px; padding: 5px 14px; }
.chip, .tog { border-radius: 999px; background: var(--surface); border-color: var(--line-strong); }
.tog:has(input:checked) { background: var(--strong); border-color: var(--strong); color: var(--bg); }
.search-bar { border-radius: 999px; background: var(--surface); border-color: var(--surface-line); padding-left: 18px; }
.search-bar:focus-within { border-color: var(--brand-orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-orange) 16%, transparent); }
.danger button { border-radius: 999px; }
.seg-switch { background: var(--track); border: 0; border-radius: 999px; }
.seg-switch span { border-radius: 999px; }
.seg-switch input:checked + span { background: var(--surface-solid); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.picked { border-radius: var(--radius); background: color-mix(in srgb, var(--surface-solid) 70%, transparent); }

/* ================= Tabulky ================= */
th { font-size: 12.5px; font-weight: 500; color: var(--muted); background: transparent; padding-top: 14px; padding-bottom: 12px; }
th, td { padding-left: 20px; padding-right: 20px; border-bottom-color: var(--line); }
td { padding-top: 14px; padding-bottom: 14px; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-solid) 45%, transparent); }
td .strong, td b { font-weight: 500; color: var(--strong); }

/* ================= Hlášky a štítky ================= */
.flash, .note, .warn { border: 0; border-radius: 16px; }
.flash::before { background: var(--traffic-green); }
.empty { border: 1px dashed var(--line-strong); background: transparent; border-radius: 20px; }
.ask-card, .search-now, .lead-banner { background: linear-gradient(135deg, color-mix(in srgb, var(--brand-orange) 14%, var(--surface)), var(--surface) 65%); border-color: var(--surface-line); }
.search-now.is-waiting { background: linear-gradient(135deg, var(--peach-soft), var(--surface) 70%); }
.ask-icon { border-radius: 12px; background: var(--strong); color: var(--bg); }
.ask-icon.alt { background: var(--brand-orange); color: var(--brand-navy); }
.badge { font-weight: 500; padding: 4px 10px; }
.score { border-radius: 999px; width: 42px; }
.status-on::before { background: var(--traffic-green); }
.avatar { background: var(--coral-soft); color: var(--coral-ink); }
.agent-avatar { border-radius: 50%; }
.agent-sales { background: var(--coral-soft); color: var(--coral-ink); }
.agent-marketing { background: var(--berry-soft); color: var(--berry); }
.msg { border-radius: 18px; }
.msg-user { border-bottom-right-radius: 6px; }
.msg-assistant { border-bottom-left-radius: 6px; background: var(--surface-solid); border-color: var(--line); }
.chat-log { background: transparent; border-top: 0; }
.chat-input input { border-radius: 999px; }
.chat-input button { width: 42px; height: 42px; }
.approval { border-radius: 20px; padding: 18px 22px; }
.approval .kind { color: var(--muted); font-weight: 500; }
pre.draft, .lead-pitch { background: color-mix(in srgb, var(--surface-solid) 60%, transparent); border-color: var(--line); border-radius: 16px; }
.cal-day { border-radius: 14px; background: var(--softer); border-color: var(--line); }
.cal-day.today { background: var(--coral-soft); border-color: color-mix(in srgb, var(--brand-orange) 45%, transparent); }
.cal-post { border-radius: 8px; background: var(--surface-solid); }
.post-date, .logo-tile { border-radius: 14px; background: var(--track); border: 0; }
.kb-card { border-radius: 20px; transition: transform .25s, box-shadow .25s; }
.kb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--surface-line); }
.integration.soon { background: var(--softer); }
.settings-row { border-bottom-color: var(--line); }
.settings-row:target { scroll-margin-top: 24px; }

/* ================= Pipeline (kanban) a karta dealu ================= */
.kanban { gap: 12px; grid-auto-columns: minmax(160px, 1fr); }
.column { background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px solid var(--surface-line); border-radius: var(--radius-lg); padding: 16px 10px 10px; }
.column.over { background: var(--coral-soft); box-shadow: inset 0 0 0 1.5px var(--brand-orange); }
.col-head { padding: 0 6px 14px; }
.col-head h3 { font-size: 14px; font-weight: 500; }
.col-progress { height: 4px; border-radius: 999px; background: var(--track); }
.col-progress i { border-radius: 999px; background: linear-gradient(90deg, var(--brand-sunlight), var(--brand-orange)); }
.col-cards { gap: 10px; }
.deal-card { padding: 14px 14px 12px; border-radius: 16px; background: var(--surface-solid); border-color: transparent; }
.deal-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: transparent; }
.deal-title { font-weight: 500; }
.col-add > summary { border-radius: 12px; }
.col-add > summary:hover { background: var(--surface); }
.stage-step button { background: var(--track); }
.stage-step.done button { background: color-mix(in srgb, var(--brand-orange) 16%, transparent); color: var(--strong); }
.stage-step.current button { background: var(--strong); color: var(--bg); }
.stage-step:first-child button { border-radius: 999px 0 0 999px; }
.stage-step:last-child button { border-radius: 0 999px 999px 0; }
.owner-chip { background: var(--surface); border-color: var(--surface-line); }
.history::before { background: var(--line-strong); }
.ev-ico { background: var(--surface-solid); border-color: var(--line); }
.nudge { background: var(--peach-soft); border-radius: 20px; }
.composer-tabs a.active { border-bottom-color: var(--brand-orange); }
.pill-tabs a { border-color: var(--line-strong); }
.pill-tabs a.active { background: var(--strong); color: var(--bg); }

/* ================= Přehled ================= */
.dash-head { align-items: flex-end; }
.greet { font-size: clamp(32px, 3.6vw, 50px); }
.greet span { color: var(--muted); font-weight: 300; }
.dash-head .lead { display: block; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.kpi { --tone: var(--brand-orange); display: flex; flex-direction: column; gap: 4px; min-height: 172px; padding: 22px 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--surface-line); color: var(--text); transition: transform .25s, box-shadow .25s; animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.kpi:nth-child(2) { animation-delay: .05s; } .kpi:nth-child(3) { animation-delay: .1s; } .kpi:nth-child(4) { animation-delay: .15s; }
.kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ico, .mini-ico { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone); }
.mini-ico { width: 40px; height: 40px; }
.kpi-label { font-size: 14px; color: var(--muted); }
.kpi-n { margin-top: auto; padding-top: 14px; font-size: clamp(36px, 3.4vw, 48px); line-height: 1; font-weight: 300; letter-spacing: -0.04em; color: var(--strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-n small { margin-left: 6px; font-size: .42em; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.kpi.is-zero .kpi-n { color: var(--muted); }
.kpi-hint { display: flex; align-items: center; align-content: flex-start; flex-wrap: wrap; gap: 6px 10px; min-height: 2.6em; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 4px; width: max-content; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--green); background: var(--green-soft); }
.delta-warn { color: var(--coral-ink); background: var(--red-soft); }
.kpi-hero { background: linear-gradient(140deg, color-mix(in srgb, var(--brand-orange) 92%, #fff), var(--brand-sunrise)); border: 0; color: var(--brand-navy); }
.kpi-hero .kpi-label, .kpi-hero .kpi-hint, .kpi-hero .kpi-n, .kpi-hero .kpi-n small { color: var(--brand-navy); }
.kpi-hero .kpi-n small, .kpi-hero .kpi-hint { opacity: .8; }
.kpi-hero .kpi-ico, .kpi-hero .delta { background: rgba(255, 255, 255, .3); color: var(--brand-navy); }
.kpi-hero:hover { box-shadow: 0 22px 40px -18px var(--brand-orange); }
.tone-orange { --tone: #e2513d; }
.tone-blue { --tone: var(--brand-blue); }
.tone-purple { --tone: var(--brand-purple); }
.tone-sun { --tone: #c46a00; }
.tone-green { --tone: var(--green); }

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.dash-grid > .card { margin: 0; animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .15s; }
.dash-chart { grid-column: span 8; }
.dash-goal { grid-column: span 4; display: flex; flex-direction: column; }
.dash-stages { grid-column: span 7; }
.dash-segments { grid-column: span 5; }
.dash-agenda, .dash-agents, .dash-top { grid-column: span 4; }

/* Plošný graf: SVG se roztáhne, popisky jsou HTML, aby se nedeformovaly. */
.area-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 220px auto; column-gap: 12px; }
.area-y { position: relative; width: 46px; }
.area-y span { position: absolute; right: 0; transform: translateY(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.area-plot { position: relative; }
.area-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 5; }
.area-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s .2s cubic-bezier(.4, 0, .2, 1) forwards; }
.area-fill { animation: fade .9s .6s both; }
.area-dot { position: absolute; right: -7px; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--brand-orange); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-orange) 22%, transparent); animation: fade .4s 1.6s both; }
.area-val { position: absolute; right: 14px; margin-top: -40px; padding: 3px 10px; border-radius: 999px; background: var(--strong); color: var(--bg); font-size: 12.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; animation: fade .4s 1.7s both; }
.area-x { grid-column: 2; display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Prstenec cíle a koláč oborů */
.ring { position: relative; width: min(200px, 100%); aspect-ratio: 1; margin: 10px auto 6px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring-track { stroke: var(--track); }
.ring-val { stroke: url(#rg); stroke-linecap: round; stroke-dasharray: var(--pct) 100; animation: ring 1.4s .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ring { from { stroke-dasharray: 0 100; } }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-text b { font-size: 44px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; color: var(--strong); font-variant-numeric: tabular-nums; }
.ring-text b small { font-size: .45em; color: var(--muted); letter-spacing: 0; }
.ring-text span { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.ring-note { margin: auto 0 0; padding-top: 10px; text-align: center; font-size: 13.5px; color: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut { flex: none; width: 168px; margin: 0; }
.donut circle { stroke-width: 14; }
.donut .ring-text b { font-size: 34px; }
.seg-list { list-style: none; flex: 1; margin: 0; padding: 0; display: grid; gap: 12px; }
.goal-team { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 13.5px; }
.goal-team li { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; align-items: center; gap: 10px; }
.goal-team span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-bar { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand-orange); }
.goal-team b { font-weight: 500; color: var(--strong); font-variant-numeric: tabular-nums; }
.goal-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 10px; }
.goal-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.goal-list .field { width: 180px; margin: 0; }
.seg-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.seg-list i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.seg-list span { flex: 1; }
.seg-list b { font-weight: 500; color: var(--strong); font-variant-numeric: tabular-nums; }

/* Fáze obchodu jako vodorovné ukazatele */
.pipe-strip { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pipe-row a { display: grid; grid-template-columns: minmax(100px, 160px) minmax(0, 1fr) 24px minmax(80px, auto); align-items: center; gap: 14px; padding: 8px 10px; margin: 0 -10px; border-radius: 12px; color: var(--text); transition: background .15s; }
.pipe-row a:hover { background: color-mix(in srgb, var(--surface-solid) 60%, transparent); text-decoration: none; }
.pipe-name { font-size: 14px; color: var(--strong); line-height: 1.3; }
.pipe-bar { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.pipe-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-sunlight), var(--brand-orange)); animation: grow 1.1s .3s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.pipe-n { font-size: 14.5px; font-weight: 500; color: var(--strong); text-align: right; font-variant-numeric: tabular-nums; }
.pipe-value { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pipe-row.zero .pipe-name, .pipe-row.zero .pipe-n { color: var(--muted); }

/* Krátké seznamy: agenda, agenti, firmy */
.mini-list { list-style: none; margin: 6px 0 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.mini-list li:first-child { border-top: 0; }
.mini-t { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
a.mini-t:hover { text-decoration: none; }
a.mini-t:hover b { color: var(--brand-orange); }
.mini-t b { font-weight: 500; font-size: 14.5px; color: var(--strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.mini-t span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .when { flex: none; display: flex; flex-direction: column; align-items: center; gap: 0; width: 48px; padding: 6px 0; border-radius: 14px; background: var(--track); line-height: 1.1; }
.mini-list .when b { font-size: 17px; font-weight: 500; color: var(--strong); }
.mini-list .when span { font-size: 11px; color: var(--muted); }
.mini-list .when.today { background: var(--brand-orange); }
.mini-list .when.today b, .mini-list .when.today span { color: var(--brand-navy); }
.mini-list .when.late { background: var(--red-soft); }
.mini-list .when.late span { color: var(--coral-ink); }
.pill-btn { flex: none; padding: 6px 13px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 12.5px; font-weight: 500; transition: transform .2s; }
.pill-btn:hover { text-decoration: none; transform: translateY(-1px); }
.mono-logo { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 13px; color: #fff; font-size: 14px; font-weight: 600; }
.score-pill { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.score-pill.low { background: var(--peach-soft); color: var(--peach-ink); }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-chart, .dash-goal, .dash-stages, .dash-segments { grid-column: span 12; }
  .dash-goal { display: grid; grid-template-columns: minmax(0, 1fr) 180px; grid-template-rows: auto 1fr; column-gap: 24px; }
  .dash-goal .card-head { grid-column: 1 / -1; }
  .dash-goal .ring { grid-column: 2; grid-row: 2 / span 2; margin: 0; }
  .dash-goal .ring-note { grid-column: 1; grid-row: 2; margin: 0; text-align: left; align-self: center; font-size: 15px; }
  .dash-goal .goal-team { grid-column: 1; grid-row: 3; }
  .dash-agenda, .dash-agents, .dash-top { grid-column: span 6; }
  .dash-top { grid-column: span 12; }
}

/* ================= Úzké obrazovky ================= */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); margin: 10px auto; width: calc(100% - 20px); min-height: calc(100vh - 20px); border-radius: 26px; }
  .side-note { display: none; }
  main { padding: 24px 18px 48px; }
}
@media (max-width: 640px) {
  .dash-agenda, .dash-agents, .dash-top { grid-column: span 12; }
  .dash-goal { display: flex; }
  .dash-goal .ring { margin: 10px auto 6px; }
  .dash-goal .ring-note { text-align: center; font-size: 13.5px; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { width: 160px; margin: 0 auto; }
  .area-chart { grid-template-rows: 170px auto; }
  .area-y { width: 40px; }
  .area-x span:nth-child(even) { visibility: hidden; }
  .pipe-row a { grid-template-columns: minmax(0, 1fr) 24px; gap: 6px 12px; }
  .pipe-bar { grid-column: 1 / -1; grid-row: 2; }
  .pipe-value { display: none; }
}
@media (max-width: 520px) {
  .shell { width: calc(100% - 12px); margin: 6px auto; border-radius: 22px; }
  main { padding: 20px 14px 40px; }
  .kpi-grid { gap: 10px; }
  .kpi { min-height: 0; padding: 16px; border-radius: 20px; }
  .kpi-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .kpi-label { font-size: 13.5px; line-height: 1.3; }
  .kpi-n { font-size: 32px; padding-top: 8px; }
  .kpi-hint { font-size: 12px; }
  .head-actions { width: 100%; }
  .dash-head .head-actions .btn { flex: 1; padding: 10px 14px; }
  .card { padding: 20px 18px; }
  .dash-grid { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Finanční argument (odhad mzdových nákladů vs. cíl oboru) */
.finance-box { margin: 14px 0; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(135deg, var(--peach-soft), var(--surface) 75%); border: 1px solid var(--surface-line); }
.card > .finance-box:first-child { margin-top: 0; }
section.finance-box:not(.compact) + .cols, main > .finance-box { margin-bottom: 18px; }
.finance-box header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; color: var(--strong); }
.finance-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 18px; }
.finance-kpis > div { display: flex; flex-direction: column; gap: 2px; }
.finance-kpis strong { font-size: 1.35rem; font-weight: 300; color: var(--strong); letter-spacing: -0.02em; }
.finance-kpis .fin-ok { color: var(--green); }
.finance-kpis .fin-over { color: var(--coral-ink); }
.finance-kpis .fin-under { color: var(--peach-ink); }
.finance-box p { margin: 10px 0 0; }
.ico-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ico-row form { margin: 0; }
.ico-row .small-btn { padding: 4px 12px; font-size: .85rem; min-height: 0; }
.card-head .tiny-form { margin: 0; }
.card-head .small-btn { padding: 4px 12px; font-size: .85rem; min-height: 0; }
.decider { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--peach-soft); color: var(--coral-ink); font-size: .75rem; font-weight: 600; vertical-align: 1px; }
.company-lead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-form { margin: 0; }
.status-select { min-height: 0; width: auto; padding: 4px 30px 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; background-color: var(--peach-soft); color: var(--coral-ink); border: 1px solid transparent; cursor: pointer; }
.status-select.status-customer { background-color: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.status-select.status-lost, .status-select.status-do_not_contact { background-color: var(--surface); color: var(--muted, inherit); }
/* Úprava a smazání aktivity v detailu dealu */
.plan-list li { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.ev { grid-template-columns: 32px minmax(0, 1fr) auto; }
.act-menu { position: relative; align-self: start; }
.act-menu > summary { list-style: none; margin: 0; padding: 0 8px; border-radius: 10px; color: var(--muted); font-size: 1.2rem; line-height: 1.6; cursor: pointer; }
.act-menu > summary::-webkit-details-marker { display: none; }
.act-menu > summary::before, .act-menu[open] > summary::before { content: none; }
.act-menu > summary:hover, .act-menu[open] > summary { background: var(--peach-soft); color: var(--coral-ink); }
.act-menu .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 8; width: min(340px, calc(100vw - 24px)); box-sizing: border-box; padding: 16px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); display: grid; gap: 8px; }
.act-menu .pop form { margin: 0; }
.act-menu .row2 { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; }
.act-menu .pop .field, .act-menu .pop input, .act-menu .pop textarea, .act-menu .pop .dp { min-width: 0; max-width: 100%; box-sizing: border-box; }
.act-menu .actions button { width: 100%; }
.act-menu .danger-link { width: 100%; color: var(--coral-ink); }
/* Dokumenty u dealu */
.docs-card .doc-list { list-style: none; margin: 0 0 12px; padding: 0; }
.docs-card .doc-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.docs-card .doc-main a { overflow-wrap: anywhere; }
.doc-ico { min-width: 52px; padding: 4px 6px; border-radius: 10px; background: var(--surface); color: var(--muted); font-size: .7rem; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .02em; }
.doc-ico.doc-offer { background: var(--peach-soft); color: var(--coral-ink); }
.doc-del { min-height: 0; padding: 2px 9px; font-size: 1.1rem; color: var(--muted); }
.offer-quick { margin: 0 0 10px; }
.offer-quick > button { width: 100%; }
.offer-quick details { margin-top: 6px; }
.offer-quick summary { font-size: .85rem; color: var(--muted); }
.offer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.doc-upload { margin: 0; }
.doc-drop { display: grid; gap: 2px; justify-items: center; padding: 12px; border: 1.5px dashed var(--line); border-radius: 14px; cursor: pointer; text-align: center; }
.doc-drop:hover { border-color: var(--primary); }
.doc-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.doc-drop span { font-weight: 600; color: var(--primary); }
.doc-drop small { color: var(--muted); }

/* Hodnota dealu: měsíční fee a pop-up s balíčky */
.deal-value .dv-open { all: unset; cursor: pointer; display: inline-flex; gap: 8px; align-items: baseline; }
.deal-value .dv-open:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.deal-value .dv-edit { font-size: 12px; color: var(--muted); text-decoration: underline; }
.deal-value .dv-items { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.value-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-solid, #fff); color: var(--ink); box-shadow: 0 20px 48px rgba(29, 29, 34, .2); }
.value-dialog::backdrop { background: rgba(29, 29, 34, .35); }
.value-dialog h2 { margin: 0 0 4px; }
.value-dialog form { display: grid; gap: 12px; }
.vi-rows { display: grid; gap: 10px; }
.vi-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 80px 120px 84px 28px; gap: 8px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.vi-pkg { display: grid; gap: 6px; min-width: 0; }
.vi-num { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.vi-row select, .vi-row input { width: 100%; min-width: 0; color: var(--ink); }
.vi-disc-in { display: grid; grid-template-columns: minmax(0, 1fr) 58px; gap: 4px; }
.vi-disc-in select { padding-left: 8px; padding-right: 4px; }
.vi-total { text-align: right; font-weight: 600; padding-bottom: 10px; white-space: nowrap; }
.vi-del { padding: 6px 0; font-size: 18px; line-height: 1; }
.vi-add { justify-self: start; }
.vi-foot { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; border-radius: 14px; background: var(--surface, #f6f3ee); }
.vi-foot strong { font-size: 22px; }
@media (max-width: 560px) {
  .vi-row { grid-template-columns: 1fr 1fr 1.4fr; }
  .vi-pkg { grid-column: 1 / -1; }
  .vi-total { grid-column: 1 / 3; text-align: left; padding: 0; }
}

/* Znalostní mozek → Klienti: karta klienta a reference v nabídce */
.client-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.client-logo { height: 28px; width: auto; max-width: 90px; object-fit: contain; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ref-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface-solid); margin-bottom: 12px; }
.ref-preview img { display: block; height: 48px; width: auto; max-width: 200px; object-fit: contain; margin-bottom: 12px; }
.ref-nologo { font-weight: 600; font-size: 18px; color: var(--strong); margin-bottom: 10px; }
.ref-preview p { margin: 0 0 8px; font-size: 14px; }
.ref-benefit { border-left: 3px solid var(--brand-orange); padding-left: 10px; color: var(--strong); }

/* ================= Uživatelé, role, přihlášení ================= */
.side-user { display: flex; align-items: center; gap: 8px; margin: auto 6px 0; padding: 10px 8px; border-top: 1px solid var(--line); }
.side-user-link { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: var(--text); }
.side-user-link:hover { text-decoration: none; color: var(--strong); }
.side-user-link b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-link .sub { display: block; font-size: 12px; }
.side-user form { margin: 0; }
.side-user button.small-btn { min-height: 30px; padding: 3px 10px; font-size: 12.5px; }
.pill-warn { background: var(--berry-soft); color: var(--berry); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); display: grid; gap: 4px; }
.login-card h1 { margin: 14px 0 0; font-size: 28px; }
.login-card button { width: 100%; margin-top: 4px; }
.narrow-form { max-width: 440px; }
.badge-role-admin { background: var(--indigo-soft); color: var(--indigo-ink); }
.badge-role-sales { background: var(--coral-soft); color: var(--coral-ink); }
.badge-role-implementation { background: var(--green-soft); color: var(--green); }
.users-table td { vertical-align: middle; }
.lang-sw { display: flex; align-items: center; gap: 6px; margin: -14px 6px 0; padding: 0 12px; }
.lang-sw-label { flex: 1; font-size: 11.5px; white-space: nowrap; color: var(--muted); }
.lang-sw button { min-height: 30px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; border-radius: 999px; border: 1px solid var(--clouds-medium); background: var(--surface-solid); color: var(--text); box-shadow: none; }
html[lang="cs"] .lang-sw .lang-cs, html[lang="en"] .lang-sw .lang-en { background: var(--brand-orange); border-color: var(--brand-orange); color: #fff; }
.seg-choice { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip-radio { position: relative; cursor: pointer; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 18px; border-radius: 999px; border: 1px solid var(--clouds-medium); background: var(--surface-solid); font-weight: 600; color: var(--text); }
.chip-radio input:checked + span { background: var(--brand-orange); border-color: var(--brand-orange); color: #fff; }
.chip-radio input:focus-visible + span { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

/* ================= Projekty ================= */
.project-kanban { grid-auto-columns: minmax(190px, 1fr); }
.project-card { position: relative; padding-top: 14px; cursor: pointer; }
.health-bar { position: absolute; top: 7px; left: 11px; width: 34px; height: 3px; border-radius: 2px; background: var(--line); }
.hb-green { background: var(--green); } .hb-amber { background: var(--peach); } .hb-red { background: var(--berry); }
.deal-flag-ring { margin-left: auto; display: inline-flex; }
.mini-ring { transform: rotate(-90deg); }
.mini-ring circle { fill: none; stroke: var(--line); stroke-width: 3; }
.mini-ring .mini-ring-on { stroke: var(--green); stroke-linecap: round; }
.warn-banner { background: var(--berry-soft); }
.progress-big { display: grid; gap: 2px; margin-bottom: 18px; }
.progress-big b { font-size: 30px; font-weight: 600; color: var(--strong); font-variant-numeric: tabular-nums; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.linked { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 9px; }
.linked li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.li-ico { width: 20px; text-align: center; color: var(--muted); }
.small-h { font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 8px; text-transform: none; }
.contact-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.alerts { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.alert { padding: 9px 14px; border-radius: var(--radius); font-size: 14px; border-left: 3px solid; }
.alert-danger { background: var(--berry-soft); border-color: var(--berry); }
.alert-warn { background: var(--peach-soft); border-color: var(--peach); }
.alert-info { background: var(--indigo-soft); border-color: var(--indigo); }
.mini-timeline { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; gap: 8px; font-size: 14px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-phase { padding: 16px 20px; }
.plan-phase.is-current { border-left: 4px solid var(--green); }
.plan-head { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.plan-head::-webkit-details-marker { display: none; }
.plan-head b { font-size: 16px; }
.plan-head .bar { flex: 0 0 140px; margin-left: auto; }
.ptask-list { list-style: none; padding: 0; margin: 12px 0 8px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row .tick { margin: 0; }
.task-row.is-done .tick button { background: var(--green); border-color: var(--green); color: #fff; font-size: 12px; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-title { font-size: 14.5px; }
.ai-tag { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--indigo-soft); color: var(--indigo-ink); font-size: 11px; font-weight: 600; }
.task-edit { position: relative; }
.task-edit > summary { list-style: none; cursor: pointer; margin: 0; padding: 2px 8px; border-radius: 8px; color: var(--muted); font-weight: 700; }
details.task-edit > summary::before, details.task-edit[open] > summary::before { content: none; }
.plan-head { margin: 0; color: var(--strong); }
.task-edit > summary::-webkit-details-marker { display: none; }
.task-edit .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; width: 280px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(29, 29, 34, .14); }
.add-task > summary { cursor: pointer; color: var(--indigo-ink); font-weight: 500; font-size: 14px; margin-top: 6px; }
.add-task form { margin-top: 12px; }
.steps { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.steps form { margin: 0; flex: none; }
.watch-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.watch-head h2 { margin: 0 0 4px; }
.watch-head form { margin: 0; flex: none; }
.agent-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1000px) { .agent-grid { grid-template-columns: minmax(0, 1fr); } }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-row .card { padding: 16px 18px; display: grid; gap: 2px; }
.stat-row b { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.agent-impl { background: var(--green-soft); color: var(--green); }
.two-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 800px) { .two-forms { grid-template-columns: minmax(0, 1fr); } }
.note-item p { margin: 6px 0 10px; }
.pre { white-space: pre-wrap; }
.inline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; align-items: end; }
.inline-grid > h2, .inline-grid > p, .inline-grid > .actions { grid-column: 1 / -1; }
.inline-grid .actions { margin-bottom: 14px; }
.project-kanban { grid-auto-columns: minmax(160px, 1fr); }
.idle-tag { align-self: flex-start; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: var(--berry-soft); color: var(--berry); font-size: 12px; font-weight: 500; }
.side-user { flex-wrap: wrap; }
.side-user form { margin-left: 46px; }
.side-user button.small-btn { min-height: 0; padding: 0; background: none; border: 0; color: var(--muted); font-size: 12.5px; text-decoration: underline; }
.side-user { flex-direction: column; align-items: stretch; gap: 4px; }
.side-user-link b { white-space: normal; }
details.add-task > summary::before { content: "+ "; }
details.add-task[open] > summary::before { content: "− "; }
/* Chat s AI obchodníkem na detailu dealu */
.chat.chat-deal { min-height: 0; margin-bottom: 20px; }
.chat-deal .chat-log { min-height: 140px; max-height: 380px; }
.chat-deal .msg { white-space: pre-line; }

/* ---------- Aktivní support (CSM) ---------- */
.hs-pill { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 999px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--soft); color: var(--muted); flex: none; }
.hs-green { background: var(--green-soft); color: var(--green); }
.hs-amber { background: var(--peach-soft); color: var(--peach-ink); }
.hs-red { background: var(--berry-soft); color: var(--berry); }
.hs-big { min-width: 64px; height: 64px; font-size: 24px; border-radius: 20px; }
.score-cell { display: inline-flex; align-items: center; gap: 8px; }
.score-big { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.score-parts { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13.5px; }
.score-parts li { display: flex; justify-content: space-between; gap: 12px; }
.score-parts b { font-variant-numeric: tabular-nums; }
.score-big .score-parts { flex: 1; }
.metric-history td { padding-top: 6px; padding-bottom: 6px; }
.support-table td { vertical-align: top; }
.support-table td:nth-child(4), .support-table td:nth-child(5), .score-cell .sub { white-space: nowrap; }
.group-chip { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo-ink); font-size: 12px; font-weight: 600; }
.stat-row.stat-row-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; }
a.stat-link { color: inherit; text-decoration: none; }
.metric-bars { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 12px; }
.mb-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.mb-head b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mb-track { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--soft); }
.mb-track i { display: block; height: 100%; border-radius: 4px; }
.mb-track em { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--strong); opacity: .45; }
.mb-green { background: var(--green); } .mb-amber { background: var(--peach); } .mb-red { background: var(--berry); } .mb-none { background: transparent; }
.trend-up { color: var(--green); font-size: 12px; } .trend-down { color: var(--berry); font-size: 12px; }
.touch-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.touch { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.touch.is-planned { border-style: dashed; }
.touch-date { font-size: 13.5px; font-weight: 600; display: grid; gap: 2px; align-content: start; }
.touch-body { min-width: 0; }
.touch-sum { margin: 6px 0 2px; font-size: 14px; white-space: pre-wrap; }
.touch-del { margin: 0; }
.touch-done { margin-top: 6px; }
.touch-done > summary { cursor: pointer; color: var(--indigo-ink); font-size: 13px; font-weight: 600; }
.stack-form { display: grid; gap: 4px; margin-top: 8px; }
.senti { font-size: 12.5px; font-weight: 600; }
.senti-positive { color: var(--green); } .senti-neutral { color: var(--muted); } .senti-negative { color: var(--berry); }
.badge-touch-checkin, .badge-touch-qbr { background: var(--indigo-soft); color: var(--indigo-ink); }
.badge-touch-training, .badge-touch-onsite { background: var(--green-soft); color: var(--green); }
.badge-touch-call, .badge-touch-email { background: var(--coral-soft); color: var(--coral-ink); }
.badge-touch-task { background: var(--peach-soft); color: var(--peach-ink); }
.inline-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.more-fields { margin: 4px 0 12px; }
.more-fields > summary { cursor: pointer; font-size: 13.5px; color: var(--muted); }
.metric-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 14px; align-items: end; }
.metric-form .actions { grid-column: 1 / -1; }
.table-scroll { overflow-x: auto; }
.metric-history td, .metric-history th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.metric-history form { margin: 0; }
.nps-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.nps-list li { display: flex; gap: 12px; align-items: flex-start; }
.nps-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-weight: 700; flex: none; }
.nps-pro { background: var(--green-soft); color: var(--green); } .nps-pas { background: var(--soft); color: var(--muted); } .nps-det { background: var(--berry-soft); color: var(--berry); }
.opp-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.opp { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.opp-won { background: var(--green-soft); } .opp-lost { opacity: .6; }
.opp-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.opp-actions form { margin: 0; }
.opp-status { display: flex; gap: 6px; }
.opp-status select { width: auto; min-height: 0; padding: 4px 28px 4px 10px; font-size: 13px; }
.opp-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.group-grid .group-card { margin: 0; color: inherit; text-decoration: none; display: block; }
.group-card:hover { box-shadow: var(--shadow-md, var(--shadow-sm)); transform: translateY(-1px); }
.group-members { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 14px; }
.group-members li { display: flex; align-items: center; gap: 8px; }
.group-members .hs-pill { min-width: 32px; height: 22px; font-size: 12px; }
.need-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.need-list li, .row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.need-list li { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.row-between form { margin: 0; }
.danger-zone { margin-top: 14px; }
.scoring-table input[type="number"] { width: 80px; }
.scoring-table td { vertical-align: top; }
.agent-csm { background: var(--indigo-soft); color: var(--indigo-ink); }
@media (max-width: 900px) {
  .stat-row.stat-row-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-grid.four { grid-template-columns: 1fr; }
  .touch { grid-template-columns: 1fr auto; }
  .touch-date { grid-column: 1 / -1; display: flex; gap: 8px; }
  .support-table { font-size: 13.5px; }
}

/* ---------- Kalendář pro výběr data ---------- */
.dp { position: relative; display: block; }
.dp-input { cursor: pointer; padding-right: 64px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23736b66' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M3 6h14v11H3zM3 9h14M7 3v4M13 3v4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.dp-input:focus { cursor: pointer; }
.dp:not(.has-value) .dp-input { padding-right: 40px !important; }
.dp-clear { display: none; position: absolute; right: 36px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; box-shadow: none; cursor: pointer; }
.dp-clear:hover { background: var(--soft); color: var(--strong); transform: translateY(-50%); }
.dp.has-value .dp-clear { display: grid; place-items: center; }
.dp-pop { position: fixed; z-index: 1000; top: 0; left: 0; width: 280px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 14px; border-radius: 18px; background: var(--surface-solid, #fff); border: 1px solid var(--surface-line, var(--line)); box-shadow: 0 18px 40px rgba(30, 27, 46, .16), 0 2px 6px rgba(30, 27, 46, .06); animation: dp-in .14s ease-out; }
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px); } }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-head b { font-size: 15px; font-weight: 600; color: var(--strong); text-transform: capitalize; }
.dp-pop button { min-height: 0; padding: 0; border: 0; box-shadow: none; background: transparent; color: var(--text); font-weight: 500; transform: none; }
.dp-pop .dp-nav { width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--strong); }
.dp-pop .dp-nav:hover { background: var(--soft); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 4px 0 6px; }
.dp-pop .dp-day { height: 34px; border-radius: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.dp-pop .dp-day:hover { background: var(--coral-soft, var(--soft)); color: var(--strong); }
.dp-pop .dp-day.we { color: var(--muted); }
.dp-pop .dp-day.out { color: var(--line-strong); }
.dp-pop .dp-day.today { box-shadow: inset 0 0 0 1.5px var(--brand-orange, var(--coral)); color: var(--strong); font-weight: 700; }
.dp-pop .dp-day.sel { background: var(--strong); color: #fff; font-weight: 600; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-pop .dp-link { padding: 5px 10px; border-radius: 999px; font-size: 13px; color: var(--indigo-ink); font-weight: 600; }
.dp-pop .dp-link:hover { background: var(--indigo-soft); }

/* ---------- Projekty: řešitel úkolu, přetahování ---------- */
.assignee { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; color: var(--text); }
.assignee .avatar { width: 18px; height: 18px; font-size: 10.5px; }

/* ---------- Rozbalovací seznam (místo vzhledu prohlížeče) ---------- */
.sel { position: relative; display: block; min-width: 0; }
.sel[hidden] { display: none; }
.sel-native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.sel-btn { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 0; padding: 10px 40px 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: color-mix(in srgb, var(--surface-solid) 70%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23736b66' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; color: var(--ink, var(--text)); font-size: 15px; font-weight: 400; text-align: left; line-height: 1.4; white-space: nowrap; box-shadow: none; transform: none; transition: border-color .15s, box-shadow .15s; }
.sel-btn:hover { background-color: color-mix(in srgb, var(--surface-solid) 70%, transparent); border-color: color-mix(in srgb, var(--strong) 25%, transparent); transform: none; box-shadow: none; }
.sel-btn:focus-visible, .sel.open .sel-btn { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-orange) 16%, transparent); background-color: var(--surface-solid); }
.sel-btn:active { transform: none; }
.sel-btn:disabled { opacity: .55; cursor: not-allowed; }
.sel-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sel.sel-blank .sel-text { color: var(--muted); }
.sel-pop { position: absolute; text-align: left; z-index: 60; top: calc(100% + 6px); left: 0; max-width: min(420px, calc(100vw - 24px)); padding: 6px; border-radius: 16px; background: var(--surface-solid, #fff); border: 1px solid var(--surface-line, var(--line)); box-shadow: 0 18px 40px rgba(30, 27, 46, .16), 0 2px 6px rgba(30, 27, 46, .06); animation: dp-in .14s ease-out; }
.sel-pop.sel-right { left: auto; right: 0; }
.sel-pop.sel-up { top: auto; bottom: calc(100% + 6px); }
.sel-list { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.sel-search { margin-bottom: 6px; padding: 8px 12px; font-size: 14px; }
.sel-opt { position: relative; padding: 8px 32px 8px 12px; border-radius: 10px; font-size: 14.5px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-opt.none { color: var(--muted); }
.sel-opt.active { background: var(--coral-soft, var(--soft)); color: var(--strong); }
.sel-opt.sel-on { font-weight: 600; color: var(--strong); }
.sel-opt.sel-on::after { content: ''; position: absolute; right: 12px; top: 50%; width: 12px; height: 7px; margin-top: -5px; border-left: 2px solid var(--brand-orange, var(--coral)); border-bottom: 2px solid var(--brand-orange, var(--coral)); transform: rotate(-45deg); }
.sel-opt.off { opacity: .45; cursor: default; background: none; }
.sel-empty { padding: 10px 12px; font-size: 13.5px; color: var(--muted); }
.inline .sel { flex: 1 1 170px; }
.filters .sel { flex: 1 1 160px; }
.vi-row .sel, .vi-disc-in .sel { width: 100%; }
.vi-disc-in .sel-btn { padding: 10px 24px 10px 8px; background-position: right 4px center; background-size: 14px; }
.sel-btn.status-select { width: auto; min-height: 0; padding: 4px 30px 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; background-color: var(--peach-soft); color: var(--coral-ink); border: 1px solid transparent; background-position: right 8px center; background-size: 16px; }
.sel-btn.status-select.status-customer { background-color: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.sel-btn.status-select.status-lost, .sel-btn.status-select.status-do_not_contact { background-color: var(--surface); color: var(--muted, inherit); }
.sel:has(.status-select) { display: inline-block; }

/* ---------- Propojené: ikony v dlaždicích ---------- */
.linked { gap: 12px; }
.linked .link-row { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.link-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--coral-soft, var(--soft)); color: var(--coral-ink, var(--strong)); }
.link-txt { display: grid; min-width: 0; line-height: 1.3; }
.link-txt a { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.link-txt .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.meta-ico { display: inline-flex; align-items: center; gap: 4px; }
.meta-ico .ico { color: var(--muted); }
.auto-note { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.auto-note .ico { color: var(--brand-orange, var(--coral)); }

/* ---------- Workbook pro klienta ---------- */
.wb-public { min-height: 100vh; }
.wb-main { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 36px 20px 80px; }
.wb-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.wb-logo { width: 46px; height: 46px; flex: none; margin-top: 6px; }
.wb-head h1 { margin: 2px 0 6px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-orange, var(--coral)); }
.wb-progress { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.wb-progress .bar { display: block; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.wb-progress .bar i { display: block; height: 100%; width: 0; background: var(--brand-orange, var(--coral)); border-radius: inherit; transition: width .3s; }
.wb-save { min-width: 90px; text-align: right; }
.wb-save.ok { color: var(--green); }
.wb-save.err { color: var(--berry, #b44677); }
.wb-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin-bottom: 16px; border-radius: 999px; background: color-mix(in srgb, var(--surface-solid) 70%, transparent); border: 1px solid var(--surface-line, var(--line)); scrollbar-width: thin; }
.wb-tabs button { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 0; padding: 8px 14px; border-radius: 999px; background: transparent; color: var(--text); font-size: 13.5px; font-weight: 500; box-shadow: none; transform: none; }
.wb-tabs button:hover { background: var(--soft); transform: none; box-shadow: none; }
.wb-tabs button.active { background: var(--strong); color: #fff; }
.wb-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .5; }
.wb-tabs button.done .wb-dot { background: var(--green); border-color: var(--green); opacity: 1; }
.wb-tabs .wb-send { margin-left: auto; font-weight: 600; }
.wb-panel h2 { margin-top: 0; }
.wb-panel > p { max-width: 75ch; }
.wb-example { margin: 12px 0 18px; }
.wb-example summary { cursor: pointer; font-weight: 600; color: var(--indigo-ink, var(--strong)); }
.wb-example table { margin-top: 8px; opacity: .8; }
.wb-table { margin: 6px 0 14px; }
.wb-table table { width: 100%; border-collapse: separate; border-spacing: 0; }
.wb-table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 6px 6px; white-space: nowrap; }
.wb-table td { padding: 3px; vertical-align: middle; }
.wb-table td input, .wb-table td .sel-btn { min-width: 120px; padding: 8px 10px; font-size: 14px; }
.wb-table td .sel-btn { padding-right: 34px; }
.wb-n { width: 28px; text-align: right; color: var(--muted); font-size: 12px; }
.wb-suf { position: relative; }
.wb-suf input { padding-right: 52px !important; }
.wb-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--muted); pointer-events: none; }
.wb-del button { min-height: 0; width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 18px; color: var(--muted); }
.wb-add { margin-top: 8px; min-height: 0; padding: 7px 16px; font-size: 13.5px; }
.wb-nav { justify-content: space-between; margin-top: 18px; }
.wb-files { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.wb-files li { padding: 8px 12px; border-radius: 10px; background: var(--soft); }
.flash.warn { background: var(--peach-soft, #fff1ec); color: var(--coral-ink, inherit); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font-size: 13.5px; }
.wb-sheet { padding: 0; }
.wb-sheet > summary { display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; list-style: none; }
.wb-sheet > summary::-webkit-details-marker { display: none; }
.wb-sheet[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.wb-sheet > :not(summary) { margin-left: 20px; margin-right: 20px; }
.wb-sheet > :last-child { margin-bottom: 18px; }
.wb-state { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); color: #fff; }
.wb-state.ok { background: var(--green); border-color: var(--green); }
.wb-view { font-size: 13.5px; }
.wb-view th { white-space: nowrap; }
.wb-comment { background: var(--soft); padding: 10px 12px; border-radius: 10px; }
@media (max-width: 700px) { .wb-head { flex-direction: column; gap: 8px; } .wb-progress { grid-template-columns: 1fr; } .wb-save { text-align: left; } }
.sel-pop.sel-fixed { position: fixed; top: 0; left: 0; z-index: 200; }
.flash.warn::before { background: var(--brand-orange, var(--coral)); }
.wb-panel > h2 { font-size: 24px; font-weight: 500; letter-spacing: -.02em; margin-bottom: 12px; }
.wb-table td input, .wb-table td .sel-btn { min-width: 104px; }

/* Workbook: výběr více možností, závislé buňky, ARES u společnosti */
.wb-multi { display: flex; flex-wrap: wrap; gap: 5px; min-width: 200px; padding: 2px 0; }
.wb-chip { min-height: 0; padding: 5px 11px; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 500; white-space: nowrap; }
.wb-chip:hover { border-color: var(--coral); color: var(--strong); background: var(--surface); }
.wb-chip.on { background: var(--coral-soft); border-color: var(--coral); color: var(--strong); }
.wb-chip.on::before { content: "✓ "; }
.wb-table td.wb-off { color: var(--muted); padding-left: 12px; }
.wb-company .field.wide > .field { margin: 0; }
.wb-company .wb-ares-note { margin: 6px 0 0; }
.wb-ares-hits { display: flex; flex-direction: column; margin-top: 6px; border-radius: 10px; overflow: hidden; }
.wb-ares-hits:not(:empty) { border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.wb-ares-hit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--strong); text-align: left; font-weight: 400; }
.wb-ares-hit:last-child { border-bottom: 0; }
.wb-ares-hit:hover, .wb-ares-hit:focus-visible { background: var(--coral-soft); }
.wb-upload + .wb-table { margin-top: 18px; }

/* ---------- Role a oprávnění ---------- */
main.ro form[method="post"]:not(.view-as-bar), main.ro .ro-hide { display: none !important; }
.ro-note { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 500; }
.ro-note::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.view-as-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--indigo-soft); color: var(--indigo-ink); border: 1px solid color-mix(in srgb, var(--indigo) 25%, transparent); font-size: 14px; }
.view-as-bar button { background: var(--surface); color: var(--strong); border-color: var(--line-strong); }
.view-as { margin: auto 8px 6px; }
.view-as + .side-user { margin-top: 0; }
.view-as .sel-btn, .view-as select { padding: 6px 10px; font-size: 13px; }
.role-list .role-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.role-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.role-add { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-top: 8px; }
.role-add .field { margin: 0; }
@media (max-width: 720px) { .role-add { grid-template-columns: 1fr; } }
.perm-group { margin-top: 18px; }
.perm-group .small-h { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; color: var(--muted); }
.perm-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.perm-row:last-child { border-bottom: 0; }
.perm-name { min-width: 0; }
.perm-row.off .perm-name b { color: var(--muted); }
.perm-cards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.perm-card { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; cursor: pointer; background: var(--surface); }
.perm-card input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand-orange); }
.perm-row.off .perm-card { opacity: .45; cursor: default; }
.perm-info { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.perm-info:last-of-type { border-bottom: 0; }
.perm-info input { width: 17px; height: 17px; margin: 3px 0 0; flex: none; accent-color: var(--brand-orange); }
.sticky-actions { position: sticky; bottom: 12px; z-index: 3; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow); width: fit-content; }
@media (max-width: 720px) { .perm-row { flex-direction: column; } .perm-row .seg-switch { align-self: stretch; } .perm-row .seg-switch label { flex: 1; text-align: center; } }

/* Firmy ke schválení: údaje od AI obchodníka a pop-up chat */
.candidates .facts { margin-top: 3px; font-size: 13.5px; }
.candidates .facts b { font-weight: 600; color: var(--strong); }
.sales-contacts { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 3px; }
.role-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--track); color: var(--strong); }
.role-tag.role-0 { background: var(--indigo-soft); color: var(--indigo-ink); }
.role-tag.role-2 { background: var(--berry-soft); color: var(--berry); }
.role-tag.role-3 { background: var(--peach-soft); color: var(--peach-ink); }
.candidates td .small-btn { margin-top: 6px; min-height: 0; padding: 3px 10px; font-size: 12.5px; }
.row-actions { flex-wrap: wrap; }
.ask-ai { font-size: 13px; font-weight: 500; color: var(--indigo-ink); white-space: nowrap; padding: 6px 4px; }
.prep-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.prep-bar .agent-avatar { width: 22px; height: 22px; font-size: 11px; display: inline-grid; vertical-align: middle; }
.cand-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-solid); color: var(--text); box-shadow: 0 24px 60px rgba(40, 25, 10, .25); }
.cand-dialog::backdrop { background: rgba(30, 25, 20, .35); backdrop-filter: blur(2px); }
.cand-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 10px; }
.cand-dialog-head .sub { margin-top: 4px; line-height: 1.45; }
.close-x { font-size: 24px; line-height: 1; color: var(--muted); text-decoration: none; padding: 0 4px; }
.cand-dialog .chat { margin: 0 12px; box-shadow: none; min-height: 0; }
.cand-dialog .chat-log { min-height: 160px; max-height: 46vh; }
.cand-dialog .msg { white-space: pre-line; }
.cand-dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px 18px; }

/* Leads */
.seg-chip { display: inline-block; font-size: 12.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo-ink); white-space: nowrap; }
.src-chip { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border-radius: 6px; background: var(--track); color: var(--strong); }
.src-chip.src-merk { background: var(--green-soft); color: var(--green); }
.src-chip.src-weblead { background: var(--peach-soft); color: var(--peach-ink); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 260px; }
.warn-text { color: var(--peach-ink); font-size: 13.5px; }
.tabs.inline-tabs { margin: 0 0 14px; }
.lead-meta { display: grid; gap: 10px; margin-bottom: 14px; }
.lead-meta .small-btn { justify-self: start; }
.lead-people li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.lead-people li:last-child { border-bottom: 0; }
.note-form { display: grid; gap: 8px; margin-bottom: 14px; }
.note-form .small-btn { justify-self: start; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline .pre { white-space: pre-line; margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.rival { margin-top: 4px; font-size: 12.5px; }
.rival-found { display: inline-block; padding: 2px 9px; border-radius: 8px; background: var(--red-soft); color: var(--coral-ink); font-weight: 600; }
.rival-found a { color: inherit; text-decoration: underline; }

/* ---------- Načíst z ARES (všude, kde se přidává firma) ---------- */
.ares-fill { grid-column: 1 / -1; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--soft); }
.ares-row { display: flex; gap: 8px; }
.ares-row input { flex: 1; min-width: 0; }
.ares-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.ares-list button { width: 100%; display: flex; justify-content: space-between; gap: 12px; text-align: left; padding: 8px 10px; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--line); color: var(--text); font-weight: 400; }
.ares-list button:hover { border-color: var(--accent, #e8553e); }
.ares-list button span { color: var(--muted); font-size: 13px; }
.new-deal-form .ares-fill { padding: 8px 10px; }
@media (max-width: 600px) { .ares-list button { flex-direction: column; gap: 2px; } }

/* ---------- Aktivity: další krok, historie záznamu ---------- */
.composer-next { box-shadow: 0 0 0 2px var(--green, #2f7d55) inset; }
.next-prompt { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--green-soft, #e6f3ea); color: var(--text); }
.act-history { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); max-height: 260px; overflow: auto; }
.act-history h4 { margin: 0 0 6px; font-size: 13px; }
.act-history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.act-history li { display: block; padding: 0; border: 0; font-size: 13px; overflow-wrap: anywhere; }
.act-history li > * + * { margin-top: 2px; }
.act-history .pre { white-space: pre-wrap; }
.lead-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.lead-actions .tiny-form { margin: 0; }

/* ---------- Doporučený balíček v hodnotě dealu ---------- */
.vi-rec-wrap { display: flex; align-items: center; }
.vi-rec { white-space: nowrap; font-size: 13px; padding: 6px 10px; }
.vi-is-rec .vi-rec { color: var(--green, #2f7d55); font-weight: 600; }
.vi-alt .vi-total { text-decoration: line-through; color: var(--muted); }
.vi-alt { opacity: .8; }
.vi-rec-hint { margin: 6px 0 0; }
.dv-rec { color: var(--green, #2f7d55); font-weight: 600; }
.dv-alt { color: var(--muted); }
.dv-alt-tag { font-size: 12px; }
.vi-group[data-recommend] .vi-row { grid-template-columns: minmax(0, 1fr) 64px 76px 116px 112px 76px 24px; }
@media (max-width: 560px) { .vi-group[data-recommend] .vi-row { grid-template-columns: 1fr 1fr 1.4fr; } }

/* Platná nabídka u dealu */
.offer-badge { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .03em; vertical-align: 2px; }
.offer-badge.valid { background: var(--green); color: #fff; }
.offer-badge.old { background: var(--soft); color: var(--muted); font-weight: 600; letter-spacing: 0; }
.doc-ico.doc-valid { background: var(--green); color: #fff; }
.docs-card li.offer-valid { background: var(--green-soft); border-radius: 12px; padding-left: 8px; padding-right: 8px; border-bottom-color: transparent; margin-bottom: 4px; }
.docs-card li.offer-old .doc-main > a, .docs-card li.offer-old .doc-ico { opacity: .55; }
.offer-mark { margin-top: 4px; }
.offer-mark .small-btn { min-height: 0; padding: 3px 11px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; color: var(--strong); }
.offer-hint { margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; background: var(--peach-soft); color: var(--strong); }
.offer-history { margin: 0 0 12px; font-size: 13px; }
.offer-history summary { cursor: pointer; color: var(--muted); }
.offer-history ul { margin: 6px 0 0; padding-left: 18px; }
.deal-offer { display: inline-block; margin-top: 4px; padding: 0 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 11.5px; font-weight: 600; }

/* Vážená hodnota pipeline: legenda a čárkovaná linie absolutní hodnoty */
.chart-legend { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.chart-legend .lg { display: inline-block; width: 14px; height: 0; border-top: 3px solid var(--brand-orange); border-radius: 2px; margin-left: 6px; }
.chart-legend .lg-a { border-top: 2px dashed var(--line-strong); }
.abs-line { stroke: var(--line-strong); }

/* Tlačítka Uložit – vždy výrazná, v barvě tamiga (oranžová), ať je nikdo nemusí hledat */
button.save, .btn.save {
  background: linear-gradient(135deg, var(--brand-orange), #e8503c);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 16px -8px var(--brand-orange);
}
button.save::before, .btn.save::before { content: "✓"; font-weight: 700; }
button.save:hover, .btn.save:hover { background: linear-gradient(135deg, var(--brand-orange-2), var(--brand-orange)); color: #fff; }
button.save.small-btn { min-height: 38px; padding: 7px 18px; }

/* Leads: kompaktní přehled, 1 řádek = 1 lead (detaily jsou na detailu leadu) */
.leads-table td { padding-top: 9px; padding-bottom: 9px; vertical-align: middle; white-space: nowrap; }
.leads-table .lead-name { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.leads-table .lead-name a { display: block; overflow: hidden; text-overflow: ellipsis; }
.leads-table .lead-person { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.leads-table .lead-actions .small-btn { min-height: 30px; padding: 3px 12px; font-size: 13px; }

/* ---------- Reporting (admin) ---------- */
.rep-period { margin: 0; }
.rep-areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 10px; }
.rep-area { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--surface-line, var(--line)); color: var(--strong); font-weight: 500; }
.rep-area:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.rep-area .badge { margin-left: auto; }
.rep-area.active { border-color: var(--strong); box-shadow: inset 0 0 0 1px var(--strong); }
.rep-period-label { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.rep-signals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.rep-sig { --tone: var(--muted); display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--surface-line, var(--line)); border-top: 3px solid var(--tone); color: var(--text); }
a.rep-sig:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.rep-sig.tone-ok { --tone: var(--green); } .rep-sig.tone-warn { --tone: var(--brand-sunlight, #ffa046); } .rep-sig.tone-bad { --tone: var(--berry); }
.rep-sig-top { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
.rep-sig-label { font-size: 13px; color: var(--muted); line-height: 1.3; }
.rep-sig-val { font-size: 26px; font-weight: 400; letter-spacing: -0.02em; color: var(--strong); font-variant-numeric: tabular-nums; line-height: 1.1; }
.rep-sig-note { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.rep-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; }
.rep-grid > .card { margin-bottom: 20px; }
.rep-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px 20px; }
.rep-stat { display: flex; flex-direction: column; gap: 4px; }
.rep-stat > span { font-size: 13px; color: var(--muted); }
.rep-stat > b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 22px; font-weight: 500; color: var(--strong); font-variant-numeric: tabular-nums; }
.rep-stat small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.rep-h3 { margin: 22px 0 10px; font-size: 14px; font-weight: 600; }
.rep-bars { margin: 0 0 18px; }
.rep-bars figcaption { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.rep-bars-plot { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; height: 120px; align-items: end; border-bottom: 1px solid var(--line); }
.rep-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; padding-top: 18px; cursor: default; }
.rep-bar i { display: block; width: min(100%, 34px); border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--brand-orange) 45%, transparent); }
.rep-bar.is-now i { background: var(--brand-orange); }
.rep-bar:hover i { background: var(--brand-orange); }
.rep-bar-val { position: absolute; top: 0; font-size: 12px; color: var(--strong); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.rep-bar.is-now .rep-bar-val, .rep-bar:hover .rep-bar-val { opacity: 1; }
.rep-bar-x { position: absolute; bottom: -20px; font-size: 12px; color: var(--muted); }
.rep-bars { padding-bottom: 20px; }
.rep-meter { display: inline-block; vertical-align: middle; width: 60px; height: 6px; margin-left: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.rep-meter.wide { width: auto; margin: 0; }
.rep-meter i { display: block; height: 100%; border-radius: 999px; background: var(--brand-orange); }
.rep-phases { display: flex; flex-direction: column; gap: 8px; }
.rep-phase { display: grid; grid-template-columns: 170px 1fr 28px 96px; align-items: center; gap: 12px; font-size: 14px; }
.rep-phase b { text-align: right; font-variant-numeric: tabular-nums; }
.rep-table td { white-space: nowrap; }
.rep-table .sub { color: var(--muted); font-size: 12.5px; }
.rep-list { list-style: none; margin: 0; padding: 0; }
.rep-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rep-list li:last-child { border-bottom: 0; }
.rep-list .sub { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
@media (max-width: 1200px) { .rep-signals { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rep-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .rep-signals, .rep-areas { grid-template-columns: 1fr; }
  .rep-phase { grid-template-columns: 120px 1fr 24px; }
  .rep-phase .badge { grid-column: 1 / -1; justify-self: start; }
}

/* Reporting: období od–do, deal conversion, weblead */
.rep-period { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 10px 14px; }
.rep-period .pill-tabs { margin: 0; }
.rep-range { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.rep-range label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12.5px; color: var(--muted); }
.rep-range .dp, .rep-range .dp-input, .rep-range input[type="date"] { width: 168px; }
.rep-area { flex-wrap: wrap; row-gap: 6px; }
.rep-area > span:not(.badge) { white-space: nowrap; }
.rep-area .badge { flex: none; }
.rep-conv-mode { margin: 0; }
.rep-conv-head { margin: 4px 0 14px; font-size: 17px; color: var(--strong); }
.rep-conv-head .sub { font-size: 13px; color: var(--muted); }
.rep-conv { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.rep-conv-col { flex: 1 1 0; min-width: 72px; display: flex; flex-direction: column; align-items: center; cursor: default; }
.rep-conv-plot { position: relative; width: 100%; height: 190px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-bottom: 1px solid var(--line); }
.rep-conv-plot i { display: block; width: min(76%, 64px); border-radius: 4px 4px 0 0; background: var(--brand-sunlight, #ffa046); }
.rep-conv-col.is-won .rep-conv-plot i { background: var(--green); }
.rep-conv-col:hover .rep-conv-plot i { filter: brightness(.94); }
.rep-conv-n { margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--strong); font-variant-numeric: tabular-nums; }
.rep-conv-x { margin-top: 8px; font-size: 12.5px; color: var(--text); text-align: center; line-height: 1.25; }
.rep-conv-step { flex: 0 0 58px; display: flex; align-items: center; justify-content: center; height: 190px; }
.rep-conv-step span { position: relative; padding: 5px 12px 5px 8px; background: var(--strong); color: var(--bg, #fff); font-size: 12.5px; font-weight: 500; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); white-space: nowrap; }
.rep-legend { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.rep-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.rep-legend .lg-reach { background: var(--brand-sunlight, #ffa046); } .rep-legend .lg-won { background: var(--green); margin-left: 8px; }
.rep-big { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.rep-big-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 18px; text-align: center; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--surface-line, var(--line)); color: var(--text); }
a.rep-big-card:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.rep-big-label { font-size: 14px; font-weight: 500; color: var(--strong); }
.rep-big-delta { font-size: 13px; color: var(--muted); }
.rep-big-delta.up { color: var(--green); } .rep-big-delta.down { color: var(--berry); }
.rep-big-delta small { color: var(--muted); font-size: 12px; }
.rep-big-n { font-size: clamp(32px, 3vw, 44px); font-weight: 500; letter-spacing: -0.02em; color: var(--strong); font-variant-numeric: tabular-nums; line-height: 1.1; }
.rep-big-sub { font-size: 12.5px; color: var(--muted); }
.rep-grid-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1200px) { .rep-web { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .rep-web-nums { grid-template-columns: 1fr 1fr; }
  .rep-period { align-items: stretch; }
  .rep-conv-col { min-width: 64px; } .rep-conv-step { flex-basis: 50px; }
}

.rep-conv-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.rep-web { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: center; }
.rep-web-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.rep-web-nums .rep-big-card { padding: 8px 10px; background: transparent; border: 0; border-left: 1px solid var(--line); border-radius: 0; gap: 4px; }
.rep-web-nums .rep-big-card:first-child { border-left: 0; }
.rep-web-nums .rep-big-label { font-size: 13px; font-weight: 400; color: var(--muted); }
.rep-web-nums .rep-big-n { font-size: 28px; }
.rep-web .rep-bars { margin: 0; }

/* Reporting: filtr obchodníka a cíle */
.rep-owner { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 0; }
.rep-owner label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12.5px; color: var(--muted); }
.rep-owner select, .rep-owner .sel { min-width: 180px; }
.rep-signals { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.rep-goals-table input { width: 110px; min-width: 0; }
.rep-goals-table td { vertical-align: middle; }
.rep-goals .form-actions { display: flex; justify-content: flex-end; margin: 4px 0 24px; }

/* ================= Přehled podle role ================= */
.dash-grid > .span-4 { grid-column: span 4; } .dash-grid > .span-5 { grid-column: span 5; } .dash-grid > .span-6 { grid-column: span 6; }
.dash-grid > .span-7 { grid-column: span 7; } .dash-grid > .span-8 { grid-column: span 8; } .dash-grid > .span-12 { grid-column: span 12; }
.dash-grid > .card .card-head .badge { margin-left: auto; }
.pipe-strip.no-value .pipe-row a { grid-template-columns: minmax(100px, 170px) minmax(0, 1fr) 24px; }
.lead-top { margin-top: 14px; border-top: 1px solid var(--line); }
.lead-top li:first-child { border-top: 0; }

/* Cíle se semaforem (stejné jako Reporting) */
.goal-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 28px; }
.goal-list li { --tone: var(--line-strong); display: block; border-top: 1px solid var(--line); }
.goal-list li > * { width: 100%; box-sizing: border-box; }
.goal-list li > a, .goal-list li > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 0 11px 12px; border-left: 3px solid var(--tone); margin: 6px 0; color: var(--text); }
.goal-list li > a:hover { text-decoration: none; background: color-mix(in srgb, var(--surface-solid) 60%, transparent); }
.goal-list li.tone-ok { --tone: var(--green); } .goal-list li.tone-warn { --tone: var(--brand-sunlight); } .goal-list li.tone-bad { --tone: var(--berry); }
.gl-label { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--strong); min-width: 0; }
.gl-label small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.gl-val { max-width: 120px; font-size: 17px; font-weight: 500; color: var(--strong); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.2; }

/* Admin: stav cílů po oblastech */
.dash-areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-area { --tone: var(--line-strong); display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface-solid) 55%, transparent); box-shadow: inset 0 3px 0 var(--tone); color: var(--text); }
.dash-area:hover { text-decoration: none; background: var(--surface-solid); }
.dash-area.tone-ok { --tone: var(--green); } .dash-area.tone-warn { --tone: var(--brand-sunlight); } .dash-area.tone-bad { --tone: var(--berry); }
.da-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.da-top b { font-size: 16px; font-weight: 500; color: var(--strong); }
.dash-area ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; }
.dash-area li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.dash-area li span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-area li b { font-weight: 500; color: var(--strong); font-variant-numeric: tabular-nums; }
.da-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.da-dot.tone-ok { background: var(--green); } .da-dot.tone-warn { background: var(--brand-sunlight); } .da-dot.tone-bad { background: var(--berry); }

/* Admin: obchodníci */
.dash-people { width: 100%; border-collapse: collapse; font-size: 14px; }
.dash-people th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dash-people td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.dash-people tr:last-child td { border-bottom: 0; }
.dash-people .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-people tr.is-me td { background: color-mix(in srgb, var(--brand-orange) 7%, transparent); }
.dash-people small { color: var(--muted); }

/* Projekty: vývoj */
.proj-list { list-style: none; margin: 4px 0 0; padding: 0; }
.proj-list li { border-top: 1px solid var(--line); }
.proj-list li:first-child { border-top: 0; }
.proj-list a { display: grid; grid-template-columns: 10px minmax(0, 1fr) minmax(90px, 130px) 80px 40px; align-items: center; gap: 12px; padding: 11px 0; color: var(--text); }
.proj-list a:hover { text-decoration: none; }
.proj-list a:hover b { text-decoration: underline; }
.pl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-main b { font-weight: 500; color: var(--strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-main small { font-size: 12.5px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-phase { display: flex; flex-direction: column; font-size: 13px; color: var(--strong); }
.pl-phase small { font-size: 12px; color: var(--muted); }
.pl-bar { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.pl-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-sunlight), var(--brand-orange)); }
.pl-pct { font-size: 13px; text-align: right; color: var(--strong); font-variant-numeric: tabular-nums; }
.hdot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.hdot-amber { background: var(--brand-sunlight); } .hdot-red { background: var(--berry); }
.phase-dots { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.phase-dots li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: color-mix(in srgb, var(--brand-orange) 9%, transparent); text-align: center; }
.phase-dots li.zero { background: var(--track); }
.phase-dots b { font-size: 20px; font-weight: 500; color: var(--strong); line-height: 1.1; }
.phase-dots span { font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.phase-dots small { font-size: 11px; color: var(--berry); }
.seg-list .seg-nps { padding-top: 10px; border-top: 1px solid var(--line); }
.risk-list { margin-top: 12px; }
.dash-sub-h { margin: 18px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); }

@media (max-width: 1200px) {
  .dash-grid > .span-4, .dash-grid > .span-5, .dash-grid > .span-7, .dash-grid > .span-8 { grid-column: span 12; }
  .dash-grid > .span-6 { grid-column: span 12; }
  .dash-areas { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .proj-list a { grid-template-columns: 10px minmax(0, 1fr) 40px; }
  .pl-phase, .pl-bar { display: none; }
  .phase-dots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .goal-list { grid-template-columns: 1fr; }
  .dash-people th:nth-child(3), .dash-people td:nth-child(3) { display: none; }
}

/* Administrace → Cíle: vlevo lidé, vpravo jejich cíle */
.goals-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.goals-people { display: flex; flex-direction: column; gap: 4px; padding: 10px; position: sticky; top: 16px; }
.goals-people a { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border-radius: 12px; color: var(--text); }
.goals-people a:hover { background: var(--soft); text-decoration: none; }
.goals-people a.active { background: color-mix(in srgb, var(--brand-orange) 14%, transparent); }
.goals-person-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.goals-form-head h2 { margin: 2px 0 4px; }
.goals-form-head { margin-bottom: 12px; }
.goals-form .form-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.goals-form .rep-goals-table td.small { white-space: normal; }
.nowrap { white-space: nowrap; }
@media (max-width: 860px) {
  .goals-layout { grid-template-columns: 1fr; }
  .goals-people { position: static; }
}

/* Ke schválení → Nové firmy: jedna karta pro firmy z MERKu i z článků */
.nc-list { display: grid; gap: 14px; }
.nc-card { margin: 0; }
.nc-card.dim { opacity: .78; }
.nc-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.nc-head .nc-check { margin-top: 6px; width: 18px; height: 18px; flex: none; }
.nc-head .score { flex: none; }
.nc-title { flex: 1; min-width: 0; }
.nc-title h3 { font-size: 17px; margin: 0 0 2px; }
.nc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.src-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.src-tag.src-merk { background: var(--green-soft); color: var(--green); }
.src-tag.src-web { background: var(--peach-soft); color: var(--peach-ink); }
.src-tag.src-returned { background: var(--indigo-soft); color: var(--indigo); }
.nc-returned { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--indigo-soft); color: var(--strong); font-size: 14px; }
.nc-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px 24px; margin-bottom: 10px; }
.nc-grid .facts { display: block; margin: 0 0 4px; font-size: 14px; }
.nc-grid .facts b { font-weight: 600; color: var(--strong); }
.nc-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.nc-actions { margin-top: 10px; flex-wrap: wrap; }
.nc-filter { margin: 4px 0 14px; }
.nc-filter .fchip { text-decoration: none; }
.nc-filter .fchip.on { background: var(--strong); color: var(--surface-solid, #fff); }
.nc-all { display: inline-flex; gap: 8px; align-items: center; margin: 0 0 10px; font-size: 14px; }
.nc-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nc-bulk input[name=reject_reason] { flex: 1 1 220px; max-width: 340px; }
.search-now-actions { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; min-width: 180px !important; }
.search-now-actions form { margin: 0; }
.search-now-actions .btn, .search-now-actions button { width: 100%; justify-content: center; text-align: center; box-sizing: border-box; white-space: nowrap; }
.search-row { display: flex; gap: 8px; margin-bottom: 14px; max-width: 520px; }
.search-row input { flex: 1; }
@media (max-width: 720px) {
  .nc-grid { grid-template-columns: 1fr; }
  .nc-actions button { flex: 1 1 0; min-height: 38px; }
  .search-now-actions { flex-direction: row; flex-wrap: wrap; min-width: 0 !important; }
  .search-now-actions > * { flex: 1 1 150px; min-width: 0; }
  .search-now-actions button { min-width: 0 !important; }
}
.search-steps h2 { margin-bottom: 6px; }
.search-auto { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-weight: 500; font-size: 14px; }
.search-now-how { margin: 10px 0 4px; font-weight: 600; color: var(--strong); }
.search-how { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 4px; font-size: 14.5px; }
.run-phrase { padding: 2px 8px; border-radius: 6px; background: var(--surface-solid); border: 1px solid var(--line); font-weight: 600; }

/* ================= Telefon a tablet: horní lišta, spodní lišta, menu jako panel =================
   Do 900 px se postranní menu schová do vysouvacího panelu (tlačítko Menu ve spodní liště).
   Spodní lišta drží 4 hlavní sekce podle role, horní lišta ukazuje logo, název stránky a účet. */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.mtop, .mbar, .nav-backdrop, .side-close { display: none; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
@media (max-width: 900px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .shell { margin: 0 auto; width: 100%; min-height: 0; border-radius: 0; border: 0; box-shadow: none; }
  .shell::before { border-radius: 0; }
  main { padding: 18px 16px 32px; }

  .mtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 14px; padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
  .mtop-brand { display: flex; flex: none; }
  .mtop-brand img { height: 20px; width: auto; display: block; }
  .mtop-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; color: var(--strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
  .mtop-avatar { flex: none; width: 34px; height: 34px; display: grid; place-items: center; text-decoration: none !important; }

  .mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface-solid) 92%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(80, 50, 20, .35); }
  .mbar a, .mbar label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 2px; border-radius: 14px; color: var(--muted); font-size: 11.5px; font-weight: 500; line-height: 1.15; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mbar a > span:last-child, .mbar label > span:last-child { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mbar a[data-section="approvals"] > span:last-child { white-space: normal; font-size: 10.5px; line-height: 1.1; }
  .mbar a:hover { text-decoration: none; }
  .mbar .active { color: var(--strong); background: color-mix(in srgb, var(--brand-orange) 10%, transparent); }
  .mbar svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .mbar .active svg { stroke: var(--brand-orange); }
  .mbar-ico { position: relative; display: block; }
  .mbar .pill { position: absolute; top: -6px; left: 14px; margin: 0; min-width: 18px; padding: 0 5px; font-size: 10.5px; line-height: 16px; }
  .mbar .pill-dot { min-width: 0; width: 9px; height: 9px; padding: 0; top: -2px; left: 17px; background: var(--brand-orange); }

  /* Menu: celé postranní menu jako panel zleva */
  .side { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); height: 100%; height: 100dvh; padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); gap: 22px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface-solid); border-right: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(-104%); transition: transform .22s ease; visibility: hidden; }
  .nav-toggle:checked ~ .shell .side { transform: none; visibility: visible; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 40; display: block; background: rgba(29, 34, 56, .32); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .nav-toggle:checked ~ .shell { z-index: 60; }
  .nav-toggle:checked ~ .shell .nav-backdrop { opacity: 1; pointer-events: auto; }
  .side-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
  .side-close:hover { background: var(--soft); color: var(--strong); }
  .side nav { gap: 16px; }
  .side nav a { padding: 11px 12px; font-size: 15px; }
  .side-user { margin-top: 8px; }

  /* Záložky: posuvné, s jemným náznakem, že pokračují */
  .tabs { align-self: stretch; margin: -4px 0 20px; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .tabs.at-end { -webkit-mask-image: none; mask-image: none; }
  .tabs a { padding: 9px 16px; scroll-snap-align: start; }
}

/* Tabulky na telefonu: řádek = karta, první buňka je nadpis, ostatní „sloupec: hodnota“.
   Tabulky s poli k vyplnění zůstávají tabulkou a dají se posouvat do strany. */
@media (max-width: 640px) {
  .panel { overflow-x: auto; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tfoot { display: block; width: 100%; }
  table.stack tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td, table.stack tfoot th { display: block; position: relative; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  table.stack td[data-label] { padding-left: calc(38% + 10px); min-height: 20px; }
  table.stack td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 1px; width: 38%; color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1.4; overflow-wrap: break-word; }
  table.stack td:first-child { padding-left: 0; font-size: 15px; margin-bottom: 4px; }
  table.stack td:first-child::before { content: none; }
  table.stack td:empty { display: none; }
  table.stack td.num { text-align: left; }
}

/* Vyskakovací okna (Prohráno, akce, úprava úkolu) na telefonu: jako panel nad spodní lištou přes celou šířku. */
@media (max-width: 640px) {
  .lost-pop .pop, .act-menu .pop, .task-edit .pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); width: auto; max-height: 70vh; overflow-y: auto; z-index: 70; }
}

/* Reporting na užších obrazovkách (pravidla musí být až za základními styly, jinak je přebijí). */
@media (max-width: 1200px) { .rep-web { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .rep-big { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rep-big-card { padding: 16px 12px; }
  .rep-web-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .rep-web-nums .rep-big-card:nth-child(odd) { border-left: 0; }
}
@media (max-width: 640px) {
  .card-head { flex-wrap: wrap; row-gap: 8px; }
  .rep-conv-filters { justify-content: flex-start; }
}

/* Lepicí lišty s akcemi drží nad spodní lištou telefonu. */
@media (max-width: 900px) {
  .actions.sticky { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .sticky-actions { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .goals-people { position: static; }
}
@media (max-width: 640px) {
  .sticky-actions { width: auto; }
}

/* iPhone při klepnutí do pole menším než 16 px přiblíží stránku; na telefonu proto pole 16 px. */
@media (max-width: 900px) {
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; }
}

/* Kanban (pipeline, projekty) na telefonu: jeden sloupec skoro přes celou šířku, posun prstem po sloupcích. */
@media (max-width: 640px) {
  .kanban, .project-kanban { grid-auto-columns: 82%; scroll-snap-type: x mandatory; scroll-padding-left: 2px; }
  .kanban > * { scroll-snap-align: start; }
}

/* Detail leadu: kompaktní shrnutí – štítky v řádku, podrobnosti v bublině (myš / ťuknutí) */
.lead-chips { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 8px; }
.lead-chips > * { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 10px; line-height: 1; font-size: 12.5px; border-radius: 999px; }
.lead-chips .score { width: auto; min-width: 40px; font-weight: 600; }
.lead-owner { gap: 6px; font-weight: 500; background: var(--track); color: var(--strong); white-space: nowrap; }
.lead-owner::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.lead-chips .score-high { background: var(--green-soft); color: var(--green); }
.lead-chips .score-mid { background: var(--peach-soft); color: var(--peach-ink); }
.tip { cursor: help; outline: none; }
.tip:focus-visible { box-shadow: 0 0 0 3px var(--indigo-soft); }
.tip-pop { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; padding: 9px 11px; border-radius: 10px; background: var(--strong); color: var(--bg); font-size: 12.5px; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-align: left; white-space: normal; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); pointer-events: none; }
.tip:hover .tip-pop, .tip:focus .tip-pop { display: block; }
.lead-facts { position: relative; gap: 7px 12px; font-size: 14px; }
.lead-facts .tip-pop { top: auto; margin-top: 6px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lead-edit { margin: 0 0 12px; }
.lead-edit summary { display: inline-block; cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; }
.lead-edit summary::-webkit-details-marker { display: none; }
.lead-edit summary:hover { color: var(--strong); }
.lead-edit[open] summary { margin-bottom: 10px; }
.lead-edit .lead-meta { margin-bottom: 4px; }
@media (hover: none) { .tip { cursor: pointer; } }

/* ================= Úkoly: moje / všechny ================= */
.task-scope { display: flex; width: fit-content; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--surface-line); border-radius: 999px; box-shadow: var(--shadow-sm); }
.task-scope a { padding: 7px 16px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.task-scope a.on { background: var(--ink, #1d2336); color: #fff; }
.task-count { margin: -6px 0 10px; }
.task-list li.done b { text-decoration: line-through; color: var(--muted); }
.task-list li.done .tick button { background: var(--green-soft); border-color: var(--green); color: var(--green); font-size: 12px; line-height: 1; }
.task-owner { color: var(--muted); }
@media (max-width: 640px) {
  .task-scope { width: auto; }
  .task-scope a { flex: 1; text-align: center; }
  .task-filters > input, .task-filters .sel, .task-filters select { flex: 1 1 100%; }
  .task-list li { grid-template-columns: auto minmax(0, 1fr); }
  .task-list li .due { grid-column: 2; }
}
.task-filters .clear-filters { align-self: center; font-size: 14px; }
/* Úkol je klikací celý: vede na deal, lead nebo firmu. Odkazy uvnitř a zaškrtnutí zůstávají nad ním. */
.task-list li.task-link { position: relative; cursor: pointer; transition: background .15s; }
.task-list li.task-link:hover { background: color-mix(in srgb, var(--peach-soft) 55%, transparent); }
.task-open { font-weight: 600; color: var(--strong); text-decoration: none; }
.task-open::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.task-open:hover { text-decoration: underline; }
.task-open:focus-visible { outline: none; }
.task-open:focus-visible::after { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: inherit; }
.task-list li.task-link .tick, .task-list li.task-link .sub a { position: relative; z-index: 2; }
.task-kind { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--peach-soft); color: var(--coral-ink); }
.task-kind.kind-deal { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.task-kind.kind-firma { background: var(--soft); color: var(--muted); }
/* Typ úkolu: přepínač nad filtry a štítek u řádku */
.task-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.task-types a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--surface-line); background: var(--surface); color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.task-types a.on { background: var(--ink, #1d2336); border-color: var(--ink, #1d2336); color: #fff; }
.task-type { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); vertical-align: middle; }
.task-type .ico { width: 13px; height: 13px; }
.task-type.type-meeting { background: var(--indigo-soft); color: var(--indigo); }
.task-type.type-call { background: color-mix(in srgb, #2f7fd0 14%, transparent); color: #2a6fb5; }
.task-type.type-email { background: var(--peach-soft); color: var(--coral-ink); }
@media (max-width: 640px) {
  .task-types { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .task-types a { flex: 0 0 auto; }
}

/* ================= Menu: plovoucí panel, sbalení na ikony, hledání, podstránky =================
   Podle videa od Michala (2026-12-05): menu je samostatný zaoblený skleněný panel. Šipkou vedle loga se sbalí
   na úzký pruh ikon (bublina s názvem při najetí). Hledání v menu a podstránky Michal nechce (záložky jsou na stránce). Na telefonu se stejný panel vysouvá zleva přes tlačítko Menu. */
.side-top { position: relative; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 0 4px; }
.brand-mark { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, var(--brand-orange-2), var(--brand-orange) 60%, var(--coral-ink)); color: #fff; font-size: 21px; font-weight: 700; line-height: 1; box-shadow: 0 6px 16px -6px var(--brand-orange), inset 0 1px 0 rgba(255, 255, 255, .35); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }
.brand-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; line-height: 1.1; white-space: nowrap; }
.brand-txt img { height: 19px; width: auto; }
.brand-txt span { font-size: 12px; color: var(--muted); }
.side-rail-btn { flex: none; display: grid; place-items: center; width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface-solid); color: var(--muted); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .35s cubic-bezier(.2, .8, .2, 1), color .15s, background .15s; }
.side-rail-btn:hover { color: var(--strong); background: #fff; }
.side-rail-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }


/* Položky: měkké podsvícení při najetí, aktivní jako pilulka s okrajem */
.side nav a { border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s; }
.side nav a:active { transform: scale(.98); }
.side nav a.active { background: var(--surface-solid); border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(80, 50, 20, .05), 0 6px 14px -10px rgba(120, 70, 30, .35); }
.group-label { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.side nav a > span:first-of-type { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* Bublina s názvem položky (úzký pruh) */
.nav-tip { position: fixed; z-index: 90; display: flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); color: var(--strong); font-size: 13px; font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-6px, -50%) scale(.96); transform-origin: left center; transition: opacity .16s, transform .2s cubic-bezier(.2, .8, .2, 1); }
.nav-tip.show { opacity: 1; transform: translate(0, -50%) scale(1); }
.nav-tip b { padding: 0 6px; border-radius: 999px; background: var(--brand-orange); color: #fff; font-size: 11px; line-height: 17px; }

@media (min-width: 901px) {
  /* Plovoucí panel uvnitř aplikace */
  .shell { grid-template-columns: 262px minmax(0, 1fr); transition: grid-template-columns .38s cubic-bezier(.2, .8, .2, 1); }
  .side { top: 30px; height: calc(100vh - 60px); margin: 12px 0 12px 12px; padding: 20px 12px 14px; gap: 22px; border: 1px solid var(--surface-line); border-radius: 26px; background: linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 78%, transparent), var(--surface)); box-shadow: var(--shadow); overflow-x: hidden; scrollbar-width: none; transition: padding .38s cubic-bezier(.2, .8, .2, 1); }
  .side::-webkit-scrollbar { display: none; }
  .lang-sw { margin: -10px 0 0; padding: 0 4px; }
  .side nav { gap: 12px; }
  .side nav a { padding: 7px 12px; }
  .group-label { padding-bottom: 4px; }

  /* Sbaleno: úzký pruh ikon */
  html.rail .shell { grid-template-columns: 86px minmax(0, 1fr); }
  html.rail .side { padding: 20px 10px 14px; align-items: stretch; }
  html.rail .side-top { justify-content: center; }
  html.rail .brand { padding: 0; }
  html.rail .brand-txt, html.rail .side nav a > span,
  html.rail .lang-sw-label, html.rail .view-as, html.rail .side-user-link > span:last-child, html.rail .side-user form { display: none; }
  html.rail .side-rail-btn { position: absolute; left: calc(50% + 13px); top: 50%; width: 22px; height: 22px; transform: translateY(-50%) rotate(180deg); z-index: 1; }
  html.rail .lang-sw { flex-direction: column; gap: 4px; padding: 0; }
  html.rail .lang-sw button { min-height: 24px; padding: 1px 0; width: 40px; font-size: 11px; }
  html.rail .side nav { gap: 10px; }
  html.rail .group-label { height: 1px; padding: 0; margin: 2px 16px 8px; font-size: 0; background: var(--line-strong); }
  html.rail .side nav a { justify-content: center; width: 44px; height: 44px; margin: 0 auto; padding: 0; border-radius: 14px; }
  html.rail .side nav .pill { position: absolute; top: 5px; right: 5px; min-width: 0; width: 9px; height: 9px; padding: 0; font-size: 0; border: 2px solid var(--surface-solid); box-sizing: content-box; }
  html.rail .side-user { align-items: center; padding: 10px 0 0; margin: auto 0 0; }
  html.rail .side-user-link { flex: none; }

  /* Při přepnutí: popisky se plynule objeví */
  html.rail-anim:not(.rail) .brand-txt, html.rail-anim:not(.rail) .side nav a > span,
  html.rail-anim:not(.rail) .group-label, html.rail-anim:not(.rail) .side-user-link > span:last-child { animation: nav-in .4s cubic-bezier(.2, .8, .2, 1) both; }
  html.rail-anim.rail .side nav a, html.rail-anim.rail .brand-mark { animation: nav-pop .35s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes nav-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes nav-pop { from { opacity: .4; transform: scale(.9); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .side-rail-btn { display: none; }
  /* Telefon: stejný plovoucí panel, vysune se zleva s jemným zvětšením */
  .side { top: calc(10px + env(safe-area-inset-top)); bottom: auto; left: 10px; height: calc(100vh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - 20px); padding-top: 18px; padding-bottom: 18px; -webkit-overflow-scrolling: touch; touch-action: pan-y; width: min(320px, calc(100vw - 52px)); border: 1px solid var(--surface-line); border-radius: 26px; background: color-mix(in srgb, var(--surface-solid) 94%, transparent); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); transform: translateX(-24px) scale(.96); transform-origin: left center; opacity: 0; transition: transform .34s cubic-bezier(.2, .8, .2, 1), opacity .22s, visibility 0s .34s; }
  .nav-toggle:checked ~ .shell .side { transform: none; opacity: 1; visibility: visible; transition: transform .34s cubic-bezier(.2, .8, .2, 1), opacity .22s, visibility 0s; }
  .nav-backdrop { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .shell, .side, .nav-tip, .side-rail-btn { transition: none !important; }
  html.rail-anim * { animation: none !important; }
}
