/* FIG Hub look (approved mockup: docs/mockups/hub-cloud-menu.html). Loaded after app.css: it sets the design tokens the
   CliniBooks screens already use, so every screen takes the FIG red and black, and styles the Hub frame itself.
   Light is the default; dark comes from html[data-mode="dark"] (each person's choice). */

@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/dm-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/dm-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/dm-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/dm-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/poppins-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #EEF0F4; --surface: #FFFFFF; --surface-2: #F8F9FB; --sunk: #E9ECF1; --topbar: #FFFFFF;
  --line: #DCE0E7; --line-2: #E9ECF1;
  --ink: #141416; --ink-2: #3B404B; --muted: #555B68; --on-ink: #FFFFFF; --solid: #0F0F10;
  --brand: #DE0A0A; --brand-ink: #FFFFFF; --brand-soft: #FCE4E4; --accent: #0F0F10; --red-text: #B30808;
  --ok: #1B6B3A; --ok-soft: #DDF1E4; --warn: #8A4D06; --warn-soft: #FBEBD5; --bad: #B30808; --bad-soft: #FCE4E4;
  --side: #0F0F10; --side-2: #1B1B1E; --side-line: #2A2A2F; --side-text: #ECEAE7; --side-muted: #9B99A1;
  --sidebar: var(--side); --sidebar-ink: var(--side-text); --nav-active: var(--side-2); --nav-active-ink: #fff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,22,40,.05), 0 8px 24px rgba(20,22,40,.06);
  --shadow-lg: 0 18px 48px rgba(20,22,40,.18);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Poppins", "DM Sans", system-ui, sans-serif;
  color-scheme: light;
}
html[data-mode="dark"] {
  color-scheme: dark;
  --bg: #0E0E0F; --surface: #18181B; --surface-2: #1E1E22; --sunk: #232328; --topbar: #18181B;
  --line: #2C2C31; --line-2: #232328;
  --ink: #F2F0EE; --ink-2: #CFCCC8; --muted: #A3A1A9; --on-ink: #0E0E0F; --solid: #F2F0EE;
  --brand: #ED1C24; --brand-ink: #FFFFFF; --brand-soft: #3A1214; --red-text: #FF6B6F;
  --ok: #6FD39A; --ok-soft: #14301F; --warn: #F0A15A; --warn-soft: #3A2412; --bad: #FF6B6F; --bad-soft: #3A1214;
  --info: #9cc2ff; --info-soft: #182841;
  --side: #070708; --side-2: #161619; --side-line: #232327;
  --sidebar: var(--side); --sidebar-ink: var(--side-text); --nav-active: var(--side-2); --nav-active-ink: #fff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3); --shadow-lg: 0 18px 48px rgba(0,0,0,.55);
}

body { font-family: var(--font); background: var(--bg); color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--display); }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.2px; }
a { color: var(--red-text); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Frame ---------- */
.hub-app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.hub-side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; min-height: 0; z-index: 40; }
.hub-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; color: var(--side-text); text-decoration: none !important; }
.hub-brand b { font: 600 15px var(--display); letter-spacing: .2px; }
.hub-brand span:last-child { color: var(--side-muted); font-size: 11.5px; margin-left: auto; }
.hub-mark { width: 28px; height: 28px; border-radius: 50%; background: #DE0A0A; display: grid; place-items: center; font: 700 10px var(--display); color: #fff; letter-spacing: .02em; }
.hub-switch { margin: 6px 14px 0; padding: 12px; border-radius: 16px; background: var(--side-2); border: 1px solid var(--side-line); }
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 6px; justify-items: center; }
.hub-cell { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.hub-biz { width: 52px; height: 52px; border-radius: 50%; position: relative; display: grid; place-items: center; font: 600 14px var(--display); color: #fff !important; background: var(--c, #3D4B5C); text-decoration: none !important; transition: transform .15s ease, box-shadow .15s ease; flex: none; }
.hub-biz img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hub-biz:hover { transform: translateY(-1px); }
.hub-biz[aria-current="true"] { box-shadow: 0 0 0 3px var(--side-2), 0 0 0 5px #DE0A0A; }
.hub-biz-all { background: #F2F0EE; color: #0F0F10 !important; }
.hub-dot { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #DE0A0A; color: #fff; font: 600 11px/14px var(--font); border: 2px solid var(--side-2); }
.hub-biz-label { display: block; max-width: 100%; text-align: center; font-size: 11px; color: var(--side-muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-current { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--side-line); display: flex; align-items: baseline; gap: 8px; }
.hub-current b { font: 600 14px var(--display); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-current span { color: var(--side-muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.hub-menu { flex: 1; overflow: auto; padding: 10px 10px 12px; }
.hub-group { margin-top: 12px; }
.hub-group:first-child { margin-top: 0; }
.hub-group h4 { margin: 0 10px 4px; font: 600 11px var(--font); letter-spacing: .9px; text-transform: uppercase; color: var(--side-muted); }
.hub-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--side-text) !important; text-decoration: none !important; position: relative; }
.hub-item .ic { opacity: .85; }
.hub-item:hover { background: var(--side-2); }
.hub-item[aria-current="page"] { background: var(--side-2); color: #fff !important; }
.hub-item[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: #DE0A0A; }
.hub-item .n { margin-left: auto; font-size: 12px; color: var(--side-muted); }
.hub-item .n.alert { color: #fff; background: #DE0A0A; border-radius: 9px; padding: 0 7px; line-height: 18px; font-weight: 600; }
.hub-side-foot { padding: 10px 14px 14px; border-top: 1px solid var(--side-line); display: flex; gap: 8px; }
.hub-side-foot > *, .hub-side-foot form { flex: 1; display: flex; }
.hub-side-foot button { flex: 1; border: 1px solid var(--side-line); background: none; color: var(--side-text); border-radius: 10px; padding: 7px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.hub-side-foot button:hover { background: var(--side-2); }

.hub-main { display: flex; flex-direction: column; min-width: 0; }
.hub-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--topbar); }
.hub-search { flex: 1; max-width: 620px; width: auto; }
.hub-search input.input { height: 38px; border-radius: 12px; background: var(--sunk); border-color: transparent; padding-right: 36px; }
.hub-search input.input:focus { background: var(--surface); border-color: var(--brand); }
.hub-search kbd { position: absolute; right: 10px; top: 9px; font: 500 11px var(--font); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--surface); color: var(--muted); }
.hub-icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; position: relative; cursor: pointer; flex: none; }
.hub-icon-btn .pip { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.hub-burger { display: none; }
.hub-me { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.hub-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--solid); color: var(--on-ink); display: grid; place-items: center; font: 600 13px var(--display); flex: none; }
.hub-me-text b { display: block; font-weight: 600; font-size: 13px; line-height: 1.2; }
.hub-me-text small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }
.hub-dd-head { margin: 6px 10px 4px; font: 600 11px var(--font); text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.hub-dd-foot { border-top: 1px solid var(--line-2); margin-top: 4px; padding: 8px 10px 4px; font-size: 11.5px; color: var(--muted); }
.hub-notes { min-width: 280px; }
.hub-content { padding: 22px 24px 48px; max-width: none; }
.hub-crumb { color: var(--muted); font-size: 12px; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.hub-crumb i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }

/* ---------- Dashboard pieces ---------- */
.hub-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.hub-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.hub-tile .k { color: var(--muted); font-size: 12px; }
.hub-tile .v { font: 600 26px/1.15 var(--display); margin-top: 4px; }
.hub-tile .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.hub-tile.hot .v { color: var(--red-text); }
.hub-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.hub-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hub-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.hub-card-head h3 { margin: 0; font: 600 15px var(--display); }
.hub-card-head .more { margin-left: auto; color: var(--red-text); font-weight: 500; font-size: 13px; }
.hub-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--ink) !important; text-decoration: none !important; }
.hub-row:last-child { border-bottom: 0; }
a.hub-row:hover { background: var(--surface-2); }
.hub-row .t { font-weight: 600; font-size: 13px; width: 52px; flex: none; }
.hub-row .who { min-width: 0; flex: 1; }
.hub-row .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-row .who small { color: var(--muted); }
.hub-row.edge::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.hub-biz-sm { width: 34px; height: 34px; font-size: 11px; }
.hub-soon { display: flex; gap: 16px; align-items: flex-start; padding: 22px; }
.hub-soon h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.hub-soon p { margin: 0 0 10px; color: var(--ink-2); }
.hub-soon-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--red-text); display: grid; place-items: center; flex: none; }

/* ---------- CliniBooks screens in the Hub look ---------- */
.card { border-radius: 16px; }
.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-dark { background: var(--solid); border-color: var(--solid); color: var(--on-ink) !important; text-decoration: none !important; }
.btn-dark:hover { background: var(--solid); filter: brightness(.9); }
.input, select.input, textarea.input { border-radius: 10px; }
.page-head h1 { font: 600 24px/1.2 var(--display); }
.table th { background: transparent; font-size: 11px; letter-spacing: .7px; }
.table tbody tr:hover td { background: var(--surface-2); }
.chip { background: var(--sunk); color: var(--muted); font-weight: 600; font-size: 11px; border-radius: 999px; padding: 1px 8px; }
.chip.red { background: var(--bad-soft); color: var(--red-text); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.amber { background: var(--warn-soft); color: var(--warn); }
.badge { border-radius: 6px; letter-spacing: .4px; }
.tabs .active { color: var(--ink); border-bottom-color: var(--brand); }
.dd-menu { border-radius: 12px; }
.dd-menu a, .dd-menu button { border-radius: 8px; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--sunk); }
.alert { border-radius: 12px; }
.counter { border-radius: 16px; box-shadow: var(--shadow); }
.counter .dot { border-radius: 50%; }
.counter:hover { border-color: var(--line); box-shadow: var(--shadow-lg); }
.counter .n { font-family: var(--display); font-weight: 600; }

/* ---------- Team & access ---------- */
.hub-client-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 4px 16px; margin: 8px 0 0 24px; }
.hub-logo-preview { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font: 600 20px var(--display); color: #fff; overflow: hidden; flex: none; }
.hub-logo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Clients & services ---------- */
.hub-svc-wrap { overflow: auto; max-height: calc(100vh - 220px); }
.hub-svc th { position: sticky; top: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
.hub-svc th:first-child, .hub-svc td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 2; }
.hub-svc-name { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hub-svc-name a { color: var(--ink); }
.hub-svc td { vertical-align: middle; padding: 7px 10px; }
.hub-tick { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; padding: 0; color: var(--on-ink); }
.hub-tick[aria-checked="true"] { background: var(--solid); border-color: var(--solid); }
.hub-tick[aria-checked="true"]::after { content: ""; width: 9px; height: 5px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -1px); }
.hub-tick:disabled { cursor: default; }
.hub-svc-list { display: flex; flex-direction: column; gap: 6px; }
.hub-svc-item { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hub-svc-item .input { max-width: 260px; }

/* ---------- Scheduled checks ---------- */
.hub-check { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.hub-check:last-child { border-bottom: 0; }
.hub-check-row { display: flex; align-items: center; gap: 10px; padding: 8px 0 0; flex-wrap: wrap; }
.hub-check-note { height: 30px; width: 180px; font-size: 13px; }
@media (max-width: 520px) { .hub-check-note { width: 100%; } .hub-check-row form { width: 100%; } }

/* ---------- Task board ---------- */
.hub-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.hub-col { background: var(--sunk); border-radius: 14px; padding: 10px; min-height: 120px; }
.hub-col h4 { margin: 2px 4px 8px; font: 600 13px var(--display); display: flex; justify-content: space-between; }
.hub-col h4 span { color: var(--muted); font-weight: 500; }
.hub-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; }
.hub-card:hover, .hub-card:focus-visible { border-color: var(--muted); }
.hub-card.done { opacity: .6; }
.hub-card.done b { text-decoration: line-through; }
.hub-card .cl { font-size: 12px; font-weight: 600; color: var(--muted); }
.hub-card b { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.hub-card .chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.hub-card .chip { margin: 0; }
.hub-pri { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; vertical-align: 1px; }
.hub-people { display: flex; margin-top: 6px; }
.hub-avatar-xs { width: 24px; height: 24px; font-size: 10px; border: 2px solid var(--surface); }
.hub-people .hub-avatar-xs + .hub-avatar-xs { margin-left: -6px; }
.hub-add { width: 100%; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 10px; padding: 8px; font: inherit; cursor: pointer; }
.hub-add:hover { color: var(--ink); border-color: var(--muted); }
.hub-modal-wide { width: min(760px, calc(100vw - 32px)); }
.hub-task-form { padding: 14px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.hub-quick { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.hub-quick button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 12px; cursor: pointer; }
.hub-quick button:hover { border-color: var(--muted); }
.hub-checkitem { gap: 8px; margin-bottom: 6px; }
.hub-checkitem input[type=checkbox] { width: 18px; height: 18px; flex: none; }
@media (max-width: 900px) { .hub-board { grid-auto-columns: minmax(240px, 82vw); } }

/* ---------- Brand kits ---------- */
.hub-eyebrow { font-size: 11px; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.hub-kit-dots { display: flex; gap: 3px; width: 92px; flex: none; }
.hub-kit-dots i { width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line); }
.hub-draftbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
.hub-sec { display: flex; justify-content: space-between; align-items: center; margin: 0 0 12px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-family: var(--font); font-weight: 600; }
.hub-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.hub-sw { border-radius: 12px; padding: 10px; min-height: 96px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid rgba(0,0,0,.06); font-size: 11.5px; }
.hub-sw b { font-size: 13px; }
.hub-type { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hub-type > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.hub-type .big { font: 600 22px/1.2 var(--display); margin-bottom: 4px; overflow-wrap: anywhere; }
.hub-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hub-rules ul { margin: 0; padding: 12px 14px 12px 30px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.hub-rules li { margin: 3px 0; } .hub-rules .lbl { list-style: none; margin-left: -16px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.hub-rules .do .lbl { color: var(--ok); } .hub-rules .dont .lbl { color: var(--red-text); }
.hub-files { display: flex; flex-direction: column; gap: 6px; }
.hub-file { display: flex; align-items: center; gap: 10px; }
.hub-file img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: var(--sunk); border: 1px solid var(--line); }
.hub-file a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-file-k { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--red-text); flex: none; }
.hub-colrow { gap: 8px; margin-bottom: 8px; }
.hub-colpick { width: 40px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); flex: none; }
@media (max-width: 640px) { .hub-type, .hub-rules { grid-template-columns: 1fr; } }

/* ---------- Mail ---------- */
.hub-mail-tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.hub-tab { padding: 7px 14px; border-radius: 999px; font-weight: 500; color: var(--muted) !important; text-decoration: none !important; }
.hub-tab b { font-weight: 600; margin-left: 4px; }
.hub-tab[aria-current="page"] { background: var(--solid); color: var(--on-ink) !important; }
.hub-mail { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 14px; align-items: start; }
.hub-mail-list { max-height: calc(100vh - 210px); overflow: auto; }
.hub-mrow { display: flex; gap: 10px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.hub-mrow:first-child { border-top: 0; }
.hub-mrow:hover { background: var(--surface-2); }
.hub-mrow[aria-current="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand); }
.hub-mrow .from { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-mrow.read .from { font-weight: 500; }
.hub-mrow .subj { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-mrow .chips { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.hub-mrow .chip { margin: 0; }
.hub-mrow .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.hub-mrow .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.hub-avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.hub-rhead { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px 10px; flex-wrap: wrap; }
.hub-rhead h2 { margin: 0 0 6px; font: 600 20px/1.25 var(--display); }
.hub-rhead .chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hub-snooze { padding: 0 20px 10px; }
.hub-thread { padding: 0 20px 14px; }
.hub-msg { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.hub-mail-text { white-space: pre-wrap; margin-top: 8px; overflow-wrap: anywhere; }
.hub-mail-frame { width: 100%; min-height: 320px; border: 0; background: #fff; border-radius: 8px; margin-top: 8px; }
.hub-draft { margin: 0 20px 18px; border: 1.5px solid var(--solid); border-radius: 16px; overflow: hidden; }
.hub-dtop { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.hub-dbody { padding: 12px 14px; }
.hub-dfoot { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 1100px) { .hub-mail { grid-template-columns: 320px minmax(0, 1fr); } }
@media (max-width: 900px) { .hub-mail { grid-template-columns: minmax(0, 1fr); } .hub-mail-list { max-height: none; } }

/* ---------- Tasks · Trello ---------- */
.hub-summary { font: 600 24px/1.25 var(--display); }
.hub-summary .o { color: var(--red-text); } .hub-summary .w { color: var(--muted); }
.hub-stagebar { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.hub-stg { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink) !important; text-decoration: none !important; }
.hub-stg b { font-weight: 600; color: var(--muted); }
.hub-stg[aria-current="page"] { background: var(--solid); color: var(--on-ink) !important; border-color: var(--solid); }
.hub-stg[aria-current="page"] b { color: inherit; opacity: .75; }
.hub-sec2 { padding: 14px 16px 6px; font: 600 14px var(--display); }
.hub-sec2 span { font: 500 12px var(--font); color: var(--muted); }
.hub-sec2.late { color: var(--red-text); }
.hub-trow { display: flex; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.hub-trow:hover { background: var(--surface-2); }
.hub-trow .tmeta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.hub-trow .tmeta b { color: var(--ink); }
.hub-trow .tmeta .chip { margin: 0; }
.hub-trow .ttitle { display: block; font-weight: 600; font-size: 15px; margin: 2px 0; }
.hub-trow .tright { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; white-space: nowrap; }
.hub-trow .due { font-weight: 600; color: var(--muted); } .hub-trow .due.late { color: var(--red-text); } .hub-trow .due.soon { color: var(--warn); border: 0; }
.hub-trow .rand { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Customise dialog ---------- */
.hub-modal-back { position: fixed; inset: 0; background: rgba(10,10,12,.45); z-index: 80; }
.hub-modal { position: fixed; z-index: 81; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.hub-modal header { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.hub-modal header h3 { margin: 0; font: 600 17px var(--display); }
.hub-modal header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.hub-mods { padding: 4px 20px; overflow: auto; }
.hub-mod { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hub-mod:last-child { border-bottom: 0; }
.hub-mod > div { flex: 1; min-width: 0; }
.hub-mod small { display: block; color: var(--muted); font-size: 12px; }
.hub-mod .hub-mod-group { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-left: 4px; }
.hub-mod .hub-mod-lock { color: var(--warn); }
.hub-toggle { width: 40px; height: 24px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); position: relative; flex: none; padding: 0; cursor: pointer; }
.hub-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease; }
.hub-toggle[aria-checked="true"] { background: var(--brand); border-color: var(--brand); }
.hub-toggle[aria-checked="true"]::after { transform: translateX(16px); }
.hub-toggle:disabled { opacity: .5; cursor: not-allowed; }
.hub-modal footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.hub-modal footer .muted { margin-right: auto; }

/* ---------- Phone and tablet ---------- */
@media (max-width: 1100px) { .hub-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hub-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .hub-top > .grow { display: none; }
  .hub-app { grid-template-columns: minmax(0, 1fr); }
  .hub-side { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; }
  .hub-side.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.35); }
  .hub-burger { display: grid; }
  .hub-top { padding: 10px 16px; gap: 8px; }
  .hub-me-text, .hub-search kbd { display: none; }
  .hub-content { padding: 16px 16px 40px; }
  .hub-tiles { gap: 10px; }
}
@media (max-width: 520px) { .hub-top .btn-primary { padding: 0 10px; } }
@media (prefers-reduced-motion: reduce) { .hub-biz, .hub-side, .hub-toggle::after { transition: none; } }

/* Phase 6: shared directory */
.hub-dirguard { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.hub-dir-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.hub-warn { color: var(--warn); }
/* Phase 8: partner pipeline */
.hub-pipe { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.hub-pipe-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.hub-deal { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.hub-deal a { color: inherit; text-decoration: none; }
.hub-late { color: var(--red-text); font-weight: 600; }
.input-sm { height: 32px; padding: 4px 8px; font-size: 13px; margin-top: 4px; }
/* Phase 9: go-live checks */
.hub-gl { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-weight: 700; font-size: 12px; margin-right: 4px; }
.hub-gl-ok { background: var(--ok-soft); color: var(--ok); } .hub-gl-todo { background: var(--brand-soft); color: var(--red-text); } .hub-gl-warn { background: var(--warn-soft); color: var(--warn); }

/* Two-step sign-in QR code: always dark on white so phones can read it, also in dark mode */
.hub-qr { width: 200px; max-width: 100%; background: #fff; border-radius: 12px; padding: 6px; border: 1px solid var(--line); }
.hub-qr svg { display: block; width: 100%; height: auto; }

/* Dashboard: work on the left, finance on the right (one column on narrower screens) */
.hub-dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.hub-dash.one { grid-template-columns: minmax(0, 1fr); }
.hub-dash-col { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hub-dash-col > .dash-panel > *:first-child { margin-top: 0; }
.hub-dash-col > .dash-panel > .sec, .hub-dash-col > .dash-panel > section { margin-bottom: 0; }
.hub-dash-col .card { overflow: hidden; }   /* rows keep inside the rounded corners */
.hub-dash-col .cols-2, .hub-dash-col .cols-3, .hub-dash-col .dash-top { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1180px) { .hub-dash { grid-template-columns: minmax(0, 1fr); } }

/* Clients & services: billing marks beside a tick */
.hub-bill { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 3px; margin-left: 4px; border-radius: 5px; font-size: 10px; font-weight: 700; vertical-align: middle; }
.hub-bill.ok { background: var(--ok-soft); color: var(--ok); } .hub-bill.no { background: var(--warn-soft); color: var(--warn); } .hub-bill.odd { background: var(--sunk); color: var(--muted); }

/* Tasks · Trello board view: a column per stage (drag a card to change its stage) */
.hub-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.hub-kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 140px; }
.hub-kcol.over { outline: 2px dashed var(--brand); outline-offset: -4px; }
.hub-kcol > header { display: flex; gap: 6px; align-items: baseline; padding: 2px 4px 8px; }
.hub-kcards { display: flex; flex-direction: column; gap: 8px; }
.hub-kcards .hub-trow { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; flex-direction: column; align-items: stretch; gap: 6px; }
.hub-kcards .hub-trow .tright { flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
.hub-kcards [draggable="true"] { cursor: grab; }
