/* Tenant admin shell — sidebar + top bar on one #FBFBFB surface, hairlines between.
   Tokens, buttons, cards come from authentication/code/shared/styles.css (design-system.md). */

.shell-page {
  --shell-bg: #fbfbfb;
  --nav-current: #efefee;
  --side-w: 256px;
  --top-h: 56px;
  background: var(--shell-bg);
}

/* Dark theme: same tokens, swapped values (set on <html data-theme>) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1b1d1c;
  --surface-soft: #262928;
  --surface-sunken: #202322;
  --fg: #ececea;
  --fg-2: #c3c7c5;
  --muted: #959a97;
  --border: #2c2f2e;
  --border-strong: #3e4241;
  --danger: #f0716a;
  --danger-bg: #2a1a19;
  --danger-line: #4d2a27;
  --warn: #e8b04a;
  --warn-bg: #282114;
  --warn-line: #4a3a1c;
  --success: #5cc28a;
  --success-bg: #16241c;
  --success-line: #25402f;
  --info: #7d9ef5;
  --info-bg: #171d2e;
  --info-line: #283559;
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-pop: 0 24px 60px -20px rgb(0 0 0 / 0.7);
}
:root[data-theme="dark"] .shell-page { --shell-bg: #121413; --nav-current: #232625; }
.shell-page .proto:not(.proto-tenant) { display: none; } /* auth demo panels would cover the sidebar */
.proto-links button {
  padding: 6px 8px; border: 0; border-radius: 6px; background: var(--surface-sunken);
  color: var(--fg); font-size: 13px; text-align: left; cursor: pointer;
}
.proto-links button:hover { background: var(--surface-soft); }
.proto-tenant .proto-body { width: min(320px, calc(100vw - 32px)); }
:root[data-theme="dark"] .proto summary { background: var(--surface); }
:root[data-theme="dark"] .proto[open] summary { background: var(--fg); color: var(--surface); }

.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  height: 100dvh;
  background: var(--shell-bg);
  transition: grid-template-columns 0.2s var(--ease);
}

/* ─── Top row ─── */
.shell-account {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 0 12px 0 16px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.shell-logo { display: grid; flex: none; }
.shell-logo img { height: 22px; width: auto; }
.account-switch {
  display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1;
  height: 34px; padding: 0 8px; border: 0; border-radius: var(--r-control);
  background: none; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--fg);
}
.account-switch:hover { background: var(--surface-soft); }
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-switch svg.lucide { width: 16px; height: 16px; margin-left: auto; color: var(--muted); }

.shell-top {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; border-bottom: 1px solid var(--border);
}
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.top-link {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px;
  border-radius: var(--r-control); color: var(--fg); font-size: 14px; font-weight: 500;
}
.top-link:hover { background: var(--surface-soft); text-decoration: none; }
.top-link svg.lucide { width: 16px; height: 16px; color: var(--muted); }

.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: var(--r-control); background: none; color: var(--fg-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-soft); color: var(--fg); }
.icon-btn svg.lucide { width: 18px; height: 18px; }
.nav-toggle { display: none; }

/* ─── Sidebar ─── */
.sidebar {
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
  padding: 14px 12px 0; border-right: 1px solid var(--border); background: var(--shell-bg);
}
.quick-search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-control); cursor: text;
}
.quick-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.quick-search svg.lucide { width: 16px; height: 16px; color: var(--muted); }
.quick-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; padding: 0; }
.quick-search input:focus-visible { box-shadow: none; }
.quick-search input::placeholder { color: var(--muted); }
.quick-search kbd { font: 500 12px var(--font); color: var(--muted); }

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border-radius: var(--r-control); color: var(--fg); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.nav-item:hover { background: var(--surface-soft); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--nav-current); }
.nav-item svg.lucide { width: 17px; height: 17px; color: var(--fg-2); }
.nav-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .nav-chev { width: 15px; height: 15px; color: var(--muted); }
.nav-section { margin: 18px 10px 6px; font-size: 13px; color: var(--muted); }
.nav-rule { border: 0; border-top: 1px solid var(--border); margin: 14px 8px; }
.sidebar-foot {
  position: sticky; bottom: 0; margin: auto -12px 0; padding: 10px 12px;
  border-top: 1px solid var(--border); background: var(--shell-bg);
}

/* ─── Canvas ─── */
.canvas { min-width: 0; overflow-y: auto; }
.canvas:focus { box-shadow: none; }

/* Views: one per sidebar item, shown by hash (#people). Head is a full-bleed band like the reference. */
.view.enter { animation: enter 0.3s var(--ease) both; }
.view-head { border-bottom: 1px solid var(--border); }
.view-head-in, .view-body { width: min(100% - 64px, 1600px); margin: 0 auto; } /* content max 1600px, centred, 32px gutters */
.view-head-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 30px 0 26px; }
.view-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view-title h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.view-title h1:focus { box-shadow: none; }
.view-head p { margin-top: 4px; color: var(--muted); font-size: 14.5px; }
.view-actions { display: flex; gap: 8px; }
.view-body { display: grid; gap: 14px; padding: 24px 0 96px; }
.pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface); color: var(--fg-2); font-size: 12.5px; font-weight: 500;
}
.empty { display: grid; justify-items: center; gap: 8px; padding: 64px 24px; text-align: center; }
.empty svg.lucide { width: 28px; height: 28px; margin-bottom: 6px; color: var(--fg-2); }
.empty strong { font-size: 16px; font-weight: 600; }
.empty p { color: var(--muted); font-size: 14px; }

/* ─── Profile menu (native popover: light-dismiss + Esc for free) ─── */
.menu {
  inset: auto; top: calc(var(--top-h) - 4px); right: 16px; margin: 0;
  width: 248px; padding: 6px; border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow-pop); color: var(--fg);
}
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-head .avatar { width: 34px; height: 34px; font-size: 13px; }
.menu-head .app-user-name { font-size: 14px; }
.menu-head .app-user-role { font-size: 12.5px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 8px;
  border: 0; border-radius: var(--r-control); background: none; color: var(--fg);
  font-size: 14px; font-weight: 500; cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--surface-soft); text-decoration: none; }
.menu-item svg.lucide { width: 16px; height: 16px; color: var(--fg-2); }

/* ─── Account switcher menu ─── */
.account-menu { right: auto; left: 24px; width: min(264px, 100vw - 36px); padding: 8px 12px; }
.acct-head { display: flex; align-items: center; gap: 12px; padding: 6px 6px 12px; }
.acct-avatar {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 9px;
  background: var(--fg); color: var(--surface); font-size: 15px; font-weight: 600;
}
.acct-who { min-width: 0; }
.acct-name { font-size: 15px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-count { font-size: 13px; color: var(--muted); }
.acct-invite {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 38px;
  border: 0; border-radius: var(--r-control); background: var(--surface-soft); color: var(--fg-2);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.acct-invite:hover { background: var(--nav-current); color: var(--fg); }
.acct-invite svg.lucide { width: 16px; height: 16px; }
.menu-rule { border: 0; border-top: 1px solid var(--border); margin: 8px -12px; }
.org-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.org-logo { width: 20px; height: 20px; flex: none; object-fit: contain; }
.org-letter {
  display: grid; place-items: center; border-radius: 5px;
  background: var(--fg); color: var(--surface); font-size: 11px; font-weight: 700;
}
.org-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item.is-current { background: var(--surface-soft); cursor: default; }
.menu-item .org-check { margin-left: auto; color: var(--muted); }
.menu-row { cursor: default; }
.menu-row:hover { background: none; }
.theme-toggle { display: flex; gap: 2px; margin-left: auto; padding: 2px; border-radius: 7px; background: var(--surface-soft); }
.theme-toggle button {
  display: grid; place-items: center; width: 28px; height: 24px; padding: 0;
  border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer;
}
.theme-toggle button:hover { color: var(--fg); }
.theme-toggle button[aria-checked="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.theme-toggle svg.lucide { width: 14px; height: 14px; }
.menu-danger, .menu-danger svg.lucide { color: var(--danger); }
/* Account menu runs one step smaller than the profile menu */
.account-menu .acct-head { gap: 10px; padding: 6px 4px 10px; }
.account-menu .acct-avatar { width: 34px; height: 34px; border-radius: 8px; font-size: 13px; }
.account-menu .acct-name { font-size: 14px; }
.account-menu .acct-count { font-size: 12.5px; }
.account-menu .acct-invite { height: 34px; font-size: 13.5px; }
.account-menu .acct-invite svg.lucide { width: 15px; height: 15px; }
.account-menu .menu-item { height: 32px; padding: 0 8px; gap: 9px; font-size: 13.5px; }
.account-menu .menu-item svg.lucide { width: 15px; height: 15px; }
.account-menu .org-logo { width: 18px; height: 18px; }
.account-menu .org-letter { font-size: 10px; }
.account-menu .theme-toggle button { width: 26px; height: 22px; }
.account-menu .theme-toggle svg.lucide { width: 13px; height: 13px; }

/* ─── Collapsed sidebar: icons only ─── */
.shell[data-collapsed] { --side-w: 60px; }
.shell[data-collapsed] :is(.account-switch, .quick-search input, .quick-search kbd, .nav-item span, .nav-chev, .nav-section) { display: none; }
.shell[data-collapsed] :is(.shell-account, .quick-search, .nav-item) { justify-content: center; padding: 0; }

/* ─── Phones / small tablets: sidebar becomes a drawer ─── */
@media (max-width: 860px) {
  .shell, .shell[data-collapsed] { grid-template-columns: auto minmax(0, 1fr); }
  .shell-account { border-right: 0; max-width: 62vw; }
  .nav-toggle { display: grid; order: 1; }
  .sidebar {
    position: fixed; z-index: 20; top: var(--top-h); bottom: 0; left: 0; width: min(288px, 86vw);
    transform: translateX(-100%); visibility: hidden;
    transition: transform 0.22s var(--ease), visibility 0.22s;
    box-shadow: var(--shadow-pop);
  }
  .shell[data-nav-open] .sidebar { transform: none; visibility: visible; }
  .sidebar-foot { display: none; }
  .canvas { grid-column: 1 / -1; }
  .view-head-in, .view-body { width: calc(100% - 32px); }
  .view-head-in { padding: 22px 0 18px; }
}
@media (max-width: 520px) { .top-link { font-size: 0; gap: 0; } }
@media (prefers-reduced-motion: reduce) { .shell, .sidebar { transition: none; } }

/* ─── Toolbar: search + segmented filter ─── */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: min(100%, 240px); height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-control);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.search svg.lucide { width: 16px; height: 16px; color: var(--muted); }
.search input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: none; font-size: 14.5px; }
.search input:focus-visible { box-shadow: none; }
.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-soft); overflow-x: auto; }
.segmented button {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; flex: none;
  border: 0; border-radius: 7px; background: none; color: var(--fg-2); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.segmented button:hover { color: var(--fg); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / 0.1); }
.segmented .count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ─── Data table (bordered card, short column dividers in the head) ─── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 14px; }
.table th {
  position: relative; height: 46px; padding: 0 16px; text-align: left; white-space: nowrap;
  color: var(--muted); font-size: 13.5px; font-weight: 500; border-bottom: 1px solid var(--border);
}
.table th + th::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 1px; background: var(--border); }
.table th.col-actions::before { display: none; }
.table td { padding: 11px 16px; border-top: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: var(--surface-sunken); }
.table tbody tr.is-flash td { animation: flash 1.6s var(--ease); }
@keyframes flash { from { background: var(--info-bg); } }
.th-inner { display: inline-flex; align-items: center; gap: 6px; }
.th-sort { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.th-sort:hover { color: var(--fg); }
.th-sort svg.lucide, .th-info svg.lucide { width: 14px; height: 14px; }
.th-sort[data-dir] { color: var(--fg); }
.th-info { display: grid; padding: 0; border: 0; background: none; color: inherit; cursor: help; border-radius: 4px; }
.col-actions { width: 56px; text-align: right; }
.table-foot { color: var(--muted); font-size: 13.5px; }
.table .empty-row td { padding: 44px 16px; text-align: center; color: var(--muted); white-space: normal; }

.member { display: flex; align-items: center; gap: 11px; }
.member-avatar {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: hsl(var(--h) 55% 92%); color: hsl(var(--h) 45% 28%); font-size: 12px; font-weight: 600;
}
.member-avatar[data-dim] { filter: grayscale(1); opacity: 0.7; }
.member-text { display: grid; min-width: 0; line-height: 1.35; }
.member-email { color: var(--muted); font-size: 13px; }
.link-inline {
  padding: 0; border: 0; background: none; cursor: pointer; justify-self: start;
  color: var(--fg); font: inherit; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px;
}
.link-inline:hover { text-decoration-color: currentColor; }
.you { margin-left: 6px; padding: 1px 7px; border-radius: var(--r-full); background: var(--surface-soft); color: var(--muted); font-size: 11.5px; font-weight: 500; }
.cell-sub { display: block; color: var(--muted); font-size: 13px; }
.is-expired { color: var(--danger); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.row-btn { width: 30px; height: 30px; margin-left: auto; }

/* ─── Selects share the input look ─── */
select.input {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236a706d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .field-grid { grid-template-columns: 1fr; } }

/* ─── Modal forms (invite, reassign) ─── */
dialog.modal form { display: block; }
.modal-x { position: absolute; top: 14px; right: 14px; }
dialog.modal { position: fixed; }
.modal-body .form-body { margin-top: 12px; }
.modal-body .alert { margin-top: 4px; }

/* ─── Row actions menu ─── */
.row-menu { right: auto; width: 220px; padding: 6px; }
.row-menu .menu-item:disabled { color: var(--muted); cursor: default; background: none; }

/* ─── Dark-mode fixes for auth styles that hardcode light colours ─── */
:root[data-theme="dark"] .toast { background: #2a2d2c; color: #fff; }
:root[data-theme="dark"] .compact .btn-outline { box-shadow: inset 0 0 0 1px var(--border-strong); }
:root[data-theme="dark"] .member-avatar { background: hsl(var(--h) 25% 24%); color: hsl(var(--h) 60% 85%); }
:root[data-theme="dark"] select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23959a97' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

/* ─── Smaller buttons across the tenant admin (36px, was 40px) ─── */
.shell-page.compact .btn-sm { height: 36px; padding: 0 14px; font-size: 14px; gap: 7px; }
.shell-page.compact .btn-sm svg.lucide { width: 16px; height: 16px; }

/* ─── Invite modal: email chips + role choice ─── */
.compact dialog.modal.modal-std { width: min(520px, calc(100% - 32px)); }
.modal-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title-row h2 { min-width: 0; }
.modal-close { width: 32px; height: 32px; border: 1px solid var(--border); }
.modal-close svg.lucide { width: 16px; height: 16px; }
.chip-input {
  flex-wrap: wrap; align-items: center; gap: 6px; min-height: var(--control-h); padding: 6px 8px; cursor: text;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-control);
}
.chip-input:hover { border-color: #b8bcba; }
.chip-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.chip-input:has([aria-invalid="true"]) { border-color: var(--danger); }
.chip-input input { flex: 1; min-width: 120px; height: 28px; padding: 0 4px; border: 0; outline: 0; background: none; font-size: 14.5px; }
.chip-input input:focus-visible { box-shadow: none; }
.chips { display: contents; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; height: 28px; padding: 0 3px 0 10px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface-sunken); font-size: 13.5px; font-weight: 500;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; }
.chip button:hover { background: var(--surface-soft); color: var(--fg); }
.chip svg.lucide { width: 13px; height: 13px; }
.form-body:disabled .chip-input { background: var(--surface-sunken); }
.choices { display: grid; gap: 2px; margin: 0 -12px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.choice:hover { background: var(--surface-sunken); }
.choice input[type="radio"] { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--fg); cursor: pointer; }
.choice-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.choice-text strong { font-size: 14.5px; font-weight: 500; }
.choice-text span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.choice-extra { display: grid; gap: 4px; flex: none; width: 168px; }
.choice-extra .input { height: 34px; font-size: 13.5px; }
.shell-page .choice-extra .field-error { font-size: 12.5px; }
[data-invite-alert]:empty { display: none; }
.modal-std .hint { font-size: 13px; margin-top: -2px; }
.table thead th { background: var(--shell-bg); } /* #FBFBFB in light */

/* Invite modal type scale: title > role name > label > description */
.compact .modal-std .modal-body { gap: 6px; padding: 20px 22px 18px; }
.compact .modal-std .modal-body h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.modal-std .form-body { gap: 14px; }
.modal-std .label { font-size: 13px; font-weight: 500; color: var(--fg-2); }
.modal-std .chip-input input { font-size: 13.5px; }
.modal-std .chip { height: 26px; font-size: 12.5px; }
.compact .modal-std p.hint { font-size: 12px; color: var(--muted); }
.modal-std .choice { padding: 8px 12px; gap: 10px; }
.modal-std .choice input[type="radio"] { width: 15px; height: 15px; margin-top: 2px; }
.modal-std .choice-text strong { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.modal-std .choice-text span { font-size: 12px; font-weight: 400; color: var(--muted); }
.modal-std .choice-extra .input { height: 32px; font-size: 12.5px; }
.modal-std .alert { font-size: 12.5px; }
/* Team picker only matters for team managers */
.choice:not(:has(input:checked)) .choice-extra { display: none; }
.modal-std .modal-foot { padding: 14px 22px; }
.modal-std .modal-foot .btn { width: 100%; }

/* Header info tooltips (hover + keyboard focus) */
.th-info { position: relative; }
.th-info::after {
  content: attr(data-tip); position: absolute; z-index: 5; top: calc(100% + 8px); left: -8px;
  width: 260px; padding: 9px 11px; border-radius: 8px; background: var(--fg); color: var(--surface);
  font-size: 12.5px; font-weight: 400; line-height: 1.45; white-space: normal; text-align: left;
  box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(-2px); pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
}
.th-info:hover::after, .th-info:focus-visible::after { opacity: 1; transform: none; }

/* Invite modal v3: roomier, account-menu style role rows (soft selected row + check) */
.compact dialog.modal.modal-std { width: min(480px, calc(100% - 32px)); }
.compact .modal-std .modal-body { gap: 8px; padding: 24px 24px 20px; }
.modal-std .form-body { gap: 18px; margin-top: 8px; }
.modal-std .chip-input { min-height: 46px; padding: 8px 10px; }
.modal-std .chip { height: 28px; }
.modal-std .choices { gap: 4px; margin: 0 -8px; }
.modal-std .choice { align-items: flex-start; gap: 12px; padding: 12px; border-radius: 10px; }
.modal-std .choice:has(input:checked) { background: var(--surface-soft); }
.modal-std .choice:has(:focus-visible) { box-shadow: 0 0 0 3px var(--focus); }
.choice-icon { flex: none; margin-top: 1px; color: var(--fg-2); }
.shell-page .choice-icon { width: 17px; height: 17px; }
.choice-check { flex: none; margin-left: auto; color: var(--fg-2); }
.shell-page .choice-check { width: 17px; height: 17px; }
.choice:not(:has(input:checked)) .choice-check { visibility: hidden; }
.modal-std .choice-text { gap: 3px; }
.modal-std .choice-extra { width: auto; margin-top: 8px; }
.modal-std .choice-extra .input { height: 38px; font-size: 13.5px; background-color: var(--surface); }
.modal-std .modal-foot { padding: 16px 24px; }
.shell-page.compact .modal-std .modal-foot .btn { height: 44px; font-size: 14.5px; }

/* ─── Member profile page ─── */
.profile-top { padding-bottom: 22px; }
.profile-top .crumbs { flex-basis: 100%; display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.profile-top .crumbs a { color: var(--muted); font-weight: 500; }
.profile-top .crumbs a:hover { color: var(--fg); }
.shell-page .profile-top .crumbs svg.lucide { width: 14px; height: 14px; }
.profile-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-id .member-avatar { width: 56px; height: 56px; font-size: 19px; }
.profile-id p { margin-top: 4px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.view-head-in.tabs { display: flex; gap: 2px; padding: 0; overflow-x: auto; justify-content: flex-start; flex-wrap: nowrap; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 12px; margin-bottom: -1px; white-space: nowrap;
  color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--fg); text-decoration: none; }
.tab[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }
.tab .count { padding: 0 7px; border-radius: var(--r-full); background: var(--surface-soft); color: var(--muted); font-size: 12px; line-height: 20px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.stat { display: grid; gap: 4px; padding: 16px 18px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat strong { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.panel { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.panel-wide { grid-column: 1 / -1; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--shell-bg); }
.panel-head h2 { font-size: 14px; font-weight: 600; }
.panel-head a { color: var(--fg-2); font-size: 13px; font-weight: 500; }
.kv { margin: 0; }
.kv > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 16px; font-size: 13.5px; }
.kv > div + div { border-top: 1px solid var(--border); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.kv a, .panel a.link { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.panel-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-sunken); color: var(--muted); font-size: 12.5px; }
.shell-page .panel-note svg.lucide { width: 14px; height: 14px; margin-top: 2px; }
.panel-empty { padding: 16px; color: var(--muted); font-size: 13.5px; }
.history { display: grid; gap: 10px; margin: 0; padding: 14px 16px; list-style: none; border-top: 1px solid var(--border); font-size: 13px; }
.history li { display: flex; align-items: center; gap: 10px; }
.shell-page .history svg.lucide { width: 15px; height: 15px; color: var(--muted); }
.history time { margin-left: auto; color: var(--muted); white-space: nowrap; }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: 12px; font-weight: 500; background: var(--surface-soft); color: var(--fg-2); border: 1px solid var(--border); }
.tag[data-tone="success"] { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.tag[data-tone="warning"] { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.tag[data-tone="info"] { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.tag[data-tone="danger"] { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.cell-strong { font-weight: 500; }

.feed { margin: 0; padding: 0; list-style: none; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; font-size: 13.5px; }
.feed li + li { border-top: 1px solid var(--border); }
.feed .feed-day { padding: 8px 16px; background: var(--surface-sunken); color: var(--muted); font-size: 12px; font-weight: 600; }
.feed-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--surface-soft); color: var(--fg-2); }
.shell-page .feed-icon svg.lucide { width: 14px; height: 14px; }
.feed-text { flex: 1; min-width: 0; color: var(--fg-2); }
.feed-text b { color: var(--fg); font-weight: 500; }
.feed time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.note { display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.note header { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.note header strong { font-weight: 600; }
.note time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.note p { color: var(--fg-2); font-size: 13.5px; line-height: 1.5; }
.note[data-private] { background: var(--surface-sunken); border-style: dashed; }
.note[data-private] p { display: flex; align-items: center; gap: 6px; color: var(--muted); font-style: italic; }
.shell-page .note svg.lucide { width: 14px; height: 14px; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .profile-grid, .notes { grid-template-columns: 1fr; }
  .kv > div { grid-template-columns: 120px minmax(0, 1fr); }
}

/* ─── Standard modal extras (reassign, confirm) ─── */
.compact .modal-std .modal-body > p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.modal-std .label { display: flex; align-items: center; gap: 8px; }
.step {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--fg); color: var(--surface); font-size: 11px; font-weight: 600;
}
.choices-scroll { max-height: 236px; overflow-y: auto; }
.choices-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.choice.is-disabled { opacity: 0.5; cursor: not-allowed; }
.choice.is-disabled:hover { background: none; }
.choice .member-avatar { width: 28px; height: 28px; margin-top: -2px; font-size: 11px; }
.modal-std [data-confirm-alert]:empty { display: none; }

/* ─── Searchable dropdown (combobox.js) ─── */
.combo { position: relative; align-items: center; }
.combo .input { width: 100%; padding-left: 36px; padding-right: 36px; }
.combo .input:disabled { background: var(--surface-sunken); color: var(--muted); cursor: not-allowed; }
.shell-page .combo-search, .shell-page .combo-caret { position: absolute; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.combo-search { left: 12px; }
.combo-caret { right: 12px; transition: transform 0.15s; }
.combo:has([aria-expanded="true"]) .combo-caret { transform: rotate(180deg); }
.combo-list {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 264px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop);
}
.combo-list [role="option"] { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.combo-list [role="option"].is-active { background: var(--surface-soft); }
.combo-list [aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.combo-text { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.combo-text strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-text span { color: var(--muted); font-size: 12px; }
.combo-text mark { padding: 0 1px; border-radius: 3px; background: var(--warn-bg); color: inherit; box-shadow: inset 0 -1px 0 var(--warn-line); }
.shell-page .combo-icon { width: 16px; height: 16px; flex: none; color: var(--fg-2); }
.shell-page .combo-tick { width: 16px; height: 16px; flex: none; color: var(--fg); }
.combo-list .member-avatar { width: 26px; height: 26px; font-size: 10.5px; }
.combo-more { padding: 8px 10px; color: var(--muted); font-size: 12.5px; }
.modal-std .combo .input { height: 42px; font-size: 14px; }
.modal-std .choice-extra .combo .input { height: 38px; font-size: 13.5px; }

/* Pages are bare <main> until shell.js wraps them in the chrome — hide that first frame */
.shell-page:not([data-ready]) { visibility: hidden; }

/* ─── Loading skeletons + load-error message (demo states the real API fetch would show) ─── */
.skeleton {
  display: block; height: 10px; width: 70%; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-soft) 25%, var(--surface-sunken) 50%, var(--surface-soft) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
.skeleton-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.member-text .skeleton + .skeleton { margin-top: 7px; }
.stat .skeleton:first-child { height: 9px; } .stat .skeleton + .skeleton { height: 18px; }
.skeleton-lines { display: grid; gap: 14px; padding: 16px; }
.skeleton-row td { height: 57px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.state-msg { display: grid; justify-items: center; gap: 6px; padding: 16px 0; color: var(--muted); font-size: 13.5px; }
.state-msg strong { color: var(--fg); font-size: 14.5px; font-weight: 600; }
.state-msg .btn { margin-top: 8px; }
.shell-page .state-msg > svg.lucide { width: 26px; height: 26px; color: var(--fg-2); }
.card.empty .btn { margin-top: 8px; }

/* ─── Team cell + misc ─── */
.team-tile {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px;
  background: hsl(var(--h) 55% 93%); color: hsl(var(--h) 45% 30%);
}
:root[data-theme="dark"] .team-tile { background: hsl(var(--h) 25% 22%); color: hsl(var(--h) 60% 82%); }
.shell-page .team-tile svg.lucide { width: 16px; height: 16px; }
.label-note { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }

/* ─── Table footer: count left, pagination right ─── */
.table-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pager-btn {
  display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: var(--r-control); background: var(--surface); color: var(--fg-2); font-size: 13px; font-weight: 500;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.pager-btn:hover:not(:disabled) { background: var(--surface-sunken); color: var(--fg); }
.pager-btn[aria-current="page"] { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.pager-btn:disabled { opacity: 0.4; cursor: default; }
.shell-page .pager-btn svg.lucide { width: 15px; height: 15px; }
.pager-gap { padding: 0 2px; color: var(--muted); }

/* ─── KPI cards (label · value · change · edge-to-edge sparkline) — Team detail ─── */
.shell-page { --chart: #3d6fe8; }
:root[data-theme="dark"] .shell-page { --chart: #5f8af5; } /* both validated: dataviz validate_palette (light + dark) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi {
  position: relative; display: grid; gap: 6px; padding: 16px 18px 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
}
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi-label .th-info::after { top: calc(100% + 6px); left: -40px; width: 220px; }
.kpi-value { display: flex; align-items: baseline; gap: 10px; }
.kpi-value strong { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi-delta[data-dir="up"] { color: var(--success); }
.kpi-delta[data-dir="down"] { color: var(--danger); }
.shell-page .kpi-delta svg.lucide { width: 14px; height: 14px; }
.kpi-chart { position: relative; height: 56px; margin: 6px -18px 0; color: var(--chart); cursor: crosshair; }
.kpi-spark { display: block; width: 100%; height: 100%; overflow: visible; }
.kpi-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: miter; stroke-miterlimit: 8; stroke-linecap: round; vector-effect: non-scaling-stroke; } /* sharp peaks */
.kpi-area { fill: currentColor; opacity: 0.1; }
.kpi-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.kpi-tip {
  position: absolute; bottom: calc(100% + 2px); transform: translateX(-50%); display: grid; gap: 1px; padding: 5px 8px; z-index: 2;
  border-radius: 7px; background: var(--fg); color: var(--surface); font-size: 11.5px; line-height: 1.3; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-pop);
}
.kpi-tip strong { font-size: 13px; font-weight: 600; }
.kpi > .skeleton:first-child { height: 9px; } .kpi > .skeleton + .skeleton { height: 22px; }

/* ─── Team detail layout: members (left) · information + activity (right) ─── */
.team-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.team-side { display: grid; gap: 16px; }
.team-tile-lg { width: 52px; height: 52px; border-radius: 12px; }
.shell-page .team-tile-lg svg.lucide { width: 24px; height: 24px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.count-pill { padding: 0 7px; border-radius: var(--r-full); background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 20px; }
.panel-head .btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.panel .state-msg { padding: 32px 16px; }
.role-lead { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.shell-page .role-lead svg.lucide { width: 14px; height: 14px; color: #c27a12; }
.team-side .feed li { padding: 10px 16px; font-size: 13px; }
.view-body > .alert .alert-action { justify-self: start; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.picked:empty { display: none; }
.picked .chip { gap: 6px; padding-left: 4px; }
.picked .member-avatar { width: 20px; height: 20px; font-size: 9px; }
/* Members panel stays in view while the taller right column (info + activity) scrolls past */
.team-members { position: sticky; top: 16px; }
/* Table inside a panel: panel head (title + count) · table · footer — all in one container */
.panel-table { overflow-x: auto; }
.panel-table .table { min-width: 560px; }
.panel-table .table th:first-child, .panel-table .table td:first-child { padding-left: 16px; }
.panel-foot { padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
@media (max-width: 1080px) { .team-grid { grid-template-columns: 1fr; } .team-members { position: static; } }

/* ─── Leads & Clients: filter row, contact links ─── */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.compact select.input.filter { width: auto; min-width: 150px; height: 36px; padding: 0 32px 0 12px; font-size: 13.5px; color: var(--fg-2); background-position: right 10px center; }
select.input.filter.is-set { border-color: var(--fg-2); color: var(--fg); font-weight: 500; }
.clear-filters { width: 40px; height: 40px; border: 1px solid var(--border); background: var(--surface); }
.clear-filters:hover { border-color: var(--border-strong); }
.cell-link { color: var(--fg); }
.cell-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.choice > .tag { flex: none; min-width: 92px; justify-content: center; }
/* Search + dropdowns share one row; on narrow screens the dropdowns wrap under the search */
.toolbar > .filters { flex: 0 1 auto; }
.toolbar .search { min-width: min(100%, 220px); }
.compact .toolbar select.input.filter { height: 40px; min-width: 0; max-width: 220px; }

/* ─── Client detail ─── */
.compact .input.input-sm { height: 34px; padding: 0 10px; font-size: 13.5px; }
.meta-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.chip-meta { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); color: var(--muted); font-size: 12px; }
.chip-meta b { color: var(--fg); font-weight: 600; }
.chip-meta a { color: var(--fg); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.shell-page .chip-meta svg.lucide, .shell-page .tag svg.lucide { width: 12px; height: 12px; }
.tag { gap: 4px; }
.stage-pick select { width: auto; height: 28px; padding: 0 30px 0 10px; font-size: 12.5px; font-weight: 500; background-position: right 8px center; }
/* Header: identity left, Edit + more right; ratio strip as its own tight band */
.rec-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px 40px; padding-bottom: 24px; }
.rec-top .crumbs { grid-column: 1 / -1; margin-bottom: 8px; }
.rec-top .profile-id { align-items: flex-start; }
.rec-top .profile-id .member-avatar { width: 64px; height: 64px; font-size: 21px; }
.rec-top .profile-id p { margin-top: 6px; }
.rec-contact span { white-space: nowrap; }
.rec-top .meta-chips { margin-top: 12px; }
.view-head-in.rec-ratios { padding: 0 0 24px; }
@media (max-width: 720px) { .rec-top { grid-template-columns: 1fr; } }
.ratio-strip .stat small { color: var(--muted); font-size: 12px; }
.ratio-strip .stat.is-pass strong { color: var(--success); }
.ratio-strip .stat.is-fail strong { color: var(--danger); }
.tab .count.warn { background: var(--warn-bg); color: var(--warn); }
.ai-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--info-line); border-radius: var(--r-card); background: var(--info-bg); color: var(--fg-2); font-size: 13.5px; line-height: 1.5; }
.shell-page .ai-line svg.lucide { width: 16px; height: 16px; margin-top: 2px; color: var(--info); flex: none; }
.edit-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-card); background: var(--surface); font-size: 13.5px; }
.edit-bar span { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-2); } .edit-bar > div { display: flex; gap: 8px; }
.shell-page .edit-bar svg.lucide { width: 15px; height: 15px; }
.kv dd .input { max-width: 280px; }
.afford-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.afford-out { display: grid; gap: 16px; }
.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 16px; }
.calc-field { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.calc-input { position: relative; display: flex; align-items: center; }
.calc-input i { position: absolute; color: var(--muted); font-style: normal; font-size: 13px; }
.calc-input i:first-child { left: 10px; } .calc-input i:last-child { right: 10px; }
.calc-input .input { width: 100%; padding-left: 22px; font-variant-numeric: tabular-nums; }
.pass-fail { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.pass-fail.is-pass { color: var(--success); } .pass-fail.is-fail { color: var(--danger); }
.shell-page .pass-fail svg.lucide { width: 15px; height: 15px; }
.doc-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.doc-meter { display: grid; gap: 6px; min-width: 260px; font-size: 13.5px; }
.meter { height: 6px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.enc-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: 12px; font-weight: 500; }
.shell-page .enc-badge svg.lucide { width: 13px; height: 13px; }
.doc-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--surface-soft); color: var(--fg-2); }
.shell-page .doc-icon svg.lucide { width: 16px; height: 16px; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.row-actions .btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.doc-preview { display: grid; justify-items: center; gap: 6px; margin-top: 8px; padding: 36px 16px; border: 1px dashed var(--border-strong); border-radius: var(--r-card); background: var(--surface-sunken); text-align: center; }
.shell-page .doc-preview svg.lucide { width: 32px; height: 32px; color: var(--muted); }
.doc-preview span { font-weight: 600; } .doc-preview small { color: var(--muted); font-size: 12.5px; }
.notes-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.note-composer { display: grid; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.note-composer textarea, .email-editor textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; font-size: 13.5px; }
.note-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--fg); }
.note-list, .task-list, .opps, .drafts { margin: 0; padding: 0; list-style: none; }
.note-item { display: grid; gap: 4px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13.5px; }
.note-item:first-child { border-top: 0; }
.note-item.is-important { background: var(--warn-bg); }
.note-item header { display: flex; align-items: center; gap: 8px; } .note-item time { margin-left: auto; color: var(--muted); font-size: 12px; }
.note-item p { color: var(--fg-2); }
.intake { padding: 14px 16px; color: var(--fg-2); font-size: 13.5px; line-height: 1.55; }
.ai-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.ai-col { display: grid; gap: 16px; }
.ai-title { display: inline-flex; align-items: center; gap: 6px; } .shell-page .ai-title svg.lucide { width: 15px; height: 15px; color: var(--info); }
.ai-text { padding: 14px 16px; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }
.opps li { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13.5px; }
.opps li:first-child { border-top: 0; } .opps li > div { flex: 1; min-width: 0; } .opps p { color: var(--muted); font-size: 12.5px; }
.email-types { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.email-types [aria-pressed="true"] { background: var(--fg); color: var(--surface); }
.email-editor { display: grid; gap: 6px; padding: 14px 16px; }
.email-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; }
.email-foot > div { display: flex; gap: 8px; }
.drafts li { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.shell-page .drafts svg.lucide { width: 15px; height: 15px; color: var(--muted); }
.drafts .muted { margin-left: auto; font-size: 12px; }
.task-add { display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px auto; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.task-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--border); }
.task-item:first-child { border-top: 0; }
.task-item .check { flex: 1; min-width: 0; } .task-item time { font-size: 12.5px; white-space: nowrap; }
.task-item.is-done .check span { color: var(--muted); text-decoration: line-through; }
@media (max-width: 960px) { .afford-grid, .notes-grid, .ai-grid { grid-template-columns: 1fr; } .task-add { grid-template-columns: 1fr 1fr; } .calc-form { grid-template-columns: 1fr; } }
.view-head-in > .ratio-strip { flex: 1; }

/* ─── Booking ─── */
.bookings { display: grid; gap: 14px; }
.bookings[hidden] { display: none; }
.triage-slot:empty, .conn-slot:empty { display: none; }
.field-hint { margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.is-warn { color: var(--warn); }
tr.is-orphan td { color: var(--muted); }
tr.is-orphan .doc-icon { opacity: 0.6; }
.modal-std .details dd .tag { margin-left: 6px; }
.svc-tile { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--fg-2); }
.shell-page .svc-tile svg.lucide { width: 16px; height: 16px; }

/* Connect cards (nothing connected yet): one per service — inset illustration → title → text → Connect */
.connect-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: min(100%, 1020px); margin: 8px auto 0; }
.connect-card { display: grid; grid-template-rows: auto 1fr auto; gap: 16px; padding: 10px 10px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; transition: border-color 0.2s var(--ease); }
.connect-card:hover, .connect-card:focus-within { border-color: var(--border-strong); }
.connect-text { display: grid; align-content: start; gap: 6px; padding: 0 14px; }
.connect-text h2 { font-size: 16px; font-weight: 600; }
.connect-text p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.connect-pick { padding: 0 14px; }

/* Illustration frame: inset panel; sheet anchored to the bottom edge (cut off), ghost layer above, chip floating over */
.connect-art {
  --peach: color-mix(in srgb, var(--brand) 26%, var(--surface));
  --peach-soft: color-mix(in srgb, var(--brand) 9%, var(--surface));
  --peach-line: color-mix(in srgb, var(--brand) 38%, transparent);
  position: relative; height: 240px; overflow: hidden; background: var(--shell-bg); border: 1px solid var(--border); border-radius: 12px;
}
.art-ghost { position: absolute; left: 50%; top: 14px; width: min(244px, calc(100% - 96px)); height: 64px; transform: translateX(-50%); border: 1.5px dashed var(--peach-line); border-radius: 16px; background: var(--peach-soft); }
.art-sheet { position: absolute; left: 50%; top: 36px; bottom: -16px; display: flex; flex-direction: column; gap: 12px; width: min(296px, calc(100% - 44px)); padding: 0 14px; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: 0 18px 40px -24px rgb(16 24 20 / 0.35); }
.sheet-head { display: flex; align-items: center; gap: 8px; height: 40px; margin: 0 -14px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.art-url { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; padding: 4px 9px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 10.5px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.shell-page .art-url svg.lucide { width: 10px; height: 10px; flex: none; }
.art-bar { flex: 0 0 44%; height: 8px; border-radius: 999px; background: var(--peach); }
.art-bar.is-grey { flex-basis: 18%; background: var(--surface-soft); }
.art-chip { position: absolute; right: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--fg); font-size: 11px; font-weight: 600; white-space: nowrap; box-shadow: 0 10px 24px -12px rgb(16 24 20 / 0.4); animation: chip-in 0.5s 0.25s var(--ease) both; }
.art-chip.is-left { left: 16px; right: auto; }
.chip-dot { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; }
.shell-page .chip-dot svg.lucide { width: 11px; height: 11px; stroke-width: 3; }
@keyframes chip-in { from { opacity: 0; transform: translateY(6px); } }

/* cal.com: host row → day grid (free days peach, picked day orange) + time slots (picked slot orange, cursor on it) */
.cal-host { display: flex; align-items: center; gap: 8px; }
.host-dot { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--peach-soft); }
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 14px; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; align-content: start; }
.cal-days span { aspect-ratio: 1; border-radius: 6px; background: var(--surface-soft); }
.cal-days .is-free { background: var(--peach-soft); box-shadow: inset 0 0 0 1px var(--peach-line); }
.cal-days .is-on { background: var(--brand); box-shadow: 0 4px 10px -4px var(--brand); }
.cal-times { display: grid; align-content: start; gap: 6px; }
.cal-times span { position: relative; display: grid; place-items: center; height: 22px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--fg-2); font-size: 10px; font-weight: 600; }
.cal-times .is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.art-cursor { position: absolute; right: -9px; bottom: -13px; width: 18px; height: 18px; fill: var(--brand); stroke: var(--surface); stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgb(16 24 20 / 0.25)); }

/* Google Meet: Meet-link header → active speaker (orange ring + voice wave) beside two waiting tiles → call controls */
.meet-badge { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 7px; background: var(--brand); color: #fff; }
.shell-page .meet-badge svg.lucide { width: 12px; height: 12px; }
.meet-stage { display: grid; grid-template-columns: 1.7fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; height: 104px; }
.meet-main { position: relative; grid-row: span 2; display: grid; place-items: center; border-radius: 12px; background: var(--peach-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.meet-side { display: grid; place-items: center; border-radius: 10px; background: var(--surface-soft); }
.meet-av { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; box-shadow: 0 0 0 5px var(--peach); }
.meet-av.is-sm { width: 24px; height: 24px; background: var(--surface); color: var(--muted); font-size: 8.5px; box-shadow: inset 0 0 0 1px var(--border-strong); }
.meet-wave { position: absolute; left: 9px; bottom: 9px; display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.meet-wave i { width: 3px; height: 100%; border-radius: 2px; background: var(--brand); transform-origin: bottom; animation: wave 1s ease-in-out infinite; }
.meet-wave i:nth-child(2) { animation-delay: -0.25s; } .meet-wave i:nth-child(3) { animation-delay: -0.5s; } .meet-wave i:nth-child(4) { animation-delay: -0.75s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
.meet-ctrl { display: flex; justify-content: center; gap: 8px; }
.meet-ctrl span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.meet-ctrl .meet-end { width: 44px; border-radius: 999px; background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px var(--brand); }
.shell-page .meet-ctrl svg.lucide { width: 13px; height: 13px; }
@media (prefers-reduced-motion: reduce) { .meet-wave i, .art-chip { animation: none; } }
/* Under the cards: a short "how syncing works" note — admin connects, then each broker connects */
.connect-doc { display: grid; gap: 6px; margin-top: 16px; padding-top: 28px; border-top: 1px solid var(--border); }
.connect-doc > h2 { font-size: 15px; font-weight: 600; }
.connect-doc > p { max-width: 640px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.sync-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 18px 0 0; padding: 0; list-style: none; }
.sync-steps li { display: flex; gap: 12px; align-items: flex-start; }
.sync-num { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); font-size: 12px; font-weight: 700; }
.sync-steps strong { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13.5px; font-weight: 600; }
.shell-page .sync-steps strong svg.lucide { width: 14px; height: 14px; color: var(--muted); }
.sync-steps p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sync-steps b { color: var(--fg-2); font-weight: 600; }
@media (max-width: 760px) { .connect-cards, .sync-steps { grid-template-columns: 1fr; } }

/* Connected: Table | Calendar switch in the header */
.view-switch button { display: inline-flex; align-items: center; gap: 6px; }
.shell-page .view-switch svg.lucide { width: 15px; height: 15px; }
.table-view { display: grid; gap: 14px; }
.table-view[hidden], .cal-view[hidden] { display: none; }

/* Calendar view: month grid; each booking is a quiet row — status dot · name · time (no fills, no accent stripes) */
.cal-view { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.calv-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.calv-head h2 { font-size: 16px; font-weight: 700; }
.calv-count { color: var(--muted); font-size: 13px; }
.calv-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.calv-week, .calv-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calv-week span { padding: 8px 10px; background: var(--shell-bg); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12.5px; font-weight: 500; }
.calv-day { display: grid; align-content: start; gap: 3px; min-width: 0; min-height: 124px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calv-day:nth-child(7n) { border-right: 0; }
.calv-day:nth-last-child(-n + 7) { border-bottom: 0; }
.calv-day.is-out { background: var(--surface-sunken); }
.calv-date { display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 2px; border-radius: 50%; font-size: 12.5px; font-weight: 600; }
.calv-day.is-out .calv-date { color: var(--muted); font-weight: 400; }
.calv-day.is-today .calv-date { background: var(--brand); color: #fff; }
.calv-ev { --c: var(--muted); display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; height: 24px; padding: 0 6px; border: 0; border-radius: 6px;
  background: none; color: var(--fg); font: inherit; font-size: 12px; text-align: left; cursor: pointer; transition: background 0.15s var(--ease); }
.calv-ev::before { content: ""; order: -1; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--c); }
.calv-ev[data-tone="success"] { --c: var(--success); }
.calv-ev[data-tone="info"] { --c: var(--info); }
.calv-ev[data-tone="warning"] { --c: #d98a00; }
.calv-ev[data-tone="danger"] { --c: var(--danger); }
.calv-ev:hover { background: var(--surface-soft); }
.calv-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.calv-time { order: 1; flex: none; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.calv-ev[data-open]::before { background: none; box-shadow: inset 0 0 0 1.5px var(--c); }
.calv-ev[data-open] .calv-name { color: var(--muted); font-weight: 400; }
.calv-ev[data-cancelled] .calv-name { color: var(--muted); font-weight: 400; text-decoration: line-through; text-decoration-color: var(--border-strong); }
.calv-more { justify-self: start; padding: 2px 6px; border: 0; border-radius: 5px; background: none; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.calv-more:hover { background: var(--surface-soft); color: var(--fg); }
@media (max-width: 760px) { .calv-day { min-height: 76px; padding: 4px; } .calv-name { display: none; } .calv-time { order: 0; } .calv-week span { padding: 6px 4px; text-align: center; } }
.menu-meta { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.scope-list { display: grid; gap: 12px; margin: 4px 0 0; padding: 14px; list-style: none; border: 1px solid var(--border); border-radius: 12px; }
.scope-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.45; }
.scope-list strong { display: block; color: var(--fg); font-size: 13.5px; font-weight: 600; }
.shell-page .scope-list svg.lucide { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.scope-list .is-yes { color: var(--success); } .scope-list .is-no { color: var(--muted); }

/* ─── Reports ─── */
/* Multi-series slots: dataviz reference palette (blue · orange · aqua), validated all-pairs light + dark. Single series uses --chart. */
.shell-page { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; }
:root[data-theme="dark"] .shell-page { --s1: #3987e5; --s2: #d95926; --s3: #199e70; }
.report { display: grid; gap: 36px; }
.rsection { display: grid; gap: 14px; scroll-margin-top: 16px; }
.rsection-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.rsection-head p { margin-top: 2px; color: var(--muted); font-size: 13.5px; }
.rkpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.rgrid > .rcard:first-child:nth-last-child(3) { grid-column: 1 / -1; } /* three cards: the first (trend / comparison) runs full width */
.rcard { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.rcard > * { min-width: 0; }
.rcard-body { display: flex; flex: 1; flex-direction: column; } /* a chart beside a taller list grows to match it */
.rcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rcard-head h3 { font-size: 14px; font-weight: 600; }
.rcard-head p { margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.rcard-toggle { flex: none; width: 30px; height: 30px; }
.rcard-toggle[aria-pressed="true"] { background: var(--surface-soft); color: var(--fg); }
.shell-page .rcard-toggle svg.lucide { width: 15px; height: 15px; }
.rcard-body[hidden], .rtable[hidden] { display: none; }
.rtable { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.rcard-foot { color: var(--muted); font-size: 12.5px; }
.rlegend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; }
.rlegend span { display: inline-flex; align-items: center; gap: 6px; }
.rlegend i { width: 8px; height: 8px; border-radius: 50%; }
.rlegend b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.rchart { position: relative; flex: 1; min-height: 230px; }
.rchart svg { display: block; overflow: visible; }
.raxis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rval { fill: var(--fg-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rgrid-line { stroke: var(--border); stroke-width: 1; }
.rbase { stroke: var(--border-strong); stroke-width: 1; }
.rline { fill: none; stroke-width: 2; stroke-linejoin: miter; stroke-miterlimit: 8; stroke-linecap: round; } /* sharp peaks, like the KPI sparklines */
.rcross { stroke: var(--border-strong); stroke-width: 1; pointer-events: none; }
.rdot { stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.rhit { fill: transparent; }
.rbar-group.is-on .rhit { fill: color-mix(in srgb, var(--fg) 4%, transparent); }
.rbar { transition: opacity 0.15s var(--ease); }
.rchart:has(.rbar-group.is-on) .rbar-group:not(.is-on) .rbar { opacity: 0.45; }
.rtip { position: absolute; top: 0; z-index: 3; display: grid; gap: 3px; min-width: 140px; padding: 8px 10px; transform: translateX(-50%); pointer-events: none;
  border-radius: 8px; background: var(--fg); color: var(--surface); font-size: 12px; line-height: 1.35; white-space: nowrap; box-shadow: var(--shadow-pop); }
.rtip-title { color: color-mix(in srgb, var(--surface) 70%, transparent); font-size: 11.5px; }
.rtip-row { display: flex; align-items: center; gap: 7px; }
.rtip-row i { width: 10px; height: 2px; border-radius: 1px; }
.rtip-row strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rtip-extra { color: color-mix(in srgb, var(--surface) 70%, transparent); font-size: 11.5px; }
.rnodata { display: grid; place-items: center; flex: 1; min-height: 230px; }
.rnodata span { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 12.5px; }
/* Ranked bars: label · bar · value (one row per broker/team) */
.hbars { margin: 0; padding: 0; list-style: none; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 64px; align-items: center; gap: 16px; height: 34px; padding: 0 6px; margin: 0 -6px; border-radius: 6px; }
.hbars li:hover { background: var(--surface-sunken); }
.hb-label { min-width: 0; overflow: hidden; font-size: 13.5px; white-space: nowrap; text-overflow: ellipsis; }
.hb-label small { margin-left: 8px; color: var(--muted); font-size: 12px; }
.hb-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.hb-fill { display: block; height: 100%; border-radius: 999px; background: var(--chart); }
.hb-val { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rtable-scroll { flex: 1; max-height: 330px; min-height: 0; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.rtable-scroll .table { width: 100%; min-width: 0; font-size: 13px; } /* the page-list .table min-width doesn't apply inside a card */
.rtable-scroll .table td { font-variant-numeric: tabular-nums; }
.rtable-scroll thead th { position: sticky; top: 0; z-index: 1; height: 36px; padding: 0 14px; font-size: 12.5px; }
.rtable-scroll th[scope="row"], .rtable-scroll td { height: auto; padding: 8px 14px; border-top: 1px solid var(--border); border-bottom: 0; color: var(--fg); font-size: 13px; }
.rtable-scroll th[scope="row"] { font-weight: 500; }
.rtable-scroll tbody tr:first-child > * { border-top: 0; }
.rtable-scroll th[scope="row"]::before { display: none; }
.rstats .stat { align-content: start; }
.rstats .stat small { color: var(--muted); font-size: 12px; }
.rstats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rskel { height: 260px; border-radius: 8px; }
@media (max-width: 1680px) { .rkpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rkpis .kpi-delta { white-space: nowrap; }
@media (max-width: 960px) { .rgrid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .rkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rstats-3 { grid-template-columns: 1fr; } .hbars li { grid-template-columns: minmax(0, 1fr) 72px; } .hb-track { grid-column: 1 / -1; grid-row: 2; } }

/* ─── Dashboard: sections (Reports cards) on the left, recent activity rail on the right ─── */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.dash-main { display: grid; gap: 32px; min-width: 0; }
.dash-rail { display: grid; gap: 16px; position: sticky; top: 16px; }
.dash-error { grid-column: 1 / -1; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.dash-more { display: inline-flex; flex: none; align-items: center; gap: 4px; color: var(--fg-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.dash-more:hover { color: var(--fg); }
.shell-page .dash-more svg.lucide { width: 14px; height: 14px; }
.dash .rkpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash .rchart, .dash .rnodata { min-height: 220px; }
.dash-stack { grid-template-columns: minmax(0, 1fr); } /* the 5-column team table needs the full width beside the rail */
.dash-feed li { align-items: flex-start; }
.dash-feed .feed-day { align-items: center; }
.dash-feed .feed-text { line-height: 1.45; }
.dash-feed time { padding-top: 2px; }
.due { display: grid; margin: 0; padding: 0; list-style: none; }
.due li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.due li + li { border-top: 1px solid var(--border); }
.due-who, .due-when { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; }
.due-who small, .due-when small { overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.due-when { flex: none; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1200px) { .dash { grid-template-columns: 1fr; } .dash-rail { position: static; } }
@media (max-width: 760px) { .dash-head { align-items: flex-start; flex-direction: column; gap: 6px; } }
@media (max-width: 640px) { .dash .rkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ─── Dashboard empty state: heading · (AI bar) · three action cards with static illustrations ─── */
.dash:has(.dash-start) { grid-template-columns: minmax(0, 1fr); }
.dash-start { display: grid; gap: 24px; width: min(100%, 1120px); margin: 24px auto 0; }
.start-head { text-align: center; }
.start-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.start-head p { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.start-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.start-card { display: flex; flex-direction: column; gap: 14px; padding: 6px 6px 18px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.start-art { aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--border); border-radius: calc(var(--r-card) - 4px); background: var(--surface-sunken); }
.start-art svg { display: block; width: 100%; height: 100%; }
.start-text { display: grid; gap: 6px; padding: 0 12px; }
.start-text h3 { font-size: 15px; font-weight: 600; }
.start-text p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.start-action { margin-top: auto; padding: 0 12px; }
.start-inline .input { width: 100%; }
/* illustration parts — tokens, so they follow light/dark */
.art-card { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; }
.art-lift { filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--fg) 8%, transparent)); }
.art-col { fill: color-mix(in srgb, var(--surface-soft) 60%, transparent); }
.art-field { fill: var(--surface-sunken); stroke: var(--border); }
.art-chip { fill: var(--surface); stroke: var(--border); }
.art-bar { fill: var(--border-strong); }
.art-bar-soft { fill: var(--border); }
.art-avatar { fill: var(--surface-soft); stroke: var(--border-strong); }
.art-line { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.art-dash { fill: none; stroke: var(--border-strong); stroke-dasharray: 4 4; }
.art-dash-brand { fill: color-mix(in srgb, var(--brand) 5%, var(--surface)); stroke: color-mix(in srgb, var(--brand) 55%, transparent); stroke-dasharray: 4 4; }
.art-brand { fill: var(--brand); }
.art-brand-soft { fill: color-mix(in srgb, var(--brand) 30%, var(--surface)); }
.art-brand-line { stroke: color-mix(in srgb, var(--brand) 55%, transparent); }
.art-on-brand { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.art-caret { fill: var(--fg); }
@media (max-width: 1000px) { .start-cards { grid-template-columns: 1fr; } .start-art { aspect-ratio: 2 / 1; } }

/* ─── Dashboard with AI: search/ask bar on top; the chat panel takes the activity rail's place while open ─── */
body[data-ai-open] .dash { grid-template-columns: minmax(0, 1fr); }
body[data-ai-open] .dash-rail { display: none; }
.ask { padding: 5px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-sunken); }
.ask-field { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 12px 0 16px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); cursor: text; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.ask-field:focus-within { border-color: var(--fg); box-shadow: 0 0 0 3px var(--focus); }
.shell-page .ask-field > svg.lucide { width: 18px; height: 18px; flex: none; color: var(--muted); }
.ask-field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--fg); font: inherit; font-size: 15px; }
.ask-field input:focus-visible { box-shadow: none; }
.ask-field input::placeholder { color: var(--muted); }
.ask-field kbd { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg-2); font: 500 12px var(--font); }
.ask-field kbd + kbd { margin-left: -4px; }

/* ─── AI chat panel: docked right, full height; the shell narrows to make room ─── */
.shell-page { --ai-w: 420px; }
.shell { transition: grid-template-columns 0.2s var(--ease), margin-right 0.2s var(--ease); }
body[data-ai-open] .shell { margin-right: var(--ai-w); }
body[data-ai-open] .proto-tenant { right: calc(var(--ai-w) + 16px); }
.ai-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-direction: column; width: var(--ai-w); border-left: 1px solid var(--border); background: var(--surface); }
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; align-items: center; gap: 8px; height: var(--top-h); flex: none; padding: 0 12px 0 18px; border-bottom: 1px solid var(--border); }
.ai-title { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-size: 14.5px; font-weight: 600; }
.shell-page .ai-title svg.lucide { width: 17px; height: 17px; color: var(--brand); }
.ai-ro { gap: 5px; }
.shell-page .ai-ro svg.lucide { width: 12px; height: 12px; }
.ai-log { display: flex; flex: 1; flex-direction: column; gap: 16px; min-height: 0; overflow-y: auto; padding: 20px 18px; }
.ai-msg { display: flex; gap: 10px; align-items: flex-start; }
.ai-msg[data-role="user"] { justify-content: flex-end; }
.ai-avatar { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--surface-soft); color: var(--brand); }
.shell-page .ai-avatar svg.lucide { width: 14px; height: 14px; }
.ai-bubble { display: grid; gap: 8px; min-width: 0; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.ai-msg[data-role="user"] .ai-bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--surface-soft); }
.ai-msg[data-role="ai"] .ai-bubble { flex: 1; padding-top: 3px; }
.ai-bubble b { font-weight: 600; }
.ai-bubble a { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.ai-list { display: grid; gap: 6px; margin: 0; padding-left: 18px; }
.ai-list:has(.ai-suggest) { padding: 0; list-style: none; }
.ai-muted { color: var(--muted); font-size: 12.5px; }
.ai-suggest { padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--fg-2); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.ai-suggest:hover { border-color: var(--border-strong); color: var(--fg); }
.ai-intro { display: grid; justify-items: start; gap: 8px; margin-top: auto; }
.ai-intro strong { font-size: 15px; font-weight: 600; }
.ai-intro p { color: var(--muted); font-size: 13px; }
.ai-thinking { display: flex; gap: 4px; padding-top: 10px; }
.ai-thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ai-dot 1s infinite ease-in-out; }
.ai-thinking i:nth-child(2) { animation-delay: 0.15s; } .ai-thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-compose { display: grid; gap: 8px; flex: none; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.ai-input { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.ai-input:focus-within { border-color: var(--fg); box-shadow: 0 0 0 3px var(--focus); }
.ai-input textarea { flex: 1; min-width: 0; height: 34px; max-height: 140px; padding: 7px 0; border: 0; outline: 0; background: none; color: var(--fg); font: inherit; font-size: 13.5px; line-height: 1.45; resize: none; }
.ai-input textarea:focus-visible { box-shadow: none; }
.ai-send { width: 32px; height: 32px; border-radius: 8px; background: var(--fg); color: var(--surface); }
.ai-send:hover { background: var(--fg); color: var(--surface); opacity: 0.85; }
.shell-page .ai-send svg.lucide { width: 16px; height: 16px; }
.ai-note { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
@media (max-width: 1100px) { body[data-ai-open] .shell { margin-right: 0; } .ai-panel { box-shadow: var(--shadow-pop); } body[data-ai-open] .proto-tenant { display: none; } }
@media (max-width: 640px) { .shell-page { --ai-w: 100vw; } .ask-field kbd { display: none; } }
@media (prefers-reduced-motion: reduce) { .ai-thinking i { animation: none; } }

/* ─── Notifications ─── */
.ntf { display: grid; gap: 32px; }
.ntf > .alert { margin-bottom: -16px; }
.ntf-channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ntf-channel { display: grid; gap: 12px; align-content: start; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.ntf-channel header { display: flex; align-items: center; gap: 12px; }
.ntf-channel header > div { flex: 1; min-width: 0; }
.ntf-channel h3 { font-size: 14.5px; font-weight: 600; }
.ntf-channel header p, .ntf-desc, .ntf-uses { color: var(--muted); font-size: 12.5px; }
.ntf-desc { font-size: 13px; }
.ntf-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 10px 0; border-block: 1px solid var(--border); }
.ntf-nums div + div { padding-left: 12px; border-left: 1px solid var(--border); }
.ntf-nums dt { color: var(--muted); font-size: 12px; }
.ntf-nums dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ntf-channel > .skeleton { height: 12px; }
/* status: small dot + label (no tinted pills) */
.ndot { display: inline-flex; align-items: center; gap: 7px; color: var(--fg-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.ndot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.ndot[data-tone="ok"]::before { background: var(--success); }
.ndot[data-tone="warn"]::before { background: var(--warn); }
.ndot[data-tone="bad"]::before { background: var(--danger); }
.ndot[data-tone="idle"]::before { background: var(--border-strong); }
.ntf-types { min-width: 760px; }
.ntf-types td { white-space: normal; vertical-align: top; padding-block: 14px; }
.ntf-name { display: grid; gap: 3px; max-width: 420px; }
.ntf-name strong { font-weight: 500; }
.ntf-name span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.ntf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ntf-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--fg-2); font-size: 12.5px; white-space: nowrap; }
.shell-page .ntf-chip svg.lucide { width: 13px; height: 13px; }
.ntf-warn { display: block; margin-top: 6px; color: var(--warn); font-size: 12px; }
.ntf-when { color: var(--fg-2); font-size: 13px; }
.ntf-types tr[data-off] :is(.ntf-name, .ntf-chips, .ntf-when) { opacity: 0.55; }
.ntf-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-2); white-space: nowrap; }
.switch { position: relative; width: 36px; height: 20px; flex: none; padding: 0; border: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background 0.15s var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform 0.15s var(--ease); }
.switch[aria-checked="true"] { background: var(--success); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.switch:focus-visible { box-shadow: 0 0 0 3px var(--focus); outline: 0; }
.ntf-log td.ntf-detail { max-width: 360px; overflow: hidden; color: var(--fg-2); font-size: 13px; white-space: normal; }
.ntf-log .col-actions { width: 1%; text-align: right; }
@media (max-width: 1000px) { .ntf-channels { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

/* ─── Data Export ─── */
.export-new .panel-head .check { font-weight: 500; }
.dataset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.dataset { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; transition: border-color 0.15s var(--ease), background 0.15s var(--ease); }
.dataset:hover { border-color: var(--border-strong); }
.dataset.is-on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.dataset:has(:focus-visible) { box-shadow: 0 0 0 3px var(--focus); }
.dataset-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--surface-soft); color: var(--fg-2); }
.dataset.is-on .dataset-icon { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); }
.shell-page .dataset-icon svg.lucide { width: 17px; height: 17px; }
.dataset-text { display: grid; gap: 3px; flex: 1; min-width: 0; }
.dataset-text strong { font-size: 13.5px; font-weight: 600; }
.dataset-text span { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.dataset-text small { margin-top: 3px; color: var(--fg-2); font-size: 12px; font-weight: 500; }
.dataset-check { flex: none; color: var(--brand); }
.shell-page .dataset-check { width: 18px; height: 18px; }
.dataset:not(.is-on) .dataset-check { visibility: hidden; }
.export-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-sunken); }
.export-note { display: flex; align-items: flex-start; gap: 8px; max-width: 620px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.shell-page .export-note svg.lucide { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--success); }
.export-go { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.export-sum { color: var(--fg-2); font-size: 13px; }
.export-id { font-weight: 600; font-variant-numeric: tabular-nums; }
.set-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 340px; white-space: normal; }
.export-progress { display: flex; align-items: center; gap: 10px; }
.export-progress .meter { width: 90px; }
.export-progress .meter span { background: var(--info); transition: width 0.6s linear; }
.export-reason { max-width: 280px; white-space: normal; }
.export-wait { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.shell-page .export-wait svg.lucide { width: 15px; height: 15px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.feed-icon[data-tone="danger"] { background: var(--danger-bg); color: var(--danger); }
.export-audit { max-height: 420px; overflow: auto; }
@media (max-width: 1100px) { .dataset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dataset-grid { grid-template-columns: 1fr; } .export-go { width: 100%; justify-content: space-between; } }
@media (prefers-reduced-motion: reduce) { .shell-page .export-wait svg.lucide { animation: none; } }
.member-text > .tag { justify-self: start; }

/* ─── Billing & Subscription ─── */
.billing { gap: 24px; }
.bsection { display: grid; gap: 10px; min-width: 0; align-content: start; }
.bsection-title { font-size: 15px; font-weight: 600; }
.bsection-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.promo { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 16px; border-radius: var(--r-card); background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info); font-size: 14px; font-weight: 500; }
.promo b { font-weight: 700; }
.shell-page .promo > svg.lucide { width: 17px; height: 17px; flex: none; }
.promo > span { flex: 1; }
.promo-btn { background: var(--fg); color: var(--surface); }
.promo-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 85%, var(--surface)); }
.plan-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.plan-id { display: grid; align-content: start; gap: 8px; padding: 20px 22px; }
.plan-name { display: flex; align-items: center; gap: 10px; }
.plan-name h3 { font-size: 16px; font-weight: 600; }
.plan-price { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.plan-price strong { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.plan-price span { color: var(--muted); font-size: 13.5px; }
.plan-desc { max-width: 460px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.plan-usage { display: grid; align-content: start; gap: 10px; padding: 20px 22px; border-left: 1px solid var(--border); background: var(--surface-sunken); }
.plan-count { font-size: 14px; color: var(--fg-2); } .plan-count strong { color: var(--fg); font-weight: 600; }
.seat-meter { height: 8px; }
.seat-meter span { background: var(--chart); }
.seat-meter.is-near span { background: var(--warn); }
.plan-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.plan-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.plan-alert { padding: 0 22px 18px; }
.billing-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.billing-side { display: grid; gap: 24px; }
.billing-grid .panel-table .table { min-width: 540px; }
.billing-grid .row-actions { flex-wrap: nowrap; gap: 2px; }
td.nowrap { white-space: nowrap; }
td.num { font-weight: 500; font-variant-numeric: tabular-nums; }
.cards-list { margin: 0; padding: 0; list-style: none; }
.cards-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.cards-list li + li { border-top: 1px solid var(--border); }
.cards-list .member-text { flex: 1; }
.cards-list strong { font-size: 13.5px; font-weight: 600; }
.card-mark { display: grid; place-items: center; width: 40px; height: 28px; flex: none; border-radius: 6px; font-size: 10px; font-weight: 800; font-style: italic; letter-spacing: 0.02em; }
.card-mark[data-brand="visa"] { background: #1a3fd6; color: #fff; }
.card-mark[data-brand="amex"] { background: #1f72cd; color: #fff; font-style: normal; font-size: 9px; }
.card-mark[data-brand="mastercard"] { display: flex; justify-content: center; background: var(--surface); border: 1px solid var(--border); }
.card-mark[data-brand="mastercard"] i { width: 13px; height: 13px; border-radius: 50%; background: #eb001b; }
.card-mark[data-brand="mastercard"] i + i { margin-left: -5px; background: #f79e1b; mix-blend-mode: multiply; }
.card-safe { display: flex; align-items: flex-start; gap: 6px; }
.shell-page .card-safe svg.lucide { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--success); }
.details .is-total dt, .details .is-total dd { color: var(--fg); font-weight: 700; }
@media (max-width: 1100px) { .billing-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .plan-top { grid-template-columns: 1fr; } .plan-usage { border-left: 0; border-top: 1px solid var(--border); } .promo { flex-wrap: wrap; } }

/* Billing · plan card: change plan · seat stepper (used in the Manage seats modal) */
.plan-change { justify-self: start; margin-top: 6px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-control); background: var(--surface); overflow: hidden; }
.stepper .icon-btn { width: 34px; height: 34px; border-radius: 0; }
.stepper .icon-btn:disabled { opacity: 0.35; }
.compact .stepper .input { width: 64px; height: 34px; padding: 0; border: 0; border-inline: 1px solid var(--border); border-radius: 0; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: none; -moz-appearance: textfield; }
.stepper .input::-webkit-inner-spin-button, .stepper .input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ─── Plans page: three columns, then a comparison table ─── */
.cycle-switch { align-self: end; }
.cycle-switch button { display: inline-flex; align-items: center; gap: 6px; }
.save-pill { padding: 1px 6px; border-radius: 999px; background: var(--success-bg); color: var(--success); font-size: 11.5px; font-weight: 600; }
.plan-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan-col { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.plan-col.is-current { border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.plan-col-head { display: grid; gap: 10px; padding: 22px 22px 20px; }
.plan-col-name { display: flex; align-items: center; gap: 8px; }
.plan-col-name h2 { font-size: 17px; font-weight: 600; }
.plan-col-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan-col-price strong { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.plan-col-price span { color: var(--muted); font-size: 13.5px; }
.plan-col-price s { color: var(--muted); font-size: 13.5px; }
.plan-col-desc { min-height: 42px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.plan-col-est { color: var(--fg-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.plan-col-head > .btn { width: 100%; height: 40px; margin-top: 4px; }
.plan-col-why { color: var(--muted); font-size: 12.5px; }
.plan-col-body { flex: 1; padding: 18px 22px 22px; border-top: 1px solid var(--border); background: var(--surface-sunken); }
.plan-col-lead { margin-bottom: 10px; font-size: 13.5px; font-weight: 600; }
.plan-col-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.plan-col-list li { display: flex; gap: 8px; align-items: flex-start; color: var(--fg-2); font-size: 13.5px; line-height: 1.45; }
.shell-page .plan-col-list svg.lucide { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--success); }
.compare .panel-table .table { min-width: 640px; }
.compare-table th[scope="col"] { width: 22%; }
.compare-table th[scope="col"]:first-child { width: auto; }
.compare-table th[scope="col"].is-current, .compare-table td.is-current { background: color-mix(in srgb, var(--fg) 2.5%, transparent); }
.compare-table th[scope="row"] { height: auto; padding: 11px 16px; border-top: 1px solid var(--border); border-bottom: 0; color: var(--fg-2); font-size: 13.5px; font-weight: 400; white-space: normal; }
.compare-table th[scope="row"]::before { display: none; }
.compare-table td { white-space: normal; font-size: 13.5px; }
.cmp-section th { height: auto; padding: 18px 16px 8px; border-bottom: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.cmp-section th::before { display: none; }
.shell-page .cmp-yes { width: 16px; height: 16px; color: var(--success); }
.cmp-no { color: var(--border-strong); }
.plan-note { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
@media (max-width: 1000px) { .plan-cols { grid-template-columns: 1fr; } .plan-col-desc { min-height: 0; } }
.plan-col-head > .btn:disabled { opacity: 1; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); cursor: not-allowed; }

/* Manage seats modal */
.seat-facts { margin-bottom: 4px; }
.stepper-lg { display: flex; width: 100%; }
.stepper-lg .icon-btn { width: 46px; height: 46px; }
.compact .stepper-lg .input { flex: 1; width: auto; height: 46px; font-size: 18px; }
.seat-total { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-sunken); font-size: 13.5px; color: var(--fg-2); }
.seat-total strong { font-size: 20px; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; }
.seat-total small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.seat-diff { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.seat-diff[data-dir="up"] { color: var(--fg-2); }
.seat-diff[data-dir="down"] { color: var(--success); }

/* ─── Integrations ─── */
.integrations { gap: 32px; }
.isection { display: grid; gap: 12px; min-width: 0; }
.isection-title { font-size: 15px; font-weight: 600; }
.isection-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn-dark { background: var(--fg); color: var(--surface); }
.btn-dark:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 85%, var(--surface)); text-decoration: none; }
/* Logos: brand-colour tile with a mark (text or icon) */
.int-logo { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--c); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: -0.02em; }
.shell-page .int-logo svg.lucide { width: 16px; height: 16px; }
.int-logo.is-xs { width: 18px; height: 18px; border-radius: 5px; font-size: 8px; } .shell-page .int-logo.is-xs svg.lucide { width: 10px; height: 10px; }
.int-logo.is-sm { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
.int-logo.is-md { width: 38px; height: 38px; border-radius: 10px; font-size: 13px; } .shell-page .int-logo.is-md svg.lucide { width: 19px; height: 19px; }
.int-logo.is-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 17px; } .shell-page .int-logo.is-lg svg.lucide { width: 26px; height: 26px; }
.int-logo.is-k { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.int-logo.is-k img { width: 62%; height: 62%; }
/* Connected list / empty */
.int-empty { display: grid; justify-items: center; gap: 6px; padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }
.int-empty strong { color: var(--fg); font-size: 14px; font-weight: 600; }
.shell-page .int-empty svg.lucide { width: 22px; height: 22px; }
.int-connected { margin: 0; padding: 0; list-style: none; }
.int-connected li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.int-connected li + li { border-top: 1px solid var(--border); }
.int-connected li.is-error { background: color-mix(in srgb, var(--danger-bg) 60%, transparent); }
.int-connected .member-text { flex: 1; }
.int-connected strong { font-size: 14px; font-weight: 600; }
/* Featured: inset illustration · title · text · dark button (reference style) */
.featured { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feat-card { display: flex; flex-direction: column; gap: 12px; padding: 10px 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.feat-card .connect-art { height: 190px; }
.feat-card .art-sheet { top: 30px; width: min(260px, calc(100% - 40px)); gap: 10px; }
.feat-card .art-ghost { top: 12px; height: 52px; }
.feat-card .art-chip { right: 12px; bottom: 12px; }
.art-bar.w80 { flex-basis: auto; width: 80%; } .art-bar.w70 { flex-basis: auto; width: 70%; } .art-bar.w50 { flex-basis: auto; width: 50%; }
/* calendar week */
.wk { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.wk-col { display: grid; gap: 4px; }
.wk-col b { color: var(--muted); font-size: 9px; font-weight: 600; text-align: center; }
.wk-col i { display: grid; place-items: center; height: 17px; border-radius: 4px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); font-size: 8.5px; font-style: normal; font-weight: 700; color: #fff; }
.wk-col i.busy { background: repeating-linear-gradient(135deg, var(--surface-soft) 0 3px, var(--border) 3px 4px); box-shadow: none; }
.wk-col i.on { background: var(--brand); box-shadow: 0 4px 10px -4px var(--brand); }
/* invite */
.inv { display: grid; gap: 9px; }
.inv-row { display: flex; align-items: center; gap: 8px; }
.shell-page .inv svg.lucide { width: 13px; height: 13px; flex: none; color: var(--muted); }
.inv-av { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--peach-soft); box-shadow: inset 0 0 0 1px var(--peach-line); color: var(--brand); font-size: 8px; font-weight: 700; }
.inv-av.is-b { margin-left: -12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--muted); }
.inv-link { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 8px; background: var(--peach-soft); box-shadow: inset 0 0 0 1px var(--peach-line); color: var(--fg); font-size: 10.5px; font-weight: 600; }
.shell-page .inv-link svg.lucide { color: var(--brand); }
/* summary */
.sum { display: grid; gap: 7px; }
.sum-label { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.sum-item { display: flex; align-items: center; gap: 7px; }
.sum-box { width: 12px; height: 12px; flex: none; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.sum-box.is-on { background: var(--brand); box-shadow: none; }
.feat-text { display: grid; gap: 4px; padding: 0 6px; flex: 1; }
.feat-text h3 { font-size: 14.5px; font-weight: 600; }
.feat-text p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.feat-btn { align-self: flex-start; margin-left: 6px; gap: 6px; }
/* All integrations */
.int-group { display: grid; gap: 10px; margin-top: 16px; }
.int-group header h3 { font-size: 14px; font-weight: 600; }
.int-group header p { color: var(--muted); font-size: 12.5px; }
.int-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.int-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.15s var(--ease); }
.int-card:hover { border-color: var(--border-strong); }
.int-card.is-error { border-color: var(--danger-line); }
.int-head { display: flex; align-items: center; gap: 10px; }
.int-head h4 { flex: 1; font-size: 14px; font-weight: 600; }
.int-desc { flex: 1; color: var(--muted); font-size: 13px; line-height: 1.5; }
.int-acct { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--fg-2); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.int-card.is-error .int-acct { white-space: normal; }
.shell-page .int-acct svg.lucide { width: 13px; height: 13px; flex: none; }
.int-actions { display: flex; gap: 6px; margin-top: 4px; }
.int-card.is-flash { animation: flash 1.6s var(--ease); }
/* Dialogs */
.auth-pair { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 6px 0 4px; }
.auth-dots { display: flex; gap: 4px; } .auth-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }
.manage-head { display: flex; align-items: flex-start; gap: 12px; }
.manage-head strong { font-size: 14.5px; font-weight: 600; }
.manage-settings { display: grid; gap: 8px; }
.set-label { margin-top: 6px; color: var(--fg-2); font-size: 13px; font-weight: 500; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--fg); }
.check-row span { display: grid; gap: 1px; } .check-row strong { font-size: 13.5px; font-weight: 500; } .check-row small { color: var(--muted); font-size: 12.5px; }
.check-row.is-disabled { opacity: 0.55; cursor: not-allowed; }
.manage-danger { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
@media (max-width: 1100px) { .featured, .int-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .featured, .int-grid { grid-template-columns: 1fr; } .int-connected li { flex-wrap: wrap; } }
/* Featured · meeting link: one 5s loop — time fills → attendees pop in → link drops in and shines → chip */
.feat-art.is-anim .inv-row:first-child .art-bar:not(.is-grey) { transform-origin: left; animation: inv-fill 5s var(--ease) infinite; }
.feat-art.is-anim .inv-av { animation: inv-pop 5s var(--ease) infinite; }
.feat-art.is-anim .inv-av.is-b { animation-name: inv-pop-b; }
.feat-art.is-anim .inv-link { position: relative; overflow: hidden; animation: inv-link 5s var(--ease) infinite; }
.feat-art.is-anim .inv-link::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.7) 50%, transparent 70%); transform: translateX(-100%); animation: inv-shine 5s ease-in-out infinite; }
.feat-art.is-anim .art-chip { animation: inv-chip 5s var(--ease) infinite; }
@keyframes inv-fill { 0%, 4% { transform: scaleX(0); } 18%, 92% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes inv-pop { 0%, 18% { opacity: 0; transform: scale(0.5); } 26%, 92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.5); } }
@keyframes inv-pop-b { 0%, 24% { opacity: 0; transform: scale(0.5); } 32%, 92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.5); } }
@keyframes inv-link { 0%, 34% { opacity: 0; transform: translateY(8px); } 44%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(8px); } }
@keyframes inv-shine { 0%, 46% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes inv-chip { 0%, 56% { opacity: 0; transform: translateY(8px) scale(0.96); } 64%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(8px) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .feat-art.is-anim *, .feat-art.is-anim *::after { animation: none !important; } }
/* Featured · card 1: two tilted mini cards + sync badge */
.feat-art.is-split { display: flex; align-items: center; justify-content: center; gap: 0; }
.split-line { position: absolute; left: 22%; right: 22%; top: 50%; border-top: 1.5px dashed var(--peach-line); }
.mini-card { position: relative; z-index: 1; display: grid; gap: 8px; width: 38%; max-width: 132px; padding: 9px 10px 11px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 14px 30px -20px rgb(16 24 20 / 0.45); }
.mini-card.is-left { transform: rotate(-5deg) translateY(4px); }
.mini-card.is-right { transform: rotate(4deg) translateY(-4px); }
.mini-head { display: flex; align-items: center; gap: 6px; }
.mini-head b { font-size: 10px; font-weight: 600; }
.mini-blocks { display: grid; gap: 4px; }
.mini-blocks i { height: 11px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--border); }
.mini-blocks i.busy { background: repeating-linear-gradient(135deg, var(--surface-soft) 0 3px, var(--border) 3px 4px); box-shadow: none; }
.mini-slots { display: grid; gap: 4px; }
.mini-slots span { padding: 3px 0; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--border-strong); text-align: center; font-size: 9.5px; font-weight: 600; color: var(--fg-2); }
.mini-slots .is-off { color: var(--border-strong); text-decoration: line-through; box-shadow: inset 0 0 0 1px var(--border); }
.mini-slots .is-on { background: var(--brand); color: #fff; box-shadow: 0 4px 10px -4px var(--brand); }
.sync-badge { position: relative; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; margin: 0 -6px; flex: none; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--peach-soft), 0 6px 14px -6px var(--brand); }
.shell-page .sync-badge svg.lucide { width: 14px; height: 14px; stroke-width: 2.5; }
/* Featured · card 3: waveform pill → summary note pinned to the client */
.feat-art.is-stack { display: flex; flex-direction: column; align-items: center; padding-top: 16px; }
.wave-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); box-shadow: 0 10px 24px -16px rgb(16 24 20 / 0.45); }
.wave { display: flex; align-items: center; gap: 2px; height: 16px; }
.wave i { width: 3px; border-radius: 2px; background: var(--peach); }
.wave i:nth-child(3n + 2) { background: var(--brand); }
.wave-pill b { color: var(--muted); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stack-line { height: 18px; border-left: 1.5px dashed var(--peach-line); }
.note-card { position: relative; display: grid; gap: 7px; width: min(220px, calc(100% - 48px)); flex: 1; padding: 12px 14px; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--surface); box-shadow: 0 18px 40px -24px rgb(16 24 20 / 0.35); }
.note-pin { position: absolute; top: -10px; right: -10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--peach-soft); box-shadow: inset 0 0 0 1.5px var(--peach-line), 0 0 0 3px var(--surface); color: var(--brand); font-size: 9px; font-weight: 700; }
.note-card .sum-label { margin: 0; }

/* ─── Brokerage Profile ─── */
.bp { display: grid; gap: 14px; }
.bp-bar { position: sticky; top: 12px; z-index: 5; box-shadow: var(--shadow-card); }
.bp-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.bp-side { display: grid; gap: 16px; }
.bp-fields { display: grid; gap: 14px; padding: 16px; }
.bp-logo-body { display: flex; align-items: flex-start; gap: 16px; padding: 16px; }
.bp-logo { display: grid; place-items: center; width: 44px; height: 44px; flex: none; overflow: hidden; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--border); color: var(--fg-2); font-weight: 700; }
.bp-logo.is-lg { width: 76px; height: 76px; border-radius: 16px; font-size: 22px; }
.bp-logo img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.bp-logo-text { display: grid; gap: 10px; min-width: 0; }
.bp-logo-text > p:first-child { color: var(--muted); font-size: 13px; line-height: 1.5; }
.bp-logo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bp-logo-actions label.btn { cursor: pointer; }
.bp-logo-actions:has(:focus-visible) label.btn { box-shadow: 0 0 0 3px var(--focus); }
.bp-id { display: flex; align-items: center; gap: 6px; }
.bp-id code { padding: 2px 7px; border-radius: 6px; background: var(--surface-soft); font-family: var(--mono); font-size: 12.5px; }
.save-note { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 13px; font-weight: 500; }
.shell-page .save-note svg.lucide { width: 15px; height: 15px; }
@media (max-width: 960px) { .bp-grid { grid-template-columns: 1fr; } }
