/* ==========================================================================
   Secen design system - "soft canvas" theme (inspired by the YourCRM style card)
   Font: Blender Pro (self-hosted).  Palette: #030303 ink · #729DEE periwinkle ·
   #E56868 coral · #F9F9F9 paper · #E2E2E2 mist, on a warm-grey canvas.
   Type scale: 12 / 14 / 16 / 30 / 32 / 40 px.  No inline styles (strict CSP).
   ========================================================================== */
@font-face { font-family: "Blender Pro"; src: url("../fonts/BlenderPro-Thin.woff2") format("woff2"); font-weight: 200; font-display: swap; }
@font-face { font-family: "Blender Pro"; src: url("../fonts/BlenderPro-Book.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Blender Pro"; src: url("../fonts/BlenderPro-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Blender Pro"; src: url("../fonts/BlenderPro-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Blender Pro"; src: url("../fonts/BlenderPro-Heavy.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --font: "Blender Pro", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* brand / fixed */
  --ink: #0c111d;                 /* deep slate — sidebar, pills, tooltips */
  --blue: #101828;                /* monochrome accent */
  --coral: #d92d20;               /* alert red */
  --paper: #ffffff;
  --mist: #eaecf0;
  --sidebar-bg: #0c111d;          /* enterprise dark rail, both themes */
  --sidebar-bg-2: #161b26;
  --sidebar-text: #c3c9d5;
  --sidebar-muted: #8a93a6;
  --sidebar-border: #1f2633;

  /* light theme (default) */
  --canvas: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f6;
  --glass: #ffffff;
  --glass-edge: #e4e7ec;
  --card: #ffffff;
  --frame: #ffffff;
  --frame-top: #ffffff;
  --glow-1: transparent;
  --glow-2: transparent;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #475467;
  --muted: #667085;

  --primary: #101828;             /* primary actions are ink-black */
  --primary-ink: #ffffff;
  --accent: #101828;
  --accent-ink: #101828;
  --accent-soft: rgba(16, 24, 40, 0.06);
  --danger: #d92d20;
  --danger-ink: #b42318;
  --danger-soft: rgba(217, 45, 32, 0.10);
  --ok-ink: #067647;
  --ok-soft: rgba(6, 118, 71, 0.10);

  --chart-1: #344054;
  --chart-2: #d92d20;
  --chart-ink: #101828;
  --chart-track: #eef1f6;
  --chart-grid: rgba(16, 24, 40, 0.06);
  /* severity — four clearly distinct hues (red / orange / amber / blue) */
  --sev-critical: #b42318; --sev-high: #e8590c; --sev-medium: #dc9a06; --sev-low: #1570ef; --sev-info: #667085;
  --sev-critical-soft: rgba(180, 35, 24, 0.12); --sev-high-soft: rgba(232, 89, 12, 0.12);
  --sev-medium-soft: rgba(220, 154, 6, 0.14); --sev-low-soft: rgba(21, 112, 239, 0.12);
  --cat-1: #344054; --cat-2: #e8590c; --cat-3: #0e9384;

  --r-xl: 16px;
  --r-lg: 12px;
  --r-md: 10px;
  --r-sm: 8px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 4px 6px -2px rgba(16, 24, 40, 0.04), 0 12px 24px -6px rgba(16, 24, 40, 0.14);
  --shadow-glass: 0 1px 2px rgba(16, 24, 40, 0.04);
  --sidebar-w: 256px;
  --gap: 18px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --canvas: #0c111d;
  --surface: #161b26;
  --surface-2: #1d242f;
  --surface-3: #272f3d;
  --glass: #161b26;
  --glass-edge: #272f3d;
  --card: #161b26;
  --frame: #161b26;
  --frame-top: #161b26;
  --glow-1: transparent;
  --glow-2: transparent;
  --border: #272f3d;
  --border-strong: #3a4454;
  --text: #f5f6f8;
  --text-2: #cdd3dd;
  --muted: #94a0b2;
  --primary: #f5f6f8;
  --primary-ink: #0c111d;
  --accent: #f5f6f8;
  --accent-ink: #f5f6f8;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --blue: #f5f6f8;
  --danger: #f04438;
  --danger-ink: #fda29b;
  --danger-soft: rgba(240, 68, 56, 0.16);
  --ok-ink: #75e0a7;
  --ok-soft: rgba(27, 127, 85, 0.22);
  --chart-1: #d0d5dd;
  --chart-2: #f97066;
  --chart-ink: #f5f6f8;
  --chart-track: #272f3d;
  --chart-grid: rgba(255, 255, 255, 0.06);
  --sev-critical: #f97066; --sev-high: #f38744; --sev-medium: #f5c451; --sev-low: #53b1fd; --sev-info: #94a0b2;
  --sev-critical-soft: rgba(249, 112, 102, 0.16); --sev-high-soft: rgba(243, 135, 68, 0.16);
  --sev-medium-soft: rgba(245, 196, 81, 0.16); --sev-low-soft: rgba(83, 177, 253, 0.16);
  --cat-1: #d0d5dd; --cat-2: #f38744; --cat-3: #2dd4bf;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, 0.5);
  --shadow-glass: 0 1px 2px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--canvas); letter-spacing: 0.015em; -webkit-font-smoothing: antialiased; }
/* Inline text links are underlined by DEFAULT so they are recognisable without
   hovering (an interactive element must not rely on hover or colour alone).
   Structural and component links — navigation, buttons, tabs, cards, tiles,
   table row links, icon buttons, chips — carry their own affordance (border,
   background, weight), so they opt out in the rule below. */
a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px;
    text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { text-decoration-thickness: 2px; text-decoration-color: currentColor; }
.nav-link, .logo, .btn, a.icon-btn, .dropdown a, .pill-tabs a, .sub-tabs a, .mini-tabs a,
.status-tabs a, .tab a, .table a.row-link, .page-btn, .tile, .tile-row a, a.card-link,
a.sec-tile, a.sev-tile, .sevcard, .sev-chip, .health-pills a, .agent-usage, .risk-rows li a,
.activity-item > a, .host-rank a, .status-list a, .fw-bars a, .kpi-strip a, .fd-list a,
.fd-v a, .card-head a.sub, .eyebrow a, .crumb a, a.chip, .chip a, .brand {
  text-decoration: none;
}
/* These still get a clear underline on hover for extra feedback. */
.table a.row-link:hover, .status-list a:hover, .fw-bars a:hover, .agent-usage:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: 0.01em; }
h1 { font-size: 40px; font-weight: 500; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: 0.04em; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--text); color: var(--surface); }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- app frame */
body { background: var(--canvas); }
/* Enterprise shell: fixed dark left rail (full labels, collapsible to icons) + content column. */
.app { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar { position: sticky; top: 0; align-self: flex-start; height: 100vh; width: var(--sidebar-w); flex: none; z-index: 40;
  display: flex; flex-direction: column; background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border);
  transition: width .16s ease; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 14px; min-height: 68px; border-bottom: 1px solid var(--sidebar-border); }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; }
.nav-group:first-child { margin-top: 2px; }
.nav-group-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--sidebar-border); }
.nav-group-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar-muted); font-weight: 600; padding: 4px 12px 6px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--sidebar-text); font-size: 14.5px; font-weight: 500; letter-spacing: 0.01em; }
.nav-link .icon { width: 19px; height: 19px; flex: none; color: var(--sidebar-muted); }
.nav-link:hover { background: var(--sidebar-bg-2); color: #fff; text-decoration: none; }
.nav-link:hover .icon { color: #fff; }
.nav-link.active, .nav-link.active:hover { background: #ffffff; color: #0c111d; }
.nav-link.active .icon, .nav-link.active:hover .icon { color: #0c111d; }
.nav-label { white-space: nowrap; overflow: hidden; }

.logo { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.logo:hover { text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); flex: none; }
.sidebar .brand-mark { background: #ffffff; color: #0c111d; }
.brand-mark svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 2; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: 0.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .brand-name { color: #fff; }
.brand-name span { font-weight: 400; }
.brand-logo { max-height: 36px; width: auto; }
.brand-logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: inline; }

/* Collapsed: icons only, labels hidden, tooltips on hover. */
.app[data-nav-collapsed="true"] .sidebar { width: 76px; }
.app[data-nav-collapsed="true"] .nav-label,
.app[data-nav-collapsed="true"] .nav-group-label,
.app[data-nav-collapsed="true"] .brand-name,
.app[data-nav-collapsed="true"] .brand .sub { display: none; }
.app[data-nav-collapsed="true"] .sidebar-head { justify-content: center; }
.app[data-nav-collapsed="true"] .nav-link { justify-content: center; padding: 0; }
.app[data-nav-collapsed="true"] .nav-link::after { content: attr(data-tip); position: absolute; left: 60px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; padding: 6px 12px; border-radius: var(--pill); background: var(--ink); color: var(--paper); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 60; box-shadow: var(--shadow); }
:root[data-theme="dark"] .app[data-nav-collapsed="true"] .nav-link::after { background: var(--paper); color: var(--ink); }
.app[data-nav-collapsed="true"] .nav-link:hover::after, .app[data-nav-collapsed="true"] .nav-link:focus-visible::after { opacity: 1; }

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 26px; min-height: 64px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-spacer { flex: 1; }
.topbar .nav-toggle-sm { display: none; }
.nav-scrim { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.search { position: relative; width: 240px; }
.search input[type=search] { width: 100%; padding-left: 40px; height: 44px; border-radius: var(--pill); background: var(--card); border-color: var(--glass-edge); }
.search .icon { position: absolute; left: 15px; top: 14px; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.sm { width: 34px; height: 34px; border-color: var(--border); }
.icon-btn.sm .icon { width: 15px; height: 15px; }
.nav-toggle { border: 0; background: none; box-shadow: none; width: 36px; height: 36px; border-radius: var(--r-sm); color: var(--sidebar-muted); flex: none; }
.nav-toggle:hover { background: var(--sidebar-bg-2); color: #fff; border: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--primary); color: var(--primary-ink); border: 0; }
.user-menu { position: relative; }
.user-menu > button { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 8px; display: none; z-index: 50; }
.dropdown.open { display: block; }
.export-menu { position: relative; display: inline-block; }
.tile.is-disabled { opacity: .6; cursor: not-allowed; }
.tile .cta.muted { background: var(--surface-2); color: var(--text-2); }
.tile.is-disabled:hover { transform: none; }
.export-menu > summary { list-style: none; cursor: pointer; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu[open] > .dropdown { display: block; min-width: 290px; }
.dropdown a, .dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--pill); color: var(--text-2); font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.dd-head { padding: 8px 12px 4px; display: flex; flex-direction: column; line-height: 1.3; }
.dd-head span { color: var(--muted); font-size: 13px; }
.dd-head .dd-org { margin-top: 4px; color: var(--text-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.content { padding: 26px 30px 40px; min-width: 0; width: 100%; max-width: 1560px; margin: 0 auto; }

/* Mobile: sidebar slides over the content. */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); width: 254px; }
  .app[data-nav-open="true"] .sidebar { transform: translateX(0); }
  .app[data-nav-collapsed="true"] .sidebar { width: 254px; }
  .app[data-nav-collapsed="true"] .nav-label, .app[data-nav-collapsed="true"] .nav-group-label, .app[data-nav-collapsed="true"] .brand-name { display: revert; }
  .app[data-nav-collapsed="true"] .nav-link { justify-content: flex-start; padding: 0 12px; }
  .topbar .nav-toggle-sm { display: inline-grid; border: 0; background: none; box-shadow: none; }
  .app[data-nav-open="true"] .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .content { padding: 20px 16px 32px; }
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--pill); font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); margin-bottom: 14px;
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-glass); }
.eyebrow a { color: var(--text); }
.page-head p { color: var(--text-2); margin: 10px 0 0; max-width: 760px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: var(--pill);
  font: inherit; font-size: 15px; font-weight: 500; letter-spacing: 0.04em; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: background .15s, border-color .15s, color .15s, transform .05s; }
.btn:hover { border-color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn { border-radius: var(--r-sm); font-weight: 600; letter-spacing: 0.01em; box-shadow: var(--shadow-glass); }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #344054; border-color: #344054; color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { background: #ffffff; border-color: #ffffff; color: #0c111d; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-ink); border-color: var(--danger-ink); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline-form { display: inline; }

/* ---------------------------------------------------------------- cards & grid */
.grid { display: grid; gap: var(--gap); }
.grid-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: var(--gap); }
.mt-lg { margin-top: 28px; }
.mb0 { margin-bottom: 4px; }
.card { background: var(--card); border: 1px solid var(--glass-edge); border-radius: var(--r-xl); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; }
.card-head h2 { font-size: 18px; font-weight: 700; letter-spacing: 0.02em; }
.card-head .sub { color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0.02em; }
.card-head a.sub { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--pill); border: 1px solid var(--border); color: var(--text-2); }
.card-head a.sub:hover { border-color: var(--text); color: var(--text); text-decoration: none; }
.card-body { padding: 4px 24px 24px; }
.card-body.flush { padding: 0; }

/* KPI tiles - white by default, solid brand tiles for the hero row */
.kpi { position: relative; padding: 20px 22px 22px; display: flex; flex-direction: column; min-height: 150px; }
.kpi .label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 500; color: var(--text-2); letter-spacing: 0.03em; }
.kpi .label .icon { display: none; width: 38px; height: 38px; padding: 9px; border-radius: 50%; color: var(--kpi-ink, var(--text)); background: var(--kpi-bg, var(--surface-2)); border: 1px solid var(--border); }
.kpi .value { font-size: 40px; font-weight: 700; line-height: 1; margin-top: auto; padding-top: 18px; letter-spacing: 0.01em; }
.kpi .value small { font-size: 16px; font-weight: 500; opacity: .65; margin-left: 4px; }
.kpi .meta { margin-top: 10px; font-size: 14px; color: var(--muted); }
.kpi .meta strong { color: var(--text); font-weight: 700; }
.kpi .meta .meter .pct { color: inherit; }
.kpi-green { --kpi-bg: var(--accent-soft); --kpi-ink: var(--accent-ink); }
.kpi-amber, .kpi-red { --kpi-bg: var(--danger-soft); --kpi-ink: var(--danger-ink); }
.kpi-violet { --kpi-bg: var(--accent-soft); --kpi-ink: var(--accent-ink); }
.kpi-dark, .kpi-blue, .kpi-coral { border: 0; }
.kpi-dark { background: var(--ink); color: var(--paper); }
.kpi-dark .label, .kpi-dark .meta { color: rgba(249, 249, 249, 0.7); }
.kpi-dark .meta strong { color: var(--paper); }
.kpi-dark .label .icon { background: rgba(249, 249, 249, 0.1); border-color: rgba(249, 249, 249, 0.16); color: var(--paper); }
:root[data-theme="dark"] .kpi-dark { background: var(--paper); color: var(--ink); }
:root[data-theme="dark"] .kpi-dark .label, :root[data-theme="dark"] .kpi-dark .meta { color: rgba(3, 3, 3, 0.65); }
:root[data-theme="dark"] .kpi-dark .meta strong { color: var(--ink); }
:root[data-theme="dark"] .kpi-dark .label .icon { background: rgba(3, 3, 3, 0.06); border-color: rgba(3, 3, 3, 0.12); color: var(--ink); }
.kpi-blue { background: var(--blue); color: var(--ink); }
.kpi-coral { background: var(--coral); color: var(--ink); }
.kpi-blue .label, .kpi-blue .meta, .kpi-coral .label, .kpi-coral .meta { color: rgba(3, 3, 3, 0.72); }
.kpi-blue .meta strong, .kpi-coral .meta strong { color: var(--ink); }
.kpi-blue .label .icon, .kpi-coral .label .icon { background: rgba(255, 255, 255, 0.35); border-color: rgba(255, 255, 255, 0.55); color: var(--ink); }

.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 340px; }
.chart-box.short { height: 240px; }

.head-actions { display: flex; gap: 6px; align-items: center; }
.pill-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 24px 16px; }
.pill-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--border); background: var(--card); color: var(--text-2); font-size: 14px; font-weight: 500; }
.pill-tabs a:hover { color: var(--text); border-color: var(--text); text-decoration: none; }
.pill-tabs a.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pill-tabs a small { font-size: 12px; opacity: .7; }
.gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 16px 8px; }
.gauge { position: relative; text-align: center; min-width: 0; }
.gauge .chart-box { height: 150px; }
.gauge .g-val { position: relative; margin-top: -40px; font-size: 30px; font-weight: 700; line-height: 1; }
.gauge .g-label { margin-top: 8px; font-size: 14px; color: var(--text-2); }
.gauge .g-sub { font-size: 13px; color: var(--muted); }
.health-pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 24px 24px; }
.health-pills a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.health-pills .n { font-weight: 700; color: var(--text); }

.alert-list { list-style: none; margin: 0; padding: 0 12px 12px; }
.alert-item { display: flex; gap: 14px; align-items: flex-start; padding: 16px 12px; border-top: 1px solid var(--border); }
.alert-item:first-child { border-top: 0; }
.alert-item.is-resolved { opacity: .6; }
.sev-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 9px; background: var(--chart-1); }
.sev-critical .sev-dot { background: var(--coral); box-shadow: 0 0 0 4px var(--danger-soft); }
.sev-warning .sev-dot { background: var(--chart-ink); }
.alert-body { flex: 1; min-width: 0; }
.alert-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.alert-title { font-weight: 700; font-size: 16px; }
.alert-title a { color: var(--text); }
.alert-msg { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.alert-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.alert-actions { display: flex; gap: 6px; flex: none; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { display: inline-flex !important; align-items: center; gap: 0; margin: 0 !important; padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--border);
  background: var(--card); font-size: 14px !important; text-transform: none !important; letter-spacing: .02em !important; font-weight: 500 !important; color: var(--text) !important; cursor: pointer; }
.check-pill:has(input:checked) { border-color: var(--text); background: var(--surface-2); }
.kpi .value.value-sm { font-size: 24px; }
.help-list { font-size: 13px; color: var(--muted); margin: -6px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: var(--pill); background: var(--coral); color: var(--ink); font-size: 12px; font-weight: 700; }
.bell { position: relative; }
.bell .dot { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--coral); color: var(--ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--canvas); }
@media (max-width: 640px) { .alert-item { flex-wrap: wrap; } .alert-actions { width: 100%; padding-left: 24px; } }

/* ---------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 12px 18px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: transparent; white-space: nowrap; }
.table th:first-child { padding-left: 24px; }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table tbody tr:hover td { background: var(--glass); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 700; color: var(--text); }
.table .sub { display: block; color: var(--muted); font-size: 13px; }
.table a.row-link { color: var(--text); font-weight: 700; }
.table a.row-link:hover { color: var(--accent-ink); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: var(--border-strong); margin-bottom: 10px; }
.empty h2 { color: var(--text); margin-bottom: 8px; }

/* ---------------------------------------------------------------- badges, meters */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--pill); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; white-space: nowrap;
  background: var(--glass); color: var(--text-2); border: 1px solid var(--border); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge-healthy, .badge-success, .badge-green, .badge-primary { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.badge-expiring, .badge-amber, .badge-partial, .badge-running { background: var(--danger-soft); border-color: transparent; color: var(--danger-ink); }
.badge-expired, .badge-failed, .badge-red { background: var(--coral); border-color: var(--coral); color: var(--ink); }
.badge-over { background: var(--ink); border-color: var(--ink); color: var(--paper); }
:root[data-theme="dark"] .badge-over { background: var(--paper); color: var(--ink); }
.badge-under, .badge-violet { background: var(--surface-3); border-color: transparent; color: var(--text); }
.badge-unknown, .badge-never { background: transparent; color: var(--muted); }
.badge-free { background: transparent; color: var(--muted); border-style: dashed; }

.meter { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.meter .track { flex: 1; height: 8px; border-radius: var(--pill); background: var(--chart-track); overflow: hidden; }
.meter .fill { height: 100%; width: 0; border-radius: var(--pill); background: var(--chart-1); transition: width .6s ease; }
.meter .fill.low { background: var(--chart-2); }
.meter .fill.mid, .meter .fill.high { background: var(--chart-1); }
.meter .fill.over { background: var(--chart-ink); }
.meter .pct { min-width: 46px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }

.stack-list { list-style: none; margin: 0; padding: 0 12px 12px; }
.stack-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: var(--r-md); }
.stack-list li:hover { background: var(--surface-2); }
.stack-list .title { font-weight: 700; color: var(--text); }
.stack-list .sub { display: block; color: var(--muted); font-size: 13px; }
.days { font-weight: 700; font-size: 24px; line-height: 1; text-align: right; }
.days small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 3px; }
.text-red, .text-amber { color: var(--danger-ink); } .text-green, .text-primary { color: var(--accent-ink); } .text-muted { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--pill); border: 1px solid var(--border); background: var(--surface); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; }
.sw-c1 { background: var(--chart-1); } .sw-c2 { background: var(--chart-2); } .sw-ink { background: var(--chart-ink); } .sw-track { background: var(--chart-track); }
.sw-dash { width: 16px !important; height: 0 !important; border-radius: 0 !important; border-top: 2px dashed var(--muted); }
.sw-primary { background: var(--accent); } .sw-violet { background: var(--accent); } .sw-amber, .sw-red { background: var(--coral); } .sw-green { background: var(--accent); } .sw-muted { background: var(--surface-3); }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 8px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=time], input[type=datetime-local], input[type=month], input[type=week], input[type=tel], input[type=search], select, textarea {
  width: 100%; height: 46px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 16px; letter-spacing: 0.02em; transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none; appearance: none; }
select { -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px; }
/* native date/time pickers: keep the picker indicator, tint it for dark mode */
input[type=date], input[type=time], input[type=datetime-local], input[type=month], input[type=week] { -webkit-appearance: none; appearance: none; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
:root[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type=datetime-local]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .7; }
textarea { height: auto; padding: 12px 16px; resize: vertical; font-family: var(--mono); font-size: 13px; }
textarea.prose { font-family: var(--font); font-size: 15px; line-height: 1.5; }   /* sentences, not keys or lists */
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); vertical-align: -3px; margin: 0 10px 0 0; }
:root[data-theme="dark"] input[type=checkbox] { accent-color: var(--blue); }
.field { margin-bottom: 18px; }
.field .help { font-size: 13px; color: var(--muted); margin-top: 6px; }
.field .error, .errorlist { color: var(--danger-ink); font-size: 14px; margin: 6px 0 0; padding: 0; list-style: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--coral); }
.field.check label { display: flex; align-items: center; text-transform: none; letter-spacing: 0.02em; font-size: 16px; font-weight: 500; color: var(--text); }
.opt-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 12px 14px; margin-bottom: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); text-transform: none; letter-spacing: normal; font-size: 14px; font-weight: 400; }
.opt-check input[type=checkbox] { margin: 3px 0 0; flex: none; }
.opt-check .opt-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.opt-check .opt-title { font-size: 15px; font-weight: 500; color: var(--text); letter-spacing: 0.01em; }
.opt-check .help { margin-top: 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-transform: none; letter-spacing: normal; }
.opt-check:hover { border-color: var(--ink); }
.trend { display: block; overflow: visible; }
.head-actions.start { justify-content: flex-start; }
.smtp-test { gap: 8px; align-items: flex-end; }
.smtp-test .field { margin: 0; }
.trend-foot { display: flex; width: 100%; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.trend-foot span { flex: 1; }
.trend-foot span:nth-child(2) { font-weight: 500; color: var(--text); text-align: center; }
.trend-foot span:last-child { text-align: right; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 6px 24px 20px; }
.filters .f { min-width: 150px; flex: 1; }
.filters .f.grow { flex: 2.4; min-width: 220px; }
.filters label { font-size: 11px; margin-bottom: 6px; }
.filters input, .filters select { height: 42px; font-size: 15px; border-radius: var(--pill); }
fieldset { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px 4px; margin: 0 0 18px; background: transparent; }
legend { padding: 4px 12px; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); border-radius: var(--pill); border: 1px solid var(--border); background: var(--surface-2); }

/* ---------------------------------------------------------------- alerts */
/* Flash messages render as a stacked toast column, top-right, never overlapping. */
.messages { position: fixed; top: 76px; right: 24px; z-index: 80; display: flex; flex-direction: column; gap: 10px; width: 380px; max-width: calc(100vw - 32px); margin: 0; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--border); border-left-width: 4px; background: var(--surface); color: var(--text); font-size: 14.5px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease; }
.alert .icon { margin-top: 1px; flex: none; }
.alert-success { border-left-color: var(--ok-ink); } .alert-success .icon { color: var(--ok-ink); }
.alert-info { border-left-color: var(--accent); } .alert-info .icon { color: var(--accent-ink); }
.alert-error { border-left-color: var(--danger); } .alert-error .icon { color: var(--danger-ink); }
.alert-warning { border-left-color: var(--sev-medium); } .alert-warning .icon { color: #a16207; }
.alert span { color: var(--text); flex: 1; min-width: 0; }
.alert button { margin-left: 8px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; flex: none; }
.alert button:hover { color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .messages { left: 12px; right: 12px; width: auto; top: 68px; } }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.pg-left { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pg-count { color: var(--text-2); }
.pg-count strong { color: var(--text); font-weight: 600; }
.pg-size-form { margin: 0; }
.pg-size { display: inline-flex; align-items: center; gap: 8px; margin: 0; text-transform: none; letter-spacing: normal; font-size: 13px; color: var(--muted); font-weight: 500; }
.pg-size select { height: 34px; width: auto; min-width: 70px; padding: 0 30px 0 12px; font-size: 13px; border-radius: var(--r-sm); background-color: var(--surface); background-position: right 10px center; }
.pages { display: flex; gap: 4px; align-items: center; }
.page-btn { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; transition: background .12s, border-color .12s, color .12s; }
.page-btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.page-btn.is-current { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.page-btn.is-disabled { opacity: .4; pointer-events: none; }
.page-gap { padding: 0 4px; color: var(--muted); }

/* ---------------------------------------------------------------- connectors */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--glass-edge); border-radius: var(--r-lg); background: var(--card); color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; min-height: 170px; }
.tile:hover { border-color: var(--text); transform: translateY(-2px); text-decoration: none; }
.tile .t-head { display: flex; align-items: center; gap: 12px; }
.tile .logo { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; }
.tile:nth-child(3n+2) .logo { background: var(--danger-soft); color: var(--danger-ink); }
.tile:nth-child(3n) .logo { background: var(--surface-3); color: var(--text); }
.tile h3 { font-size: 18px; }
.tile p { color: var(--text-2); font-size: 14px; margin: 0; flex: 1; }
.tile .cta { align-self: flex-start; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--pill); background: var(--primary); color: var(--primary-ink); }
.group-title { display: inline-flex; margin: 30px 0 14px; height: 32px; align-items: center; padding: 0 14px; border-radius: var(--pill); font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text);
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-glass); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 2px 0 16px 44px; color: var(--text-2); font-size: 15px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 700; font-size: 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 12px 22px; font-size: 15px; margin: 0; }
.kv dt { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: 0.12em; font-weight: 500; padding-top: 3px; }
.kv dd { margin: 0; font-weight: 500; }

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--gap); padding: var(--gap); }
.auth-art { position: relative; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border-radius: var(--r-xl); background: var(--ink); color: var(--paper); }
.auth-art::before { content: ""; position: absolute; width: 520px; height: 520px; right: -140px; top: -160px; border-radius: 50%; background: #ffffff; opacity: .07; }
.auth-art::after { content: ""; position: absolute; width: 300px; height: 300px; right: -110px; bottom: -120px; border-radius: 50%; background: #ffffff; opacity: .05; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .brand-name { color: var(--paper); }
.auth-art .brand-mark { background: var(--paper); color: var(--ink); }
.auth-art .eyebrow { color: var(--paper); background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); box-shadow: none; }
.auth-art h1 { font-size: 56px; font-weight: 500; line-height: 1.02; max-width: 560px; }
.auth-art h1 em { font-style: normal; color: #ffffff; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
.auth-art p.lead { color: rgba(249,249,249,.72); font-size: 18px; max-width: 520px; margin-top: 18px; }
.auth-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 580px; }
.auth-point { padding: 16px 18px; border-radius: var(--r-lg); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.auth-point strong { display: block; font-size: 30px; font-weight: 700; color: var(--paper); }
.auth-point span { color: rgba(249,249,249,.72); font-size: 14px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 32px; font-weight: 500; letter-spacing: 0.01em; }
.auth-card .lead { color: var(--text-2); margin: 10px 0 26px; }
.auth-top { display: flex; justify-content: flex-end; margin-bottom: 24px; }
.auth-brand { padding: 0; }
.otp-input { font-family: var(--mono) !important; font-size: 26px !important; height: 60px !important; text-align: center; letter-spacing: 0.4em !important; border-radius: var(--r-md) !important; }
.qr { width: 220px; height: 220px; padding: 12px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--border); display: block; margin: 0 auto 16px; }
.secret { font-family: var(--mono); font-size: 15px; letter-spacing: 0.08em; padding: 12px 16px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); background: var(--surface-2); text-align: center; overflow-wrap: anywhere; color: var(--text); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.codes code { padding: 12px; text-align: center; font-size: 17px; border: 1px solid var(--border); border-radius: var(--pill); background: var(--surface-2); letter-spacing: 0.1em; color: var(--text); }
.app-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.step-row { display: flex; gap: 14px; margin-bottom: 18px; }
.step-row .n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 700; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.foot-note { margin-top: 28px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- misc */
.month { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.month:last-child { border-bottom: 0; }
.month .m-label strong { display: block; font-size: 30px; font-weight: 500; }
.month .m-label span { color: var(--muted); font-size: 14px; }
.renew-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.renew-row:last-child { border-bottom: 0; }
.renew-row .date { width: 60px; height: 60px; display: grid; place-content: center; text-align: center; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.renew-row .date b { display: block; font-size: 22px; font-weight: 700; line-height: 1; }
.renew-row .date small { font-size: 11px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.renew-row .info { flex: 1; min-width: 0; }
.renew-row .info strong { display: block; color: var(--text); }
.renew-row .info span { color: var(--muted); font-size: 14px; }
.callout { border-radius: var(--r-lg); padding: 18px 20px; background: var(--accent-soft); color: var(--text); }
.callout strong { color: var(--accent-ink); }
.err-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.overlay { position: fixed; inset: 0; background: rgba(16,24,40,0.55); z-index: 90; display: none; }
.overlay.show { display: block; }
.overlay .err-page { min-height: 100vh; padding: 24px; }
.overlay .card { width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); border-radius: var(--r-lg); animation: modal-in .18s cubic-bezier(.22,.61,.36,1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.copy-row { display: flex; gap: 10px; align-items: stretch; }
.copy-row .secret { flex: 1; text-align: left; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }


/* ---------------------------------------------------------------- endpoints (devices & posture) */
.pill-tabs.subnav { padding: 0; margin-top: 4px; }
.subnav-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.content { position: relative; }
/* Infrastructure > Refresh all data: same place on every Infrastructure page, on the eyebrow line at the top right
   (page-head actions sit at the bottom of the page head, so they never meet it). In the flow on phones. */
.subnav-refresh { position: absolute; top: 14px; right: 6px; margin: 0; }
@media (max-width: 640px) { .subnav-refresh { position: static; margin-top: 4px; } }
.kv dd .sub { display: block; font-weight: 400; }
.kb-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kb-stats div { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.kb-stats b { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; }
.kb-stats span { color: var(--muted); font-size: 13px; }
.kb-scroll { max-height: 360px; overflow-y: auto; margin-top: 12px; border: 1px solid var(--border); border-radius: var(--r-md); }
.kb-scroll thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.table.compact td, .table.compact th { padding-top: 8px; padding-bottom: 8px; }
details[open] > summary .icon { transform: rotate(180deg); }
.export-menu[open] > summary .icon:first-child { transform: none; }
@media (max-width: 640px) { .kb-stats { grid-template-columns: 1fr; } }
.qty-form { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.qty-form input { width: 90px !important; height: 34px !important; text-align: right; }
.badge.sev { font-weight: 700; letter-spacing: 0.03em; }
.sev-b-critical { background: var(--sev-critical); border-color: var(--sev-critical); color: #fff; }
.sev-b-high { background: var(--sev-high-soft); border-color: transparent; color: #c4320a; }
.sev-b-medium { background: var(--sev-medium-soft); border-color: transparent; color: #a16207; }
.sev-b-low { background: var(--sev-low-soft); border-color: transparent; color: #175cd3; }
.sev-b-info { background: var(--surface-3); border-color: transparent; color: var(--muted); }
:root[data-theme="dark"] .sev-b-high { color: var(--sev-high); }
:root[data-theme="dark"] .sev-b-medium { color: var(--sev-medium); }
:root[data-theme="dark"] .sev-b-low { color: var(--sev-low); }
.sev-critical .sev-dot { background: var(--sev-critical); box-shadow: 0 0 0 4px var(--sev-critical-soft); }
.sev-high .sev-dot { background: var(--sev-high); }
.sev-medium .sev-dot { background: var(--sev-medium); }
.sev-low .sev-dot { background: var(--sev-low); }
.sev-info .sev-dot { background: var(--sev-info); }
.sev-line { display: flex; flex-wrap: wrap; gap: 6px; }
.sev-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--pill); font-size: 13px; font-weight: 500; }
.sev-chip:hover { text-decoration: none; filter: brightness(0.96); }
.sev-c-critical { background: var(--sev-critical); color: #fff; }
.sev-c-high { background: var(--sev-high-soft); color: #c4320a; }
.sev-c-medium { background: var(--sev-medium-soft); color: #a16207; }
.sev-c-low { background: var(--sev-low-soft); color: #175cd3; }
:root[data-theme="dark"] .sev-c-high { color: var(--sev-high); }
:root[data-theme="dark"] .sev-c-medium { color: var(--sev-medium); }
:root[data-theme="dark"] .sev-c-low { color: var(--sev-low); }
.kpi-dark .sev-chip { color: var(--ink); }
.risk { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: var(--pill); font-size: 14px; font-weight: 700; }
.risk b { font-weight: 700; }
.risk-low { background: var(--sev-low-soft); color: #175cd3; }
.risk-medium { background: var(--sev-medium-soft); color: #a16207; }
.risk-high { background: var(--sev-high-soft); color: #c4320a; }
.risk-critical { background: var(--sev-critical); color: #fff; }
:root[data-theme="dark"] .risk-low { color: var(--sev-low); }
:root[data-theme="dark"] .risk-medium { color: var(--sev-medium); }
:root[data-theme="dark"] .risk-high { color: var(--sev-high); }
.risk-rows { list-style: none; margin: 0; padding: 0 12px 12px; }
.risk-rows li a { display: grid; grid-template-columns: 78px minmax(0, 1fr) 120px 92px; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md); color: var(--text); }
.risk-rows li a:hover { background: var(--surface-2); text-decoration: none; }
.risk-rows .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-rows .n { color: var(--muted); font-size: 13px; text-align: right; }
.risk-rows .bar { height: 8px; border-radius: var(--pill); background: var(--chart-track); overflow: hidden; }
.risk-rows .bar i { display: block; height: 100%; border-radius: var(--pill); background: var(--chart-1); min-width: 6px; }
.risk-rows .bar i.w-0 { width: 0%; }
.risk-rows .bar i.w-1 { width: 5%; }
.risk-rows .bar i.w-2 { width: 10%; }
.risk-rows .bar i.w-3 { width: 15%; }
.risk-rows .bar i.w-4 { width: 20%; }
.risk-rows .bar i.w-5 { width: 25%; }
.risk-rows .bar i.w-6 { width: 30%; }
.risk-rows .bar i.w-7 { width: 35%; }
.risk-rows .bar i.w-8 { width: 40%; }
.risk-rows .bar i.w-9 { width: 45%; }
.risk-rows .bar i.w-10 { width: 50%; }
.risk-rows .bar i.w-11 { width: 55%; }
.risk-rows .bar i.w-12 { width: 60%; }
.risk-rows .bar i.w-13 { width: 65%; }
.risk-rows .bar i.w-14 { width: 70%; }
.risk-rows .bar i.w-15 { width: 75%; }
.risk-rows .bar i.w-16 { width: 80%; }
.risk-rows .bar i.w-17 { width: 85%; }
.risk-rows .bar i.w-18 { width: 90%; }
.risk-rows .bar i.w-19 { width: 95%; }
.risk-rows .bar i.w-20 { width: 100%; }
.checklist { list-style: none; margin: 0; padding: 0 12px 8px; }
.checklist li { display: grid; grid-template-columns: 14px 190px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); }
.checklist li:first-child { border-top: 0; }
.checklist .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.checklist .label { font-weight: 500; }
.checklist .val { color: var(--text-2); }
.checklist .st-ok .dot { background: var(--chart-1); }
.checklist .st-warn .dot { background: var(--chart-ink); }
.checklist .st-bad .dot { background: var(--coral); box-shadow: 0 0 0 4px var(--danger-soft); }
.checklist .st-bad .val { color: var(--danger-ink); font-weight: 500; }
.finding-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.cmd { position: relative; margin: 8px 0 4px; }
.cmd pre { margin: 0; padding: 14px 16px 44px; border-radius: var(--r-md); background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
:root[data-theme="dark"] .cmd pre { background: #000; border: 1px solid var(--border); }
.cmd .btn { position: absolute; right: 10px; bottom: 10px; }
h3.mini { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text); margin: 0 0 6px; }
h3.mini .text-muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.small { font-size: 13px; }
.prose-p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.6; white-space: pre-line; }
.h-ver { font-size: 0.6em; color: var(--muted); font-weight: 400; }
.cve-list { list-style: none; margin: 0; padding: 0 24px 16px; }
.cve-list li { padding: 14px 0; border-top: 1px solid var(--border); }
.cve-list li:first-child { border-top: 0; }
.cve-list .cve-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cve-list p { margin: 8px 0 0; color: var(--text-2); font-size: 14px; }
.stack-form { display: grid; gap: 8px; }
.stack-form label { font-size: 13px; color: var(--muted); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
@media (max-width: 640px) {
  .risk-rows li a { grid-template-columns: 70px minmax(0, 1fr) 70px; }
  .risk-rows .bar { display: none; }
  .checklist li { grid-template-columns: 14px minmax(0, 1fr); }
  .checklist .val { grid-column: 2; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 1180px) { .search { display: none; } }
@media (max-width: 1024px) {
  .top-actions { margin-left: auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-top .auth-mobile-brand { display: flex; }
  .search { display: none; }
}
@media (max-width: 640px) {
  :root { --gap: 10px; }
  .content { padding: 20px 4px 24px; }
  .grid-kpi { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  h1 { font-size: 30px; }
  .kpi { min-height: 140px; }
  .kpi .value { font-size: 32px; }
  .brand-name { font-size: 19px; }
  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month { grid-template-columns: 1fr; gap: 8px; }
  .codes { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .table th, .table td { padding: 12px; }
  .card { border-radius: var(--r-lg); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .sidebar, .topbar, .actions, .filters, .pagination, .pill-tabs { display: none !important; } body { background: #fff; color: #000; } .app { margin: 0; border: 0; box-shadow: none; } }

/* ---------- file drop zone (replaces the raw browser file control) ---------- */
.field-label { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 8px; }
.filedrop { position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease; }
.filedrop:hover, .filedrop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.filedrop:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filedrop.has-file { border-style: solid; border-color: var(--border); background: var(--surface); }
.filedrop.has-error { border-color: var(--danger); }
.filedrop-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.filedrop-empty, .filedrop-chosen { display: flex; align-items: center; gap: 14px; padding: 18px 20px; min-width: 0; }
.filedrop-chosen[hidden], .filedrop-empty[hidden], .filedrop-error[hidden] { display: none; }
.filedrop-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-glass); }
.filedrop-icon.ok { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.filedrop-icon svg { width: 20px; height: 20px; }
.filedrop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.filedrop-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filedrop-text span { font-size: 13px; color: var(--muted); }
.filedrop label.btn { display: inline-flex; margin: 0; text-transform: none; letter-spacing: normal; font-size: 14px; color: var(--text); cursor: pointer; flex: none; }
.filedrop .filedrop-error { padding: 0 20px 14px; margin: 0; }
.filedrop-text strong span { font-size: inherit; color: inherit; }
.filedrop .t-touch { display: none; }
@media (hover: none) { .filedrop .t-pointer { display: none; } .filedrop .t-touch { display: inline; } }
.dd-hint { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
  .filedrop-empty { flex-wrap: wrap; }
  .filedrop-empty label.btn { width: 100%; justify-content: center; }
}

/* ---------- white-label branding ---------- */
.powered-by { margin-top: 28px; padding: 14px 0 4px; border-top: 1px solid var(--border); text-align: center; font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.mode-form select { min-width: 150px; height: 36px; padding: 0 12px; font-size: 13px; }
.brand-logo { display: block; height: 36px; width: auto; max-width: 220px; object-fit: contain; }
.brand-logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
.brand-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the sign-in art panel is always dark */
.auth-mobile-brand { display: none; margin-right: auto; }    /* the brand lives in the art panel on wide screens */
.auth-art .brand-logo-light { display: none; }
.auth-art .brand-logo-dark { display: block; height: 44px; max-width: 260px; }
.preview-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.preview-label:first-child { margin-top: 0; }
.brand-preview { border-radius: var(--r-md); padding: 18px 20px; border: 1px solid var(--border); }
.brand-preview.light { background: #f9f9f9; }
.brand-preview.light .brand-name { color: #030303; }
.brand-preview.light .brand-mark { background: #030303; color: #f9f9f9; }
.brand-preview.light .brand-logo-light { display: block; } .brand-preview.light .brand-logo-dark { display: none; }
.brand-preview.dark { background: #151515; border-color: #262626; }
.brand-preview.dark .brand-name { color: #f9f9f9; }
.brand-preview.dark .brand-mark { background: #f9f9f9; color: #030303; }
.brand-preview.dark .brand-logo-light { display: none; } .brand-preview.dark .brand-logo-dark { display: block; }
.tab-preview { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 14px; border-radius: 10px 10px 0 0;
  background: var(--surface-2); border: 1px solid var(--border); border-bottom: 0; font-size: 13px; }
.tab-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .brand-logo { height: 30px; max-width: 150px; } .brand-name { max-width: 140px; font-size: 18px; } }
.nowrap { white-space: nowrap; }
/* audit retention */
.retention-form .check-pill input[type="radio"] { margin: 0 8px 0 0; accent-color: var(--text); }
.retention-form .custom-days { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.retention-form .custom-days input { width: 110px; height: 40px; border-radius: var(--pill); }
/* plan limits */
.limit-choice .check-pill input[type="radio"] { margin: 0 8px 0 0; accent-color: var(--text); }
.limit-number { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.limit-number input { width: 120px; height: 40px; border-radius: var(--pill); }
.agent-usage { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; }
.agent-usage:hover { text-decoration: underline; }
.agent-usage.is-full { color: var(--danger-ink); }
.kpi-inline { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.kpi-inline b { font-size: 40px; line-height: 1; }
.kpi-inline span { color: var(--muted); }

/* ---- remediation */
.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.act-icons { display: inline-flex; gap: 6px; align-items: center; }
.act-icons .inline-form { display: inline-flex; }
.icon-btn.sm.is-on { border-color: var(--sev-medium); color: var(--sev-medium); background: var(--sev-medium-soft); }
.icon-btn.sm.is-danger:hover { border-color: var(--sev-critical); color: var(--sev-critical); background: var(--sev-critical-soft); }
.task-box p { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.timeline .who { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text); }
.timeline .who.sys { background: var(--accent-soft); color: var(--accent-ink); }
.timeline .ev-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .ev-comment { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; margin-top: 4px; }
.tile-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.tile-row a, .tile-row div { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); color: inherit; text-decoration: none; }
.tile-row b { display: block; font-size: 26px; }
.tile-row a.warn b { color: var(--danger-ink); }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 12px 20px; border-top: 1px solid var(--border); }
.opt-check-warn { border: 1px solid var(--danger-soft); border-radius: var(--radius); padding: 10px; background: color-mix(in srgb, var(--danger-soft) 22%, transparent); }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row .field { flex: 1 1 160px; margin: 0; }
.form-row .field-actions { flex: 0 0 auto; }
.table tr.row-muted td { opacity: 0.55; }
.badge-on { background: var(--accent-soft); color: var(--accent-ink); }
.row-link.danger { color: var(--danger-ink); }
.vtag { display: inline-block; padding: 0 7px; border-radius: var(--pill); font-size: 11px; font-weight: 600;
        letter-spacing: 0.02em; line-height: 17px; vertical-align: middle; }
.vtag-ok { background: var(--accent-soft); color: var(--accent-ink); }
.vtag-warn { background: var(--danger-soft); color: var(--danger-ink); }
.icon-btn.is-accent { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.bulk-bar .bulk-sep { flex-basis: 100%; height: 0; }
@media (min-width: 720px) { .bulk-bar .bulk-sep { flex-basis: auto; width: 1px; align-self: stretch; background: var(--border); margin: 2px 2px; } }
.task-table td.ref { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.w-check { width: 36px; }
.mt-xs { margin-top: 6px; }
.inline-form input[type="text"], .inline-form input[type="date"] { max-width: 220px; }
/* nine primary tabs: tighten them before the bar has to scroll */
@media (max-width: 1440px) { .search { width: 190px; } }
.sub-tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 14px; border-bottom: 1px solid var(--border); }
.sub-tabs a { padding: 8px 0 10px; color: var(--text-2); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sub-tabs a:hover { color: var(--text); text-decoration: none; }
.sub-tabs a.active { color: var(--text); border-bottom-color: var(--primary); }
.diff { font: 12px/1.55 var(--mono, ui-monospace, monospace); white-space: normal; word-break: break-all; max-height: 640px; overflow: auto; padding: 14px 18px; margin: 0; }
.diff span { display: block; min-height: 1.55em; white-space: pre-wrap; }
.diff .add { color: var(--green, #16794c); background: color-mix(in srgb, currentColor 8%, transparent); }
.diff .del { color: var(--red, #c0392b); background: color-mix(in srgb, currentColor 8%, transparent); }
.diff .hunk { color: var(--text-3, #888); }
@media print { .sub-tabs { display: none !important; } }
.big-num { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 6px 0 4px; }
a.card-link { display: block; color: inherit; text-decoration: none; }
a.card-link:hover { border-color: var(--text); }
.plain-list { margin: 6px 0 0; padding-left: 18px; }
.plain-list li { margin: 3px 0; }
.tile-row a.active { border-color: var(--primary); }
.day-strip { display: flex; flex-wrap: wrap; gap: 3px; }
.day-strip .d { width: 10px; height: 22px; border-radius: 2px; background: var(--border); }
.day-strip .d-pass { background: #2f9e6b; }
.day-strip .d-fail { background: #d64545; }
.day-strip .d-unknown { background: #c9a227; }
.grid > * { min-width: 0; }

/* ---------------------------------------------------------------- dashboard: security & compliance tiles */
.sec-head { padding: 0 4px 12px; }
a.sec-tile { color: var(--text); text-decoration: none; min-height: 168px; transition: border-color .15s; }
a.sec-tile:hover { border-color: var(--text); text-decoration: none; }
a.sec-tile .meta { line-height: 1.45; }
.sec-tile .value small { font-size: 14px; }
.sec-fail { display: block; margin-top: 4px; color: var(--danger-ink); font-weight: 500; }

/* ---------------------------------------------------------------- consistency fixes (3.9.1) */
/* checkbox / radio rows written by hand (same look as {% field %} checkboxes) */
label.check-inline { display: flex; align-items: center; gap: 0; margin: 0 0 10px; text-transform: none; letter-spacing: 0.02em;
  font-size: 15px; font-weight: 500; color: var(--text); cursor: pointer; }
label.check-inline input { flex: none; }
label.check-inline + .sub, .choice-list .sub { display: block; margin: -4px 0 14px 28px; color: var(--muted); font-size: 13px; }
/* any file input not using the drag-and-drop picker */
input[type=file] { font: inherit; font-size: 14px; color: var(--text-2); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 13px; letter-spacing: .02em; margin-right: 12px;
  padding: 8px 16px; border-radius: var(--pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--text); }
/* stacked forms: every control gets the same rhythm */
.stack-form > .field, .stack-form > div { margin-bottom: 14px; }
/* notes at the bottom of a card line up with the card's content */
.card > .foot-note { margin: 8px 0 0; padding: 0 24px 20px; align-items: flex-start; line-height: 1.5; }
.card > .foot-note .icon { flex: none; margin-top: 2px; }
/* simple lists inside a card body */
.choice-list { list-style: none; margin: 0 0 18px; padding: 0; }
.choice-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.choice-list li:last-child { border-bottom: 0; }
.choice-list .title { font-weight: 700; color: var(--text); }
.choice-list .meta { color: var(--text-2); font-size: 14px; margin-left: 6px; }
.choice-list li > .sub { margin: 4px 0 0; }
.card > .card-body:first-child { padding-top: 24px; }
.choice-list label.check-inline { margin: 0; }
.choice-list label.check-inline + .sub { margin: 4px 0 0 28px; }
/* long unbroken values (URLs, record values, hashes, CPU names) wrap inside their card instead of running out */
.card { overflow-wrap: break-word; }
.kv dt, .kv dd { min-width: 0; }
.kv dd, .mono, .steps li, .stack-list li > div, .alert-body { overflow-wrap: anywhere; }
.stack-list li > div, .alert-body { min-width: 0; }
/* phones: a card heading with buttons wraps; the buttons go below the title instead of off the edge */
@media (max-width: 640px) {
  .card-head { flex-wrap: wrap; }
  .card-head > div:first-child { flex: 1 1 180px; min-width: 0; }
  .card-head > .head-actions, .card-head > .actions, .card-head > form, .card-head > div:not(:first-child) { flex-wrap: wrap; }
}
/* dashboard sections */
.dash-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.dash-section { margin-top: 40px; scroll-margin-top: 90px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 4px 14px; }
.section-head h2 { font-size: 24px; font-weight: 700; letter-spacing: .01em; margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.sw-sev-critical { background: var(--sev-critical); } .sw-sev-high { background: var(--sev-high); }
.sw-sev-medium { background: var(--sev-medium); } .sw-sev-low { background: var(--sev-low); }
.sw-cat-1 { background: var(--cat-1); } .sw-cat-2 { background: var(--cat-2); } .sw-cat-3 { background: var(--cat-3); }
.card-body > .legend { margin-bottom: 12px; }
details.chart-table { margin-top: 10px; font-size: 14px; }
details.chart-table summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
details.chart-table .table { margin-top: 8px; }
.kpi .value.value-muted { color: var(--muted); font-size: 28px; }
a.sec-tile.kpi-dark { color: var(--paper); }
:root[data-theme="dark"] a.sec-tile.kpi-dark { color: var(--ink); }

/* Findings severity summary cards */
.grid-sev { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.sevcard { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-left: 4px solid var(--border); transition: border-color .12s, transform .12s; }
.sevcard:hover { text-decoration: none; transform: translateY(-1px); }
.sevcard.is-active { outline: 2px solid var(--primary); }
.sevcard-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sevcard-value { font-size: 30px; font-weight: 700; line-height: 1; color: var(--text); }
.sevcard-critical { border-left-color: var(--sev-critical); }
.sevcard-high { border-left-color: var(--sev-high); }
.sevcard-medium { border-left-color: var(--sev-medium); }
.sevcard-low { border-left-color: var(--sev-low); }
.sevcard-info { border-left-color: var(--text-2); }
.sevcard-total { border-left-color: var(--primary); }
@media (max-width: 900px) { .grid-sev { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Standalone error pages (404/403/500/400) */
.error-body { min-height: 100vh; display: grid; place-items: center; }
.err-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; width: 100%; }
.err-card { max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 44px 36px; box-shadow: var(--shadow); }
.err-card .brand-mark { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 6px; }
.err-code { font-size: 15px; font-weight: 700; letter-spacing: 0.18em; color: var(--muted); }
.err-card h1 { font-size: 26px; margin: 0; }
.err-card p { color: var(--text-2); margin: 0 0 8px; }
.err-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ========================================================================
   Dashboard — risk rings, severity KPI bars, activity list, scan engine
   ======================================================================== */
.card-head > div { min-width: 0; }
.card-head h2 .icon { width: 16px; height: 16px; color: var(--accent-ink); vertical-align: -3px; margin-right: 6px; }

/* circular risk meters */
.ring-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; justify-items: center; padding: 6px 0; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.ring svg { width: 128px; height: 128px; max-width: 100%; }
.ring-track { fill: none; stroke: var(--chart-track); stroke-width: 9; }
.ring-fill { fill: none; stroke-width: 9; stroke-linecap: round; stroke-dasharray: 0 100; transform: rotate(-90deg); transform-origin: center; transition: stroke-dasharray .9s cubic-bezier(.22,.61,.36,1); filter: drop-shadow(0 0 5px color-mix(in srgb, currentColor 35%, transparent)); }
.ring-value { font-size: 26px; font-weight: 700; fill: var(--text); letter-spacing: .01em; }
.ring-label { font-size: 14px; font-weight: 500; color: var(--muted); text-align: center; letter-spacing: .02em; }

/* severity KPI cards: coloured value, dot, mini progress bar */
.kpi .label .sev-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--muted)) 18%, transparent); }
.kpi .value[data-var] { color: var(--c); }
.kpi-bar { margin-top: 14px; height: 6px; border-radius: var(--pill); background: var(--chart-track); overflow: hidden; }
.kpi-bar-fill { display: block; height: 100%; width: 0; border-radius: var(--pill); background: var(--c, var(--primary)); transition: width .8s cubic-bezier(.22,.61,.36,1); }

/* recent activity list */
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.activity-item > a { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); transition: border-color .15s, background .15s, transform .15s; text-decoration: none; color: inherit; }
.activity-item > a:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.activity-item.is-active > a { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.activity-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); }
.activity-ic.badge-healthy, .activity-ic.badge-primary { color: var(--accent-ink); background: var(--accent-soft); }
.activity-ic.badge-failed { color: var(--danger-ink); background: var(--danger-soft); }
.activity-main { flex: 1; min-width: 0; }
.activity-name { display: block; font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.activity-side { flex: none; }

/* scan engine panel */
.engine-row { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); margin-bottom: 10px; }
.engine-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--c, var(--accent-ink)); background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); }
.engine-label { font-size: 13px; color: var(--muted); }
.engine-value { font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--c, var(--text)); }
.engine-aside { margin-left: auto; text-align: right; display: flex; align-items: center; gap: 7px; }
.engine-cap { font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.engine-health { padding-top: 6px; }
.engine-health-head { display: flex; justify-content: space-between; margin-bottom: 7px; }
.small.ok[data-var] { color: var(--c); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.meter .fill[data-var] { background: var(--c); }

.trend-lg { height: 160px; }
.badge-ghost { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-ghost .icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }

@media (max-width: 900px) {
  .ring-row { grid-template-columns: repeat(2, 1fr); }
  .grid-kpi { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* 5-up KPI row (Total + 4 severities), like the original breakdown grid */
.grid-sev5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.grid-sev5 .kpi { min-height: 160px; }
.kpi-dark .kpi-bar { background: rgba(255, 255, 255, 0.16); }
.kpi-dark .kpi-bar-fill { background: var(--primary-ink) !important; }
:root[data-theme="dark"] .kpi-dark .kpi-bar { background: rgba(3, 3, 3, 0.18); }
:root[data-theme="dark"] .kpi-dark .kpi-bar-fill { background: var(--ink) !important; }
@media (max-width: 1100px) { .grid-sev5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .grid-sev5 { grid-template-columns: repeat(2, 1fr); } }

/* identity/label stack: name + muted sublines on their own rows */
.id-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.id-head > strong { font-weight: 700; }
.id-head .sub { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }

/* inline callouts with a leading icon (scan wait notices) */
.callout { display: flex; gap: 11px; align-items: flex-start; }
.callout .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent-ink); }
.callout-info { background: var(--accent-soft); }
.callout-warn { background: color-mix(in srgb, var(--cat-2) 14%, transparent); }
.callout-warn .icon { color: var(--cat-2); }
.callout-error { background: var(--danger-soft); }
.callout-error .icon { color: var(--danger-ink); }

/* Persistent "Install an agent" panel */
.install-panel { padding: 0; }
.install-panel > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline;
  gap: 12px; padding: 18px 22px; border-radius: var(--r); }
.install-panel > summary::-webkit-details-marker { display: none; }
.install-panel > summary::after { content: "▸"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.install-panel[open] > summary::after { transform: rotate(90deg); }
.install-panel > summary:hover { background: var(--surface-2); }
.install-panel .card-body { padding-top: 4px; }
.dl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-row .icon-sm { width: 13px; height: 13px; vertical-align: -2px; }

/* ========================================================================
   Enterprise overhaul (wave 1): cohesive stat strip, refined cards, misc
   ======================================================================== */
.card { box-shadow: var(--shadow); }
.card-head { padding: 18px 22px 12px; }
.card-head h2 { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; }
.card-head h2 .icon { color: var(--muted); }
.card-body { padding: 4px 22px 22px; }

/* unified stat strip — replaces free-floating KPI boxes */
.stat-strip { display: grid; grid-template-columns: repeat(5, 1fr); }
.stat { padding: 20px 22px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.stat:first-child { border-left: 0; }
.stat-feature { background: var(--surface-2); }
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; letter-spacing: .01em; }
.stat-label .sev-dot { margin: 0; width: 9px; height: 9px; }
.stat-value { font-size: 34px; font-weight: 700; line-height: 1; color: var(--text); letter-spacing: -0.01em; }
.stat-value[data-var] { color: var(--c); }
.stat-note { font-size: 12.5px; color: var(--muted); }
.stat-bar { height: 5px; border-radius: var(--pill); background: var(--chart-track); overflow: hidden; margin-top: auto; }
.stat-bar-fill { display: block; height: 100%; width: 0; border-radius: var(--pill); background: var(--c, var(--primary)); transition: width .8s cubic-bezier(.22,.61,.36,1); }
@media (max-width: 900px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat { border-top: 1px solid var(--border); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:first-child, .stat:nth-child(2) { border-top: 0; }
}
@media (max-width: 520px) { .stat-strip { grid-template-columns: 1fr; } .stat { border-left: 0; } .stat:first-child { border-top: 0; } }

/* page head: smaller, tighter, enterprise */
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.page-head { align-items: flex-start; margin-bottom: 22px; }
.page-head p { font-size: 14px; margin-top: 6px; }
.eyebrow { height: 24px; padding: 0 10px; font-size: 11px; letter-spacing: 0.08em; margin-bottom: 10px; background: var(--accent-soft); color: var(--accent-ink); border: 0; box-shadow: none; border-radius: var(--r-sm); }

/* Styled confirmation modal (replaces window.confirm) */
.modal-backdrop { position: fixed; inset: 0; z-index: 95; display: none; align-items: center; justify-content: center; padding: 24px;
  background: rgba(16, 24, 40, 0.55); }
.modal-backdrop.show { display: flex; animation: toast-in .15s ease; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 24px; text-align: center; animation: modal-in .18s cubic-bezier(.22,.61,.36,1); }
.modal-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px;
  background: var(--danger-soft); color: var(--danger-ink); }
.modal-ic .icon { width: 24px; height: 24px; }
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal p { color: var(--text-2); font-size: 14.5px; margin: 0 0 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { min-width: 110px; }

/* Collapsed rail: keep the expand toggle reachable, brand mark on top */
.app[data-nav-collapsed="true"] .sidebar-head .logo { justify-content: center; }

/* Normalize KPI tiles app-wide: clean white cards with a subtle top accent and
   a semantically tinted value — no more loud solid-color boxes. */
.kpi { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-xl); min-height: 128px; padding: 18px 20px 20px; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--kpi-accent, var(--border-strong)); opacity: .9; }
.kpi .label { color: var(--text-2); font-size: 13px; }
.kpi .value { color: var(--text); font-size: 34px; padding-top: 14px; }
.kpi .meta { color: var(--muted); font-size: 13px; }
.kpi .meta strong { color: var(--text); }
.kpi-dark, .kpi-blue, .kpi-coral, .kpi-green, .kpi-amber, .kpi-red, .kpi-violet { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.kpi-dark .label, .kpi-blue .label, .kpi-coral .label, .kpi-green .label, .kpi-amber .label, .kpi-red .label, .kpi-violet .label { color: var(--text-2) !important; }
.kpi-dark .meta, .kpi-blue .meta, .kpi-coral .meta, .kpi-green .meta, .kpi-amber .meta, .kpi-red .meta, .kpi-violet .meta { color: var(--muted) !important; }
.kpi-dark .meta strong, .kpi-blue .meta strong, .kpi-coral .meta strong { color: var(--text) !important; }
.kpi-dark { --kpi-accent: var(--primary); }
.kpi-dark .value { color: var(--text) !important; }
.kpi-blue, .kpi-violet, .kpi-green { --kpi-accent: var(--primary); }
.kpi-green .value { color: var(--ok-ink) !important; }
.kpi-amber { --kpi-accent: var(--sev-medium); }
.kpi-amber .value { color: #a16207 !important; }
.kpi-coral, .kpi-red { --kpi-accent: var(--danger); }
.kpi-coral .value, .kpi-red .value { color: var(--danger-ink) !important; }
.kpi-dark .label .icon, .kpi-blue .label .icon, .kpi-coral .label .icon { background: var(--surface-2) !important; border-color: var(--border) !important; color: var(--text-2) !important; }

/* ---- Finding detail: modal + structured sections (matches old BlackVault) ---- */
.modal.modal-lg { max-width: 760px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; padding: 0; text-align: left; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; font-weight: 700; line-height: 1.3; margin: 0; }
.modal-head .icon-btn.sm { flex: none; width: 32px; height: 32px; }
.modal-body { padding: 20px 22px 24px; overflow-y: auto; }
.fm-loading { color: var(--muted); padding: 24px 0; text-align: center; }

.fd-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.fd-section { padding: 18px 0; border-top: 1px solid var(--border); }
.fd-section:first-of-type { border-top: 0; padding-top: 0; }
.fd-section h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.fd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fd-grid > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fd-k { font-size: 12px; color: var(--muted); }
.fd-v { font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 12px; overflow-wrap: anywhere; }
.fd-v a { color: var(--accent-ink); }
.fd-prose { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.fd-list { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.fd-list li { margin: 4px 0; overflow-wrap: anywhere; }
.fd-list a { color: var(--accent-ink); }
.fd-code { margin: 0; padding: 14px 16px; border-radius: var(--r-md); background: var(--ink); color: #e4e7ec; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow-y: auto; }
:root[data-theme="dark"] .fd-code { background: #0a0e16; border: 1px solid var(--border); }
@media (max-width: 560px) { .fd-grid { grid-template-columns: 1fr; } .modal.modal-lg { max-height: calc(100vh - 24px); } }

/* ---- sidebar collapse: round chevron toggle sitting on the rail's right border */
.nav-edge { position: absolute; top: 22px; right: -13px; z-index: 45; width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); transition: transform .16s ease, background .12s ease; }
.nav-edge .icon { width: 15px; height: 15px; stroke-width: 2.2; transition: transform .16s ease; }
.nav-edge:hover { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.app[data-nav-collapsed="true"] .nav-edge .icon { transform: rotate(180deg); }
.app[data-nav-collapsed="true"] .sidebar-head { justify-content: center; padding: 18px 0 14px; }
@media (max-width: 900px) { .nav-edge { display: none; } }

/* ======================================================================
   Dashboard v3: asset risk overview, remediation, compliance, engine
   ====================================================================== */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.badge.sev-chip { gap: 7px; background: color-mix(in srgb, var(--c, var(--muted)) 12%, transparent); color: var(--c, var(--text)); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 30%, transparent); height: 28px; }
.badge.sev-chip .dot { background: currentColor; }
.sev-chip-sm { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.empty-sm { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); color: var(--muted); font-size: 14px; }

.aro { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(280px, 360px); gap: 28px; align-items: stretch; }
.aro-donut { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.aro-donut svg { width: 196px; height: 196px; }
.donut-track { fill: none; stroke: var(--surface-3); stroke-width: 14; }
.donut-seg { fill: none; stroke: var(--c); stroke-width: 14; stroke-linecap: butt; }
.aro-center { position: absolute; top: 0; left: 50%; width: 196px; height: 196px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.aro-score { font-size: 44px; font-weight: 700; line-height: 1; color: var(--c, var(--text)); }
.aro-score-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.aro-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.aro-legend li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.aro-legend strong { margin-left: auto; color: var(--text); font-weight: 700; }
.aro-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: stretch; }
.aro-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.aro-tile-ic { grid-row: 1 / span 3; align-self: start; width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 18%, transparent); }
.aro-tile-label { font-size: 13px; color: var(--muted); }
.aro-tile-value { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--text); }
.aro-tile-note { font-size: 12.5px; color: var(--muted); }
.aro-hosts { display: flex; flex-direction: column; gap: 10px; padding-left: 24px; border-left: 1px solid var(--border); }
.aro-hosts-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.host-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.host-rank a { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 6px 10px; padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid var(--border); color: inherit; text-decoration: none; background: var(--surface); }
.host-rank a:hover { border-color: var(--border-strong); background: var(--surface-2); }
.host-id { display: flex; flex-direction: column; min-width: 0; }
.host-id .mono { font-size: 13.5px; font-weight: 600; color: var(--text); }
.host-id .sub { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-sev { display: flex; gap: 4px; align-items: center; }
.host-bar { grid-column: 1 / -1; height: 4px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; }
.host-bar i { display: block; height: 100%; width: 0; background: var(--c); border-radius: var(--pill); transition: width .8s ease; }
@media (max-width: 1280px) { .aro { grid-template-columns: minmax(240px, 280px) 1fr; } .aro-hosts { grid-column: 1 / -1; padding-left: 0; border-left: 0; border-top: 1px solid var(--border); padding-top: 16px; } }
@media (max-width: 760px) { .aro { grid-template-columns: 1fr; } .aro-tiles { grid-template-columns: 1fr; } }

.rem-kpis { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 16px; }
.rem-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface-2); }
.rem-kpis > div + div { border-left: 1px solid var(--border); }
.rem-kpi-v { font-size: 24px; font-weight: 700; color: var(--c, var(--text)); line-height: 1.15; }
.rem-kpi-l { font-size: 12.5px; color: var(--muted); }
.seg-bar { display: flex; height: 10px; border-radius: var(--pill); overflow: hidden; background: var(--surface-3); gap: 2px; margin-bottom: 14px; }
.seg-bar i { display: block; height: 100%; width: 0; background: var(--c); transition: width .8s ease; min-width: 4px; }
.status-list, .fw-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.status-list a { display: grid; grid-template-columns: 30px 1fr 56px 46px; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 14px; }
.status-list li:last-child a { border-bottom: 0; }
.status-list a:hover { background: var(--surface-2); }
.status-ic { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 11%, transparent); }
.status-n { text-align: right; font-weight: 700; }
.status-pct { text-align: right; color: var(--muted); font-size: 13px; }
.fw-bars a { display: grid; grid-template-columns: 110px 1fr 46px 82px; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 14px; }
.fw-bars li:last-child a { border-bottom: 0; }
.fw-bars a:hover { background: var(--surface-2); }
.fw-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-track { height: 8px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; }
.fw-track i { display: block; height: 100%; width: 0; background: var(--c); border-radius: var(--pill); transition: width .8s ease; }
.fw-pct { text-align: right; font-weight: 700; }
.fw-fail { text-align: right; color: var(--muted); font-size: 13px; }

.activity-ic.act-critical { color: var(--sev-critical); background: var(--sev-critical-soft); }
.activity-ic.act-high { color: var(--sev-high); background: var(--sev-high-soft); }
.activity-ic.act-medium { color: var(--sev-medium); background: var(--sev-medium-soft); }
.activity-ic.act-low { color: var(--sev-low); background: var(--sev-low-soft); }
.activity-ic.act-clean { color: var(--ok-ink); background: var(--ok-soft); }
.activity-ic.act-run { color: var(--text); background: var(--surface-3); }
.activity-ic.act-fail { color: var(--muted); background: var(--surface-3); }
.activity-sev { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.activity-item .activity-side { margin-left: 8px; }
.activity-main { min-width: 0; }
.activity-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.eng-kpis { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 18px; }
.eng-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface-2); }
.eng-kpis > div + div { border-left: 1px solid var(--border); }
.eng-v { font-size: 24px; font-weight: 700; line-height: 1.15; }
.eng-l { font-size: 12.5px; color: var(--muted); }
.eng-agents-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.eng-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); margin: -4px 0 14px; }
.eng-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.eng-list { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); }
.eng-list li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; font-size: 14px; }
.eng-list li + li { border-top: 1px solid var(--border); }
.eng-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-label .sev-dot { margin-top: 0; width: 8px; height: 8px; background: var(--c, var(--muted)); box-shadow: none; }
.badge.sev-chip::before { background: currentColor; }

/* ======================================================================
   Findings lifecycle
   ====================================================================== */
.st-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--pill); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--st, var(--text-2)); background: color-mix(in srgb, var(--st, var(--muted)) 12%, transparent); border: 1px solid color-mix(in srgb, var(--st, var(--muted)) 26%, transparent); }
.st-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-badge.lg { height: 30px; padding: 0 14px; font-size: 14px; }
.st-open { --st: var(--sev-critical); }
.st-in_progress { --st: var(--sev-medium); }
.st-remediated { --st: var(--ok-ink); }
.st-risk_accepted { --st: var(--sev-low); }
.st-false_positive { --st: var(--muted); }
:root:not([data-theme="dark"]) .st-in_progress { color: #a16207; }

.status-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: 16px; }
.status-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.status-tabs a:hover { background: var(--surface-2); color: var(--text); }
.status-tabs a.active { background: var(--primary); color: var(--primary-ink); }
.status-tabs .count { min-width: 24px; height: 20px; padding: 0 7px; border-radius: var(--pill); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.status-tabs a.active .count { background: color-mix(in srgb, var(--primary-ink) 20%, transparent); color: var(--primary-ink); }

.sev-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.sev-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; color: var(--text); text-decoration: none; border-top: 3px solid var(--tile, var(--border)); }
.sev-tile + .sev-tile { border-left: 1px solid var(--border); }
a.sev-tile:hover { background: var(--surface-2); text-decoration: none; }
.sev-tile.is-active { background: color-mix(in srgb, var(--tile) 8%, var(--surface)); }
.sev-tile-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.sev-tile-label .dot { background: var(--tile); }
.sev-tile-value { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--tile, var(--text)); }
.sev-tile-critical { --tile: var(--sev-critical); } .sev-tile-high { --tile: var(--sev-high); } .sev-tile-medium { --tile: var(--sev-medium); }
.sev-tile-low { --tile: var(--sev-low); } .sev-tile-info { --tile: var(--sev-info); }
.sev-tile-total { --tile: var(--text); background: var(--surface-2); }
.sev-tile-total .sev-tile-value { color: var(--text); }
@media (max-width: 900px) { .sev-strip { grid-template-columns: repeat(3, 1fr); } .sev-tile:nth-child(4) { border-left: 0; } .sev-tile:nth-child(n+4) { border-top-width: 3px; } }

.filters-inline { display: flex; gap: 8px; align-items: center; }
.filters-inline select { width: auto; min-width: 170px; height: 38px; }
.table-findings td { vertical-align: middle; }
.table-findings .cell-title { max-width: 440px; white-space: normal; overflow-wrap: anywhere; }
.table-findings .cell-title .row-link { white-space: normal; }
.table-findings .sub { display: block; margin-top: 2px; }
.w-actions { width: 64px; text-align: right; }
.bulk-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.bulk-status [data-bulk-count] { margin-right: auto; }
.bulk-status select { width: 220px; height: 36px; }
.bulk-status input { width: 360px; max-width: 100%; height: 36px; }

.fd-status { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; background: var(--surface-2); }
.fd-status-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; }
.fd-status-now { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.fd-note { margin: 4px 0 0; padding: 10px 12px; border-left: 3px solid var(--border-strong); background: var(--surface); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 14px; color: var(--text-2); width: 100%; }
.fd-status-form { display: grid; gap: 6px; }
.fd-status-form label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.fd-status-form textarea { min-height: 76px; resize: vertical; }
.fd-status-form .btn { justify-self: start; margin-top: 4px; }
.fd-history { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.fd-history li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; font-size: 13.5px; }
.fd-history .sub { display: block; }
.fd-history p { margin: 4px 0 0; color: var(--text-2); }
.fd-h-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: var(--st, var(--muted)); }
.st-dot-open { --st: var(--sev-critical); } .st-dot-in_progress { --st: var(--sev-medium); } .st-dot-remediated { --st: var(--ok-ink); }
.st-dot-risk_accepted { --st: var(--sev-low); } .st-dot-false_positive { --st: var(--muted); }
@media (max-width: 760px) { .fd-status-grid { grid-template-columns: 1fr; } }

/* ---- compliance tables + shared KPI strip + report buttons */
.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-strip > div { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; }
.kpi-strip > div + div { border-left: 1px solid var(--border); }
.ks-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.ks-value { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--c, var(--text)); }
.ks-note { font-size: 12.5px; color: var(--muted); }
@media (max-width: 900px) { .kpi-strip { grid-template-columns: 1fr 1fr; } .kpi-strip > div:nth-child(3) { border-left: 0; } .kpi-strip > div:nth-child(n+3) { border-top: 1px solid var(--border); } }
.table-comp td { vertical-align: middle; }
.w-cov { width: 26%; min-width: 200px; }
.cov { display: flex; align-items: center; gap: 10px; }
.cov-track { flex: 1; height: 8px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; }
.cov-track i { display: block; height: 100%; width: 0; background: var(--c); border-radius: var(--pill); transition: width .8s ease; }
.cov-pct { width: 44px; text-align: right; font-weight: 700; font-size: 14px; }
.ctl-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--pill); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--st); background: color-mix(in srgb, var(--st) 12%, transparent); border: 1px solid color-mix(in srgb, var(--st) 26%, transparent); }
.ctl-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ctl-failing { --st: var(--sev-critical); } .ctl-accepted { --st: var(--sev-low); } .ctl-resolved { --st: var(--ok-ink); } .ctl-passing { --st: var(--ok-ink); }
.report-buttons { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rb-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg .btn { border: 0; border-radius: 0; height: 36px; box-shadow: none; }
.seg .btn + .btn { border-left: 1px solid var(--border-strong); }
.seg .btn:hover { background: var(--surface-2); color: var(--text); }
.w-fw { min-width: 190px; }

/* ---- scan detail overview */
.scan-ov { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(380px, 1.5fr) minmax(260px, 1fr); }
.scan-ov > section { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.scan-ov > section + section { border-left: 1px solid var(--border); }
.ov-label { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ov-label strong { color: var(--text); margin-left: 6px; }
.ov-big { display: flex; align-items: baseline; gap: 8px; }
.ov-num { font-size: 40px; font-weight: 700; line-height: 1; }
.ov-of { color: var(--text-2); font-size: 14px; }
.scan-ov .seg-bar { margin-bottom: 4px; }
.scan-ov .eng-legend { margin: 0; }
.ov-progress { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.ov-sev-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; flex: 1; }
.ov-sev { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--border);
  border-top: 3px solid var(--tile); background: var(--surface-2); color: var(--text); text-decoration: none; min-height: 92px; }
.ov-sev:hover { text-decoration: none; border-color: var(--tile); }
.ov-sev.is-active { background: color-mix(in srgb, var(--tile) 9%, var(--surface)); border-color: var(--tile); }
.ov-sev-n { font-size: 30px; font-weight: 700; line-height: 1; color: var(--tile); }
.ov-sev-l { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.ov-sev-l .dot { background: var(--tile); }
.ov-dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 14px; }
.ov-dl dt { color: var(--muted); }
.ov-dl dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 1200px) { .scan-ov { grid-template-columns: 1fr 1fr; } .scan-ov-meta { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--border); } }
@media (max-width: 760px) { .scan-ov { grid-template-columns: 1fr; } .scan-ov > section + section { border-left: 0; border-top: 1px solid var(--border); } .ov-sev-grid { grid-template-columns: repeat(3, 1fr); } }
.mini-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.mini-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 6px; font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.mini-tabs a span { font-weight: 700; color: var(--muted); }
.mini-tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.mini-tabs a.active span { color: var(--text); }
.ports-cell { max-width: 420px; }
.port-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; margin: 2px 3px 2px 0; border-radius: 6px; font-family: var(--mono); font-size: 12px; background: var(--surface-3); color: var(--text); }
.port-chip em { font-style: normal; color: var(--muted); font-family: var(--font); }
.port-chip.more { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }
.host-down { --st: var(--muted); }
.ctl-partial { --st: var(--sev-medium); } .ctl-review { --st: var(--sev-low); }
.callout-error { background: var(--danger-soft); color: var(--danger-ink); display: flex; gap: 10px; align-items: flex-start; }

/* ---- single-card form wizard (new scan, target editor) */
.wizard { overflow: hidden; }
.wz-section { padding: 22px 26px 24px; }
.wz-section + .wz-section { border-top: 1px solid var(--border); }
.wz-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.wz-head h2 { font-size: 16px; }
.wz-head .sub { display: block; margin-top: 3px; }
.wz-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--primary); color: var(--primary-ink); }
.wz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
.wz-grid + .wz-grid { gap: 14px 20px; }
.wz-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wz-grid .span-2 { grid-column: 1 / -1; }
.wz-grid .field { margin-bottom: 16px; }
.wz-note { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.wz-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--border); background: var(--surface-2); }
@media (max-width: 900px) { .wz-grid, .wz-grid-3 { grid-template-columns: 1fr; } }
.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tpl-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 40px 14px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); cursor: pointer;
  text-transform: none; letter-spacing: normal; font-weight: 400; margin: 0; transition: border-color .12s, background .12s; min-height: 76px; }
.tpl-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tpl-title { font-size: 15px; font-weight: 600; color: var(--text); }
.tpl-desc { font-size: 13px; line-height: 1.4; color: var(--muted); }
.tpl-check { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; }
.tpl-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--surface); }
.tpl-card:has(input:checked) .tpl-check { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.tpl-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1100px) { .tpl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .tpl-grid { grid-template-columns: 1fr; } }

/* ---- target editor */
.target-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
@media (max-width: 1100px) { .target-layout { grid-template-columns: 1fr; } }
.target-layout textarea.mono { min-height: 170px; font-size: 14px; line-height: 1.6; }
.ip-preview { margin-top: 8px; font-size: 13.5px; font-weight: 600; min-height: 20px; }
.ip-preview.is-ok { color: var(--ok-ink); }
.ip-preview.is-bad { color: var(--danger-ink); }
.fmt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.fmt-grid > div { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: var(--surface-2); }
.fmt-grid > div + div { border-left: 1px solid var(--border); }
.fmt-k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.fmt-grid .mono { font-size: 13px; color: var(--text); }
.fmt-n { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .fmt-grid { grid-template-columns: 1fr 1fr; } .fmt-grid > div:nth-child(3) { border-left: 0; } .fmt-grid > div:nth-child(n+3) { border-top: 1px solid var(--border); } }
.target-side .ov-dl dd { text-align: right; }
.target-side .ov-dl + .ov-dl { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
/* table action cells must stay table-cells (flex on a td breaks row borders) */
td.row-actions { display: table-cell; white-space: nowrap; }
td.row-actions > *, td.row-actions .inline-form { display: inline-flex; vertical-align: middle; margin-right: 6px; }
td.row-actions > *:last-child { margin-right: 0; }
.w-actions3 { width: 140px; }
.scope-cell { max-width: 360px; }

/* ---- notifications dropdown */
.dropdown.notif-dd { width: 420px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.nd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.nd-head strong { display: block; font-size: 15px; }
.nd-head .sub { display: block; font-size: 12.5px; }
.nd-head form { margin: 0; }
.dropdown .nd-link { display: inline-flex; align-items: center; gap: 6px; width: auto; height: 30px; padding: 0 10px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.dropdown .nd-link:hover { color: var(--text); background: var(--surface-3); }
.nd-list { max-height: 420px; overflow-y: auto; }
.nd-list form { margin: 0; }
.dropdown .nd-item { display: grid; grid-template-columns: 34px 1fr 10px; gap: 12px; align-items: start; width: 100%; height: auto; padding: 12px 16px; border: 0; border-radius: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; font-weight: 400; color: var(--text); cursor: pointer; }
.dropdown .nd-item:hover { background: var(--surface-2); }
.dropdown .nd-item.is-unread { background: color-mix(in srgb, var(--text) 3%, var(--surface)); }
.nd-ic { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; }
.nd-critical { color: var(--sev-critical); background: var(--sev-critical-soft); }
.nd-warning { color: var(--sev-high); background: var(--sev-high-soft); }
.nd-success { color: var(--ok-ink); background: var(--ok-soft); }
.nd-info { color: var(--text-2); background: var(--surface-3); }
.nd-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nd-title { font-size: 14px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nd-item:not(.is-unread) .nd-title { font-weight: 500; color: var(--text-2); }
.nd-body { font-size: 13px; color: var(--muted); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-time { font-size: 12px; color: var(--muted); }
.nd-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--sev-critical); margin-top: 6px; }
.nd-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; color: var(--muted); }
.dropdown a.nd-foot { display: flex; justify-content: center; align-items: center; gap: 6px; height: 46px; padding: 0; border-radius: 0; font-size: 14px; font-weight: 600; color: var(--text); background: var(--surface-2); }
.dropdown a.nd-foot:hover { background: var(--surface-3); text-decoration: none; }
.agent-st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--pill); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--st); background: color-mix(in srgb, var(--st) 12%, transparent); border: 1px solid color-mix(in srgb, var(--st) 26%, transparent); }
.agent-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ast-online { --st: var(--ok-ink); } .ast-degraded { --st: var(--sev-medium); } .ast-offline { --st: var(--sev-critical); } .ast-pending { --st: var(--muted); }
:root:not([data-theme="dark"]) .ast-degraded { color: #a16207; }
.cfm-type { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 16px; text-align: left; font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: none; letter-spacing: normal; }
.cfm-type input { height: 40px; }
.modal .btn[disabled] { opacity: .45; cursor: not-allowed; }
.w-quota { min-width: 190px; }
.w-actions5 { width: 210px; }
.ks-label .icon { color: var(--muted); }
.w-quota + th, .cov-pct.small { white-space: nowrap; }
.cov-pct.small { width: auto; min-width: 64px; font-size: 13px; }
.grant-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 0 16px; align-items: start; }
.grant-form .field { margin-bottom: 0; }
.grant-submit { padding-top: 26px; }
@media (max-width: 1100px) { .grant-form { grid-template-columns: 1fr 1fr; gap: 12px 16px; } .grant-submit { padding-top: 0; } }
.danger-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border)); border-radius: var(--r-lg); background: var(--danger-soft); }

/* ---- single-card settings pages */
.wz-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .wz-grid-4 { grid-template-columns: 1fr 1fr; } }
.wz-ic { flex: none; width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
.wz-head { position: relative; }
.wz-head-act { margin-left: auto; }
.settings-split { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 28px; align-items: start; }
.id-card { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }
.settings-form .btn { margin-top: 2px; }
.ov-dl-2 { grid-template-columns: 140px 1fr; }
.ov-dl-2 dd { text-align: left; }
.opt-row { align-items: center; justify-content: space-between; }
.opt-inline { display: flex; gap: 10px; align-items: flex-start; margin: 0; text-transform: none; letter-spacing: normal; font-weight: 400; cursor: pointer; }
.opt-inline input { margin-top: 3px; }
.security-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 0; border: 1px solid var(--border); border-radius: var(--r-md); }
.sec-pane { padding: 18px 20px; }
.sec-pane + .sec-pane { border-left: 1px solid var(--border); }
.sec-pane .split { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.totp-setup { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.qr-box { width: 220px; height: 220px; padding: 12px; border-radius: var(--r-md); background: #ffffff; border: 1px solid var(--border); display: grid; place-items: center; }
.qr-box svg { width: 196px; height: 196px; display: block; }
.totp-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--text-2); }
.totp-steps .cmd pre { font-size: 13px; word-break: break-all; white-space: pre-wrap; }
.mt-sm { margin-top: 8px; }
.totp-verify { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.totp-verify .otp-input { width: 170px; height: 42px; text-align: center; letter-spacing: .35em; font-family: var(--mono); font-size: 18px; }
@media (max-width: 1100px) { .security-grid, .settings-split { grid-template-columns: 1fr; } .sec-pane + .sec-pane { border-left: 0; border-top: 1px solid var(--border); } }
@media (max-width: 640px) { .totp-setup { grid-template-columns: 1fr; } }
.totp-verify .otp-input { width: 220px; font-size: 17px; letter-spacing: .3em; padding: 0 10px; }
.sec-pane .stack-form .btn, .sec-pane form > .btn { width: auto; align-self: flex-start; }

/* ---- integrations ---- */
.w-actions4 { width: 168px; }
.txt-critical { color: var(--sev-critical); }
.field-pad { padding-top: 28px; }
.wz-foot .grow { flex: 1; align-self: center; }
.wz-n .icon { width: 15px; height: 15px; }
.integ-kind { display: inline-flex; align-items: center; gap: 10px; }
.integ-kind .sub { display: block; font-size: 12px; }
.integ-ic { flex: none; width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.integ-ic .icon { width: 17px; height: 17px; }
.integ-ic.cat-siem { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.integ-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.integ-card { align-items: center; text-decoration: none; color: var(--text); min-height: 76px; }
.integ-card .integ-ic { width: 40px; height: 40px; }
.integ-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.integ-card-body .sub { font-size: 13px; line-height: 1.4; }
.integ-card .chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.integ-card:hover .chev { color: var(--text); }
.integ-table td { vertical-align: middle; }
.integ-dest { max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.integ-deliv { min-width: 140px; max-width: 170px; }
.integ-table .row-actions { white-space: nowrap; }

/* fixed action slots: icons line up across rows even when one is unavailable */
td.row-actions { font-size: 0; }
td.row-actions > *, td.row-actions .inline-form { margin-right: 6px; }
.icon-btn.is-disabled { opacity: .35; pointer-events: none; }
[hidden], .cfm-type[hidden] { display: none !important; }
.messages .alert { transition: opacity .35s ease, transform .35s ease; }
.messages .alert.fade-out { opacity: 0; transform: translateY(-6px); }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-top: 4px; }
.check-row:not(:has(.field)) { display: none; }
.check-row .field { margin: 0; }
.totp-verify .otp-input, .otp-input { min-width: 240px; font-size: 22px !important; letter-spacing: .3em !important; padding: 0 12px !important; }
.ports-more { display: inline-block; vertical-align: top; }
.ports-more summary { cursor: pointer; list-style: none; }
.ports-more summary::-webkit-details-marker { display: none; }
.ports-more[open] summary { margin-bottom: 4px; }
.ports-all { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; margin-top: 4px; }

.host-name{white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis}

/* ---- notification badge: sized to its number (a generic .dot rule fixed it at 8px wide) */
.icon-btn.bell { overflow: visible; }
.bell .dot { width: auto; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; top: -7px; right: -9px;
  color: #fff; font-size: 11px; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; z-index: 1;
  white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* ---- action columns: one row of icons, aligned in every table, never pushed
   out of view. On narrower screens the column sticks to the right edge while
   the rest of the table scrolls underneath it. */
td.row-actions, td.w-actions { white-space: nowrap; vertical-align: middle; }
td.row-actions > .act-icons { display: inline-flex; gap: 6px; }
.table:has(td.row-actions:last-child) tr > th:last-child, .table:has(td.w-actions:last-child) tr > th:last-child,
.table td.row-actions:last-child, .table td.w-actions:last-child {
  position: sticky; right: 0; z-index: 1; background: var(--card); }
/* the edge shadow only appears when the table actually scrolls under the column */
.table-wrap.is-scrolling td.row-actions:last-child, .table-wrap.is-scrolling td.w-actions:last-child,
.table-wrap.is-scrolling th:last-child { box-shadow: -10px 0 10px -10px rgba(0,0,0,.22); }
.table thead th:last-child { background: var(--card); }
.icon-btn.slot { visibility: hidden; pointer-events: none; }  /* keeps icon columns aligned across rows */
.table tbody tr:hover td.row-actions, .table tbody tr:hover td.w-actions { background: var(--card); }
.table .chip, .table .mono-chip, .scope-chip { white-space: nowrap; }
@media (max-width: 1360px) { .table .col-optional { display: none; } }
.scope-cell .port-chip { white-space: nowrap; }

/* ---- sign-in: one centred card, no logo or hero panel ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 48px 16px; position: relative;
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--text) 6%, transparent), transparent 70%),
    var(--canvas); }
.login::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.login-theme { position: absolute; top: 20px; right: 20px; z-index: 1; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 40px 36px 28px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 24px 60px -24px rgba(16, 24, 40, .25); }
.login-product { margin: 0 0 22px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.login-card h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.login-lead { margin: 8px 0 24px; color: var(--text-2); font-size: 15px; }
.login-form .field { margin-bottom: 16px; }
.login-form .btn { margin-top: 8px; }
.btn-lg { height: 48px; font-size: 15px; }
.login-alt { margin: 16px 0 0; text-align: center; font-size: 14px; }
.login-foot { display: flex; align-items: center; gap: 8px; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 13px; }
/* messages sit inside the card here, not as floating toasts */
.messages.login-messages { position: static; width: auto; max-width: none; margin: 0 0 18px; }
.login-messages .alert { box-shadow: none; animation: none; padding: 11px 12px 11px 14px; font-size: 14px; align-items: center; }
.alert .alert-x { margin-left: auto; flex: none; width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer; border-radius: 6px; }
.alert .alert-x:hover { background: var(--surface-3); color: var(--text); }
@media (max-width: 480px) { .login-card { padding: 28px 20px 20px; } }

/* ---- form popup (change password etc.): a left-aligned form, not a centred confirm */
#form-modal .modal { max-width: 480px; text-align: left; padding: 0; }
#form-modal .modal-body { padding: 18px 22px 22px; }
#form-modal .field { margin-bottom: 14px; }
#form-modal .field label { text-align: left; }
#form-modal .modal-actions { justify-content: flex-end; margin-top: 18px; }
#form-modal .modal-actions .btn { min-width: 0; }
/* tables: never break e-mail addresses / IDs one character per line */
.table td.mono { white-space: nowrap; }
@media (max-width: 1500px) { .table .col-optional-xl { display: none; } }
.uid-copy { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; cursor: copy; }
.uid-copy:hover { color: var(--text); text-decoration: underline; }
td .act-icons .icon-btn.sm, td.row-actions .icon-btn.sm { width: 34px; height: 34px; }
.act-icons > *, .act-icons .inline-form { margin: 0 !important; }
.table td .strong, .uid-copy { white-space: nowrap; }

/* ---- community pack groups (Super Admin > YAML Templates) */
.pack-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pack-group { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); }
.pack-name { font-weight: 600; }
.pack-count { color: var(--muted); font-size: 13px; align-self: center; }
.pack-actions { grid-column: 1 / -1; display: flex; gap: 6px; }

/* ---- vulnerability details popup: wider, and a tidy remediation-status card */
.modal.modal-lg { max-width: min(1040px, calc(100vw - 48px)); }
.fd-status { padding: 18px 20px 16px; }
.fd-status-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.fd-status-head h3 { margin: 0; }
.fd-status-now { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.fd-status .fd-note { margin: 0 0 14px; display: grid; gap: 4px; }
.fd-status-form { display: block; }
.fd-status-fields { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 16px; align-items: start; }
.fd-status-fields .field { margin: 0; display: grid; gap: 6px; }
.fd-status-form .fd-status-fields label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fd-status-fields select, .fd-status-fields textarea { width: 100%; }
.fd-status-fields textarea { min-height: 92px; }
.fd-status-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.fd-status-actions .hint { color: var(--muted); font-size: 13px; }
.fd-status-form .fd-status-actions .btn { margin: 0; justify-self: auto; }
@media (max-width: 760px) {
  .fd-status-fields { grid-template-columns: 1fr; }
  .fd-status-actions { flex-direction: column; align-items: stretch; }
}
.fd-section.fd-status { padding: 18px 20px 16px; margin-top: 6px; border-top: 1px solid var(--border); }

/* ---- action icons: one flex group per row, right-aligned under a
   right-aligned "Actions" heading, identical spacing on every page ---- */
td.row-actions { text-align: right; font-size: inherit; }
td.row-actions > .act-icons { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end;
  vertical-align: middle; }
td.row-actions > .act-icons > *, td.row-actions > .act-icons .inline-form { margin: 0 !important;
  display: inline-flex; flex: none; }
.table:has(td.row-actions:last-child) thead tr > th:last-child { text-align: right; }
.agent-keys .kv { display: block; white-space: nowrap; font-size: 12px; line-height: 1.6; }
.agent-keys .kv .k { display: inline-block; min-width: 74px; color: var(--muted); }
.cvss-est { font-weight: 500; color: var(--text-2); border-bottom: 1px dotted var(--border-strong); cursor: help; }
td.yaml-name { min-width: 260px; max-width: 420px; }
td.yaml-name .sub { word-break: break-all; }
td.yaml-tags { min-width: 150px; }

/* ---- endpoints (inventory) ---- */
.kpi-strip > a.ks-link { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; color: inherit; text-decoration: none; border-left: 1px solid var(--border); }
.kpi-strip > a.ks-link:hover { background: var(--surface-2); }
.kpi-strip > a.ks-link:first-child { border-left: 0; }
.ks-value.ks-small { font-size: 20px; padding: 5px 0 4px; }
.ks-value small { font-size: 14px; font-weight: 500; }
.text-warn { color: var(--sev-medium) !important; }
.text-crit { color: var(--sev-critical) !important; }
.ok { color: var(--sev-good, #16a34a); font-weight: 600; }
.bad { color: var(--sev-critical); font-weight: 600; }
.warn { color: var(--sev-medium); font-weight: 600; }
.risk-meter { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; }
.risk-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; min-width: 60px; }
.risk-bar span { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .4s; }
.rm-low .risk-bar span { background: var(--sev-low); }
.rm-med .risk-bar span { background: var(--sev-medium); }
.rm-high .risk-bar span { background: var(--sev-critical); }
.risk-num { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.os-ic { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; background: var(--muted); vertical-align: middle; }
.os-windows { background: #2563eb; } .os-macos { background: #64748b; } .os-linux { background: #d97706; }
.ep-finding { border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: var(--r-md); padding: 14px 18px; background: var(--card); }
.ep-finding + .ep-finding { margin-top: 12px; }
.ep-finding.sevb-critical { border-left-color: var(--sev-critical); } .ep-finding.sevb-high { border-left-color: var(--sev-high); }
.ep-finding.sevb-medium { border-left-color: var(--sev-medium); } .ep-finding.sevb-low { border-left-color: var(--sev-low); }
.ep-finding header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ep-finding h3 { font-size: 15.5px; margin: 0; flex: 1 1 320px; }
.ep-finding header .muted { flex-basis: 100%; }
.ep-finding .ep-dev { font-weight: 600; font-size: 13.5px; }
.ep-finding > p { margin: 8px 0 10px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.ep-fix { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 14px; }
.ep-fix .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.ep-fix p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.55; white-space: pre-line; }
.ep-ev { margin-top: 8px; font-size: 13px; } .ep-ev summary { cursor: pointer; color: var(--muted); }
.ep-ev pre { margin: 6px 0 0; white-space: pre-wrap; font-size: 12px; background: var(--surface-2); padding: 8px 12px; border-radius: var(--r-sm); }
.ep-accept { margin-top: 10px; } .ep-accept summary { list-style: none; display: inline-flex; cursor: pointer; }
.ep-accept summary::-webkit-details-marker { display: none; }
.ep-accept form { display: grid; gap: 6px; margin-top: 8px; max-width: 560px; }
.ep-accept form .btn { justify-self: start; }
.ep-accepted { margin-top: 10px; font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--text-2); }
.small-head { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 18px 0 6px; }
.empty-note { color: var(--muted); margin: 6px 0; }
.kv.kv-wide { grid-template-columns: minmax(180px, max-content) 1fr; }
.card-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }
.callout-warn { border-color: var(--sev-medium); }
@media (max-width: 1000px) { .grid.grid-2 { grid-template-columns: 1fr; } }
.form-card > .card-body { padding: 22px 22px 6px; }

/* ---- 1.19: action columns, one rule for every table ----
   The column shrinks to its icons, the "Actions" header is centred over them,
   icons keep an even 8px gap, and nothing floats over other columns (no sticky
   overlay): on narrow screens the whole table scrolls instead. */
.table td.row-actions, .table td.w-actions,
.table:has(td.row-actions:last-child) tr > th:last-child, .table:has(td.w-actions:last-child) tr > th:last-child,
.table th.w-actions, .table th.w-actions3, .table th.w-actions4, .table th.w-actions5 {
  position: static !important; box-shadow: none !important; width: 1%; white-space: nowrap;
  text-align: center !important; padding-left: 12px; padding-right: 18px; }
.table-wrap.is-scrolling td.row-actions:last-child, .table-wrap.is-scrolling td.w-actions:last-child,
.table-wrap.is-scrolling th:last-child { box-shadow: none !important; }
.table td.row-actions .act-icons, .table td.w-actions .act-icons {
  display: inline-flex; gap: 6px; align-items: center; justify-content: center; vertical-align: middle; }
.table td.row-actions .act-icons > *, .table td.w-actions .act-icons > * { flex: none; margin: 0 !important; }
.table td.row-actions .icon-btn.sm, .table td.w-actions .icon-btn.sm { width: 32px; height: 32px; }
.table td.row-actions .icon-btn.sm .icon, .table td.w-actions .icon-btn.sm .icon { width: 15px; height: 15px; }
.table td.w-actions > .icon-btn.sm, .table td.w-actions > .inline-form { margin: 0 !important; vertical-align: middle; }
.agent-new-wrap { max-width: 860px; }
.risk-tag { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 1px 7px; border-radius: 4px; background: var(--sev-high-soft, var(--danger-soft)); color: var(--sev-high, var(--danger-ink)); }
.decide-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.decide-form input[name=note] { height: 32px; min-width: 200px; padding: 0 10px; }
/* long text columns wrap so the action column always fits */
.table td.yaml-name { min-width: 200px; max-width: 280px; white-space: normal; }
.table td.yaml-tags, .table td.yaml-comp { max-width: 150px; white-space: normal; }
.table td.yaml-comp .badge { margin: 1px 0; }
.table td.agent-keys { white-space: normal; max-width: 200px; }
/* denser cells and wrapping headers so wide tables fit without scrolling */
.table th { padding-left: 14px; padding-right: 14px; white-space: normal; }
.table td { padding-left: 14px; padding-right: 14px; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table td.row-actions, .table td.w-actions, .table th.w-actions { padding-left: 10px; padding-right: 20px; }
.table td[data-agent-status] { max-width: 150px; white-space: normal; }

/* 1.19.1: every icon button centres its icon, whatever element it is (<a>,
   <button>, <span>) and whatever display rule a table applies to it. */
.icon-btn, a.icon-btn, button.icon-btn, span.icon-btn {
  display: inline-flex; align-items: center !important; justify-content: center !important;
  padding: 0 !important; line-height: 0 !important; text-align: center; flex: none; box-sizing: border-box; }
.table td .icon-btn, .act-icons .icon-btn { display: inline-flex !important; }
/* Rules that hide an icon button on purpose still win (e.g. the menu button,
   which only exists on small screens where the sidebar slides in). */
.icon-btn[hidden] { display: none !important; }
.topbar .nav-toggle-sm { display: none; }
@media (max-width: 900px) { .topbar .nav-toggle-sm { display: inline-flex; } }
.icon-btn > .icon, .icon-btn > svg { display: block; flex: none; margin: 0 auto !important; }
.act-icons > .inline-form { display: inline-flex; margin: 0; padding: 0; }
/* narrower screens: tighter cells and wrapping text so the action column always fits */
@media (max-width: 1440px) {
  .table th, .table td { padding-left: 10px; padding-right: 10px; }
  .table th:first-child, .table td:first-child { padding-left: 18px; }
  .table td.nowrap:not(.row-actions):not(.w-actions), .table td .strong, .table td.mono { white-space: normal; }
  .table td.mono, .table td .mono { overflow-wrap: anywhere; }
  .table .uid-copy { white-space: nowrap; }
}
@media (max-width: 1360px) { .table .col-optional-md { display: none; } }

/* ---- Branding editor (1.19.3) ---- */
.brand-edit-grid { align-items: start; }
.brand-preview-col { position: sticky; top: 84px; }
.logo-slot { display: grid; grid-template-columns: 168px 1fr; gap: 16px; align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.logo-slot:last-of-type { border-bottom: 0; padding-bottom: 0; }
.logo-slot-thumb, .pv-file { height: 96px; border-radius: var(--r-md); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 10px; overflow: hidden;
  background-image: linear-gradient(45deg, rgba(0,0,0,.05) 25%, transparent 25%), linear-gradient(-45deg, rgba(0,0,0,.05) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(0,0,0,.05) 75%), linear-gradient(-45deg, transparent 75%, rgba(0,0,0,.05) 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.logo-slot-thumb.on-light, .pv-file.on-light { background-color: #ffffff; }
.logo-slot-thumb.on-dark, .pv-file.on-dark { background-color: #0c111d; border-color: #1f2633; }
.logo-slot-thumb img, .pv-file img { max-width: 100%; max-height: 72px; object-fit: contain; }
.logo-slot-title { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.logo-slot-fields .field { margin-bottom: 10px; }
.logo-slot-fields input[type=file] { width: 100%; }
.preview-switch { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; }
.preview-switch .btn.active { background: var(--surface-2, #eef0f4); font-weight: 600; }
.pv-app { display: grid; grid-template-columns: 172px 1fr; height: 236px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.pv-side { background: var(--sidebar-bg); color: var(--sidebar-text); padding: 14px 12px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pv-brand { min-height: 36px; display: flex; align-items: center; overflow: hidden; }
.pv-brand .brand-name { color: #fff; font-weight: 700; font-size: 14px; }
.pv-brand .sub { color: var(--sidebar-muted); font-size: 10.5px; }
.pv-brand .brand-mark { background: #fff; color: #0c111d; }
.pv-brand .brand-logo, .pv-collapsed .brand-logo { display: block !important; max-width: 148px; object-fit: contain; }
.pv-nav { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
.pv-nav-h { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--sidebar-muted); margin-bottom: 3px; }
.pv-item { padding: 5px 8px; border-radius: 6px; color: var(--sidebar-text); }
.pv-main { background: #f4f5f7; display: flex; flex-direction: column; min-width: 0; }
.pv-top { height: 34px; background: #fff; border-bottom: 1px solid #e6e8ec; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 10px; }
.pv-dot { width: 18px; height: 18px; border-radius: 6px; border: 1px solid #e6e8ec; }
.pv-avatar { width: 20px; height: 20px; border-radius: 50%; font-size: 8px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pv-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: #1d2330; }
.pv-eyebrow { font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: #6b7280; }
.pv-h1 { font-size: 15px; font-weight: 700; }
.pv-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0; }
.pv-cards span { height: 44px; background: #fff; border: 1px solid #e6e8ec; border-radius: 7px; }
.pv-btn { align-self: flex-start; padding: 5px 10px; border-radius: 7px; font-weight: 600; font-size: 10.5px; }
.pv-link { font-weight: 600; font-size: 10.5px; }
.pv-app[data-theme-preview="dark"] .pv-main { background: #0f1115; }
.pv-app[data-theme-preview="dark"] .pv-top { background: #151821; border-color: #232836; }
.pv-app[data-theme-preview="dark"] .pv-dot { border-color: #2a3040; }
.pv-app[data-theme-preview="dark"] .pv-body { color: #e8eaf0; }
.pv-app[data-theme-preview="dark"] .pv-cards span { background: #171a22; border-color: #262b38; }
.pv-collapsed { width: 76px; height: 64px; background: var(--sidebar-bg); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; }
.pv-collapsed .brand-logo { max-width: 48px !important; }
.pv-tab { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.pv-tab[data-theme-preview="dark"] { background: #202124; color: #e8eaed; }
.pv-fav svg, .pv-fav img { width: 14px; height: 14px; display: block; object-fit: contain; }
.logo-slot-icon img { width: 48px; height: 48px; object-fit: contain; }
.pv-files { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pv-files > div { display: flex; flex-direction: column; gap: 4px; }
.pv-err { color: var(--danger-ink, #b42318); }
@media (max-width: 1200px) { .brand-preview-col { position: static; } .logo-slot { grid-template-columns: 1fr; } }
.logo-chip { display: inline-flex; align-items: center; justify-content: center; height: 34px; min-width: 52px; max-width: 120px; padding: 4px 8px; border-radius: 8px; background: var(--sidebar-bg); }
.logo-chip img { max-height: 24px; max-width: 104px; object-fit: contain; }
/* the menu bar is dark in both themes: it always shows the logo for dark backgrounds */
.sidebar .brand-logo-light { display: none !important; }
.sidebar .brand-logo-dark { display: block !important; }
.login-brand { margin-bottom: 22px; }
.login-brand .brand-mark { background: var(--text); color: var(--surface); }
.login-brand .brand-name { font-size: 18px; font-weight: 700; color: var(--text); }
.login-brand .sub { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.pv-login { border-radius: var(--r-md); border: 1px solid var(--border); background: #f4f5f7; padding: 16px; display: flex; justify-content: center; }
.pv-login-card { width: 220px; background: #fff; border: 1px solid #e6e8ec; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; color: #1d2330; }
.pv-login .pv-brand { min-height: 28px; }
.pv-login .brand-name { color: #1d2330; font-size: 13px; }
.pv-login .sub { color: #6b7280; }
.pv-login .brand-mark { background: #1d2330; color: #fff; }
.pv-field { height: 22px; border: 1px solid #e3e6eb; border-radius: 6px; }
.pv-btn-block { align-self: stretch; text-align: center; }
.pv-login[data-theme-preview="dark"] { background: #0f1115; border-color: #232836; }
.pv-login[data-theme-preview="dark"] .pv-login-card { background: #171a22; border-color: #262b38; color: #e8eaf0; }
.pv-login[data-theme-preview="dark"] .brand-name { color: #f1f3f7; }
.pv-login[data-theme-preview="dark"] .pv-field { border-color: #2a3040; }
.pv-login[data-theme-preview="dark"] .brand-mark { background: #f1f3f7; color: #0f1115; }
