/* BoatLab CRM — light business UI: white cards on a soft lavender canvas, violet accent, pill tabs. */

:root {
  color-scheme: light;
  /* canvas & surfaces */
  --canvas: #F3F2FB;
  --surface: #FFFFFF;
  --surface-2: #F8F8FC;
  --surface-3: #F1F0F8;
  --line: #ECEBF4;
  --line-2: #DEDDEA;
  /* text */
  --text: #17161F;
  --text-2: #55546A;
  --text-3: #8F8EA4;
  /* brand */
  --brand: #6C5CE7;
  --brand-600: #5A4AD4;
  --brand-50: #F2F0FE;
  --brand-100: #E5E1FD;
  --brand-grad: linear-gradient(100deg, #8D7CF3 0%, #6F9FF5 100%);
  /* status */
  --success: #16865A;  --success-50: #E5F6EE;
  --danger: #C8403C;   --danger-50: #FDECEB;
  --warning: #9A6508;  --warning-50: #FFF4DC;
  --info: #2F6FD0;     --info-50: #EAF1FD;
  --cyan: #0B7489;     --cyan-50: #E2F5F9;
  --orange: #B5530F;   --orange-50: #FFEFE3;
  --gray: #646378;     --gray-50: #F1F1F6;
  /* charts — validated with dataviz/scripts/validate_palette.js on #FFFFFF */
  --dot: #16A374;                 /* single series */
  --accent: #6C5CE7;              /* emphasis */
  --ord-1: #ADAEFE; --ord-2: #8F8BFA; --ord-3: #756FDB; --ord-4: #5D54BD; --ord-5: #46389F;
  --cat-1: #6C5CE7; --cat-2: #F08C3C; --cat-3: #16A374; --cat-other: #D3D2DF;
  --deemph: #E4E3EE;              /* de-emphasised marks */
  --meter-track: #D3F1E5;         /* lighter step of the mint ramp */
  --grid: #EEEDF5;
  /* shape, type, motion */
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(23, 22, 31, 0.05);
  --shadow: 0 1px 2px rgba(23, 22, 31, 0.04), 0 12px 32px -18px rgba(76, 62, 160, 0.22);
  --shadow-lg: 0 20px 44px -20px rgba(76, 62, 160, 0.38);
  --ring: 0 0 0 3px rgba(108, 92, 231, 0.18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-2);
  font: 14px/1.5 var(--font);
  background:
    radial-gradient(1100px 520px at 8% -8%, #E6E1FB 0%, transparent 62%),
    radial-gradient(900px 480px at 100% 0%, #E2EBFB 0%, transparent 58%),
    var(--canvas);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 17px; line-height: 1.35; }
h3 { font-size: 15px; line-height: 1.4; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
svg.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px !important; height: 15px !important; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: var(--radius); background: var(--surface); }

.container { width: 100%; padding: 0 24px; }   /* full width: tables, the board and the lead card use the whole screen */
@media (min-width: 1600px) { .container { padding: 0 32px; } }
.page { padding: 24px 0 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.page-head .sub { margin-top: 4px; color: var(--text-3); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.section { margin-top: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title p { color: var(--text-3); font-size: 13px; }

/* ---------- app bar ---------- */
.appbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.72); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.appbar-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 16px; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px -6px rgba(108, 92, 231, 0.7); }
.brand-mark svg.icon { width: 18px; height: 18px; stroke-width: 2; }
.brand small { color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.navtabs { display: flex; gap: 6px; }
.navtabs a {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.navtabs a:hover { border-color: var(--brand-100); color: var(--text); background: #fff; }
.navtabs a[aria-current="page"] { border-color: var(--brand); background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--ring); }
.appbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.appbar-actions form { margin: 0; }
.icon-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--text); font-weight: 500; }
@media (max-width: 900px) {
  .appbar-inner { grid-template-columns: 1fr auto; padding-top: 10px; padding-bottom: 10px; }
  .navtabs { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; padding-bottom: 2px; }
  .user-chip span:last-child { display: none; }
  .user-chip { padding: 3px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: 600 14px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.2s var(--ease), transform 0.2s var(--ease), color 0.15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn-primary { border: 0; background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px -10px rgba(108, 92, 231, 0.8); }
.btn-primary:hover { color: #fff; box-shadow: 0 12px 26px -10px rgba(108, 92, 231, 0.9); transform: translateY(-1px); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--brand-50); border-color: transparent; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-wa { border: 0; background: #1FAF6B; color: #fff; }
.btn-wa:hover { color: #fff; background: #17985C; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- tabs & pills ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: 500 13.5px/1.2 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab[aria-selected="true"], .tab[aria-current="true"] { border-color: var(--brand); background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--ring); }
.count { display: inline-grid; min-width: 20px; height: 20px; padding: 0 6px; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 600; }
.tab[aria-selected="true"] .count, .tab[aria-current="true"] .count { background: var(--brand); color: #fff; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.segmented a { padding: 6px 13px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 13px; white-space: nowrap; }
.segmented a:hover { background: var(--surface-2); color: var(--text); }
.segmented a[aria-current="true"] { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }

/* ---------- cards ---------- */
.card { position: relative; min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 16px; }
.card-head .meta { color: var(--text-3); font-size: 12.5px; }
.card-head .link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 18px 22px 0; }
.hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--brand-100);
  border-radius: var(--radius);
  background: var(--brand-50);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}
.hint svg.icon { color: var(--brand); margin-top: 1px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.layout > .main, .layout > .aside { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr; } }
.kpi { padding: 18px 20px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-title { color: var(--text); font-weight: 600; font-size: 15px; }
.kpi-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 18px; }
.kpi-value { color: var(--text); font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.kpi-compare { color: var(--text-3); font-size: 12.5px; text-align: right; }
.delta { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.delta.up { background: var(--success-50); color: var(--success); }
.delta.down { background: var(--danger-50); color: var(--danger); }

/* ---------- status & chips ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  border-radius: 8px;
  background: var(--bg);
  color: var(--c);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new { --c: var(--cyan); --bg: var(--cyan-50); }
.st-no_answer { --c: var(--warning); --bg: var(--warning-50); }
.st-contacted { --c: var(--info); --bg: var(--info-50); }
.st-quote_sent { --c: var(--brand-600); --bg: var(--brand-50); }
.st-meeting { --c: var(--orange); --bg: var(--orange-50); }
.st-booked { --c: var(--success); --bg: var(--success-50); }
.st-lost { --c: var(--gray); --bg: var(--gray-50); }
.st-invalid { --c: var(--danger); --bg: var(--danger-50); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--dotc, var(--cat-other)); }
.temp { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.t-hot { background: var(--danger-50); color: var(--danger); }
.t-warm { background: var(--warning-50); color: var(--warning); }
.t-cold { background: var(--info-50); color: var(--info); }

/* avatars */
.avatar { display: inline-grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.avatar-lg { width: 76px; height: 76px; font-size: 24px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.tone-0 { background: #ECE9FD; color: #5A4AD4; }
.tone-1 { background: #E3F5EE; color: #12805A; }
.tone-2 { background: #E6F0FD; color: #2F6FD0; }
.tone-3 { background: #FDEEE4; color: #B5530F; }
.tone-4 { background: #FCE8F1; color: #B83A73; }
.tone-5 { background: #FFF3D9; color: #93620A; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-text { display: block; min-width: 0; flex: 1 1 auto; }
.who-name { display: block; max-width: 100%; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-sub { display: block; max-width: 100%; color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data .who-name, .data .who-sub { max-width: 260px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; color: var(--text-2); font-size: 13.5px; }
.data th { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 12.5px; font-weight: 500; text-align: left; white-space: nowrap; }
.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover td { background: var(--surface-2); }
.data tr[data-href] { cursor: pointer; }
.data th:first-child, .data td:first-child { padding-left: 22px; }
.data th:last-child, .data td:last-child { padding-right: 22px; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data .strong { color: var(--text); font-weight: 600; }
.data .sort { color: inherit; }
.data .sort:hover { color: var(--text); }
.task > b { display: block; color: var(--text); font-weight: 600; white-space: nowrap; }
.task-sub { display: block; margin-top: 4px; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.clip { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-key { display: block; color: var(--text-3); font-size: 11px; font-weight: 400; }
table.hide-quiz .g-quiz, table.hide-work .g-work, table.hide-source .g-source,
table.hide-review .g-review, table.hide-contacts .g-contacts { display: none; }
.table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); }
.empty { padding: 28px 22px; color: var(--text-3); text-align: center; }

.pagination { display: inline-flex; gap: 4px; }
.pagination a, .pagination span { display: inline-grid; min-width: 34px; height: 34px; padding: 0 10px; place-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--text-2); font-weight: 500; }
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination [aria-current="page"] { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; align-content: start; }
.field label, .label { color: var(--text); font-size: 13px; font-weight: 500; }
.input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: 14px/1.4 var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; min-height: 92px; padding: 10px 14px; resize: vertical; }
select.input { padding-right: 34px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238F8EA4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: #CFCDE0; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; }
.search { position: relative; display: flex; align-items: center; }
.search svg.icon { position: absolute; left: 13px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 40px; }
.toolbar .input { width: auto; min-width: 150px; height: 38px; font-size: 13.5px; }
.toolbar .search .input { min-width: 260px; }
.toolbar .date { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }   /* notes side by side on wide screens */
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.fieldset-title { margin: 24px 0 12px; color: var(--text); font-size: 14px; font-weight: 600; }
.alert { margin-bottom: 14px; padding: 12px 16px; border: 1px solid; border-radius: var(--radius); font-size: 13.5px; }
.alert-success { border-color: #BFE7D3; background: var(--success-50); color: var(--success); }
.alert-info { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-600); }
.alert-danger { border-color: #F4C9C7; background: var(--danger-50); color: var(--danger); }

/* column chooser */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; z-index: 20; display: grid; gap: 2px; min-width: 220px; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-lg); }
.dropdown-menu label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); cursor: pointer; }
.dropdown-menu label:hover { background: var(--surface-2); }
.dropdown-menu input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }

/* ---------- charts ---------- */
/* dot-matrix chart: one column per day (or week), one dot per lead; dots keep their size at any width */
.dotchart { --plot: 230px; --slot: calc(var(--plot) / var(--rows)); padding-left: 30px; }
.dc-plot { position: relative; height: var(--plot); }
.dc-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--grid); }
.dc-line span { position: absolute; left: -30px; top: -8px; width: 22px; color: var(--text-3); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }
.dc-cols { position: absolute; inset: 0; display: flex; gap: 2px; }
.dc-col { flex: 1 1 0; min-width: 0; height: 100%; container-type: inline-size; border-radius: 6px; }
.dc-col:focus { outline: none; background: rgba(108, 92, 231, 0.06); }
.dc-stack {
  --d: min(12px, 64cqw, calc(var(--slot) - 3px));
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: calc(var(--slot) - var(--d));
  height: 100%;
  padding-bottom: calc((var(--slot) - var(--d)) / 2);
}
.dc-stack i { flex: none; width: var(--d); height: var(--d); border-radius: 50%; background: var(--dot); transition: background-color 0.15s; }
.dc-col.peak i, .dc-col:hover i, .dc-col:focus i { background: var(--accent); }
.dc-badge { flex: none; padding: 1px 7px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600; line-height: 1.5; }
.dc-axis { display: flex; gap: 2px; margin: 8px 0 0 30px; }
.dc-axis span { display: flex; flex: 1 1 0; justify-content: center; min-width: 0; color: var(--text-3); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dc-axis em { padding: 1px 7px; border-radius: 6px; background: var(--accent); color: #fff; font-style: normal; font-weight: 600; }
.chart-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 760px) { .chart-layout { grid-template-columns: 1fr; } }
.chart-side { display: flex; flex-direction: column; gap: 12px; }
.legend { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--text); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--k); }
.chart-side .hint { margin-top: 0; }
.chart-side .btn { margin-top: auto; }
.table-view { margin-top: 10px; font-size: 13px; }
.table-view summary { color: var(--brand); font-weight: 600; cursor: pointer; }
.table-view .table-wrap { max-height: 300px; margin-top: 10px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }

.bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; align-items: center; gap: 12px; border-radius: var(--radius-sm); }
.bar-label { color: var(--text); font-size: 13px; line-height: 1.3; overflow-wrap: break-word; hyphens: auto; }
.bar-label small { display: block; color: var(--text-3); font-size: 11.5px; }
.bar-label a { color: inherit; }
.bar-label a:hover { color: var(--brand); }
.bar-area { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bars { --reserve: 92px; }   /* room kept for the value label at the bar tip */
.bar-fill { flex: none; width: calc(var(--w) * (100% - var(--reserve))); min-width: 3px; height: 14px; border-radius: 0 4px 4px 0; background: var(--fill, var(--accent)); transition: filter 0.15s; }
.bar-value { color: var(--text-2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bars li:hover .bar-fill, .bars li:focus .bar-fill { filter: brightness(1.1) saturate(1.1); }
.bars li:focus { outline: 2px solid var(--brand); outline-offset: 3px; }

/* stacked source bar */
.stack { display: flex; gap: 2px; height: 44px; }
.stack span { min-width: 6px; border-radius: 4px; background: var(--fill); }
.stack span:hover { filter: brightness(1.08); }
.stack-labels { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 10px; margin-top: 14px; }
.stack-labels div { padding-left: 10px; border-left: 3px solid var(--fill); }
.stack-labels b { display: block; color: var(--text); font-size: 20px; font-weight: 600; line-height: 1.1; }
.stack-labels span { color: var(--text-3); font-size: 12px; }

/* agreements: booked vs in negotiation */
.split { display: flex; gap: 2px; height: 44px; }
.split span { min-width: 6px; border-radius: 4px; background: var(--fill); }
.split-labels { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.split-labels b { display: block; color: var(--text); font-size: 26px; font-weight: 600; line-height: 1.1; }
.split-labels span { color: var(--text-3); font-size: 12.5px; }
.split-labels div:last-child { text-align: right; }

/* meter of dots */
.meter-value { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.meter-value b { color: var(--text); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.meter { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 5px; margin-top: 16px; }
.meter i { aspect-ratio: 1; border-radius: 50%; background: var(--meter-track); }
.meter i.on { background: var(--dot); }

/* hours */
.hours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; align-items: end; height: 130px; }
.hours span { display: block; min-height: 3px; max-width: 24px; margin: 0 auto; width: 100%; border-radius: 4px 4px 0 0; background: var(--deemph); transition: filter 0.15s; }
.hours span.peak { background: var(--accent); }
.hours span:hover, .hours span:focus { filter: brightness(0.94); outline: none; }
.hours-axis { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; overflow: visible; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.hours-axis span:not(:nth-child(3n + 1)) { visibility: hidden; }

.tooltip { position: fixed; z-index: 60; max-width: 260px; padding: 8px 12px; border-radius: 10px; background: var(--text); color: #fff; font-size: 12.5px; line-height: 1.4; box-shadow: var(--shadow-lg); pointer-events: none; opacity: 0; transition: opacity 0.12s; }
.tooltip.show { opacity: 1; }
.tooltip strong { display: block; font-size: 14px; }

/* ---------- attention list ---------- */
.tasks { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tasks a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; color: inherit; transition: background-color 0.15s; }
.tasks a:hover { background: var(--brand-50); }
.tasks li:first-child a { background: var(--surface-2); }
.tasks li:first-child a:hover { background: var(--brand-50); }
.task-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--bg); color: var(--c); }
.task-title { display: block; color: var(--text); font-weight: 600; }
.task-meta { display: block; color: var(--text-3); font-size: 12.5px; }
.task-count { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tasks svg.chev { color: var(--text-3); width: 16px; height: 16px; }

/* ---------- pipeline board ---------- */
.board { display: grid; grid-auto-columns: minmax(214px, 1fr);   /* all 8 stages fit a 1920px screen */ grid-auto-flow: column; gap: 12px; align-items: start; overflow-x: auto; padding: 2px 2px 14px; }
.column { min-width: 0; min-height: 260px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255, 255, 255, 0.55); transition: box-shadow 0.15s, border-color 0.15s; }
.column.drop { border-color: var(--brand); box-shadow: var(--ring); }
.column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 2px 12px; }
.column-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-height: 60px; }   /* cards never widen the column */
.kcard { display: block; min-width: 0; overflow: hidden; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; color: var(--text-2); box-shadow: var(--shadow-xs); cursor: grab; transition: box-shadow 0.15s, transform 0.15s var(--ease), border-color 0.15s; }
.kcard:hover { border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--text-2); }
.kcard.dragging { opacity: 0.5; }
.kcard-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.column-more { display: block; margin-top: 10px; font-size: 12.5px; font-weight: 600; text-align: center; }

/* ---------- quiz cards ---------- */
.qcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 18px 16px; text-align: center; transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
a.qcard { color: inherit; }
a.qcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: inherit; }
.ring { display: grid; width: 74px; height: 74px; margin-bottom: 10px; place-items: center; border-radius: 50%; background: conic-gradient(var(--rc, var(--accent)) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring-inner { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 50%; background: #fff; color: var(--text); font-weight: 600; font-size: 15px; }
.qcard h3 { font-size: 15px; }
.qcard .page-url { color: var(--text-3); font-size: 12px; }
.qstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.qstats span { display: block; color: var(--text-3); font-size: 11.5px; }
.qstats b { display: block; margin-top: 2px; color: var(--text); font-size: 14px; font-weight: 600; }
.qchips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 10px; }
.qchips span { padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; }

/* ---------- lead page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--text-2); font-weight: 500; }
.back:hover { color: var(--brand); }
.profile { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.profile .ring { width: 92px; height: 92px; margin-bottom: 8px; }
.profile .ring .avatar-lg { width: 82px; height: 82px; }
.profile h1 { font-size: 21px; }
.profile-sub { color: var(--text-3); font-size: 13px; }
.profile-actions { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.profile-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); text-align: left; }
.profile-stats .ps-wide { grid-column: 1 / -1; }
.ps-label { display: block; color: var(--text-3); font-size: 12px; }
.ps-value { display: block; margin-top: 4px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.lead-grid > div { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 1240px) { .lead-grid { grid-template-columns: 320px minmax(0, 1fr); } .lead-grid > div:last-child { grid-column: 1 / -1; } }
@media (max-width: 860px) { .lead-grid { grid-template-columns: 1fr; } }
.dl { display: grid; grid-template-columns: minmax(110px, 42%) 1fr; gap: 10px 14px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.dl dd small { display: block; color: var(--text-3); font-size: 12px; }
.history { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.history li { position: relative; padding-left: 18px; }
.history li::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-100); box-shadow: 0 0 0 3px var(--brand-50); }
.history .when { color: var(--text-3); font-size: 12px; }
.change { margin-top: 2px; color: var(--text-2); overflow-wrap: anywhere; }
.change b { color: var(--text); font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }

/* ---------- login ---------- */
.login-page { display: grid; min-height: calc(100vh - 88px); place-items: center; }
.login-card { width: min(420px, 100%); padding: 32px; }
.login-card .brand { margin-bottom: 22px; }
.login-card form { display: grid; gap: 14px; margin-top: 20px; }
.login-card .btn { height: 46px; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media (forced-colors: active) {
  .bar-fill, .dc-stack i, .stack span, .split span, .hours span, .meter i { forced-color-adjust: none; }
}
