/* MSP console: only what the portal design system does not provide.

   The console wears the customer portal's design system. portal-ui/main.css is a generated copy of
   portal/static/css/main.css (tests/unit/test_msp_console_portal_ui_parity.py keeps it exact): the
   shell, sidebar and icon rail, header, cards, stat cards, tables, buttons, badges, forms, alerts,
   dialogs and toasts all come from there, in light and in dark. This file adds the pieces the
   console has and the portal does not. It never restates a portal rule and never redefines a portal
   token: every colour below is a portal token (--primary, --secondary, --text-*, --border, --bg-*,
   --glass-*) or one of the console names in :root, which alias the platform layer (ens-tokens.css),
   so dark mode follows the portal's. */

:root {
  --msp-mono: var(--font-mono);
  --msp-well: var(--color-bg-hover);
  --msp-meter-track: var(--color-border-light);
}

/* ---- Base elements main.css leaves to the browser ------------------------------------------ */
html { color-scheme: light; }
html.dark { color-scheme: dark; }
a { color: var(--primary-light); }
code, .mono { font-family: var(--msp-mono); font-size: 0.86em; }
.text-secondary { color: var(--text-secondary); }
.label-note { font-weight: 400; }

/* ---- Shell ----------------------------------------------------------------------------------- */
/* The footer caption is styled inline in the portal's base.html, not in main.css. */
.sidebar-version-badge { padding: 0.1rem 1rem 0.35rem; text-align: center; }
.sidebar-version-badge span { font-size: 0.58rem; color: var(--text-muted); opacity: 0.65; letter-spacing: 0.02em; white-space: nowrap; }

/* The console's mark: the platform wordmark (main.css swaps the light and dark images), or the
   MSP's own logo once uploaded. */
.brand-logo { display: flex; align-items: center; justify-content: center; min-width: 0; }
.login-wordmark { display: block; height: 52px; width: auto; max-width: 280px; object-fit: contain; }
/* An uploaded logo sits on a light plate in either theme, so a transparent logo drawn for a light
   background still reads on the dark sidebar. This is the one literal surface colour in the file. */
.brand-img { display: block; background: #fff; border-radius: var(--radius-sm); padding: 3px; object-fit: contain; }
.sidebar .brand-img { height: 34px; width: auto; max-width: 148px; }
.login-header .brand-img { height: 56px; width: auto; max-width: 280px; }
/* The branding page's preview tile: initials until a logo is uploaded. */
.brand-mark { display: grid; place-items: center; flex: none; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--gradient-primary); color: #fff; font-weight: 800; letter-spacing: 0.02em; }
.brand-mark .brand-img { width: 100%; height: 100%; border-radius: 0; }

/* The role caption under the MSP's name, and a count (not an alert) on a nav item. */
.sidebar-role { margin-top: 0.4rem; text-align: center; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.sidebar-role:empty { display: none; }
.nav-badge.nav-count { background: rgba(0, 180, 216, 0.1); color: var(--primary-light); border-color: rgba(0, 180, 216, 0.25); }
.user-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 769px) {
  html.sb-collapsed .sidebar-role { display: none; }
  html.sb-collapsed .sidebar .brand-img { height: 30px; max-width: 46px; }
  /* The script shows the count with an inline display, which would outrank main.css's rail rule. */
  html.sb-collapsed .sidebar .nav-badge { display: none !important; }
}

/* Header: the plan chip, Help and Add Customer sit beside the portal's theme button. */
.breadcrumb a, .breadcrumb .current { white-space: nowrap; }
.header-right .badge, .header-right .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .header-right { gap: 0.5rem; }
  .hdr-label { display: none; }
  #planChip { display: none !important; }
}

/* The theme button on the sign-in pages, placed as the portal's login page places it. */
.auth-theme-toggle { position: fixed; top: 24px; right: 24px; z-index: 100; width: 40px; height: 40px; font-size: 1.05rem; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ---- Page furniture -------------------------------------------------------------------------- */
.msp-tab { animation: fadeIn 0.25s ease-out; }
.tab-intro { margin-bottom: 0.875rem; }
.tab-intro h2 { margin-bottom: 0.2rem; font-size: 1.05rem; font-weight: 700; }
.tab-intro p { max-width: 46rem; font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary); }
.card-title-gap { margin-bottom: 0.625rem; }
.card-text { margin: 0.3rem 0 1rem; font-size: 0.85rem; line-height: 1.55; color: var(--text-secondary); }
.table-card { padding: 0; overflow: hidden; }
/* Every page uses the full width: a form card sits in a grid beside what it explains, never alone
   in a narrow column with the right half of the page empty. */
.form-card { padding: 1.25rem 1.5rem; }
.split-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap; }
.eyebrow { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.tile-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--radius-md); background: rgba(0, 180, 216, 0.12); color: var(--secondary); }
.tile-icon-lg { width: 42px; height: 42px; font-size: 1.05rem; }
.support-row { display: flex; gap: 0.85rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.support-text { flex: 1; min-width: 0; font-size: 0.82rem; line-height: 1.45; }
.support-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.stat-card .ops-note { margin-top: 0.35rem; }

/* ---- Tables ---------------------------------------------------------------------------------- */
.table-scroll { overflow: auto; max-height: 70vh; }
/* A long list scrolls under its header, so the header is painted solid, with the portal's tint. */
thead th { position: sticky; top: 0; z-index: 2; background: linear-gradient(rgba(0, 180, 216, 0.05), rgba(0, 180, 216, 0.05)), var(--glass-bg-strong); }
.table td.table-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-secondary); }
.table .btn, .ops-pager .btn, .modal-footer .btn { white-space: nowrap; }
/* The customers tables have up to seven columns. Long domains and emails wrap instead of pushing
   the Actions column off the edge; elsewhere a word is never broken in the middle. */
.cust-table { min-width: 900px; }
.cust-table td { font-size: 0.84rem; vertical-align: middle; overflow-wrap: break-word; }
#customersTbody td:nth-child(2), #customersTbody td:nth-child(3), #cpTbody td:nth-child(2) { overflow-wrap: anywhere; }
/* On a phone the table scrolls sideways anyway, so a domain keeps its words. */
@media (max-width: 768px) {
  #customersTbody td:nth-child(2), #customersTbody td:nth-child(3), #cpTbody td:nth-child(2) { overflow-wrap: break-word; }
}
.cust-table td code { font-size: 0.72rem; white-space: nowrap; }
.cust-table th, .cust-table td { padding-left: 0.75rem; padding-right: 0.75rem; }
.cust-table td:last-child { min-width: 14rem; }
#customersTbody td:last-child { min-width: 15.5rem; }  /* Details and four icon actions on one line */
.cust-table .badge { white-space: nowrap; }

/* ---- Buttons --------------------------------------------------------------------------------- */
/* Row actions in the console's tables are a step smaller than the portal's btn-sm. */
.btn-xs { gap: 0.3rem; padding: 0.25rem 0.5rem; font-size: 0.72rem; }
.btn-xs.btn-square { justify-content: center; width: 1.75rem; height: 1.75rem; padding: 0; }
.btn-block { width: 100%; justify-content: center; }
/* main.css turns pointer events off on a disabled button, which also hides its title. The console
   explains every disabled button in its title (why a customer cannot be added, why a portal cannot
   be opened), so the tooltip must still show. A disabled button still cannot be clicked. */
.btn:disabled, .btn[disabled] { pointer-events: auto; }
.btn:disabled:hover, .btn[disabled]:hover { transform: none; filter: none; }

/* ---- Forms ----------------------------------------------------------------------------------- */
.ops-search { width: 280px; max-width: 100%; padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.ops-select { width: auto; max-width: 100%; padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.code-input { text-align: center; letter-spacing: 0.3em; font-size: 1.1rem; }
.code-input::placeholder { letter-spacing: normal; }
.secret-well { flex: 1; min-width: 0; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); background: var(--msp-well); word-break: break-all; }
.ops-check-row { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.875rem; line-height: 1.45; color: var(--text-primary); cursor: pointer; }
.ops-check-row input { flex: none; margin-top: 0.2rem; }
/* Add Customer: the MSP prefix is fixed text in front of the slug, which is made from the domain
   and cannot be edited. */
.slug-row { display: flex; align-items: stretch; }
.slug-row > .slug-prefix { display: inline-flex; align-items: center; flex: none; max-width: 55%; overflow: hidden; padding: 0 0.7rem; border: 1px solid var(--border); border-right: 0; border-radius: var(--radius-md) 0 0 var(--radius-md); background: var(--msp-well); color: var(--text-secondary); font-family: var(--msp-mono); font-size: 0.82rem; white-space: nowrap; text-overflow: ellipsis; }
.slug-row .form-control { flex: 1 1 0; width: auto; min-width: 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.slug-row .form-control[readonly] { background: var(--msp-well); color: var(--text-secondary); cursor: not-allowed; }
.field-error { display: none; margin-top: 0.25rem; font-size: 0.78rem; color: var(--danger); }
.field-error.show { display: block; }
.form-control[aria-invalid="true"] { border-color: var(--danger); }

/* ---- Alerts, dialogs and toasts -------------------------------------------------------------- */
/* main.css lays an alert out as a flex row for an icon and one block of text. The console's alerts
   carry sentences with links and bold words, which a flex row would break into columns. */
.alert { display: block; }
.alert > .fas:first-child { margin-right: 0.35rem; }
.modal-footer { flex-wrap: wrap; }
.dialog-text { margin-bottom: 0.75rem; font-size: 0.9rem; line-height: 1.5; }
/* main.css gives every span in a dialog the primary text colour, which also repaints the status
   badges and severity chips the console shows in its dialogs. They get their own colours back,
   the same as main.css gives them everywhere else (the parity test compares the two). */
.modal .badge-success { color: var(--success); }
.modal .badge-danger { color: var(--danger); }
.modal .badge-warning { color: var(--accent); }
.modal .badge-info { color: var(--info); }
.modal .badge-secondary { color: var(--text-muted); }
.modal .badge-primary { color: var(--primary); }
html.dark .modal .badge-primary { color: var(--primary-light); }
.modal .severity-critical { color: var(--critical); }
.modal .severity-high { color: var(--high); }
.modal .severity-medium { color: #fbbf24; }
.modal .severity-low { color: var(--low); }
.modal .severity-info { color: var(--informational); }
.modal .ops-sub { color: var(--text-secondary); }
/* A dialog is translucent over a dark shade, which turns the portal's muted hint colour into grey
   on grey. The console's hints carry rules (how a slug is made, what is left to allocate), so in a
   dialog they take the secondary text colour. */
.modal .form-help { color: var(--text-secondary); }
/* The console's toasts say what happened in a sentence or two, so the message is never cut. */
.msp-toast .toast-title { white-space: normal; }
.msp-toast .toast-message { display: block; overflow: visible; -webkit-line-clamp: unset; }

/* The console guide (Help). */
.help-section { margin-bottom: 1rem; }
.help-section:last-child { margin-bottom: 0; }
.help-section h4 { margin-bottom: 0.3rem; font-size: 0.95rem; font-weight: 700; }
.help-section p { font-size: 0.86rem; line-height: 1.55; color: var(--text-secondary); }

/* ---- Sign-in, password and authenticator pages ------------------------------------------------ */
.login-header .brand-logo { min-height: 52px; margin-bottom: 0.9rem; }
.login-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
.login-header .login-subtitle { margin-top: 0.2rem; }
.login-step-title { margin-bottom: 0.25rem; font-size: 1.05rem; font-weight: 700; }
.login-step-text { margin-bottom: 1.1rem; font-size: 0.85rem; line-height: 1.5; color: var(--text-secondary); }
.login-links { margin-top: 1rem; text-align: center; }
.login-link { font-size: 0.875rem; color: var(--text-secondary); text-decoration: none; }
.login-link:hover { color: var(--primary-light); }
.login-done { padding: 0.5rem 0 0.25rem; text-align: center; }
.login-done-icon { margin-bottom: 0.6rem; font-size: 2.4rem; line-height: 1; color: var(--success); }
.step-dots { display: flex; gap: 0.5rem; margin: 0 0 1.1rem; }
.step-dot { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.step-dot.on { background: var(--secondary); }

/* ---- Idle sign-out warning (the assistant launcher replaced the quick actions button) --------- */
.idle-warning { position: fixed; top: 1rem; left: 50%; z-index: 9999; display: flex; align-items: center; gap: 0.85rem; max-width: 92vw; padding: 0.7rem 1rem; transform: translateX(-50%); border: 1px solid var(--border); border-left: 4px solid var(--secondary); border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-primary); box-shadow: var(--glass-shadow-lg); font-size: 0.9rem; }
.idle-warning .btn { padding: 0.35rem 0.9rem; font-size: 0.85rem; white-space: nowrap; }

/* ---- Plan & Billing: summary, pricing cards, tabs, funding and activity ------------------------ */
.bl-pool { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); }
.bl-section { margin: 1.5rem 0 0.4rem; font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.bl-note { margin-bottom: 0.75rem; font-size: 0.82rem; color: var(--text-secondary); }
.bl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; align-items: stretch; }
.bl-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 1.25rem 1.375rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease; }
.bl-card:hover { transform: translateY(-2px); border-color: rgba(0, 180, 216, 0.3); box-shadow: var(--shadow-glow); }
.bl-card--base { border-color: var(--secondary); box-shadow: inset 0 3px 0 var(--secondary); }
.bl-card--held { border-color: var(--success); }
.bl-tag { align-self: flex-start; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--glass-hover); color: var(--text-secondary); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.bl-tag--base { background: rgba(0, 180, 216, 0.12); color: var(--primary-light); }
.bl-name { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.bl-price { display: flex; align-items: baseline; gap: 0.35rem; margin: 0.15rem 0; }
.bl-amount { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--text-primary); }
.bl-cur { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; color: var(--text-secondary); }
.bl-per, .bl-meta { font-size: 0.85rem; color: var(--text-secondary); }
.bl-held { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.1rem; }
.bl-list { display: grid; gap: 0.4rem; margin: 0.5rem 0 0; padding: 0; list-style: none; font-size: 0.875rem; }
.bl-list li { display: flex; gap: 0.5rem; align-items: flex-start; }
.bl-list li::before { content: "\2713"; font-weight: 700; color: var(--secondary); }
.bl-buy { display: grid; gap: 0.6rem; margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.bl-stepper { display: inline-flex; align-self: start; width: fit-content; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.bl-stepper button.bl-step { width: 2.25rem; border: 0; border-radius: 0; background: var(--glass-hover); color: inherit; font-size: 1.1rem; cursor: pointer; }
.bl-stepper button.bl-step:hover { background: rgba(0, 180, 216, 0.15); }
.bl-qty { width: 3.5rem; padding: 0.45rem 0; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; text-align: center; -moz-appearance: textfield; }
.bl-qty::-webkit-outer-spin-button, .bl-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bl-total { min-height: 1.2em; font-size: 0.82rem; color: var(--text-secondary); }
.bl-actions { display: flex; gap: 0.5rem; }
.bl-actions .btn { flex: 1; justify-content: center; }
.bl-table { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); border-collapse: separate; border-spacing: 0; background: var(--bg-card); }
.bl-table .bl-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Purchases, invoices and funding scroll sideways on a narrow screen rather than squeeze. */
#blPane-purchases .bl-table, #blPane-invoices .bl-table, #blFundingBody .bl-table { min-width: 720px; }
.bl-table tbody tr:last-child td { border-bottom: 0; }
.bl-table td a { font-weight: 600; }
/* The portal's phone rule pulls a table to its card's edges with a negative margin. These billing
   tables sit in a pane with no padding of their own, so on a phone that rule pushed them past the
   screen; keep them inside it (they still scroll sideways within their box). */
@media (max-width: 768px) {
  .bl-pane .table-responsive, #blFundingBody .table-responsive { margin: 0; padding: 0; }
}
.bl-pending { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bl-link { padding: 0; border: 0; background: none; color: var(--primary-light); font: inherit; font-size: 0.82rem; font-weight: 600; text-decoration: underline; cursor: pointer; }
.bl-link:disabled { opacity: 0.5; cursor: default; }
.bl-notice { grid-column: 1 / -1; padding: 0.75rem 1rem; border: 1px solid rgba(245, 158, 11, 0.35); border-radius: var(--radius-md); background: rgba(245, 158, 11, 0.08); font-size: 0.875rem; }
.bl-add:disabled { opacity: 0.5; cursor: not-allowed; }
.bl-tabs { display: flex; gap: 0.25rem; margin: 0 0 1rem; overflow-x: auto; border-bottom: 1px solid var(--border); }
.bl-tabs button.bl-tab { margin-bottom: -1px; padding: 0.65rem 1rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--text-secondary); font: inherit; font-size: 0.85rem; font-weight: 600; white-space: nowrap; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease; }
.bl-tab i { margin-right: 0.4rem; opacity: 0.8; }
.bl-tabs button.bl-tab:hover { color: var(--text-primary); }
.bl-tabs button.bl-tab.active { color: var(--text-primary); border-bottom-color: var(--secondary); }
.bl-tabs button.bl-tab:focus-visible { outline: 2px solid var(--secondary); outline-offset: -2px; }
.bl-pane { display: none; }
.bl-pane.active { display: block; animation: fadeIn 0.2s ease-out; }
.bl-chip { display: inline-flex; align-items: center; padding: 0.15rem 0.6rem; border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 999px; background: rgba(16, 185, 129, 0.1); color: var(--success); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.bl-chip--locked { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.bl-timeline { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.bl-timeline li { display: flex; gap: 0.85rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.bl-timeline li:last-child { border-bottom: 0; }
.bl-dot { flex: none; width: 10px; height: 10px; margin-top: 0.4rem; border-radius: 50%; background: var(--text-muted); }
.bl-dot--ok { background: var(--success); }
.bl-dot--warn { background: var(--warning); }
.bl-dot--bad { background: var(--danger); }

/* ---- Operations pages: filters, pagers, detail grids and meters -------------------------------
   Customer detail, Usage, Reports, Team and Audit log. Built from the same tokens as the rest of
   the console, so it follows the portal theme and has no surface colour of its own. */
.ops-note { min-height: 1em; margin-top: 0.4rem; font-size: 0.76rem; line-height: 1.4; color: var(--text-secondary); }
.ops-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ops-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem 0.75rem; align-items: end; }
.ops-filters .form-group { margin-bottom: 0; }
.ops-filters .form-label { font-size: 0.8rem; margin-bottom: 0.3rem; }
.ops-filters .form-control { padding: 0.45rem 0.7rem; font-size: 0.85rem; }
.ops-filters .ops-grow { grid-column: span 2; }
.ops-filter-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.ops-pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.7rem 1.125rem; border-top: 1px solid var(--border); font-size: 0.82rem; }
.ops-pager-buttons { display: flex; gap: 0.5rem; }
.ops-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ops-head .tab-intro { margin-bottom: 0; }
.ops-card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap; padding: 0.875rem 1.125rem; border-bottom: 1px solid var(--border); }
.ops-card-tools { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ops-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; cursor: pointer; }
.ops-sub { font-size: 0.78rem; color: var(--text-secondary); }
.ops-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 0.75rem; }
.ops-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.75rem; }
.ops-role { padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius-md); }
.ops-role h4 { margin-bottom: 0.25rem; font-size: 0.95rem; }
.ops-role p { font-size: 0.82rem; line-height: 1.45; color: var(--text-secondary); }
.ops-role ul { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.8rem; color: var(--text-secondary); }
.ops-meter { min-width: 90px; height: 6px; margin-top: 0.3rem; overflow: hidden; border-radius: 999px; background: var(--msp-meter-track); }
.ops-meter > span { display: block; height: 100%; background: var(--secondary); }
.ops-meter.is-high > span { background: var(--warning); }
.ops-meter.is-full > span { background: var(--danger); }
.ops-dl { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 0.35rem 1rem; margin: 0; font-size: 0.88rem; }
.ops-dl dt { color: var(--text-secondary); }
.ops-dl dd { margin: 0; word-break: break-word; }
.ops-section { margin: 1.1rem 0 0.5rem; font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }
.ops-section:first-child { margin-top: 0; }
.ops-activity { margin: 0; padding: 0; list-style: none; }
.ops-activity li { display: flex; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.ops-activity li:last-child { border-bottom: 0; }
.ops-link { padding: 0; border: 0; background: none; color: var(--primary-light); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.ops-link:hover { text-decoration: underline; }
.ops-link:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
.ops-cell-actions { display: flex; gap: 0.35rem; justify-content: flex-end; flex-wrap: wrap; max-width: 16rem; margin-left: auto; }
@media (max-width: 768px) {
  .ops-card-tools { width: 100%; }
  .ops-search { flex: 1 1 12rem; width: auto; }
}
@media (max-width: 640px) {
  .ops-filters .ops-grow { grid-column: 1 / -1; }
  .ops-dl { grid-template-columns: 1fr; }
}

/* ---- Dashboard -----------------------------------------------------------------------------------
   The page the console opens on: a heading row, six figure cards, then the severity of the
   customers' findings, the services' health and the assistant side by side, and under them the
   findings by customer, the riskiest customers and the newest findings on the left, the scanner and
   the activity on the right. Every surface and colour is a token, so dark mode is the portal's.
   Wide screens take the full layout; from 1500px down it folds to two columns, and to one on a
   phone. */

/* The console's page header steps aside on the dashboard, which has a heading of its own. */
.page-content[data-tab="dashboard"] > .page-header { display: none; }

.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.dash-titles { min-width: 0; }
.dash-titles h1 { margin: 0; font-size: 1.65rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; color: var(--text-primary); }
.dash-titles p { margin: 0.3rem 0 0; font-size: 0.9rem; line-height: 1.45; color: var(--text-secondary); }
.dash-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 0.45rem; }
.dash-control-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.dash-range { position: relative; display: inline-flex; align-items: center; margin: 0; }
.dash-range > i { position: absolute; left: 0.8rem; z-index: 1; font-size: 0.85rem; color: var(--text-secondary); pointer-events: none; }
.dash-range select.form-control { width: auto; min-width: 11.5rem; padding: 0.55rem 2rem 0.55rem 2.2rem; font-size: 0.875rem; font-weight: 600; }
.dash-control-row .btn { padding-top: 0.55rem; padding-bottom: 0.55rem; }
.dash-updated { display: flex; gap: 0.5rem; align-items: center; font-size: 0.78rem; color: var(--text-secondary); }
@media (max-width: 640px) {
  .dash-controls { align-items: stretch; width: 100%; }
  .dash-control-row { justify-content: stretch; }
  .dash-range { flex: 1 1 auto; }
  .dash-range select.form-control { width: 100%; min-width: 0; }
  .dash-updated { justify-content: flex-start; }
}

/* The six figure cards: an icon tile, the figure and how it changed, and a trend on the right. */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
@media (max-width: 1699px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1099px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: minmax(0, 1fr); } }
/* The label runs along the top beside the icon; the figure sits beside its trend; how it changed and
   what it is made of run the full width under them. */
.kpi-card { --tone: var(--info); display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(70px, 42%); grid-template-areas: "icon label label" "icon value spark" ". bar spark" ". delta delta" ". sub sub"; column-gap: 0.75rem; align-items: center; min-width: 0; padding: 1rem 1.05rem 0.95rem; border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--glass-bg); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.kpi-card:hover { border-color: color-mix(in srgb, var(--tone) 35%, transparent); }
.kpi-card[data-tone="info"] { --tone: var(--info); }
.kpi-card[data-tone="teal"] { --tone: var(--color-secondary-dark); }
.kpi-card[data-tone="critical"] { --tone: var(--critical); }
.kpi-card[data-tone="warn"] { --tone: var(--accent); }
.kpi-card[data-tone="accent"] { --tone: var(--color-purple); }
.kpi-card[data-tone="good"] { --tone: var(--success); }
html.dark .kpi-card[data-tone="accent"] { --tone: var(--color-primary-light); }
html.dark .kpi-card[data-tone="teal"] { --tone: var(--color-secondary-light); }
.kpi-icon { grid-area: icon; align-self: start; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone); font-size: 1.05rem; }
.kpi-body { display: contents; }
.kpi-label { grid-area: label; min-width: 0; overflow: hidden; font-size: 0.8rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.kpi-value { grid-area: value; min-width: 0; overflow: hidden; font-size: 1.65rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.kpi-value.is-unavailable { grid-column: 2 / -1; font-size: 1.05rem; font-weight: 700; letter-spacing: 0; color: var(--text-muted); }
.kpi-value.is-changed { animation: kpiChanged 0.6s ease-out; }
@keyframes kpiChanged { from { opacity: 0.35; } to { opacity: 1; } }
.kpi-bar { grid-area: bar; height: 4px; margin: 0.3rem 0 0.1rem; overflow: hidden; border-radius: 999px; background: var(--msp-meter-track); }
.kpi-bar > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--success); transition: width 0.5s ease, background-color 0.3s ease; }
.kpi-bar.is-warning > span { background: var(--warning); }
.kpi-bar.is-critical > span { background: var(--danger); }
.kpi-bar.is-unknown > span { background: var(--severity-unknown); }
.kpi-delta { grid-area: delta; display: flex; gap: 0.3rem; align-items: baseline; min-width: 0; margin-top: 0.35rem; font-size: 0.75rem; font-weight: 600; line-height: 1.35; color: var(--text-secondary); }
.kpi-delta:empty { display: none; }
.kpi-delta i { flex: none; font-size: 0.66rem; }
.kpi-delta span { min-width: 0; }
.kpi-delta.is-good { color: var(--color-success-dark); }
.kpi-delta.is-bad { color: var(--color-danger-dark); }
html.dark .kpi-delta.is-good { color: var(--color-success-light); }
html.dark .kpi-delta.is-bad { color: var(--color-danger-light); }
.kpi-sub { grid-area: sub; min-width: 0; margin-top: 0.12rem; overflow: hidden; font-size: 0.73rem; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.kpi-spark { grid-area: spark; display: flex; align-items: center; justify-content: flex-end; min-width: 0; height: 44px; color: var(--tone); }
.kpi-spark .spark { width: 100%; height: 44px; }
.kpi-notrend { font-size: 0.7rem; text-align: right; color: var(--text-muted); }
/* A card's markers: its figures are out of date (a source failed), or leave a customer out. */
.card-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.kpi-card > .card-chips { grid-column: 2 / -1; margin-top: 0.4rem; }
.card-chip { display: inline-flex; align-items: center; padding: 0.06rem 0.45rem; border-radius: 999px; font-size: 0.68rem; font-weight: 700; line-height: 1.45; white-space: nowrap; cursor: help; }
.card-chip.is-stale { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--color-warning-dark); }
.card-chip.is-partial { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
html.dark .card-chip.is-stale { color: var(--warning); }
.card-stale-note { margin: 0.25rem 0 0; font-size: 0.72rem; font-weight: 600; color: var(--color-warning-dark); }
html.dark .card-stale-note { color: var(--warning); }
.kpi-sk { display: inline-block; width: 70%; height: 1.45rem; border-radius: 6px; vertical-align: middle; }
.kpi-sk-sub { width: 55%; height: 0.7rem; }

/* A sparkline: the line in the card's accent colour over a soft fill of the same. */
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: currentColor; opacity: 0.14; }

/* The board: three columns on a wide screen, two from 1500px down, one on a phone. */
.dash-board { display: grid; grid-template-columns: minmax(0, 55fr) minmax(0, 23fr) minmax(0, 22fr); grid-template-areas: "sev health ai" "left right right"; gap: 0.75rem; align-items: stretch; }
.dash-board > .dash-sev { grid-area: sev; }
.dash-board > .dash-health { grid-area: health; }
.dash-board > .dash-ai { grid-area: ai; }
.dash-board > .dash-left { grid-area: left; }
.dash-board > .dash-right { grid-area: right; }
.dash-board .glass-card { min-width: 0; margin-bottom: 0; }
.dash-stack { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.dash-stack > .dash-grow { flex: 1 1 auto; }
.dash-pair { display: grid; flex: 1 1 auto; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 0.75rem; align-items: stretch; }
@media (max-width: 1499px) {
  .dash-board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "sev sev" "health ai" "left left" "right right"; }
}
@media (max-width: 768px) {
  .dash-board { grid-template-columns: minmax(0, 1fr); grid-template-areas: "sev" "health" "ai" "left" "right"; }
}

.dash-card { padding: 1rem 1.15rem; }
.dash-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem 0.75rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.dash-card-titles { min-width: 0; }
.dash-card-head .card-title { margin: 0; font-size: 0.95rem; }
.dash-card-sub { margin: 0.15rem 0 0; font-size: 0.76rem; line-height: 1.4; color: var(--text-secondary); }
.dash-card-sub:empty { display: none; }
.table-card.dash-card { display: flex; flex-direction: column; padding: 0; }
.table-card .dash-card-head { margin: 0; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border); }
.dash-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.dash-select.form-control { width: auto; max-width: 100%; padding: 0.35rem 1.8rem 0.35rem 0.6rem; font-size: 0.78rem; border-radius: var(--radius-sm); }
.dash-link { padding: 0; border: 0; background: none; color: var(--primary-light); font: inherit; font-size: 0.8rem; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.dash-link:hover { text-decoration: underline; }
.dash-link:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }

/* What a card says when it has nothing to show, or could not read it. */
.dash-state { margin-top: 0.5rem; }
.dash-state-inner { display: flex; gap: 0.5rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: 1.4rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius-md); font-size: 0.82rem; line-height: 1.45; text-align: center; color: var(--text-secondary); }
.dash-state-inner.is-error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.table-empty .dash-state-inner { padding: 0.5rem; border: 0; }

/* Severity: one tile per band with its figure in the band's ink, then the bars. */
.sev-critical { --band: var(--critical); --band-ink: var(--sev-stroke-critical); }
.sev-high { --band: var(--high); --band-ink: var(--sev-stroke-high); }
.sev-medium { --band: var(--medium); --band-ink: var(--sev-stroke-medium); }
.sev-low { --band: var(--color-low); --band-ink: var(--color-info-dark); }
.sev-info { --band: var(--informational); --band-ink: var(--sev-stroke-info); }
html.dark .sev-low { --band-ink: var(--color-info-light); }
.sev-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 0.9rem; }
@media (max-width: 560px) { .sev-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sev-tile { min-width: 0; padding: 0.7rem 0.85rem; border: 1px solid color-mix(in srgb, var(--band) 25%, transparent); border-radius: var(--radius-md); background: color-mix(in srgb, var(--band) 7%, transparent); }
.sev-tile-label { display: flex; gap: 0.4rem; align-items: center; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.sev-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--band); }
.sev-tile-value { display: block; margin-top: 0.2rem; font-size: 1.65rem; font-weight: 800; line-height: 1.15; color: var(--band-ink); font-variant-numeric: tabular-nums; }
.sev-tile-share { display: block; min-height: 1em; font-size: 0.72rem; color: var(--text-muted); }
.sev-pill { display: inline-flex; align-items: center; padding: 0.12rem 0.5rem; border-radius: 999px; background: color-mix(in srgb, var(--band) 14%, transparent); color: var(--band-ink); font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.sev-num { font-variant-numeric: tabular-nums; }
.sev-num:not(.is-zero) { font-weight: 700; color: var(--band-ink); }
.sev-num.is-zero { color: var(--text-muted); }
.dash-chart-box { position: relative; height: 260px; }
.dash-chart-tall { height: 300px; }
.dash-chart-box.is-empty { display: none; }
.dash-chart-box.is-loading { border-radius: var(--radius-md); background: linear-gradient(90deg, var(--glass-hover) 25%, var(--border) 50%, var(--glass-hover) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.dash-legend { display: flex; gap: 0.4rem 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; font-size: 0.75rem; color: var(--text-secondary); }
.dash-legend-item { display: inline-flex; gap: 0.4rem; align-items: center; }

/* Service health: one row per service, its state as a pill and what was measured. */
.health-list { margin: 0; padding: 0; list-style: none; }
.health-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto minmax(3.25rem, auto); gap: 0.25rem 0.55rem; align-items: center; padding: 0.4rem 0; border-top: 1px solid var(--border); font-size: 0.8rem; }
.health-row:first-child { border-top: 0; padding-top: 0; }
.health-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--secondary) 12%, transparent); color: var(--secondary); font-size: 0.74rem; }
.health-name { min-width: 0; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.health-figure { font-size: 0.74rem; text-align: right; white-space: nowrap; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.health-detail { grid-column: 2 / -1; font-size: 0.72rem; line-height: 1.4; color: var(--text-muted); }
.health-sk { display: block; grid-column: 1 / -1; width: 100%; height: 1.15rem; border-radius: 6px; }
.health-error { display: block; }
.health-pill { --pill: var(--severity-unknown); --pill-ink: var(--text-secondary); display: inline-flex; gap: 0.35rem; align-items: center; padding: 0.15rem 0.55rem; border-radius: 999px; background: color-mix(in srgb, var(--pill) 14%, transparent); color: var(--pill-ink); font-size: 0.7rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.health-pill.is-healthy { --pill: var(--success); --pill-ink: var(--color-success-dark); }
.health-pill.is-degraded { --pill: var(--warning); --pill-ink: var(--color-warning-dark); }
.health-pill.is-down { --pill: var(--danger); --pill-ink: var(--color-danger-dark); }
html.dark .health-pill.is-healthy { --pill-ink: var(--color-success-light); }
html.dark .health-pill.is-degraded { --pill-ink: var(--color-warning-light); }
html.dark .health-pill.is-down { --pill-ink: var(--color-danger-light); }
.health-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--pill); }
.stat-value .health-pill { font-size: 0.9rem; padding: 0.25rem 0.75rem; }

/* The assistant: a greeting, the questions to start from and a box to ask anything. */
.dash-ai { display: flex; flex-direction: column; }
.ai-badge { padding: 0.12rem 0.5rem; border-radius: 999px; background: color-mix(in srgb, var(--secondary) 15%, transparent); color: var(--primary-light); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.ai-hello { display: flex; gap: 0.7rem; align-items: flex-start; margin-bottom: 0.85rem; }
.ai-avatar { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--gradient-primary); box-shadow: var(--shadow-md); color: #fff; font-size: 1.1rem; }
.ai-greeting { font-size: 0.88rem; font-weight: 700; line-height: 1.35; color: var(--text-primary); }
.ai-intro { margin: 0.2rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--text-secondary); }
.ai-prompts { display: grid; gap: 0.45rem; margin-bottom: 0.85rem; }
.ai-prompt { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--glass-hover); color: var(--text-primary); font: inherit; font-size: 0.79rem; font-weight: 500; line-height: 1.35; text-align: left; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.ai-prompt:hover { border-color: rgba(0, 180, 216, 0.45); background: rgba(0, 180, 216, 0.07); }
.ai-prompt:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
.ai-prompt i { flex: none; font-size: 0.68rem; color: var(--text-muted); }
.ai-ask { display: flex; gap: 0.4rem; margin-top: auto; }
.ai-ask .form-control { flex: 1 1 auto; min-width: 0; padding: 0.5rem 0.75rem; font-size: 0.82rem; }
.ai-send.btn { flex: none; justify-content: center; width: 40px; padding: 0; }

/* Scanner operations: four figures in a row, each over a thin bar. */
.op-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; }
@media (max-width: 640px) { .op-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.op-metric { min-width: 0; padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--glass-hover); }
.op-label { display: flex; gap: 0.4rem; align-items: center; overflow: hidden; font-size: 0.74rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.op-label i { flex: none; font-size: 0.7rem; color: var(--secondary); }
.op-value { margin-top: 0.25rem; font-size: 1.3rem; font-weight: 800; line-height: 1.2; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.op-value.is-text { font-size: 0.95rem; font-weight: 700; color: var(--text-muted); }
.op-bar { height: 4px; margin-top: 0.45rem; overflow: hidden; border-radius: 999px; background: var(--msp-meter-track); }
.op-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--success); transition: width 0.5s ease; }
.op-bar.is-warning > span { background: var(--warning); }
.op-bar.is-critical > span { background: var(--danger); }
.op-bar.is-unknown > span { background: var(--severity-unknown); }
.op-note { min-height: 1em; margin-top: 0.3rem; font-size: 0.7rem; color: var(--text-muted); }

/* The dashboard's tables: compact, numbers right-aligned, a customer as an avatar and a name. */
.dash-table { margin: 0; }
.dash-table th { padding: 0.55rem 0.45rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; color: var(--text-secondary); }
.dash-table td { padding: 0.5rem 0.45rem; font-size: 0.8rem; vertical-align: middle; }
.dash-table th:first-child, .dash-table td:first-child { padding-left: 1.1rem; }
.dash-table th:last-child, .dash-table td:last-child { padding-right: 1.1rem; }
.dash-pair .dash-table th, .dash-pair .dash-table td { padding-left: 0.3rem; padding-right: 0.3rem; }
.dash-pair .dash-table th:first-child, .dash-pair .dash-table td:first-child { padding-left: 0.9rem; }
.dash-pair .dash-table th:last-child, .dash-pair .dash-table td:last-child { padding-right: 0.9rem; }
.dash-pair .dash-table td { font-size: 0.78rem; }
.dash-table tbody tr:last-child td { border-bottom: 0; }
.dash-table .dash-num { text-align: right; font-variant-numeric: tabular-nums; }
.dash-rank { width: 2rem; color: var(--text-muted); }
.dash-sort { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.dash-sort:hover, th[aria-sort="ascending"] .dash-sort, th[aria-sort="descending"] .dash-sort { color: var(--text-primary); }
.dash-sort:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
th[aria-sort="descending"] .dash-sort::after { content: " \25BE"; }
th[aria-sort="ascending"] .dash-sort::after { content: " \25B4"; }
.dash-row-link { cursor: pointer; }
.dash-row-link:hover td { background: var(--glass-hover); }
.dash-cust { display: inline-flex; gap: 0.5rem; align-items: center; max-width: 100%; padding: 0; border: 0; background: none; color: var(--text-primary); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.dash-cust:hover .dash-cust-name { text-decoration: underline; }
.dash-cust:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
.dash-cust-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The name and the title take the room the figures leave, cut short with an ellipsis. */
.dash-cust-td, .dash-title-cell { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-avatar { --av: var(--info); display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--av); color: #fff; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.02em; }
.dash-avatar.av-1 { --av: var(--color-secondary-dark); }
.dash-avatar.av-2 { --av: var(--color-purple); }
.dash-avatar.av-3 { --av: var(--color-accent-dark); }
.dash-avatar.av-4 { --av: var(--color-success-dark); }
.dash-avatar.av-5 { --av: var(--color-danger-dark); }
.dash-total { font-weight: 700; }
.dash-trend { width: 64px; color: var(--primary-light); }
.dash-trend .spark { width: 56px; height: 22px; }
.dash-id { max-width: 5.5rem; overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.dash-cust-cell .ops-link { display: inline-block; max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.dash-date { font-size: 0.76rem; white-space: nowrap; color: var(--text-secondary); }
.dash-event { min-width: 12rem; line-height: 1.4; }
.cell-sk { display: block; height: 0.8rem; border-radius: 4px; }

/* The header's customer search: a rounded box and the customers it finds under it. */
.hdr-search { position: relative; display: flex; flex: 0 1 300px; align-items: center; min-width: 0; margin-left: 1rem; }
.hdr-search > i { position: absolute; left: 0.8rem; z-index: 1; font-size: 0.8rem; color: var(--text-muted); pointer-events: none; }
.hdr-search .form-control { width: 100%; padding: 0.45rem 0.8rem 0.45rem 2.1rem; border-radius: 999px; font-size: 0.84rem; }
.hdr-search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: var(--z-panel); max-height: 60vh; overflow: auto; padding: 0.35rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-elevated); box-shadow: var(--glass-shadow-lg); }
.hdr-result { display: flex; gap: 0.6rem; align-items: center; width: 100%; padding: 0.45rem 0.55rem; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.hdr-result:hover, .hdr-result.is-active { background: var(--glass-hover); }
.hdr-result-text { display: grid; min-width: 0; font-size: 0.82rem; }
.hdr-result-text span { overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.hdr-result-empty { padding: 0.6rem; font-size: 0.8rem; color: var(--text-secondary); }
@media (max-width: 900px) { .hdr-search { display: none; } }

/* Usage & Pods: CPU and memory as a share of the allowance, and the platform's health. */
.mon-tiles .stat-card { display: flex; flex-direction: column; }
.mon-meter { margin-top: 0.5rem; }
.mon-tiles .stat-value.is-unavailable { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 700; color: var(--text-muted); }
.stat-value .health-pill { font-family: var(--font-sans); }
.ops-meter.is-unknown > span { background: var(--severity-unknown); }

/* ---- Branding: the logo beside where it appears, before and after ---------------------------- */
.brand-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0.75rem; align-items: start; }
@media (max-width: 1180px) { .brand-layout { grid-template-columns: 1fr; } }
.brand-layout > .glass-card { margin-bottom: 0; padding: 1.25rem 1.5rem; }
.logo-field { display: flex; gap: 0.9rem; align-items: stretch; flex-wrap: wrap; }
.logo-current { display: grid; place-items: center; flex: none; width: 116px; min-height: 88px; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--msp-well); }
/* The tile shows the logo in use: the MSP's own on its white plate, or the platform's wordmark. */
.logo-current .brand-mark { width: auto; height: auto; min-width: 56px; min-height: 40px; border: 0; border-radius: 0; background: none; }
.logo-current .brand-img { width: auto; height: auto; max-width: 100px; max-height: 68px; }
.logo-current .logo-tile-wordmark { width: auto; height: 22px; max-width: 96px; object-fit: contain; }
.logo-drop { display: flex; flex: 1 1 220px; flex-direction: column; justify-content: center; gap: 0.25rem; min-height: 88px; padding: 0.75rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius-md); font-size: 0.84rem; color: var(--text-secondary); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.logo-drop strong { color: var(--text-primary); }
.logo-drop i { color: var(--secondary); }
.logo-drop:hover, .logo-drop.is-over { border-color: var(--secondary); background: rgba(0, 180, 216, 0.06); }
.logo-file:focus-visible + .logo-drop { outline: 2px solid var(--secondary); outline-offset: 2px; }
.logo-drop.is-disabled { cursor: not-allowed; opacity: 0.55; }
.logo-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.brand-places { margin-top: 1.15rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.brand-place { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.45rem 0; font-size: 0.82rem; line-height: 1.45; color: var(--text-secondary); }
.brand-place strong { display: block; color: var(--text-primary); }
.brand-place .tile-icon { width: 30px; height: 30px; font-size: 0.8rem; }
.pv-legend { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pv-legend .badge:empty { display: none; }
.pv-note { margin: 0.35rem 0 0.9rem; }

/* Each place twice: today, with the platform's logo, and with the MSP's logo in its place. */
.brand-previews { display: grid; gap: 1rem; }
.pv-place { min-width: 0; }
.pv-place-head { display: flex; gap: 0.45rem; align-items: center; margin-bottom: 0.45rem; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); }
.pv-place-head i { color: var(--secondary); }
.pv-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.6rem; align-items: center; }
.pv-arrow { font-size: 0.85rem; color: var(--text-muted); }
@media (max-width: 640px) {
  .pv-pair { grid-template-columns: minmax(0, 1fr); }
  .pv-arrow { justify-self: center; transform: rotate(90deg); }
}
.pv { display: flex; flex-direction: column; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-base); }
.pv.is-after { border-color: color-mix(in srgb, var(--secondary) 45%, transparent); }
.pv-stage { display: grid; flex: 1; place-items: center; min-height: 172px; padding: 0.75rem; }
.pv figcaption { padding: 0.4rem 0.7rem; border-top: 1px solid var(--border); background: var(--bg-card); font-size: 0.72rem; font-weight: 700; text-align: center; color: var(--text-secondary); }
.pv.is-after figcaption { color: var(--primary-light); }
.pv-nologo { display: grid; place-items: center; width: 100%; min-height: 34px; padding: 0.3rem 0.5rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); font-size: 0.62rem; line-height: 1.3; text-align: center; color: var(--text-muted); }

/* The miniatures follow the real places: the selected menu item and a focused field take the
   platform's secondary colour, and the sign-in button keeps the platform's gradient. */
.pv-side { width: 100%; max-width: 190px; padding: 0.7rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-sm); }
.pv-logo { display: flex; align-items: center; justify-content: center; min-width: 0; height: 40px; margin-bottom: 0.45rem; }
.pv-logo .brand-img { width: auto; height: 34px; max-width: 148px; }
.pv-logo .pv-wordmark { width: auto; height: 26px; max-width: 148px; object-fit: contain; }
.pv-badge { overflow: hidden; padding: 0.25rem 0.5rem; border: 1px solid rgba(0, 180, 216, 0.25); border-radius: 999px; background: rgba(0, 180, 216, 0.1); color: var(--primary-light); font-size: 0.66rem; font-weight: 700; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.pv-badge:empty { display: none; }
.pv-role { margin: 0.3rem 0 0.5rem; font-size: 0.55rem; font-weight: 700; letter-spacing: 0.1em; text-align: center; text-transform: uppercase; color: var(--text-muted); }
.pv-nav { display: grid; gap: 0.2rem; }
.pv-nav span { display: flex; gap: 0.45rem; align-items: center; padding: 0.32rem 0.5rem; border-left: 3px solid transparent; border-radius: var(--radius-sm); font-size: 0.7rem; white-space: nowrap; color: var(--text-secondary); }
.pv-nav span.is-active { border-left-color: var(--secondary); background: rgba(0, 180, 216, 0.15); color: var(--primary-light); font-weight: 600; }
.pv-signin { width: 100%; max-width: 220px; padding: 0.9rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: var(--shadow-sm); text-align: center; }
.pv-signin .pv-logo { height: 52px; }
.pv-signin .pv-logo .brand-img { height: 48px; max-width: 190px; }
.pv-signin .pv-logo .pv-wordmark-lg { width: auto; height: 34px; max-width: 190px; object-fit: contain; }
.pv-sub { margin-bottom: 0.6rem; font-size: 0.64rem; color: var(--text-muted); }
.pv-input { height: 1.45rem; margin-bottom: 0.4rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--msp-well); }
.pv-input.is-focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15); }
.pv-button { padding: 0.36rem; border-radius: var(--radius-sm); background: var(--gradient-primary); color: #fff; font-size: 0.68rem; font-weight: 700; }
.pv-portal { display: grid; grid-template-columns: 96px minmax(0, 1fr); width: 100%; max-width: 300px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-sm); }
.pv-portal-side { min-width: 0; padding: 0.55rem 0.4rem; border-right: 1px solid var(--border); }
.pv-portal-side .pv-logo { height: 32px; margin-bottom: 0.35rem; }
.pv-portal-side .pv-logo .pv-plain { display: block; width: auto; height: 24px; max-width: 84px; object-fit: contain; }
.pv-portal-side .pv-logo .pv-wordmark { height: 20px; max-width: 84px; }
.pv-portal-side .pv-badge { margin-bottom: 0.45rem; font-size: 0.58rem; }
.pv-portal-side .pv-nav span { padding: 0.28rem 0.35rem; font-size: 0.6rem; }
.pv-main { min-width: 0; padding: 0.65rem 0.75rem; }
.pv-head { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; margin-bottom: 0.6rem; font-size: 0.74rem; font-weight: 700; color: var(--text-primary); }
.pv-chip { padding: 0.1rem 0.45rem; border: 1px solid var(--primary-light); border-radius: 999px; color: var(--primary-light); font-size: 0.56rem; font-weight: 700; white-space: nowrap; }
.pv-line { height: 0.42rem; margin-bottom: 0.38rem; border-radius: 999px; background: var(--msp-meter-track); }
.pv-line.w40 { width: 40%; }
.pv-line.w60 { width: 60%; }
.pv-line.w80 { width: 80%; }
/* A customer report's cover, after the report's own layout: a dark band with the logo in a box of
   the real one's proportions, fitted inside it and never stretched or cropped, beside the
   classification. The platform's logo there is its light-on-dark one in either theme. */
.pv-report { display: flex; flex-direction: column; width: 100%; max-width: 200px; aspect-ratio: 210 / 297; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: var(--color-bg-elevated); box-shadow: var(--shadow-md); }
.pv-band { padding: 0.7rem 0.75rem 0.85rem; background: linear-gradient(160deg, var(--color-primary-darker) 0%, var(--color-primary-dark) 55%, var(--color-secondary-darker) 100%); color: #fff; }
.pv-brandrow { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; margin-bottom: 0.9rem; }
.pv-logobox { display: flex; align-items: center; min-width: 0; max-width: min(150px, 72%); height: 26px; }
.pv-logobox .brand-img { width: auto; height: 100%; max-width: 100%; padding: 2px 5px; object-fit: contain; }
.pv-cover-mark { display: block; width: auto; height: 20px; max-width: 100%; object-fit: contain; }
.pv-logobox .pv-nologo { min-height: 26px; border-color: rgba(255, 255, 255, 0.35); color: rgba(255, 255, 255, 0.78); font-size: 0.48rem; }
.pv-classif { flex: none; padding: 0.1rem 0.35rem; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 4px; font-size: 0.45rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
.pv-kicker { font-size: 0.5rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-secondary-lighter); }
.pv-cover-title { margin: 0.25rem 0 0.15rem; overflow-wrap: anywhere; font-size: 0.9rem; font-weight: 700; line-height: 1.2; color: #fff; }
.pv-cover-sub { font-size: 0.55rem; color: rgba(255, 255, 255, 0.75); }
.pv-paper { flex: 1; padding: 0.7rem 0.75rem; }
.pv-paper .pv-line { background: var(--color-border-strong); }

/* ---- Legal: the standing, the agreements as tiles, signing and the history ------------------- */
.legal-overview { padding: 1.25rem 1.5rem; }
.legal-status { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.legal-status-text { flex: 1; min-width: 0; }
.legal-status-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: var(--radius-lg); background: var(--gradient-primary); color: #fff; font-size: 1.35rem; }
.legal-status-icon.is-ok { background: var(--gradient-success); }
.legal-status-icon.is-wait { background: linear-gradient(135deg, var(--color-warning), var(--color-warning-dark)); }
.legal-status-icon.is-bad { background: var(--gradient-danger); }
.legal-standing { font-size: 1.25rem; font-weight: 800; line-height: 1.25; color: var(--text-primary); }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 0.9rem 1.5rem; margin: 1.1rem 0 0; }
.fact-grid > div { min-width: 0; }
.fact-grid dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.fact-grid dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.legal-next { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 1.1rem; padding: 0.8rem 1rem; border-left: 3px solid var(--secondary); border-radius: var(--radius-md); background: var(--msp-well); font-size: 0.86rem; line-height: 1.5; color: var(--text-primary); }
.legal-next i { margin-top: 0.2rem; color: var(--secondary); }
.legal-section-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; margin: 1.25rem 0 0.6rem; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.doc-tile { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; min-height: 236px; padding: 1.15rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.doc-tile:hover { border-color: rgba(0, 180, 216, 0.3); box-shadow: var(--shadow-glow); }
.doc-head { display: flex; gap: 0.75rem; align-items: flex-start; }
.doc-title { font-size: 1rem; font-weight: 700; line-height: 1.3; color: var(--text-primary); }
.doc-version { margin-top: 0.1rem; font-size: 0.76rem; color: var(--text-secondary); }
.doc-summary { font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary); }
.doc-meta { display: grid; gap: 0.2rem; font-size: 0.78rem; color: var(--text-secondary); }
.doc-meta strong { font-weight: 600; color: var(--text-primary); }
.doc-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.6rem; border-top: 1px solid var(--border); }
.legal-lower { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0.75rem; align-items: start; }
@media (max-width: 1180px) { .legal-lower { grid-template-columns: 1fr; } }
.legal-lower > .glass-card { margin-bottom: 0; padding: 1.25rem 1.5rem; }
.legal-lower > .legal-history-only { grid-column: 1 / -1; }
.legal-sign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 0 1.25rem; }
.legal-doc-modal.modal { width: min(920px, 96vw); max-width: 920px; }
.legal-doc-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; align-items: center; margin-bottom: 0.75rem; font-size: 0.8rem; color: var(--text-secondary); }
.legal-doc-text { max-height: 60vh; overflow: auto; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--msp-well); font-size: 0.86rem; line-height: 1.65; color: var(--text-primary); }
.legal-doc-text h1 { margin: 0 0 0.6rem; font-size: 1.15rem; }
.legal-doc-text h2 { margin: 1rem 0 0.4rem; font-size: 1rem; }
.legal-doc-text h3, .legal-doc-text h4 { margin: 0.9rem 0 0.35rem; font-size: 0.92rem; }
/* Tables in an agreement (Markdown tables): bordered, header tinted like the portal's tables, and
   scrolling sideways inside their own box on a narrow screen. */
.md-table-wrap { overflow-x: auto; margin: 0.75rem 0; }
.md-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; line-height: 1.45; }
.md-table th, .md-table td { padding: 0.45rem 0.6rem; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.md-table thead th { background: rgba(0, 180, 216, 0.08); font-weight: 600; color: var(--text-primary); }
.md-table .md-al-center { text-align: center; }
.md-table .md-al-right { text-align: right; }

/* ---- Email Setup: which server customer email uses, the platform's own, and the MSP's own ------ */
.route-banner { display: flex; gap: 0.9rem; align-items: center; margin-bottom: 0.75rem; padding: 1rem 1.25rem; border: 1px solid var(--glass-border); border-left: 4px solid var(--secondary); border-radius: var(--radius-lg); background: var(--glass-bg); box-shadow: var(--glass-shadow); }
.route-banner.is-none { border-left-color: var(--warning); }
.route-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.email-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0.75rem; align-items: start; }
@media (max-width: 1180px) { .email-layout { grid-template-columns: 1fr; } }
.email-layout > .glass-card { margin-bottom: 0; padding: 1.25rem 1.5rem; }
.route-option.is-active { border-color: rgba(0, 180, 216, 0.45); box-shadow: inset 0 3px 0 var(--secondary), var(--glass-shadow); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 0 1rem; }
.email-fields { margin-top: 1rem; }
.field-row-host { grid-template-columns: minmax(0, 3fr) minmax(6rem, 1fr); }
.route-text { min-width: 0; }
.email-status { margin: 0.75rem 0 0; font-size: 0.85rem; }
.email-status:empty { display: none; }
.route-option .card-text { margin-bottom: 0.75rem; }
.route-option .fact-grid { margin-top: 0.5rem; }

/* ---- Support: the mailbox form beside the ways to reach the platform -------------------------- */
.support-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 0.75rem; align-items: start; }
.support-layout > .glass-card { margin-bottom: 0; }

/* ---- Plan & Billing: how asset capacity works ------------------------------------------------- */
.guide-intro { max-width: 62rem; margin-bottom: 0.9rem; font-size: 0.86rem; line-height: 1.55; color: var(--text-secondary); }
.guide-pool { display: flex; gap: 0.6rem 0.9rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--msp-well); font-size: 0.86rem; color: var(--text-secondary); }
.guide-pool strong { color: var(--text-primary); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 0.75rem; }
.guide-section { padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); }
.guide-section h4 { display: flex; gap: 0.55rem; align-items: center; margin-bottom: 0.55rem; font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }
.guide-num { display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: rgba(0, 180, 216, 0.12); color: var(--secondary); font-size: 0.74rem; font-weight: 700; }
.guide-section ul { margin: 0; padding-left: 1.1rem; font-size: 0.83rem; line-height: 1.55; color: var(--text-secondary); }
.guide-section li + li { margin-top: 0.35rem; }
.bl-guide-link { margin-top: 1rem; }
