/* TAZ Learning admin panel. Brand: Navy #0F2D4A, Teal #00B894, Blue #2563EB.
   Semantic colour tokens drive light + dark themes. No inline styles (CSP). */
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --navy: #0F2D4A; --teal: #00B894; --teal-dark: #007A63; --teal-light: #14D8BB; --blue: #2563EB;
  --bg: #F4F7FA; --surface: #FFFFFF; --surface-2: #F8FAFC; --surface-3: #F1F5F9; --hover: #F4FAF8;
  --line: #E5E7EB; --line-strong: #CBD5E1;
  --heading: #0F2D4A; --text: #334155; --text-strong: #1E293B; --muted: #5B6B80; --link: #007A63;
  --side-bg: #0F2D4A; --side-hover: #173B5E; --side-active: #22496F; --side-text: #C9D5E3; --side-line: rgba(255,255,255,.08);
  --btn-primary-bg: #00B894; --btn-primary-hover: #14D8BB; --btn-primary-text: #0F2D4A;
  --btn-strong-bg: #0F2D4A; --btn-strong-hover: #173B5E; --btn-strong-text: #FFFFFF;
  --danger: #B42318; --danger-bg: #FEF3F2; --danger-line: #FECDCA;
  --warn: #9A4D00; --warn-bg: #FFF4E5; --warn-line: #FEDF89;
  --ok: #067647; --ok-bg: #ECFDF3; --ok-line: #ABEFC6;
  --info: #1E40AF; --info-bg: #EAF1FE; --info-line: #BFD3FE;
  --violet: #5925DC; --violet-bg: #F4F3FF; --sky: #075985; --sky-bg: #F0F9FF; --teal-bg: #E6F8F4;
  --focus: rgba(0,184,148,.35);
  --shadow: 0 1px 2px rgba(15,45,74,.05), 0 8px 24px rgba(15,45,74,.06);
  --shadow-lg: 0 24px 60px rgba(15,45,74,.28);
  --radius: 12px; --radius-sm: 8px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --pad: clamp(16px, 2.4vw, 36px);
  --side-w: 244px;
  --control-h: 40px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A1624; --surface: #0F2133; --surface-2: #132A40; --surface-3: #17304A; --hover: #16334C;
  --line: #22394F; --line-strong: #2F4B66;
  --heading: #EEF3F8; --text: #C8D3DF; --text-strong: #E6EDF5; --muted: #8FA2B7; --link: #3FE0C0;
  --side-bg: #071321; --side-hover: #102436; --side-active: #16324B; --side-text: #B7C6D6; --side-line: rgba(255,255,255,.06);
  --btn-strong-bg: #E6EDF5; --btn-strong-hover: #FFFFFF; --btn-strong-text: #0F2D4A;
  --danger: #FDA29B; --danger-bg: #3A1614; --danger-line: #7A271A;
  --warn: #FEC84B; --warn-bg: #3A2A0B; --warn-line: #7A4A06;
  --ok: #75E0A7; --ok-bg: #0E2E22; --ok-line: #085D3A;
  --info: #9DBBFF; --info-bg: #14264A; --info-line: #22407A;
  --violet: #C3B5FD; --violet-bg: #251C4A; --sky: #7CD4FD; --sky-bg: #0B2A3F; --teal-bg: #0C2F2A;
  --focus: rgba(20,216,187,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0A1624; --surface: #0F2133; --surface-2: #132A40; --surface-3: #17304A; --hover: #16334C;
    --line: #22394F; --line-strong: #2F4B66;
    --heading: #EEF3F8; --text: #C8D3DF; --text-strong: #E6EDF5; --muted: #8FA2B7; --link: #3FE0C0;
    --side-bg: #071321; --side-hover: #102436; --side-active: #16324B; --side-text: #B7C6D6; --side-line: rgba(255,255,255,.06);
    --btn-strong-bg: #E6EDF5; --btn-strong-hover: #FFFFFF; --btn-strong-text: #0F2D4A;
    --danger: #FDA29B; --danger-bg: #3A1614; --danger-line: #7A271A;
    --warn: #FEC84B; --warn-bg: #3A2A0B; --warn-line: #7A4A06;
    --ok: #75E0A7; --ok-bg: #0E2E22; --ok-line: #085D3A;
    --info: #9DBBFF; --info-bg: #14264A; --info-line: #22407A;
    --violet: #C3B5FD; --violet-bg: #251C4A; --sky: #7CD4FD; --sky-bg: #0B2A3F; --teal-bg: #0C2F2A;
    --focus: rgba(20,216,187,.4);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.lock { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--link); }
h1, h2, h3 { color: var(--heading); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(20px, 1.2vw + 14px, 26px); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 .8em; }
.boot { padding: 48px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.break { overflow-wrap: anywhere; }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, #1B4A74 0%, transparent 60%), #0F2D4A; }
.auth__card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.auth__head { background: #0F2D4A; padding: 24px 28px 20px; border-bottom: 4px solid var(--teal); }
.auth__head img { height: 40px; display: block; }
.auth__body { padding: 26px 28px 28px; }
.auth__body h1 { font-size: 20px; }
.qr { display: grid; place-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 12px 0; background: #FFFFFF; }
.qr svg { width: 180px; height: 180px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 13px; letter-spacing: .08em; word-break: break-all; background: var(--surface-3); padding: 8px 10px; border-radius: 6px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; font-family: ui-monospace, Consolas, monospace; margin: 12px 0; }
.codes span { background: var(--surface-3); padding: 6px 8px; border-radius: 6px; text-align: center; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; z-index: 40; }
.side__brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--side-line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side__brand img { height: 34px; display: block; }
.side__brand span { display: block; margin-top: 6px; font-size: 11px; letter-spacing: .16em; color: var(--teal); font-weight: 700; }
.side__close { display: none !important; }
.nav { list-style: none; margin: 0; padding: 12px 10px; display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 42px; border-radius: var(--radius-sm); color: var(--side-text); text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--side-hover); color: #FFFFFF; }
.nav a[aria-current="page"] { background: var(--side-active); color: #FFFFFF; box-shadow: inset 3px 0 0 var(--teal); }
.nav svg { width: 19px; height: 19px; flex: none; }
.nav .count { margin-left: auto; background: var(--teal); color: #0F2D4A; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.side__foot { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid var(--side-line); font-size: 12px; display: grid; gap: 10px; }
.side__foot .email { color: #FFFFFF; word-break: break-all; }
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255,255,255,.06); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.theme-switch button { border: 0; background: transparent; color: var(--side-text); font: 600 12px/1 var(--font); padding: 7px 4px; min-height: 30px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.theme-switch button svg { width: 14px; height: 14px; flex: none; }
.theme-switch button[aria-pressed="true"] { background: var(--side-active); color: #FFFFFF; }
.backdrop { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { padding: 28px var(--pad) 56px; width: 100%; }
.page__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.page__head > div:first-child { min-width: 0; flex: 1 1 320px; }
.page__head p { margin: 2px 0 0; }
.page__head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crumb { font-size: 12.5px; margin-bottom: 4px; }
.crumb a { text-decoration: none; }
.loading { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 80; background: linear-gradient(90deg, var(--teal), var(--blue)); transform-origin: left; animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0% { transform: scaleX(0); } 70% { transform: scaleX(.85); } 100% { transform: scaleX(1); opacity: 0; } }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(14px, 1.4vw, 22px) clamp(14px, 1.6vw, 24px); min-width: 0; container-type: inline-size; }
.stack { display: grid; gap: 16px; min-width: 0; align-content: start; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card__head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid + .card, .card + .grid, .grid + .grid, .card + .card, .alert + .grid, .table-wrap + .card { margin-top: 16px; }
.grid > .card + .card, .stack > * + * { margin-top: 0; }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.grid--dash { grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .grid--dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 2100px) { .grid--dash { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid--main { grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 440px); align-items: start; }
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--teal), var(--blue)); }
.stat__label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat__value { font-size: clamp(22px, 1.4vw + 12px, 30px); font-weight: 800; color: var(--heading); line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__sub { font-size: 12.5px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 14px; min-height: var(--control-h); font: 600 13.5px/1.2 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn--primary:hover:not(:disabled) { background: var(--btn-primary-hover); }
.btn--navy { background: var(--btn-strong-bg); color: var(--btn-strong-text); }
.btn--navy:hover:not(:disabled) { background: var(--btn-strong-hover); }
.btn--ghost { background: var(--surface); color: var(--heading); border-color: var(--line); }
.btn--ghost:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn--danger:hover:not(:disabled) { background: var(--danger-bg); }
.btn--link { background: none; border: 0; color: var(--link); padding: 0 6px; min-height: 32px; }
.btn--icon { padding: 0; width: var(--control-h); }
.btn--sm { min-height: 34px; padding: 0 10px; font-size: 12.5px; }
.btn--block { width: 100%; }
.side .btn--ghost, .topbar .btn--ghost { background: transparent; color: var(--side-text); border-color: rgba(255,255,255,.18); }
.side .btn--ghost:hover, .topbar .btn--ghost:hover { background: var(--side-hover); color: #FFFFFF; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.copy { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 3px 4px; border-radius: 4px; vertical-align: middle; line-height: 0; }
.copy svg { width: 14px; height: 14px; }
.copy:hover { color: var(--link); background: var(--surface-3); }

label, .label { display: block; font-weight: 600; color: var(--heading); font-size: 13px; margin-bottom: 5px; }
.field { margin-bottom: 14px; min-width: 0; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], input[type="url"], input[type="tel"], select, textarea {
  width: 100%; min-height: var(--control-h); font: 14px/1.4 var(--font); color: var(--text-strong); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 11px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text); opacity: 1; }
textarea { min-height: 90px; resize: vertical; }
textarea.tall { min-height: 220px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, .copy:focus-visible, .theme-switch button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--teal); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--text); min-height: var(--control-h); margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); margin: 0; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > * { flex: 1; min-width: 0; }
.inline > .btn { flex: none; }

.alert { border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 14px; font-size: 13.5px; border: 1px solid; }
.alert--error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.alert--warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.alert--ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert--info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert a { color: inherit; font-weight: 700; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; background: var(--surface-3); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.badge--new, .badge--draft { background: var(--info-bg); color: var(--info); }
.badge--contacted, .badge--qualified { background: var(--sky-bg); color: var(--sky); }
.badge--proposal, .badge--sent { background: var(--violet-bg); color: var(--violet); }
.badge--won, .badge--accepted { background: var(--ok-bg); color: var(--ok); }
.badge--lost, .badge--declined, .badge--spam { background: var(--danger-bg); color: var(--danger); }
.badge--demo { background: var(--warn-bg); color: var(--warn); }
.badge--quote { background: var(--teal-bg); color: var(--link); }

/* Tables: rows when there is room, stacked cards when the container is narrow (container queries). */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); container-type: inline-size; overflow: hidden; box-shadow: var(--shadow); }
.card .table-wrap { box-shadow: none; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.right { text-align: right; }
.table th button.sort { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.table th button.sort:focus-visible { outline: 3px solid var(--focus); }
.table th button.sort[aria-sort="ascending"]::after { content: "▲"; font-size: 9px; }
.table th button.sort[aria-sort="descending"]::after { content: "▼"; font-size: 9px; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.row-link { cursor: pointer; }
.table tr.row-link:hover td { background: var(--hover); }
.table .title { font-weight: 700; color: var(--heading); display: inline-flex; align-items: center; gap: 6px; }
.table .title svg, .lead-cell svg { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -2px; display: inline-block; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--heading); font-size: 15px; margin-bottom: 4px; }
@container (max-width: 640px) {
  .table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table--cards tr:last-child { border-bottom: 0; }
  .table--cards td { border: 0; padding: 3px 0; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; text-align: right; }
  .table--cards td::before { content: attr(data-label); flex: none; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; color: var(--muted); text-align: left; }
  .table--cards td.lead-cell { display: block; text-align: left; padding-bottom: 6px; }
  .table--cards td.lead-cell::before { content: none; }
  .table--cards tr.row-link:hover td { background: transparent; }
  .table--cards tr.row-link:hover { background: var(--hover); }
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters > * { width: auto; flex: 0 1 auto; }
.filters input[type="search"] { min-width: 240px; flex: 1 1 280px; }
.filters input:not([type="search"]), .filters select { width: auto; flex: 0 1 auto; }
.filters input[type="date"] { width: 160px; }
.filters .check { padding: 0 4px; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; border: 1px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--heading); }
.tabs a[aria-current="true"] { background: var(--surface); color: var(--heading); border-color: var(--line); box-shadow: var(--shadow); }
.pager { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; margin-top: 16px; padding: 12px 0 6px; border-top: 1px solid var(--line); font-size: 13.5px; }
.pager__info { font-size: 13.5px; }
.pager__controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.pager__nav { display: flex; align-items: center; gap: 4px; }
.pager__pills { display: flex; align-items: center; gap: 3px; }
.pager__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--heading); text-decoration: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s ease; user-select: none; }
.pager__btn:hover { background: var(--surface-2); border-color: var(--teal); }
.pager__btn--active { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 700; cursor: default; }
.pager__btn--active:hover { background: var(--teal); }
.pager__btn--disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.pager__dots { padding: 0 4px; color: var(--muted); }
.pager__jump, .pager__size { display: flex; align-items: center; gap: 6px; }


dl.details { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); margin: 0; }
dl.details dt, dl.details dd { padding: 9px 0; border-top: 1px solid var(--line); margin: 0; }
dl.details dt { color: var(--muted); font-size: 13px; padding-right: 12px; }
dl.details dd { color: var(--text-strong); font-weight: 500; overflow-wrap: anywhere; }
dl.details > :nth-child(1), dl.details > :nth-child(2) { border-top: 0; }
@container (max-width: 460px) {
  dl.details { grid-template-columns: 1fr; }
  dl.details dd { border-top: 0; padding-top: 0; }
}
.message { background: var(--surface-2); border-left: 4px solid var(--teal); border-radius: var(--radius-sm); padding: 12px 14px; white-space: pre-wrap; color: var(--text-strong); overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12px; color: var(--muted); }
.note { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; background: var(--surface-2); overflow-wrap: anywhere; }
.note + .note { margin-top: 8px; }

.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(70px, 140px) 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__track { display: block; height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar__fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--blue)); border-radius: 999px; }
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.pipeline a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--muted); font-size: 12.5px; font-weight: 600; background: var(--surface-2); }
.pipeline a strong { color: var(--heading); font-size: 20px; font-weight: 800; }
.pipeline a:hover { border-color: var(--teal); }

.totals { display: grid; gap: 6px; margin-top: 4px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals .grand { border-top: 2px solid var(--teal); padding-top: 8px; margin-top: 4px; font-size: 18px; font-weight: 800; color: var(--heading); }
.sticky { position: sticky; top: 16px; }

/* Quote line items: a row layout when the card is wide, stacked blocks when narrow. */
.items-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.items-head, .item { display: grid; grid-template-columns: minmax(180px, 1fr) 80px 112px 170px 108px 34px; gap: 10px; align-items: start; padding: 12px; }
.items-head { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding-top: 10px; padding-bottom: 10px; }
.items-head > :nth-child(5) { text-align: right; }
.item + .item { border-top: 1px solid var(--line); }
.item__main { display: grid; gap: 6px; min-width: 0; }
.item__main textarea { min-height: 42px; }
.item .lbl { display: none; }
.item__total { text-align: right; font-weight: 800; color: var(--heading); padding-top: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item__disc { display: flex; gap: 4px; }
.item__disc select { flex: 0 0 70px; padding-right: 4px; }
.item__remove { padding-top: 3px; }
.items-empty { padding: 20px; text-align: center; color: var(--muted); }
@container (max-width: 780px) {
  .items-head { display: none; }
  .item { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; position: relative; padding: 14px; }
  .item__main { grid-column: 1 / -1; padding-right: 40px; }
  .item__discwrap { grid-column: 1 / -1; }
  .item .lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
  .item__total { grid-column: 1 / -1; display: flex; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 10px; }
  .item__total::before { content: "Amount"; font-weight: 700; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
  .item__remove { position: absolute; top: 10px; right: 8px; padding: 0; }
}

.preview-frame { width: 100%; height: clamp(520px, 72vh, 960px); border: 1px solid var(--line); border-radius: var(--radius); background: #F8FAFC; display: block; }
.placeholders code { background: var(--surface-3); color: var(--text-strong); padding: 1px 6px; border-radius: 4px; font-size: 12px; margin: 0 2px 4px 0; display: inline-block; }

.savebar { display: none; }

dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(5,15,28,.55); }
.dialog__body { padding: 22px 24px; overflow-y: auto; }
.dialog__foot { padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 90; background: #0F2D4A; color: #FFFFFF; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: min(420px, calc(100vw - 32px)); border-left: 4px solid var(--teal); }
.toast--error { border-left-color: #F97066; }

/* ---------- Big monitors ---------- */
@media (min-width: 1800px) {
  :root { --side-w: 264px; }
  body { font-size: 14.5px; }
}

/* ---------- Tablets & small laptops: icon rail ---------- */
@media (max-width: 1180px) and (min-width: 861px) {
  :root { --side-w: 78px; }
  .side__brand { justify-content: center; padding: 18px 8px 14px; }
  .side__brand img { height: 30px; width: 34px; object-fit: cover; object-position: left center; }
  .side__brand span, .nav a > span:not(.count), .side__foot .muted, .side__foot .email, .theme-switch button span { display: none; }
  .nav { padding: 12px 8px; }
  .nav a { justify-content: center; padding: 10px; position: relative; }
  .nav .count { position: absolute; top: 3px; right: 5px; padding: 0 5px; font-size: 10px; }
  .side__foot { padding: 12px 8px; }
  .theme-switch { grid-template-columns: 1fr; }
  .side__foot .btn { padding: 0 4px; font-size: 11px; }
  .grid--main { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}

/* ---------- Phones & portrait tablets: off-canvas menu ---------- */
@media (max-width: 860px) {
  :root { --control-h: 44px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); visibility: hidden; }
  .shell.menu-open .side { transform: none; visibility: visible; }
  .side__close { display: inline-flex !important; }
  .shell.menu-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(5,15,28,.5); z-index: 35; }
  .topbar { display: flex; align-items: center; gap: 12px; background: #0F2D4A; padding: 6px 10px 6px 16px; position: sticky; top: 0; z-index: 30; min-height: 56px; }
  :root[data-theme="dark"] .topbar { background: var(--side-bg); border-bottom: 1px solid var(--side-line); }
  .topbar img { height: 28px; flex: none; }
  .topbar__title { color: #FFFFFF; font-weight: 700; font-size: 15px; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .page { padding: 18px 14px 40px; }
  .grid--main { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], input[type="url"], input[type="tel"], select, textarea { font-size: 16px; } /* no iOS zoom */
  .btn--sm { min-height: 40px; }
  .copy { padding: 8px; }
  .page__head .actions { width: 100%; }
  .page__head .actions > .btn { flex: 1 1 calc(50% - 4px); }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters input[type="search"] { grid-column: 1 / -1; min-width: 0; }
  .filters input[type="date"], .filters select { width: 100%; }
  .filters > .btn, .filters > .btn--link { width: 100%; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .has-savebar .page { padding-bottom: 104px; }
  .savebar { display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.1); }
  .savebar .btn { flex: 1; }
  .savebar__total { flex: 1.1; display: flex; flex-direction: column; justify-content: center; font-size: 11px; color: var(--muted); line-height: 1.25; min-width: 0; }
  .savebar__total strong { font-size: 16px; color: var(--heading); font-variant-numeric: tabular-nums; }
  .has-savebar .toast { bottom: 84px; }
  .dialog__foot .btn { flex: 1; }
}
@media (max-width: 400px) {
  .filters { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .side, .topbar, .savebar, .actions, .filters, .tabs, .toast, .backdrop { display: none !important; }
  .shell { display: block; }
  .card, .table-wrap { box-shadow: none; break-inside: avoid; }
}

/* ---------- Sign-in (split screen) ---------- */
.auth2 { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); background: var(--bg); }
.auth2__brand { position: relative; overflow: hidden; background: radial-gradient(900px 520px at 0% 0%, #1B4A74 0%, transparent 60%), linear-gradient(160deg, #0F2D4A 0%, #0A2039 55%, #07182B 100%); color: #D6E1EC; display: flex; align-items: center; padding: clamp(32px, 6vw, 88px); isolation: isolate; }
.auth2__brand .glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; z-index: -1; }
.glow--a { width: 420px; height: 420px; background: #00B894; right: -120px; top: -80px; animation: drift 14s ease-in-out infinite alternate; }
.glow--b { width: 360px; height: 360px; background: #2563EB; left: -100px; bottom: -120px; opacity: .45; animation: drift 18s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 40px) scale(1.12); } }
.grid-bg { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); }
.auth2__line { position: absolute; left: 0; right: 0; bottom: 8%; width: 100%; height: 42%; z-index: -1; }
.auth2__line path { fill: none; stroke: url(#gl); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.4s .3s ease-out forwards; filter: drop-shadow(0 0 10px rgba(0,184,148,.6)); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.auth2__brandinner { max-width: 520px; }
.auth2__brandinner img { height: 56px; display: block; margin-bottom: clamp(28px, 5vh, 56px); }
.auth2__brandinner h2 { color: #FFFFFF; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.1; letter-spacing: -.02em; font-weight: 800; margin-bottom: 28px; }
.auth2__brandinner h2 span { background: linear-gradient(90deg, #14D8BB, #60A5FA); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth2__points { list-style: none; margin: 0 0 36px; padding: 0; display: grid; gap: 16px; }
.auth2__points li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 1.5; }
.auth2__points svg { width: 22px; height: 22px; flex: none; padding: 7px; box-sizing: content-box; border-radius: 10px; background: rgba(0,184,148,.14); color: #14D8BB; border: 1px solid rgba(20,216,187,.25); }
.auth2__points strong { color: #FFFFFF; }
.auth2__tag { font-size: 12px; letter-spacing: .28em; font-weight: 700; color: #14D8BB; margin: 0; }
.auth2__panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px clamp(20px, 5vw, 64px); gap: 18px; }
.auth2__card { width: 100%; max-width: 420px; }
.auth2__card h1 { font-size: clamp(26px, 2vw + 12px, 34px); margin-bottom: 6px; }
.auth2__card > p.muted { margin-bottom: 26px; }
.auth2__eyebrow { color: var(--link); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.auth2__mobilelogo { display: none; }
.auth2__remember { margin: -4px 0 16px; font-size: 13.5px; }
.auth2__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: 12.5px; }
.ifield { position: relative; }
.ifield > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.ifield input { padding-left: 42px; min-height: 48px; font-size: 15px; border-radius: 10px; }
.ifield input:focus + .ifield__btn, .ifield:focus-within > svg { color: var(--link); }
.ifield__btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); width: 38px; height: 38px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.ifield__btn:hover { background: var(--surface-3); color: var(--heading); }
.ifield__btn:focus-visible { outline: 3px solid var(--focus); }
.ifield__btn svg { width: 19px; height: 19px; }
.ifield:has(.ifield__btn) input { padding-right: 48px; }
.caps { color: var(--warn); font-weight: 600; }
.btn--lg { min-height: 50px; font-size: 15px; border-radius: 10px; box-shadow: 0 8px 20px rgba(0,184,148,.25); }
.theme-switch--auth, .theme-switch--page { background: var(--surface-3); display: inline-grid; }
.theme-switch--auth button, .theme-switch--page button { color: var(--muted); }
.theme-switch--auth button[aria-pressed="true"], .theme-switch--page button[aria-pressed="true"] { background: var(--surface); color: var(--heading); box-shadow: var(--shadow); }
.theme-switch--page { min-width: 280px; }
@media (max-width: 900px) {
  .auth2 { grid-template-columns: 1fr; }
  .auth2__brand { display: none; }
  .auth2__panel { background: radial-gradient(700px 360px at 50% -10%, rgba(0,184,148,.18), transparent 70%), var(--bg); justify-content: flex-start; padding-top: 0; }
  .auth2__mobilelogo { display: block; height: 44px; margin: 0 auto 28px; padding: 14px 20px; background: #0F2D4A; border-radius: 0 0 16px 16px; box-sizing: content-box; }
  .auth2__card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; box-shadow: var(--shadow); }
}

/* ---------- Bulk selection, notes, misc ---------- */
.selcell { width: 44px; }
.selcell input { width: 18px; height: 18px; accent-color: var(--teal); cursor: pointer; margin: 2px 0 0; }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius); background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info); position: sticky; top: 8px; z-index: 5; }
.bulkbar select { width: auto; min-width: 150px; }
@container (max-width: 640px) {
  .table--cards td.selcell { position: absolute; right: 14px; top: 12px; width: auto; padding: 0; }
  .table--cards td.selcell::before { content: none; }
  .table--cards tr { position: relative; }
  .table--cards td.lead-cell { padding-right: 36px; }
}
.note__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.notes { margin-top: 12px; }
.stat--link { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s; }
.stat--link:hover { border-color: var(--teal); transform: translateY(-1px); }
.narrow { max-width: 980px; }
.placeholder { padding: 0; }
.placeholder code { cursor: pointer; }
@media (max-width: 860px) {
  .bulkbar { top: 64px; }
  .theme-switch--page { min-width: 0; width: 100%; }
}
.placeholder { line-height: 1.4; padding: 2px; }
@container (max-width: 640px) {
  .table--cards td { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
  .table--cards td > * { min-width: 0; }
}
@media (max-width: 860px) {
  .selcell input, .check input { width: 24px; height: 24px; }
  .theme-switch button { min-height: 40px; }
  .copy { min-width: 36px; min-height: 36px; display: inline-grid; place-items: center; }
  .placeholder { min-height: 36px; padding: 4px; }
}
.auth2__line { bottom: 0; height: 30%; opacity: .9; }
.auth2__brandinner { position: relative; z-index: 1; }
@media (max-width: 900px) {
  .auth2__panel { padding: 24px 16px 32px; justify-content: center; }
  .auth2__card { padding: 0 22px 26px; overflow: hidden; }
  .auth2__mobilelogo { display: block; width: auto; height: 40px; margin: 0 -22px 26px; padding: 22px; box-sizing: content-box; background: linear-gradient(135deg, #0F2D4A 0%, #0B3B4A 60%, #0E5A55 100%); border-radius: 0; border-bottom: 4px solid var(--teal); object-fit: contain; object-position: left center; }
}
.shell { background: linear-gradient(to right, var(--side-bg) var(--side-w), var(--bg) var(--side-w)); }
@media (max-width: 900px) {
  .auth2__mobilelogo { display: block; width: auto; height: auto; margin: 0 -22px 26px; padding: 20px 22px; background: linear-gradient(135deg, #0F2D4A 0%, #0B3B4A 60%, #0E5A55 100%); border-bottom: 4px solid var(--teal); }
  .auth2__mobilelogo img { height: 40px; display: block; }
}
@media (max-width: 860px) { .shell { background: var(--bg); } }

.filters__toggle { display: none; }
@media (max-width: 860px) {
  .filters__toggle { display: inline-flex; grid-column: 1 / -1; }
  .filters:not(.filters--open) > :not(input[type="search"]):not(.filters__toggle) { display: none; }
  .hide-phone { display: none !important; }
  .item__disc select { flex-basis: 96px; }
}
@container (max-width: 640px) {
  .table--cards td { flex-wrap: wrap; justify-content: flex-end; column-gap: 8px; }
  .table--cards td::before { margin-right: auto; }
  .table--cards td.lead-cell { display: block; }
}

/* Settings: security cards side by side; the audit log scrolls inside its card instead of stretching the page. */
.audit-scroll { max-height: 560px; overflow-y: auto; }
@media (min-width: 1000px) { #s-security { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .table .sort { min-height: 36px; } }

/* ---------- Analytics ---------- */
.tabs a[aria-current="page"] { background: var(--surface); color: var(--heading); border-color: var(--line); box-shadow: var(--shadow); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.toolbar .tabs { margin-bottom: 0; }
.delta { font-weight: 700; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.delta--up { color: var(--ok); }
.delta--down { color: var(--danger); }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-right: 6px; vertical-align: 1px; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,184,148,.55); } 100% { box-shadow: 0 0 0 9px rgba(0,184,148,0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.kpis--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); margin-bottom: 0; }
.h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.chart__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12.5px; margin-bottom: 8px; min-height: 20px; }
.key { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.key::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--teal); }
.key--views::before { background: var(--blue); }
.chart__read { margin-left: auto; }
.chart__plot { position: relative; height: clamp(180px, 22vw, 300px); }
.chart__plot svg { width: 100%; height: 100%; display: block; overflow: visible; touch-action: pan-y; }
.chart__max { position: absolute; top: -2px; left: 4px; pointer-events: none; }
.chart__grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 4 4; }
.chart__line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.chart__line--users { stroke: var(--teal); }
.chart__line--views { stroke: var(--blue); opacity: .75; }
.chart__area { fill: url(#ga-fill); }
.chart__stop1 { stop-color: var(--teal); stop-opacity: .22; }
.chart__stop2 { stop-color: var(--teal); stop-opacity: 0; }
.chart__cursor { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart__ticks { display: flex; justify-content: space-between; margin-top: 6px; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.steps-list li { padding-left: 4px; }
.steps-list em { font-style: normal; font-weight: 600; color: var(--heading); }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }

/* ---------- Website: page SEO ---------- */
.seo-list { display: grid; gap: 6px; margin-top: 12px; }
.seo { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.seo[open] { border-color: var(--line-strong); box-shadow: var(--shadow); }
.seo summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 12px; min-height: 44px; cursor: pointer; list-style: none; }
.seo summary::-webkit-details-marker { display: none; }
.seo summary::before { content: "›"; font-weight: 800; color: var(--muted); transition: transform .15s; }
.seo[open] summary::before { transform: rotate(90deg); }
.seo__url { font-size: 12.5px; color: var(--link); min-width: 0; overflow-wrap: anywhere; flex: 0 1 260px; }
.seo__title { flex: 1 1 240px; min-width: 0; color: var(--text-strong); font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo__body { padding: 4px 12px 14px; border-top: 1px solid var(--line); }
.counter { font-variant-numeric: tabular-nums; font-weight: 600; }
.counter--over { color: var(--warn); }
.serp { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--line-strong); max-width: 640px; font-family: Arial, sans-serif; }
.serp__url { font-size: 12px; color: var(--text); }
.serp__title { font-size: 18px; color: #1A0DAB; line-height: 1.3; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp__desc { font-size: 13px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
:root[data-theme="dark"] .serp__title { color: #8AB4F8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .serp__title { color: #8AB4F8; } }
@media (max-width: 860px) {
  .chart__read { margin-left: 0; flex-basis: 100%; }
  .seo__url { flex: 1 1 0; }
  .seo__title { flex-basis: 100%; }
  .seo__title { white-space: normal; }
}
/* Website page: the save bar stays visible on every screen size. */
@media (min-width: 861px) {
  .savebar--always { display: flex; align-items: center; justify-content: flex-end; gap: 16px; position: sticky; bottom: 0; z-index: 25; margin: 16px calc(var(--pad) * -1) -56px; padding: 12px var(--pad); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(15,45,74,.08); }
}
.savebar__state { flex: 1; min-width: 0; }
.indexnow { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.indexnow > div { flex: 1 1 320px; min-width: 0; }
.indexnow p { margin: 4px 0 0; }
.text-danger { color: var(--danger); }

/* ---------- Users ---------- */
.menu-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.share { display: grid; gap: 6px; margin: 10px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.share > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.share .muted { min-width: 130px; }
.share .mono { font-weight: 700; color: var(--heading); overflow-wrap: anywhere; }
@container (max-width: 640px) { .menu-actions { justify-content: flex-start; } }

/* ---------- CRM: Visual Pipeline (Kanban) ---------- */
.kanban-view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.kanban-view-switch a { padding: 6px 14px; font-weight: 600; font-size: 13px; text-decoration: none; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.kanban-view-switch a[aria-current="page"] { background: var(--surface); color: var(--heading); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.kanban-view-switch svg { width: 14px; height: 14px; }

.pipeline-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 16px; margin-bottom: 20px; }
.pipeline-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; box-shadow: var(--shadow); }
.pipeline-stat .lbl { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pipeline-stat .val { font-size: 22px; font-weight: 800; color: var(--heading); margin-top: 4px; font-variant-numeric: tabular-nums; }
.pipeline-stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 24px; min-height: calc(100vh - 280px); scrollbar-width: thin; align-items: flex-start; }
.kanban__col { flex: 0 0 290px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 200px); box-shadow: var(--shadow); }
.kanban__col-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--heading); background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.kanban__col-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.kanban__col-count { background: var(--surface-3); color: var(--text); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.kanban__col-sum { font-size: 13px; font-weight: 700; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .kanban__col-sum { color: var(--teal-light); }

.kanban__list { padding: 10px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; min-height: 120px; }
.kanban__empty { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); margin: 4px; }

.kanban__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: 0 1px 3px rgba(15,45,74,.05); transition: transform .12s, box-shadow .12s, border-color .12s; cursor: pointer; position: relative; }
.kanban__card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,45,74,.09); border-color: var(--teal); }
.kanban__card-title { font-weight: 700; font-size: 14px; color: var(--heading); margin-bottom: 2px; }
.kanban__card-company { font-size: 12.5px; font-weight: 600; color: var(--blue); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.kanban__card-company svg { width: 13px; height: 13px; flex: none; }
.kanban__card-value { display: inline-flex; align-items: center; background: var(--teal-bg); color: var(--teal-dark); font-weight: 800; font-size: 12.5px; padding: 3px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
:root[data-theme="dark"] .kanban__card-value { color: var(--teal-light); }
.kanban__card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; font-size: 11px; }
.kanban__card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.kanban__card-stage-nav { display: flex; gap: 4px; }
.kanban__card-stage-nav button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 4px; padding: 2px 7px; font-size: 11px; cursor: pointer; color: var(--text); line-height: 1.2; font-weight: 700; }
.kanban__card-stage-nav button:hover { background: var(--teal); color: #0F2D4A; border-color: var(--teal); }

/* ---------- CRM: Companies & Modal Dialogs ---------- */
.badge--company { background: var(--sky-bg); color: var(--sky); border: 1px solid var(--line); }
.badge--won { background: var(--ok-bg); color: var(--ok); }
.badge--prospect { background: var(--info-bg); color: var(--info); }
.badge--active { background: var(--teal-bg); color: var(--teal-dark); font-weight: 700; }
:root[data-theme="dark"] .badge--active { color: var(--teal-light); }

dialog.crm-modal { width: 100%; max-width: 580px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; box-shadow: var(--shadow-lg); }
dialog.crm-modal::backdrop { background: rgba(15,45,74,.45); backdrop-filter: blur(2px); }
.crm-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.crm-modal__head h2 { margin: 0; font-size: 17px; }
.crm-modal__body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.crm-modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.activity-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; }
.activity-badge--email { background: var(--info-bg); color: var(--info); }
.activity-badge--call { background: var(--ok-bg); color: var(--ok); }
.activity-badge--meeting { background: var(--violet-bg); color: var(--violet); }
.activity-badge--whatsapp { background: #DCF8C6; color: #075E54; }
:root[data-theme="dark"] .activity-badge--whatsapp { background: #075E54; color: #DCF8C6; }

.form-sep { height: 1px; background: var(--line); margin: 20px 0 16px; border: 0; }

