/* ═══════════════════════════════════════
   PORTAL — BASE
   ═══════════════════════════════════════ */

/* Advisor strip disabled */
#ps-adv-strip { display: none !important; }
:root {
  --p-sidebar-w: 240px;
  --p-topbar-h: 58px;
  --p-bg: #000000;
  --p-bg2: #0A0A0A;
  --p-bg3: #141414;
  --p-border: rgba(255,255,255,0.07);
  --p-border2: rgba(255,255,255,0.13);
  --p-text: #E8EEF8;
  --p-muted: #90AFC8;
  --p-faint: #607898;
  --p-blue: #3B82F6;
  --p-green: #10B981;
  --p-amber: #F59E0B;
  --p-red: #EF4444;
  --p-purple: #8B5CF6;
  /* Tokens added for the portal-wide theme system. Default values match the
     current Penthropic look so existing CSS is unchanged; each theme file
     overrides only the tokens it needs to retarget. */
  --p-accent:        #D4AF37;          /* Brand gold */
  --p-accent-bright: #F5D76E;
  --p-accent-deep:   #B8941F;
  --p-card:          rgba(255,255,255,0.03);
  --p-card-hover:    rgba(255,255,255,0.06);
  --p-modal-scrim:   rgba(0,0,0,0.85);
  --p-radius:        10px;
  --p-radius-sm:     6px;
  --p-radius-lg:     16px;
  --p-shadow:        0 18px 40px -28px rgba(0,0,0,0.7);
  --p-font-display:  'Inter', -apple-system, system-ui, 'Segoe UI', sans-serif;
  --p-font-body:     'Inter', -apple-system, system-ui, 'Segoe UI', sans-serif;
  --p-font-mono:     'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

.portal-body { background: var(--p-bg); color: var(--p-text); overflow: hidden; height: 100vh; }

/* ═══════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════ */
.p-login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(212,175,55,0.06) 0%, transparent 60%),
              radial-gradient(ellipse 50% 40% at 80% 80%, rgba(59,130,246,0.06) 0%, transparent 60%),
              var(--p-bg);
}

.p-login-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.p-login-brand {
  position: absolute;
  top: 28px;
  left: 32px;
}
.p-login-brand .login-brand-img {
  height: 64px; width: auto;
  filter: brightness(1.05) drop-shadow(0 1px 4px rgba(212,175,55,0.2));
}
@media (max-width: 900px) {
  .p-login-brand {
    position: static;
    margin: 24px auto 0;
    text-align: center;
  }
}

.p-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--p-bg2);
  border: 1px solid var(--p-border2);
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
  animation: loginSlideIn 0.5s ease;
}
@keyframes loginSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.p-login-header { text-align: center; margin-bottom: 32px; }
.p-login-icon {
  width: 52px; height: 52px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.p-login-icon svg { width: 24px; height: 24px; stroke: #60A5FA; }
.p-login-header h1 { font-size: 1.6rem; margin-bottom: 8px; }
.p-login-header p { font-size: 0.85rem; color: var(--p-muted); }

.p-login-form { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }

.input-icon-wrap { position: relative; }
.input-icon-wrap > svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: var(--p-faint); pointer-events: none;
}
.input-icon-wrap input { padding-left: 38px; }
.password-wrap.input-icon-wrap input { padding-right: 44px; }

.p-remember { display: flex; align-items: center; }

.p-login-trust {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 20px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--p-border);
}
.trust-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--p-faint);
}
.trust-item svg { width: 12px; height: 12px; stroke: var(--p-faint); }

.p-login-access { text-align: center; font-size: 0.82rem; color: var(--p-faint); }
.p-login-access a { color: #60A5FA; }

/* ═══════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════ */
.p-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */
.p-sidebar {
  width: var(--p-sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #0A0A0A 0%, #000000 100%);
  border-right: 1px solid rgba(212,175,55,0.1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 2px 0 20px rgba(0,0,0,0.4);
}

.p-sidebar-top {
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(212,175,55,0.08);
}
.p-sidebar-logo { display: block; text-decoration: none; width: 100%; }
.p-sidebar-logo .sidebar-brand-img { width: 70%; height: auto; display: block; filter: brightness(1.05) drop-shadow(0 1px 8px rgba(212,175,55,0.25)); }
.p-sidebar-logo .logo-mark { width: 28px; height: 28px; font-size: 0.8rem; }
.p-sidebar-logo .logo-text { font-size: 0.9rem; font-weight: 700; }

.p-sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  position: relative;
}
.p-user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #3B82F6 0%, #22D3EE 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.p-user-name { font-size: 0.85rem; font-weight: 600; }
.p-user-org  { font-size: 0.72rem; color: var(--p-faint); }
.p-user-status {
  width: 8px; height: 8px;
  background: var(--p-green);
  border-radius: 50%;
  position: absolute; right: 16px; top: 18px;
  box-shadow: 0 0 0 2px var(--p-bg2);
}

.p-engagement-badge {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 12px;
  padding: 10px 12px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 10px;
}
.eng-badge-dot {
  width: 6px; height: 6px;
  background: var(--p-green);
  border-radius: 50%;
  animation: pulseDot 2s ease infinite;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  50%      { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}
.eng-badge-label { font-size: 0.72rem; font-weight: 700; color: var(--p-green); }
.eng-badge-days  { font-size: 0.68rem; color: var(--p-muted); }

.p-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; overflow-y: auto; }
.p-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--p-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  position: relative;
}
.p-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.p-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--p-text); }
.p-nav-item.active {
  background: rgba(212,175,55,0.10);
  color: #D4AF37;
}
.p-nav-item.active svg { stroke: #D4AF37; }
.p-nav-badge {
  margin-left: auto;
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
}
.p-nav-badge.red    { background: rgba(239,68,68,0.2);  color: #FCA5A5; }
.p-nav-badge.amber  { background: rgba(245,158,11,0.2); color: #FCD34D; }
.p-nav-badge.blue   { background: rgba(59,130,246,0.2); color: #93C5FD; }

/* ═══════════════════════════════════════════════════════════════════════
   Grouped sidebar (2026-05-02 redesign): 10 collapsible nav groups.
   Original p-nav-item styles still apply to leaf items.
   ═══════════════════════════════════════════════════════════════════════ */

.p-nav-primary {
  /* The lone always-visible top-level link (Command Centre) */
  font-size: 0.92rem; font-weight: 600;
  letter-spacing: 0.01em;
  padding: 11px 12px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, rgba(212,175,55,0.05), rgba(212,175,55,0.01));
  border: 1px solid rgba(212,175,55,0.10);
}
.p-nav-primary.active {
  background: linear-gradient(135deg, rgba(212,175,55,0.18), rgba(212,175,55,0.04));
  border-color: rgba(212,175,55,0.35);
  color: #F5D76E;
}
.p-nav-primary.active svg { stroke: #F5D76E; }

.p-nav-group {
  display: flex; flex-direction: column;
  margin: 2px 0;
  border-radius: 10px;
  /* Hover surface for the whole group is intentionally absent — keeping
     the row-by-row hover target makes scanning easier. */
}
.p-nav-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s;
}
.p-nav-group-head svg {
  width: 14px; height: 14px; flex-shrink: 0;
  opacity: 0.7;
}
.p-nav-group-head .p-nav-group-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.p-nav-group-head .p-nav-group-chev {
  margin-left: auto;
  width: 12px; height: 12px;
  transition: transform 0.18s ease;
  opacity: 0.5;
}
.p-nav-group-head:hover {
  background: rgba(255,255,255,0.03);
  color: var(--p-text);
}
.p-nav-group-head:hover svg { opacity: 1; }
.p-nav-group-head:focus-visible {
  outline: 2px solid rgba(212,175,55,0.55);
  outline-offset: 2px;
}
.p-nav-group.is-open > .p-nav-group-head { color: var(--p-text); }
.p-nav-group.is-open > .p-nav-group-head .p-nav-group-chev { transform: rotate(90deg); opacity: 0.9; }
.p-nav-group.has-active > .p-nav-group-head {
  color: #D4AF37;
}
.p-nav-group.has-active > .p-nav-group-head svg:first-of-type { stroke: #D4AF37; opacity: 0.9; }

.p-nav-group-body {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 4px 8px;
  border-left: 1px solid rgba(212,175,55,0.10);
  margin-left: 16px;
}
.p-nav-group.is-open > .p-nav-group-body { display: flex; }

.p-nav-sub {
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  /* Sub-items don't carry icons — they stay in the parent group's
     visual context, so removing them reduces clutter. */
}
.p-nav-sub:hover {
  background: rgba(255,255,255,0.04);
  color: var(--p-text);
}
.p-nav-sub.active {
  background: rgba(212,175,55,0.12);
  color: #F5D76E;
}

/* Roll-up attention badge on a group head — surfaces a single small
   number when child sub-items have visible counts and the group itself
   doesn't already own an explicit badge. Visually subordinate (smaller,
   muted gold pill) so it doesn't compete with severity-coloured child
   badges when the group is open. */
.p-nav-group-rollup {
  margin-left: auto;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(212,175,55,0.16);
  color: #F5D76E;
  font-variant-numeric: tabular-nums;
}
.p-nav-group.is-open > .p-nav-group-head .p-nav-group-rollup {
  /* When the group is expanded the user can already see the child
     counts, so dim the roll-up to reduce visual noise. */
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  .p-nav-group-head .p-nav-group-chev { transition: none; }
}

/* Vendors group — hidden until portal-real.js calls enableTPRMNav() */
.p-nav-group[data-tprm-gated="true"] { display: none; }

.p-sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--p-border);
  display: flex; flex-direction: column; gap: 2px;
}
.p-sidebar-help, .p-sidebar-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.82rem; font-weight: 500;
  color: var(--p-faint);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  background: none; border: none; width: 100%;
  font-family: inherit;
}
.p-sidebar-help svg, .p-sidebar-logout svg { width: 15px; height: 15px; }
.p-sidebar-help:hover { color: var(--p-text); background: rgba(255,255,255,0.04); }
.p-sidebar-logout:hover { color: #FCA5A5; background: rgba(239,68,68,0.08); }

/* ═══════════════════════════════════════
   MAIN BODY
   ═══════════════════════════════════════ */
.p-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── TOP BAR ─── */
.p-topbar {
  height: var(--p-topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--p-bg2);
  border-bottom: 1px solid var(--p-border);
}
.p-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem;
}
.p-breadcrumb svg { width: 14px; height: 14px; stroke: var(--p-faint); }
.p-breadcrumb-root { color: var(--p-faint); }
.p-breadcrumb-current { color: var(--p-text); font-weight: 600; }

.p-topbar-right { display: flex; align-items: center; gap: 8px; }

.p-search-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--p-bg3);
  border: 1px solid var(--p-border);
  border-radius: 8px;
  color: var(--p-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.p-search-btn svg { width: 14px; height: 14px; }
.p-search-btn kbd {
  font-size: 0.68rem;
  padding: 1px 5px;
  background: var(--p-bg);
  border: 1px solid var(--p-border2);
  border-radius: 4px;
  color: var(--p-faint);
  font-family: inherit;
}
.p-search-btn:hover { border-color: var(--p-border2); color: var(--p-text); }

.p-notif-wrap { position: relative; }
.p-notif-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--p-bg3);
  border: 1px solid var(--p-border);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s;
}
.p-notif-btn svg { width: 16px; height: 16px; stroke: var(--p-muted); }
.p-notif-btn:hover { border-color: var(--p-border2); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--p-red);
  border-radius: 50%;
  border: 1.5px solid var(--p-bg2);
}

.p-notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--p-bg2);
  border: 1px solid var(--p-border2);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: 300;
  display: none;
  animation: dropIn 0.2s ease;
}
.p-notif-dropdown.open { display: block; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  font-size: 0.82rem; font-weight: 700;
  border-bottom: 1px solid var(--p-border);
}
.notif-mark-read {
  background: none; border: none;
  font-size: 0.72rem; color: var(--p-blue);
  cursor: pointer; font-family: inherit;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--p-border);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(59,130,246,0.04); }
.notif-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-icon svg { width: 14px; height: 14px; }
.notif-icon.blue  { background: rgba(59,130,246,0.12); }
.notif-icon.blue svg { stroke: #60A5FA; }
.notif-icon.red   { background: rgba(239,68,68,0.12); }
.notif-icon.red svg { stroke: #FCA5A5; }
.notif-icon.green { background: rgba(16,185,129,0.12); }
.notif-icon.green svg { stroke: #6EE7B7; }
.notif-body { flex: 1; min-width: 0; }
.notif-body p { font-size: 0.82rem; margin: 0 0 3px; color: var(--p-text); }
.notif-body span { font-size: 0.72rem; color: var(--p-faint); }
.notif-dot-sm {
  width: 6px; height: 6px;
  background: var(--p-blue);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.p-topbar-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #3B82F6 0%, #22D3EE 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
}

/* ─── SEARCH MODAL ─── */
.p-search-modal {
  position: fixed; inset: 0; z-index: 500;
  display: none;
}
.p-search-modal.open { display: block; }
.p-search-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.p-search-box {
  position: absolute;
  top: 15%;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px;
  background: var(--p-bg2);
  border: 1px solid var(--p-border2);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  overflow: hidden;
  animation: searchIn 0.2s ease;
}
@keyframes searchIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.96); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}
.p-search-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--p-border);
}
.p-search-input-wrap svg { width: 18px; height: 18px; stroke: var(--p-muted); flex-shrink: 0; }
.p-search-input-wrap input {
  flex: 1; background: none; border: none;
  color: var(--p-text); font-size: 1rem; outline: none;
  font-family: inherit;
}
.p-search-input-wrap input::placeholder { color: var(--p-faint); }
.p-search-input-wrap kbd {
  font-size: 0.72rem; padding: 2px 7px;
  background: var(--p-bg3); border: 1px solid var(--p-border2);
  border-radius: 5px; color: var(--p-faint); font-family: inherit;
}
.p-search-results { padding: 8px 0 12px; }
.search-group-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--p-faint);
  padding: 10px 16px 4px;
}
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  font-size: 0.88rem; color: var(--p-muted);
  cursor: pointer;
  transition: background 0.1s;
}
.search-result-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.search-result-item:hover { background: rgba(59,130,246,0.08); color: var(--p-text); }

/* ═══════════════════════════════════════
   PANELS
   ═══════════════════════════════════════ */
.p-main {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 48px;
  background: var(--p-bg);
}

.p-panel { display: none; }
.p-panel.active { display: block; animation: panelIn 0.25s ease; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hub tab strip (portal-hub-tabs.js) ──────────────────────────── */
#phub-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--p-bg);
  border-bottom: 1px solid var(--p-border2);
  /* Bleed to .p-main edges, re-apply horizontal padding */
  margin: -28px -28px 20px;
  padding: 0 28px;
  align-items: center;
  gap: 16px;
}
#phub-bar.is-visible { display: flex; }
.phub-hub-label {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--p-faint);
  padding: 12px 16px 12px 0;
  border-right: 1px solid var(--p-border);
  white-space: nowrap;
}
.phub-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.phub-tabs::-webkit-scrollbar { display: none; }
.phub-tab {
  flex-shrink: 0;
  padding: 11px 14px 9px;
  font-size: 0.8rem;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--p-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--p-font-body);
  white-space: nowrap;
}
.phub-tab:hover { color: var(--p-text); }
.phub-tab.is-active {
  color: var(--p-text);
  font-weight: 600;
  border-bottom-color: var(--p-accent);
}

/* ── Simple / Advanced view mode ────────────────────────────────────
   CSS-only hide: display:none keeps elements in the DOM so
   portal-hub-tabs.js can still click them programmatically to route
   guided/lazy panels (SIEM, IDS, pentest, forensics, etc.)          */
body.view-simple [data-advanced="true"] { display: none !important; }

.p-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
.p-panel-head h2 { font-size: 1.55rem; margin-bottom: 4px; }
.p-panel-sub { font-size: 0.82rem; color: var(--p-muted); }
.p-panel-actions { display: flex; gap: 8px; align-items: center; }

/* widget base */
.ov-widget {
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  padding: 20px;
}
.ov-widget-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.ov-widget-head h3 { font-size: 0.92rem; font-weight: 700; }
.ov-widget-sub { font-size: 0.72rem; color: var(--p-faint); }

/* ═══ OVERVIEW ═══ */
.ov-top-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .ov-top-grid { grid-template-columns: 1fr; } }

.ov-gauge-card {
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.ov-gauge-wrap { position: relative; }
.ov-gauge-meta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ov-gauge-framework {
  font-size: 0.72rem; color: var(--p-faint);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--p-border);
  padding: 4px 10px; border-radius: 20px;
}

.ov-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.ov-kpi {
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.15s;
}
.ov-kpi:hover { border-color: var(--p-border2); }
.ov-kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ov-kpi-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.ov-kpi-icon svg { width: 15px; height: 15px; }
.ov-kpi-icon.blue   { background: rgba(59,130,246,0.12); } .ov-kpi-icon.blue svg { stroke: #60A5FA; }
.ov-kpi-icon.green  { background: rgba(16,185,129,0.12); } .ov-kpi-icon.green svg { stroke: #6EE7B7; }
.ov-kpi-icon.purple { background: rgba(139,92,246,0.12); } .ov-kpi-icon.purple svg { stroke: #C4B5FD; }
.ov-kpi-icon.amber  { background: rgba(245,158,11,0.12); } .ov-kpi-icon.amber svg { stroke: #FCD34D; }
.ov-kpi-trend { font-size: 0.68rem; font-weight: 700; }
.ov-kpi-trend.red { color: var(--p-red); } .ov-kpi-trend.green { color: var(--p-green); } .ov-kpi-trend.neutral { color: var(--p-faint); }
.ov-kpi-val { font-size: 1.9rem; font-weight: 800; line-height: 1; margin-bottom: 3px; }
.ov-kpi-label { font-size: 0.72rem; color: var(--p-muted); margin-bottom: 8px; }
.sparkline { width: 100%; height: 28px; display: block; }

/* NIST bars */
.nist-bars { display: flex; flex-direction: column; gap: 12px; }
.nist-bar-row { display: flex; align-items: center; gap: 10px; }
.nist-label { font-size: 0.78rem; color: var(--p-muted); width: 56px; flex-shrink: 0; }
.nist-track { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.nist-fill {
  height: 100%; border-radius: 3px;
  width: 0; transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.nist-fill.blue   { background: linear-gradient(to right, #3B82F6, #60A5FA); }
.nist-fill.purple { background: linear-gradient(to right, #8B5CF6, #A78BFA); }
.nist-fill.amber  { background: linear-gradient(to right, #F59E0B, #FCD34D); }
.nist-fill.red    { background: linear-gradient(to right, #EF4444, #F87171); }
.nist-fill.green  { background: linear-gradient(to right, #10B981, #6EE7B7); }
.nist-fill.gold   { background: linear-gradient(to right, #B8860B, #F5D76E); }
.nist-pct { font-size: 0.72rem; font-weight: 700; color: var(--p-text); width: 30px; text-align: right; flex-shrink: 0; }

/* Upcoming */
.upcoming-list { display: flex; flex-direction: column; gap: 10px; }
.upcoming-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.15s;
}
.upcoming-item:hover { background: rgba(255,255,255,0.03); }
.upcoming-date {
  display: flex; flex-direction: column; align-items: center;
  min-width: 36px;
}
.up-day { font-size: 1.15rem; font-weight: 800; line-height: 1; }
.up-mon { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--p-faint); }
.upcoming-body { flex: 1; min-width: 0; }
.upcoming-title { font-size: 0.84rem; font-weight: 600; }
.upcoming-meta { font-size: 0.72rem; color: var(--p-faint); }
.up-badge { font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.up-badge.blue   { background: rgba(59,130,246,0.15);  color: #93C5FD; }
.up-badge.red    { background: rgba(239,68,68,0.15);   color: #FCA5A5; }
.up-badge.amber  { background: rgba(245,158,11,0.15);  color: #FCD34D; }
.up-badge.green  { background: rgba(16,185,129,0.15);  color: #6EE7B7; }

/* Activity */
.p-activity { display: flex; flex-direction: column; gap: 14px; }
.p-act-item { display: flex; align-items: flex-start; gap: 10px; }
.p-act-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.p-act-dot.green { background: var(--p-green); }
.p-act-dot.blue  { background: var(--p-blue); }
.p-act-dot.red   { background: var(--p-red); }
.p-act-item p { font-size: 0.84rem; margin: 0 0 2px; color: var(--p-text); }
.p-act-item span { font-size: 0.72rem; color: var(--p-faint); }

/* Engagement summary */
.eng-summary { display: flex; flex-direction: column; gap: 11px; }
.eng-row { display: flex; justify-content: space-between; gap: 16px; font-size: 0.84rem; }
.eng-label { color: var(--p-faint); flex-shrink: 0; }
.eng-val { color: var(--p-text); text-align: right; }
.status-pill.active {
  display: inline-block; padding: 2px 9px;
  background: rgba(16,185,129,0.12); color: var(--p-green);
  border-radius: 20px; font-size: 0.72rem; font-weight: 700;
}

/* grids */
.ov-mid-grid, .ov-bot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 860px) {
  .ov-mid-grid, .ov-bot-grid { grid-template-columns: 1fr; }
}

/* Gauge animation */
.gauge-arc { transition: stroke-dashoffset 1.5s cubic-bezier(0.25, 1, 0.5, 1); }
.gauge-num { transition: all 0.3s; }

/* ═══ RISK ═══ */
.risk-heatmap-card, .risk-table-card {
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.risk-heatmap-head { margin-bottom: 16px; }
.risk-heatmap-head h3 { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; }
.risk-heatmap-head p { font-size: 0.78rem; color: var(--p-faint); }

.risk-heatmap { display: flex; gap: 12px; }
.heatmap-y-label {
  display: flex; flex-direction: column;
  justify-content: space-around;
  font-size: 0.65rem; color: var(--p-faint);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding-bottom: 24px;
  min-width: 28px; text-align: right;
}
.heatmap-grid-wrap { flex: 1; position: relative; }
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  height: 180px;
}
.hm-cell {
  border-radius: 6px;
  transition: transform 0.15s;
}
.hm-cell:hover { transform: scale(1.05); }
.hm-cell.green  { background: rgba(16,185,129,0.15);  border: 1px solid rgba(16,185,129,0.2); }
.hm-cell.amber  { background: rgba(245,158,11,0.18);  border: 1px solid rgba(245,158,11,0.25); }
.hm-cell.red    { background: rgba(239,68,68,0.2);    border: 1px solid rgba(239,68,68,0.3); }

.hm-dots { position: absolute; inset: 0 0 24px 0; pointer-events: none; }
.hm-dot {
  position: absolute;
  width: 28px; height: 28px;
  transform: translate(-50%, -50%);
  background: rgba(59,130,246,0.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; color: #fff;
  cursor: pointer;
  pointer-events: all;
  transition: transform 0.2s;
  z-index: 2;
}
.hm-dot:hover { transform: translate(-50%, -50%) scale(1.2); }
.hm-dot-ring {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(59,130,246,0.4);
  animation: riskPulse 2.5s ease infinite;
}
@keyframes riskPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0; }
}
.heatmap-x-label {
  display: flex; justify-content: space-around;
  font-size: 0.65rem; color: var(--p-faint);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-top: 6px;
}
.heatmap-legend { display: flex; gap: 16px; margin-top: 12px; }
.hm-leg-item { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--p-muted); }
.hm-leg-dot { width: 10px; height: 10px; border-radius: 3px; }
.hm-leg-dot.green { background: rgba(16,185,129,0.5); }
.hm-leg-dot.amber { background: rgba(245,158,11,0.5); }
.hm-leg-dot.red   { background: rgba(239,68,68,0.5); }

.risk-table-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.risk-table-head h3 { font-size: 0.92rem; font-weight: 700; }
.risk-filters { display: flex; gap: 4px; }
.risk-filter {
  padding: 5px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  background: none; border: 1px solid var(--p-border);
  color: var(--p-muted); cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.risk-filter.active, .risk-filter:hover { background: rgba(59,130,246,0.12); border-color: var(--p-blue); color: #93C5FD; }

.risk-table { overflow-x: auto; }
.risk-row {
  display: grid;
  grid-template-columns: 40px 1fr 90px 80px 80px 90px 80px;
  gap: 10px;
  align-items: center;
  padding: 11px 8px;
  border-bottom: 1px solid var(--p-border);
  font-size: 0.82rem;
}
.risk-row-head {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--p-faint);
  padding-bottom: 8px;
}
.risk-row:last-child { border-bottom: none; }
.risk-id { font-weight: 700; color: var(--p-faint); }
.risk-name { color: var(--p-text); font-weight: 500; }
.risk-cat { color: var(--p-muted); font-size: 0.75rem; }
.risk-heat {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 0.7rem; font-weight: 700;
}
.risk-heat.critical { background: rgba(239,68,68,0.2);   color: #FCA5A5; }
.risk-heat.high     { background: rgba(245,158,11,0.18); color: #FCD34D; }
.risk-heat.med      { background: rgba(59,130,246,0.15); color: #93C5FD; }
.risk-heat.low      { background: rgba(16,185,129,0.12); color: #6EE7B7; }
.risk-owner { color: var(--p-muted); font-size: 0.78rem; }
.risk-status {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 0.7rem; font-weight: 700;
}
.risk-status.overdue   { background: rgba(239,68,68,0.15);   color: #FCA5A5; }
.risk-status.pending   { background: rgba(245,158,11,0.12);  color: #FCD34D; }
.risk-status.scheduled { background: rgba(59,130,246,0.12);  color: #93C5FD; }

/* ═══ DOCUMENTS ═══ */
.doc-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.doc-search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 8px;
  flex: 1; max-width: 320px;
  transition: border-color 0.15s;
}
.doc-search-wrap:focus-within { border-color: var(--p-blue); }
.doc-search-wrap svg { width: 14px; height: 14px; stroke: var(--p-faint); flex-shrink: 0; }
.doc-search-wrap input {
  background: none; border: none; outline: none;
  color: var(--p-text); font-size: 0.84rem; flex: 1;
  font-family: inherit;
}
.doc-search-wrap input::placeholder { color: var(--p-faint); }
.doc-filters { display: flex; gap: 4px; }
.doc-filter {
  padding: 6px 14px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  background: none; border: 1px solid var(--p-border);
  color: var(--p-muted); cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.doc-filter.active, .doc-filter:hover { background: rgba(59,130,246,0.12); border-color: var(--p-blue); color: #93C5FD; }

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.doc-card {
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s, transform 0.15s;
}
.doc-card:hover { border-color: var(--p-border2); transform: translateY(-2px); }
.doc-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; margin-bottom: 4px;
}
.doc-card-icon.pdf { background: rgba(239,68,68,0.12);  color: #FCA5A5; }
.doc-card-icon.doc { background: rgba(59,130,246,0.12); color: #93C5FD; }
.doc-card-icon.xls { background: rgba(16,185,129,0.12); color: #6EE7B7; }
.doc-card-name { font-size: 0.85rem; font-weight: 600; line-height: 1.3; }
.doc-card-meta { font-size: 0.72rem; color: var(--p-faint); }
.doc-card-status {
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  display: inline-block; width: fit-content;
}
.doc-card-status.signed { background: rgba(16,185,129,0.12); color: #6EE7B7; }
.doc-card-status.draft  { background: rgba(245,158,11,0.12); color: #FCD34D; }
.doc-card-status.shared { background: rgba(59,130,246,0.12); color: #93C5FD; }

/* ═══ REPORTS ═══ */
.reports-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
}
@media (max-width: 860px) { .reports-layout { grid-template-columns: 1fr; } }

.reports-chart-card, .reports-list-card {
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  padding: 20px;
}
.radar-wrap { display: flex; justify-content: center; padding: 10px 0; }
.radar-poly { transition: all 1s cubic-bezier(0.25, 1, 0.5, 1); }
.radar-point { transition: all 1s cubic-bezier(0.25, 1, 0.5, 1); }

.rpt-list { display: flex; flex-direction: column; gap: 10px; }
.rpt-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--p-bg3);
  border: 1px solid var(--p-border);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.rpt-item.needs-review { border-color: rgba(59,130,246,0.3); }
.rpt-icon {
  width: 36px; height: 36px;
  background: rgba(59,130,246,0.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rpt-icon svg { width: 16px; height: 16px; stroke: #60A5FA; }
.rpt-body { flex: 1; min-width: 0; }
.rpt-name { font-size: 0.86rem; font-weight: 600; margin-bottom: 3px; }
.rpt-meta { font-size: 0.72rem; color: var(--p-faint); }
.rpt-tag {
  font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  white-space: nowrap;
}
.rpt-tag.review { background: rgba(59,130,246,0.15); color: #93C5FD; }
.rpt-tag.final  { background: rgba(16,185,129,0.12); color: #6EE7B7; }

/* ═══ ACTIONS ═══ */
.actions-summary {
  display: flex; align-items: center; gap: 20px;
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 14px;
  flex-wrap: wrap; gap: 16px;
}
.act-progress-ring { flex-shrink: 0; }
.act-summary-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 3px; }
.act-summary-sub { font-size: 0.78rem; color: var(--p-muted); }
.act-filters { display: flex; gap: 4px; margin-left: auto; }
.act-filter {
  padding: 5px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  background: none; border: 1px solid var(--p-border);
  color: var(--p-muted); cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.act-filter.active, .act-filter:hover { background: rgba(59,130,246,0.1); border-color: var(--p-blue); color: #93C5FD; }

.act-list { display: flex; flex-direction: column; gap: 8px; }
.act-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.15s;
}
.act-item.done { opacity: 0.5; }
.act-item:hover { border-color: var(--p-border2); }

.act-checkbox-wrap { cursor: pointer; flex-shrink: 0; }
.act-checkbox-wrap input[type="checkbox"] { display: none; }
.act-check-custom {
  display: block; width: 18px; height: 18px;
  border: 2px solid var(--p-border2);
  border-radius: 5px;
  transition: all 0.15s;
  position: relative;
}
.act-checkbox-wrap input:checked + .act-check-custom {
  background: var(--p-green); border-color: var(--p-green);
}
.act-checkbox-wrap input:checked + .act-check-custom::after {
  content: '✓'; position: absolute;
  inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; font-weight: 700;
}

.act-badge {
  font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  flex-shrink: 0;
}
.act-badge.high { background: rgba(239,68,68,0.15);  color: #FCA5A5; }
.act-badge.med  { background: rgba(245,158,11,0.15); color: #FCD34D; }
.act-badge.low  { background: rgba(16,185,129,0.12); color: #6EE7B7; }
.act-body { flex: 1; min-width: 0; }
.act-title { font-size: 0.86rem; font-weight: 600; margin-bottom: 3px; }
.act-meta { font-size: 0.72rem; color: var(--p-faint); }
.act-status {
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 9px; border-radius: 4px;
  white-space: nowrap; flex-shrink: 0;
}
.act-status.overdue  { background: rgba(239,68,68,0.15);  color: #FCA5A5; }
.act-status.pending  { background: rgba(245,158,11,0.12); color: #FCD34D; }
.act-status.complete { background: rgba(16,185,129,0.12); color: #6EE7B7; }

/* ═══ ROADMAP ═══ */
.roadmap-wrap { padding: 8px 0; }
.roadmap-track { position: relative; padding-left: 24px; }
.roadmap-milestone { display: flex; gap: 20px; position: relative; margin-bottom: 0; }
.rm-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
  margin-top: 4px;
  position: relative; z-index: 1;
}
.rm-dot.done     { background: var(--p-green); border-color: var(--p-green); }
.rm-dot.active   { background: var(--p-blue);  border-color: var(--p-blue); box-shadow: 0 0 0 4px rgba(59,130,246,0.2); }
.rm-dot.upcoming { background: var(--p-bg2);   border-color: var(--p-faint); }
.rm-line {
  position: absolute;
  left: 6px; top: 18px;
  width: 2px; height: calc(100% + 12px);
  background: var(--p-border2);
}
.rm-line.last { display: none; }
.rm-card {
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  flex: 1;
  transition: border-color 0.15s;
}
.rm-card:hover { border-color: var(--p-border2); }
.rm-date { font-size: 0.72rem; color: var(--p-faint); margin-bottom: 5px; font-weight: 600; }
.rm-title { font-size: 0.92rem; font-weight: 700; margin-bottom: 6px; }
.rm-desc { font-size: 0.82rem; color: var(--p-muted); line-height: 1.6; margin-bottom: 10px; }
.rm-tag {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  padding: 3px 9px; border-radius: 4px;
}
.rm-tag.done     { background: rgba(16,185,129,0.12); color: #6EE7B7; }
.rm-tag.active   { background: rgba(59,130,246,0.15); color: #93C5FD; }
.rm-tag.upcoming { background: rgba(255,255,255,0.05); color: var(--p-faint); }

/* ═══ MESSAGES ═══ */
.msg-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - var(--p-topbar-h) - 160px);
  background: var(--p-bg2);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  overflow: hidden;
}
@media (max-width: 720px) { .msg-layout { grid-template-columns: 1fr; } }

.msg-threads {
  border-right: 1px solid var(--p-border);
  overflow-y: auto;
}
.msg-thread {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--p-border);
  position: relative;
  transition: background 0.15s;
}
.msg-thread:hover { background: rgba(255,255,255,0.03); }
.msg-thread.active { background: rgba(59,130,246,0.07); border-left: 2px solid var(--p-blue); padding-left: 12px; }
.msg-thread-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--p-blue), var(--p-purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.msg-thread-avatar.sys { background: var(--p-bg3); color: var(--p-muted); border: 1px solid var(--p-border); }
.msg-thread-body { flex: 1; min-width: 0; }
.msg-thread-from { font-size: 0.82rem; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.msg-thread-role { font-size: 0.65rem; font-weight: 500; color: var(--p-blue); background: rgba(59,130,246,0.1); padding: 1px 6px; border-radius: 4px; }
.msg-thread-preview { font-size: 0.75rem; color: var(--p-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.msg-thread-time { font-size: 0.68rem; color: var(--p-faint); }
.msg-unread-dot { width: 7px; height: 7px; background: var(--p-blue); border-radius: 50%; flex-shrink: 0; margin-top: 6px; }

.msg-thread-view {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.msg-thread-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--p-border);
  flex-shrink: 0;
}
.msg-th-name { font-size: 0.9rem; font-weight: 700; }
.msg-th-role { font-size: 0.72rem; color: var(--p-faint); }

.msg-bubbles {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.msg-bubble { display: flex; flex-direction: column; max-width: 72%; }
.msg-bubble.them { align-self: flex-start; }
.msg-bubble.me   { align-self: flex-end; }
.msg-bubble-text {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.85rem; line-height: 1.6;
  margin-bottom: 4px;
}
.msg-bubble.them .msg-bubble-text {
  background: var(--p-bg3);
  border: 1px solid var(--p-border);
  color: var(--p-text);
  border-radius: 4px 12px 12px 12px;
}
.msg-bubble.me .msg-bubble-text {
  background: var(--p-blue);
  color: #fff;
  border-radius: 12px 4px 12px 12px;
}
.msg-bubble-time { font-size: 0.68rem; color: var(--p-faint); }
.msg-bubble.me .msg-bubble-time { text-align: right; }

.msg-compose {
  padding: 16px 20px;
  border-top: 1px solid var(--p-border);
  flex-shrink: 0;
}
.msg-compose textarea {
  width: 100%;
  background: var(--p-bg3);
  border: 1px solid var(--p-border);
  border-radius: 10px;
  color: var(--p-text);
  font-size: 0.85rem;
  padding: 10px 14px;
  resize: none;
  margin-bottom: 10px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.msg-compose textarea:focus { outline: none; border-color: var(--p-blue); }
.msg-compose textarea::placeholder { color: var(--p-faint); }
.msg-compose-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* AI bar in messages */
.msg-ai-bar {
  padding: 10px 16px; background: rgba(139,92,246,0.06);
  border-top: 1px solid rgba(139,92,246,0.12);
}
.msg-ai-indicator { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(232,238,248,0.6); }
.msg-ai-typing { display: flex; gap: 4px; align-items: center; }
.msg-ai-typing span {
  width: 5px; height: 5px; border-radius: 50%; background: #8B5CF6;
  animation: msgDot 1.4s infinite;
}
.msg-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.msg-ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes msgDot { 0%,60%,100%{ transform:scale(1); opacity:0.5; } 30%{ transform:scale(1.4); opacity:1; } }
.msg-bubble.ai-question .msg-bubble-text { background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.2); }
.msg-bubble.sent .msg-bubble-text { background: rgba(59,130,246,0.1); }

/* Overview head buttons */
.ov-head-btns { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.btn-ir-sm {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  background: rgba(239,68,68,0.1); color: #F87171; border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-ir-sm:hover { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.4); color: #FCA5A5; }
.btn-ir-sm svg { width: 14px; height: 14px; }
.btn-req-sm {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  background: rgba(212,175,55,0.08); color: #D4AF37; border: 1px solid rgba(212,175,55,0.25);
  border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-req-sm:hover { background: rgba(212,175,55,0.15); border-color: rgba(212,175,55,0.4); }
.btn-req-sm svg { width: 14px; height: 14px; }

/* Modal overlay */
.p-modal-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); padding: 24px;
}
.p-modal {
  background: linear-gradient(160deg, #0E1A2E, #0A1220);
  border: 1px solid rgba(212,175,55,0.15); border-radius: 18px; width: 100%; max-width: 580px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7); max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes modalIn { from { opacity:0; transform:scale(0.96) translateY(12px); } to { opacity:1; transform:none; } }
.p-modal-head {
  display: flex; align-items: center; gap: 14px; padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.p-modal-icon {
  width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.p-modal-icon svg { width: 20px; height: 20px; }
.p-modal-icon.ir { background: rgba(239,68,68,0.12); color: #F87171; border: 1px solid rgba(239,68,68,0.2); }
.p-modal-icon.req { background: rgba(212,175,55,0.1); color: #D4AF37; border: 1px solid rgba(212,175,55,0.2); }
.p-modal-head h3 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.p-modal-head p { font-size: 12px; color: rgba(232,238,248,0.5); }
.p-modal-close {
  margin-left: auto; background: none; border: none; color: rgba(232,238,248,0.4);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 4px; flex-shrink: 0;
  transition: color 0.15s;
}
.p-modal-close:hover { color: rgba(232,238,248,0.8); }
.p-modal-steps { display: flex; align-items: center; gap: 6px; padding: 1rem 1.5rem 0; }
.p-step-dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.1);
  transition: all 0.2s;
}
.p-step-dot.active { background: var(--p-blue); box-shadow: 0 0 6px rgba(59,130,246,0.5); width: 24px; border-radius: 4px; }
.p-step-dot.done { background: var(--p-green); }
.p-modal-body { padding: 1.25rem 1.5rem; display: none; }
.p-modal-body.active { display: block; animation: fadeSlide 0.25s ease; }
@keyframes fadeSlide { from { opacity:0; transform:translateX(8px); } to { opacity:1; transform:none; } }
.p-modal-step-label { font-size: 11px; font-weight: 700; color: rgba(232,238,248,0.4); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 1rem; }
.p-modal-textarea {
  width: 100%; background: rgba(5,10,20,0.7); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; color: rgba(232,238,248,0.9); font: inherit; font-size: 13.5px;
  padding: 0.8rem 1rem; resize: vertical; line-height: 1.6; outline: none; transition: border-color 0.2s;
}
.p-modal-textarea:focus { border-color: rgba(59,130,246,0.4); }
.p-modal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.85rem; }
.p-chip {
  padding: 5px 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px; font: inherit; font-size: 12px; color: rgba(232,238,248,0.65);
  cursor: pointer; transition: all 0.15s;
}
.p-chip:hover { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.25); color: rgba(232,238,248,0.9); }
.p-modal-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.p-modal-field { margin-bottom: 1rem; }
.p-modal-field label, .p-modal-label { display: block; font-size: 11.5px; font-weight: 600; color: rgba(232,238,248,0.5); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.p-modal-input, .p-modal-select {
  width: 100%; background: rgba(5,10,20,0.7); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; color: rgba(232,238,248,0.9); font: inherit; font-size: 13px;
  padding: 0.65rem 0.85rem; outline: none; transition: border-color 0.2s; -webkit-appearance: none;
}
.p-modal-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; padding-right:2rem; }
.p-modal-select option { background: #0A1220; }
.p-modal-input:focus, .p-modal-select:focus { border-color: rgba(59,130,246,0.4); }
.p-modal-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.p-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(232,238,248,0.75); cursor: pointer; padding: 5px 0; }
.p-check input { width: 15px; height: 15px; accent-color: var(--p-blue); }
.p-modal-radios { display: flex; gap: 1.5rem; }
.p-radio { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(232,238,248,0.75); cursor: pointer; }
.p-radio input { width: 15px; height: 15px; accent-color: var(--p-blue); }
.p-modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.06);
}
.ir-confirm-icon {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(239,68,68,0.1);
  border: 2px solid rgba(239,68,68,0.3); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
}
.ir-confirm-icon.req { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); }
.ir-confirm-icon svg { width: 26px; height: 26px; stroke: #10B981; }
.ir-next-steps { display: flex; flex-direction: column; gap: 10px; }
.ir-next-step { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; color: rgba(232,238,248,0.7); line-height: 1.5; }
.ir-ns-num {
  width: 22px; height: 22px; border-radius: 50%; background: rgba(239,68,68,0.15); color: #F87171;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.req-service-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.req-service-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px;
  cursor: pointer; font: inherit; color: rgba(232,238,248,0.65); font-size: 11.5px; font-weight: 500;
  text-align: center; line-height: 1.3; transition: all 0.15s;
}
.req-service-card svg { width: 20px; height: 20px; opacity: 0.7; }
.req-service-card:hover { background: rgba(212,175,55,0.08); border-color: rgba(212,175,55,0.25); color: rgba(232,238,248,0.9); }
.req-service-card.selected { background: rgba(212,175,55,0.12); border-color: rgba(212,175,55,0.4); color: #D4AF37; }
.req-service-card.selected svg { opacity: 1; stroke: #D4AF37; }
.req-expect { display: flex; flex-direction: column; gap: 12px; }
.req-expect-item { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; color: rgba(232,238,248,0.7); line-height: 1.5; }
.req-expect-icon {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.req-expect-icon svg { width: 15px; height: 15px; }
.req-expect-icon.blue { background: rgba(59,130,246,0.12); color: var(--p-blue); }
.req-expect-icon.gold { background: rgba(212,175,55,0.1); color: #D4AF37; }
.req-expect-icon.green { background: rgba(16,185,129,0.1); color: var(--p-green); }

/* ══════════════════════════════════════════
   BILLING PANEL
   ══════════════════════════════════════════ */
.billing-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 2rem; gap: 0.75rem; color: rgba(148,163,184,0.5); text-align: center;
}
.billing-empty svg { opacity: 0.3; }
.billing-empty p { font-size: 1rem; font-weight: 500; color: rgba(148,163,184,0.6); margin: 0; }
.billing-empty span { font-size: 0.82rem; }

.billing-kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 1.5rem;
}
.billing-kpi {
  background: var(--p-surface); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 1.1rem 1.25rem;
}
.billing-kpi-label { font-size: 0.72rem; font-weight: 600; color: rgba(148,163,184,0.6); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 4px; }
.billing-kpi-val { font-size: 1.5rem; font-weight: 700; color: rgba(232,238,248,0.95); }
.billing-kpi-sub { font-size: 0.75rem; color: rgba(148,163,184,0.5); margin-top: 2px; }

.billing-inv-list { display: flex; flex-direction: column; gap: 10px; }
.billing-inv-card {
  background: var(--p-surface); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  transition: border-color 0.2s;
}
.billing-inv-card:hover { border-color: rgba(212,175,55,0.2); }
.billing-inv-id { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: rgba(148,163,184,0.55); flex-shrink: 0; min-width: 110px; }
.billing-inv-info { flex: 1; min-width: 160px; }
.billing-inv-desc { font-size: 0.85rem; color: rgba(232,238,248,0.85); font-weight: 500; }
.billing-inv-dates { font-size: 0.75rem; color: rgba(148,163,184,0.55); margin-top: 2px; }
.billing-inv-amt { font-size: 1.05rem; font-weight: 700; color: rgba(232,238,248,0.95); flex-shrink: 0; }
.billing-inv-status {
  padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0;
}
.billing-inv-status.outstanding { background: rgba(245,158,11,0.15); color: #F59E0B; }
.billing-inv-status.overdue     { background: rgba(239,68,68,0.15);  color: #EF4444; }
.billing-inv-status.paid        { background: rgba(16,185,129,0.15); color: #10B981; }
.billing-inv-actions { flex-shrink: 0; }

/* Billing invoice view modal (light document) */
.billing-view-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(3,7,18,0.88); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.billing-view-shell {
  background: #f5f3ee; border-radius: 14px;
  width: 760px; max-width: 100%; max-height: 94vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.65);
}
.billing-view-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 0.85rem 1.25rem;
  background: #0D1625; border-bottom: 1px solid rgba(212,175,55,0.15); flex-shrink: 0;
}
.billing-view-doc {
  flex: 1; overflow-y: auto; background: #f5f3ee;
  padding: 2.5rem 3rem; color: #1a1a2e; font-family: 'Inter', sans-serif; font-size: 14px;
}

/* Overdue alert strip */
.billing-overdue-alert {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px; padding: 0.85rem 1.1rem; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; color: #EF4444;
}

/* ── Invoice document styles (used in client billing view) ── */
.inv-doc-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:2rem; padding-bottom:1.25rem; border-bottom:2px solid #050A14; }
.inv-doc-logo { height:70px; object-fit:contain; }
.inv-doc-from { text-align:right; }
.inv-doc-from-name { font-size:0.95rem; font-weight:700; color:#050A14; }
.inv-doc-from-sub { font-size:0.75rem; color:#555; line-height:1.7; margin-top:3px; }
.inv-doc-meta { display:flex; gap:2rem; margin-bottom:1.75rem; }
.inv-doc-to { flex:1; }
.inv-doc-to-label { font-size:0.68rem; font-weight:700; text-transform:uppercase; letter-spacing:0.1em; color:#999; margin-bottom:4px; }
.inv-doc-to-name { font-size:0.95rem; font-weight:600; color:#050A14; }
.inv-doc-to-sub { font-size:0.78rem; color:#666; margin-top:2px; }
.inv-doc-numbers { text-align:right; }
.inv-doc-inv-num { font-size:1.35rem; font-weight:800; color:#050A14; font-family:'JetBrains Mono',monospace; }
.inv-doc-dates { font-size:0.78rem; color:#666; margin-top:4px; line-height:1.9; }
.inv-doc-due-highlight { font-weight:700; color:#D4AF37; }
.inv-doc-lines { width:100%; border-collapse:collapse; margin:1.25rem 0; font-size:0.85rem; }
.inv-doc-lines thead th { background:#050A14; color:#fff; padding:0.6rem 0.75rem; text-align:left; font-size:0.68rem; font-weight:600; text-transform:uppercase; letter-spacing:0.07em; }
.inv-doc-lines tbody td { padding:0.65rem 0.75rem; border-bottom:1px solid #ddd; color:#222; }
.inv-doc-lines tfoot td { padding:0.4rem 0.75rem; }
.inv-doc-lines tfoot tr.inv-tfoot-sub td,
.inv-doc-lines tfoot tr.inv-tfoot-vat td { color:#666; }
.inv-doc-lines tfoot tr.inv-tfoot-vat td { border-bottom:1px solid #ccc; }
.inv-doc-lines tfoot tr.inv-tfoot-grand td { font-size:1rem; font-weight:700; color:#050A14; border-top:2px solid #050A14; padding-top:0.65rem; }
.inv-doc-notes { font-size:0.78rem; color:#555; margin-top:1.25rem; padding:0.75rem 0.9rem; background:#ede9e0; border-radius:8px; border-left:3px solid #D4AF37; }
.inv-doc-footer { display:flex; justify-content:space-between; align-items:center; margin-top:1.75rem; padding-top:0.9rem; border-top:1px solid #ccc; font-size:0.73rem; color:#999; }
.inv-doc-footer-brand { font-weight:700; color:#D4AF37; letter-spacing:0.05em; font-size:0.7rem; }

@media print {
  body > *:not(#billingViewOverlay) { display:none !important; }
  #billingViewOverlay { position:static !important; background:none !important; backdrop-filter:none !important; display:block !important; padding:0 !important; }
  .billing-view-shell { box-shadow:none !important; max-height:none !important; border-radius:0 !important; width:100% !important; background:white !important; }
  .billing-view-toolbar { display:none !important; }
  .billing-view-doc { overflow:visible !important; padding:1cm 1.5cm !important; background:white !important; }
}

/* ═══════════════════════════════════════════════════════════
   SECURE VAULT
═══════════════════════════════════════════════════════════ */
.vault-upload-zone {
  background: var(--p-bg2); border: 1px solid var(--p-border);
  border-radius: 12px; padding: 20px; margin-bottom: 20px;
}
.vault-drop-area {
  border: 2px dashed var(--p-border); border-radius: 10px;
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 14px;
}
.vault-drop-area.drag-over { border-color: #D4AF37; background: rgba(212,175,55,0.05); }
.vault-drop-area svg { color: var(--p-text-dim); margin-bottom: 10px; }
.vault-drop-area p { font-weight: 500; color: var(--p-text); margin-bottom: 4px; }
.vault-drop-area span { font-size: 0.75rem; color: var(--p-text-dim); }
.vault-browse-link { color: #D4AF37; cursor: pointer; text-decoration: underline; }
.vault-upload-category { display: flex; align-items: center; gap: 12px; }
.vault-upload-category label { font-size: 0.8rem; font-weight: 600; color: var(--p-text-dim); white-space: nowrap; }
.vault-upload-category select { flex: 1; background: var(--p-bg3); border: 1px solid var(--p-border); border-radius: 8px; padding: 8px 12px; color: var(--p-text); font-size: 0.85rem; }
.vault-upload-error { color: #EF4444; font-size: 0.8rem; padding: 8px 0; }

.vault-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.vault-filter-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
  border: 1px solid var(--p-border); background: transparent; color: var(--p-text-dim);
  cursor: pointer; transition: all 0.15s;
}
.vault-filter-btn.active, .vault-filter-btn:hover { background: rgba(212,175,55,0.12); border-color: #D4AF37; color: #D4AF37; }

.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 32px; min-height: 60px; }
.vault-empty { grid-column: 1/-1; text-align: center; padding: 40px; color: var(--p-text-dim); font-size: 0.85rem; }

.vault-file-card {
  background: var(--p-bg2); border: 1px solid var(--p-border); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.15s;
}
.vault-file-card:hover { border-color: rgba(212,175,55,0.3); }
.vault-file-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.vault-icon-pdf { background: rgba(239,68,68,0.15); color: #EF4444; }
.vault-icon-doc { background: rgba(59,130,246,0.15); color: #3B82F6; }
.vault-icon-xls { background: rgba(16,185,129,0.15); color: #10B981; }
.vault-icon-img { background: rgba(139,92,246,0.15); color: #8B5CF6; }
.vault-icon-txt { background: rgba(100,116,139,0.15); color: #94A3B8; }
.vault-file-name { font-weight: 600; font-size: 0.85rem; word-break: break-word; }
.vault-file-meta { font-size: 0.72rem; color: var(--p-text-dim); display: flex; justify-content: space-between; }
.vault-file-cat { font-size: 0.65rem; padding: 2px 8px; border-radius: 8px; background: rgba(212,175,55,0.1); color: #D4AF37; font-weight: 600; align-self: flex-start; }
.vault-file-actions { display: flex; gap: 8px; }
.vault-file-btn { flex: 1; padding: 6px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 600; border: 1px solid var(--p-border); background: transparent; color: var(--p-text-dim); cursor: pointer; transition: all 0.15s; text-align: center; }
.vault-file-btn:hover { border-color: #D4AF37; color: #D4AF37; }
.vault-file-btn.delete:hover { border-color: #EF4444; color: #EF4444; }

.vault-ransom-kit {
  background: rgba(239,68,68,0.04); border: 1px solid rgba(239,68,68,0.2);
  border-radius: 12px; padding: 20px; margin-top: 8px;
}
.vault-ransom-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.85rem; color: #EF4444; margin-bottom: 16px;
}
.vault-ransom-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.vault-ransom-step { display: flex; gap: 12px; align-items: flex-start; font-size: 0.82rem; color: var(--p-text-dim); }
.vr-num {
  width: 22px; height: 22px; border-radius: 50%; background: rgba(239,68,68,0.15);
  color: #EF4444; font-size: 0.7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vault-ransom-link { color: #EF4444; font-weight: 600; }
.vault-ransom-contacts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 10px;
  border-top: 1px solid rgba(239,68,68,0.15); padding-top: 14px;
}
.vr-contact { font-size: 0.78rem; }
.vr-contact strong { display: block; color: var(--p-text); margin-bottom: 2px; }
.vr-contact span { color: var(--p-text-dim); font-family: 'JetBrains Mono', monospace; }

/* ═══════════════════════════════════════════════════════════
   SECURITY AUDIT
═══════════════════════════════════════════════════════════ */
.audit-progress-badge {
  font-size: 0.72rem; font-weight: 700; padding: 5px 14px; border-radius: 20px;
  background: rgba(100,116,139,0.12); color: var(--p-text-dim); border: 1px solid var(--p-border);
}
.audit-complete {
  text-align: center; padding: 60px 20px;
}
.audit-complete h3 { font-size: 1.3rem; margin: 16px 0 8px; color: #10B981; }
.audit-complete p { color: var(--p-text-dim); max-width: 480px; margin: 0 auto 20px; }

.audit-progress-bar-wrap { height: 4px; background: var(--p-bg3); border-radius: 2px; margin-bottom: 24px; overflow: hidden; }
.audit-progress-bar { height: 100%; background: linear-gradient(90deg, #C9A227, #D4AF37); border-radius: 2px; transition: width 0.4s ease; }

.audit-steps-nav { display: flex; gap: 6px; margin-bottom: 28px; flex-wrap: wrap; }
.audit-step-dot {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--p-border);
  display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700;
  color: var(--p-text-dim); transition: all 0.2s; cursor: default;
}
.audit-step-dot.active { border-color: #D4AF37; background: rgba(212,175,55,0.15); color: #D4AF37; }
.audit-step-dot.done { border-color: #10B981; background: rgba(16,185,129,0.15); color: #10B981; }

.audit-form { display: flex; flex-direction: column; gap: 0; }
.audit-section { display: none; }
.audit-section.active { display: flex; flex-direction: column; gap: 20px; }
.audit-section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.audit-section-sub { font-size: 0.82rem; color: var(--p-text-dim); margin-bottom: 8px; }

.audit-q { display: flex; flex-direction: column; gap: 8px; }
.audit-q label { font-weight: 600; font-size: 0.88rem; }
.audit-q-hint { font-size: 0.75rem; color: var(--p-text-dim); margin-top: -4px; }
.audit-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.audit-radio-btn {
  padding: 7px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  border: 1.5px solid var(--p-border); background: transparent; color: var(--p-text-dim);
  cursor: pointer; transition: all 0.15s;
}
.audit-radio-btn.selected { border-color: #D4AF37; background: rgba(212,175,55,0.12); color: #D4AF37; }
.audit-text-input, .audit-select, .audit-textarea {
  background: var(--p-bg2); border: 1.5px solid var(--p-border); border-radius: 8px;
  padding: 10px 14px; color: var(--p-text); font-size: 0.85rem; font-family: inherit; width: 100%;
  transition: border-color 0.15s;
}
.audit-text-input:focus, .audit-select:focus, .audit-textarea:focus { border-color: #D4AF37; outline: none; }
.audit-text-input.error, .audit-select.error, .audit-textarea.error { border-color: #EF4444; }
.audit-textarea { resize: vertical; min-height: 80px; }

.audit-nav-btns { display: flex; justify-content: space-between; margin-top: 28px; align-items: center; }
.audit-error { color: #EF4444; font-size: 0.8rem; margin-top: 8px; padding: 8px 12px; background: rgba(239,68,68,0.08); border-radius: 6px; }

/* ═══════════════════════════════════════════════════════════
   ADMIN GLOBAL SEARCH
═══════════════════════════════════════════════════════════ */
.a-search-wrap { position: relative; flex: 1; max-width: 380px; }
.a-search-input {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 8px 14px 8px 36px; color: #fff; font-size: 0.82rem;
  font-family: inherit; transition: border-color 0.15s;
}
.a-search-input:focus { outline: none; border-color: rgba(212,175,55,0.5); background: rgba(255,255,255,0.08); }
.a-search-input::placeholder { color: rgba(255,255,255,0.3); }
.a-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.35); pointer-events: none; }
.a-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 300;
  background: #0D1625; border: 1px solid rgba(212,175,55,0.2); border-radius: 10px;
  overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  display: none;
}
.a-search-results.open { display: block; }
.a-search-group-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.35); padding: 10px 14px 4px; }
.a-search-result {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  cursor: pointer; transition: background 0.12s; font-size: 0.82rem; color: rgba(255,255,255,0.8);
}
.a-search-result:hover { background: rgba(212,175,55,0.08); color: #D4AF37; }
.a-search-result svg { flex-shrink: 0; color: rgba(255,255,255,0.35); }
.a-search-no-results { padding: 16px 14px; font-size: 0.82rem; color: rgba(255,255,255,0.35); text-align: center; }

/* ═══════════════════════════════════════════════════════════
   ADMIN PROSPECTS
═══════════════════════════════════════════════════════════ */
.prospect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 16px; }
.prospect-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
}
.prospect-card-head { display: flex; align-items: flex-start; gap: 12px; }
.prospect-avatar { width: 40px; height: 40px; border-radius: 10px; background: rgba(212,175,55,0.12); color: #D4AF37; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex-shrink: 0; }
.prospect-name { font-weight: 700; font-size: 0.95rem; }
.prospect-sector { font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; }
.prospect-stage { margin-left: auto; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 10px; }
.stage-new { background: rgba(59,130,246,0.15); color: #3B82F6; }
.stage-contacted { background: rgba(212,175,55,0.15); color: #D4AF37; }
.stage-proposal { background: rgba(139,92,246,0.15); color: #8B5CF6; }
.stage-negotiating { background: rgba(245,158,11,0.15); color: #F59E0B; }
.prospect-meta { font-size: 0.78rem; color: var(--text-dim); display: flex; flex-direction: column; gap: 3px; }
.prospect-meta span { display: flex; align-items: center; gap: 6px; }
.prospect-concern { font-size: 0.75rem; background: var(--bg-3); border-radius: 6px; padding: 7px 10px; color: var(--text-dim); font-style: italic; }
.prospect-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.prospect-empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.prospect-empty p { margin-top: 14px; }

.prospect-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 300; display: flex; align-items: center; justify-content: center; }
.prospect-modal { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; width: 520px; max-width: 95vw; max-height: 90vh; overflow-y: auto; }
.prospect-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.prospect-modal-head h3 { font-size: 1rem; }
.prospect-modal-head button { background: none; border: none; color: var(--text-dim); font-size: 1.4rem; cursor: pointer; }
.prospect-modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.prospect-field { display: flex; flex-direction: column; gap: 6px; }
.prospect-field label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); }
.prospect-field input, .prospect-field select, .prospect-field textarea {
  background: var(--bg-3); border: 1.5px solid var(--border); border-radius: 8px;
  padding: 9px 12px; color: var(--text); font-size: 0.85rem; font-family: inherit;
  transition: border-color 0.15s;
}
.prospect-field input:focus, .prospect-field select:focus, .prospect-field textarea:focus { border-color: var(--gold); outline: none; }
.prospect-field input.error, .prospect-field select.error, .prospect-field textarea.error { border-color: #EF4444; }
.prospect-field-error { font-size: 0.72rem; color: #EF4444; margin-top: -8px; }
.prospect-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }

.prospect-rec-panel { background: var(--bg-3); border-radius: 10px; padding: 14px; margin-top: 4px; font-size: 0.82rem; line-height: 1.6; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════
   ADMIN ONBOARDING RESPONSES
═══════════════════════════════════════════════════════════ */
.ob-resp-list { display: flex; flex-direction: column; gap: 16px; }
.ob-resp-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ob-resp-head { padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.ob-resp-name { font-weight: 700; flex: 1; }
.ob-resp-date { font-size: 0.72rem; color: var(--text-dim); }
.ob-resp-body { padding: 16px 20px; }
.ob-q-row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.ob-q-row:last-child { border-bottom: none; }
.ob-q-label { flex: 1; color: var(--text-dim); }
.ob-q-val { font-weight: 600; color: var(--text); text-align: right; }
.ob-q-val.yes { color: #10B981; }
.ob-q-val.no { color: #EF4444; }
.ob-q-val.partial { color: #F59E0B; }
.ob-strat-out { margin-top: 14px; background: #fff; color: #1a1a2e; border-radius: 8px; padding: 24px 28px; font-size: 0.85rem; line-height: 1.75; }
.ob-strat-out h2 { font-size: 1rem; color: #050A14; margin: 18px 0 8px; border-left: 3px solid #C9A227; padding-left: 10px; }
.ob-strat-out p, .ob-strat-out ul { color: #374151; margin-bottom: 8px; }
.ob-strat-out li { margin-bottom: 3px; }
.ob-empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════
   SECURITY SCORE TIMELINE (client portal)
═══════════════════════════════════════════════════════════ */
.st-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.st-score-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.st-score-card { background: var(--p-bg2); border: 1px solid var(--p-border); border-radius: 14px; padding: 16px 18px; }
.st-score-val { font-size: 2rem; font-weight: 800; margin-bottom: 2px; }
.st-score-val.gold { color: #D4AF37; }
.st-score-val.green { color: #10B981; }
.st-score-val.amber { color: #F59E0B; }
.st-score-label { font-size: 0.75rem; color: var(--p-text2); }
.st-chart-wrap { background: var(--p-bg2); border: 1px solid var(--p-border); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.st-chart-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--p-text2); margin-bottom: 14px; }
.st-canvas-wrap { position: relative; height: 200px; }
.st-canvas-wrap canvas { width: 100% !important; height: 100% !important; }
.st-domain-breakdown { background: var(--p-bg2); border: 1px solid var(--p-border); border-radius: 14px; padding: 18px 20px; }
.st-domain-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--p-text2); margin-bottom: 14px; }
.st-domain-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 0.82rem; }
.st-domain-name { min-width: 140px; color: var(--p-text); font-weight: 500; }
.st-domain-bar-track { flex: 1; background: var(--p-border); border-radius: 4px; height: 8px; overflow: hidden; }
.st-domain-bar-fill { height: 8px; border-radius: 4px; transition: width 0.5s ease; }
.st-domain-pct { min-width: 36px; text-align: right; font-weight: 700; color: var(--p-text); }

/* ═══════════════════════════════════════════════════════════
   CYBER ESSENTIALS QUIZ (client portal)
═══════════════════════════════════════════════════════════ */
.ce-quiz-wrap { max-width: 680px; margin: 0 auto; }
.ce-quiz-header { text-align: center; margin-bottom: 28px; }
.ce-quiz-header h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.ce-quiz-header p { font-size: 0.85rem; color: var(--p-text2); }
.ce-progress-bar-wrap { background: var(--p-border); border-radius: 4px; height: 6px; margin-bottom: 24px; overflow: hidden; }
.ce-progress-bar { height: 6px; background: #D4AF37; border-radius: 4px; transition: width 0.4s ease; }
.ce-step-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.75rem; color: var(--p-text2); }
.ce-section { background: var(--p-bg2); border: 1px solid var(--p-border); border-radius: 14px; padding: 20px 22px; margin-bottom: 20px; }
.ce-section-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.ce-section-icon { width: 24px; height: 24px; border-radius: 6px; background: rgba(212,175,55,0.15); color: #D4AF37; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ce-q { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--p-border); }
.ce-q-text { font-size: 0.85rem; font-weight: 500; color: var(--p-text); margin-bottom: 10px; line-height: 1.5; }
.ce-radio-group { display: flex; flex-direction: column; gap: 6px; }
.ce-radio-btn { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--p-border); border-radius: 10px; cursor: pointer; font-size: 0.83rem; transition: all 0.15s; }
.ce-radio-btn:hover { border-color: #D4AF37; }
.ce-radio-btn.selected { border-color: #D4AF37; background: rgba(212,175,55,0.08); }
.ce-radio-btn input { display: none; }
.ce-radio-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--p-border); flex-shrink: 0; transition: all 0.15s; }
.ce-radio-btn.selected .ce-radio-dot { border-color: #D4AF37; background: #D4AF37; }
.ce-nav-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.ce-result-wrap { text-align: center; padding: 40px 20px; max-width: 600px; margin: 0 auto; }
.ce-result-score { font-size: 4rem; font-weight: 900; line-height: 1; margin-bottom: 8px; }
.ce-result-label { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.ce-result-sub { font-size: 0.85rem; color: var(--p-text2); margin-bottom: 28px; }
.ce-result-breakdown { background: var(--p-bg2); border: 1px solid var(--p-border); border-radius: 14px; padding: 18px 22px; text-align: left; margin-bottom: 20px; }
.ce-result-domain { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--p-border); font-size: 0.83rem; }
.ce-result-domain:last-child { border-bottom: none; }
.ce-result-domain-name { font-weight: 600; }
.ce-result-domain-score { font-weight: 700; }
.ce-result-domain-score.green { color: #10B981; }
.ce-result-domain-score.amber { color: #F59E0B; }
.ce-result-domain-score.red { color: #EF4444; }

/* ═══════════════════════════════════════════════════════════
   E-SIGNATURE (client portal)
═══════════════════════════════════════════════════════════ */
.sig-panel-wrap { max-width: 780px; margin: 0 auto; }
.sig-doc-preview { background: #fff; color: #1a1a2e; border-radius: 14px; padding: 32px 36px; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
.sig-doc-preview h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; color: #050A14; }
.sig-doc-preview p { font-size: 0.83rem; color: #374151; line-height: 1.7; margin-bottom: 8px; }
.sig-doc-preview .sig-doc-meta { font-size: 0.72rem; color: #6B7280; border-top: 1px solid #E5E7EB; padding-top: 10px; margin-top: 12px; }
.sig-section { background: var(--p-bg2); border: 1px solid var(--p-border); border-radius: 14px; padding: 20px 22px; margin-bottom: 16px; }
.sig-section-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 14px; }
.sig-canvas-wrap { border: 2px dashed var(--p-border); border-radius: 10px; padding: 4px; background: rgba(255,255,255,0.02); }
.sig-canvas-wrap canvas { display: block; width: 100%; cursor: crosshair; border-radius: 8px; }
.sig-canvas-controls { display: flex; gap: 10px; margin-top: 10px; align-items: center; }
.sig-hint { font-size: 0.75rem; color: var(--p-text2); flex: 1; }
.sig-checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 0.83rem; color: var(--p-text2); line-height: 1.5; }
.sig-checkbox-row input[type=checkbox] { margin-top: 2px; flex-shrink: 0; accent-color: #D4AF37; }
.sig-confirm-btn { width: 100%; margin-top: 4px; }
.sig-signed-state { text-align: center; padding: 40px 20px; }
.sig-signed-icon { width: 56px; height: 56px; background: rgba(16,185,129,0.12); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.sig-signed-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.sig-signed-time { font-size: 0.78rem; color: var(--p-text2); }

/* ═══════════════════════════════════════════════════════════
   LIVE CHAT (portal side)
═══════════════════════════════════════════════════════════ */
.pchat-wrap { display: flex; flex-direction: column; height: 540px; background: var(--p-bg2); border: 1px solid var(--p-border); border-radius: 14px; overflow: hidden; }
.pchat-header { padding: 16px 18px; border-bottom: 1px solid var(--p-border); display: flex; align-items: center; gap: 12px; }
.pchat-advisor-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(212,175,55,0.15); color: #D4AF37; font-weight: 800; font-size: 0.88rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pchat-advisor-name { font-weight: 700; font-size: 0.9rem; }
.pchat-status { font-size: 0.72rem; color: var(--p-text2); display: flex; align-items: center; gap: 4px; }
.pchat-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #10B981; }
.pchat-messages { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.pchat-msg { display: flex; gap: 10px; }
.pchat-msg.mine { flex-direction: row-reverse; }
.pchat-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--p-bg3,var(--p-bg2)); color: var(--p-text2); font-size: 0.68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pchat-msg.mine .pchat-avatar { background: rgba(212,175,55,0.15); color: #D4AF37; }
.pchat-bubble { max-width: 70%; padding: 9px 13px; border-radius: 14px; font-size: 0.83rem; line-height: 1.5; }
.pchat-bubble.theirs { background: var(--p-bg); color: var(--p-text); border-bottom-left-radius: 4px; border: 1px solid var(--p-border); }
.pchat-bubble.mine { background: rgba(212,175,55,0.15); color: var(--p-text); border-bottom-right-radius: 4px; }
.pchat-msg-time { font-size: 0.65rem; color: var(--p-text2); align-self: flex-end; padding: 0 4px 2px; }
.pchat-input-row { padding: 12px 16px; border-top: 1px solid var(--p-border); display: flex; gap: 10px; align-items: flex-end; }
.pchat-input { flex: 1; background: var(--p-bg); border: 1px solid var(--p-border); border-radius: 20px; padding: 8px 14px; color: var(--p-text); font-size: 0.84rem; font-family: inherit; outline: none; resize: none; max-height: 80px; }
.pchat-input:focus { border-color: #D4AF37; }
.pchat-send-btn { background: #D4AF37; color: #050A14; border: none; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.pchat-send-btn:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════
   MONTHLY REPORTS (portal side)
═══════════════════════════════════════════════════════════ */
.pm-report-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.pm-report-item { background: var(--p-bg2); border: 1px solid var(--p-border); border-radius: 14px; padding: 16px 18px; cursor: pointer; transition: border-color 0.2s; display: flex; align-items: center; gap: 14px; }
.pm-report-item:hover { border-color: #D4AF37; }
.pm-report-item.selected { border-color: #D4AF37; background: rgba(212,175,55,0.04); }
.pm-report-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(212,175,55,0.12); color: #D4AF37; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pm-report-info { flex: 1; }
.pm-report-month { font-weight: 700; font-size: 0.9rem; }
.pm-report-sub { font-size: 0.75rem; color: var(--p-text2); margin-top: 2px; }
.pm-report-new-badge { font-size: 0.68rem; font-weight: 700; background: rgba(212,175,55,0.15); color: #D4AF37; padding: 3px 9px; border-radius: 10px; }
.pm-doc-wrap { background: #fff; color: #1a1a2e; border-radius: 14px; padding: 36px 44px; box-shadow: 0 4px 24px rgba(0,0,0,0.1); font-size: 0.88rem; line-height: 1.8; }
.pm-doc-wrap h1 { font-size: 1.4rem; color: #050A14; margin-bottom: 4px; }
.pm-doc-wrap h2 { font-size: 0.98rem; color: #050A14; margin: 22px 0 8px; border-left: 3px solid #C9A227; padding-left: 12px; }
.pm-doc-wrap p { color: #374151; margin-bottom: 8px; }
.pm-doc-wrap ul { color: #374151; padding-left: 20px; margin-bottom: 8px; }
.pm-doc-wrap li { margin-bottom: 4px; }
.pm-doc-meta { font-size: 0.73rem; color: #6B7280; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid #C9A227; }
.pm-empty-state { text-align: center; padding: 60px 20px; color: var(--p-text2); }
.pm-empty-state svg { opacity: 0.2; margin-bottom: 14px; }

/* ══════════════════════════════════════
   LOADING SCREEN
   ══════════════════════════════════════ */
#ps-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: #050A14;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#ps-loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.ps-loader-logo {
  height: 120px; width: auto;
  filter: drop-shadow(0 0 28px rgba(212,175,55,0.35));
  animation: loaderLogoPulse 2s ease-in-out infinite;
}
@keyframes loaderLogoPulse {
  0%,100% { filter: drop-shadow(0 0 20px rgba(212,175,55,0.25)); }
  50%      { filter: drop-shadow(0 0 44px rgba(212,175,55,0.55)); }
}

.ps-loader-ring-wrap {
  position: relative; width: 80px; height: 80px;
  margin-top: 36px;
}
.ps-loader-ring {
  width: 80px; height: 80px;
  border: 2px solid rgba(212,175,55,0.1);
  border-top-color: #D4AF37;
  border-radius: 50%;
  animation: loaderSpin 1s linear infinite;
}
.ps-loader-ring-inner {
  position: absolute; inset: 10px;
  border: 1px solid rgba(212,175,55,0.08);
  border-bottom-color: rgba(212,175,55,0.5);
  border-radius: 50%;
  animation: loaderSpin 0.7s linear infinite reverse;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }

.ps-loader-shield {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.ps-loader-shield svg {
  width: 28px; height: 28px;
  stroke: rgba(212,175,55,0.7);
  animation: loaderShieldPulse 1.4s ease-in-out infinite;
}
@keyframes loaderShieldPulse {
  0%,100% { opacity: 0.5; transform: scale(0.95); }
  50%      { opacity: 1;   transform: scale(1.05); }
}

.ps-loader-text {
  margin-top: 28px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(212,175,55,0.6);
  animation: loaderTextFade 1.4s ease-in-out infinite;
}
@keyframes loaderTextFade {
  0%,100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.ps-loader-bar-track {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: rgba(212,175,55,0.06);
}
.ps-loader-bar {
  height: 2px;
  background: linear-gradient(90deg, transparent, #D4AF37, rgba(212,175,55,0.4));
  width: 0%;
  animation: loaderBar 2s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes loaderBar {
  0%   { width: 0%; }
  60%  { width: 75%; }
  85%  { width: 92%; }
  100% { width: 100%; }
}

.ps-loader-dots {
  display: flex; gap: 6px; margin-top: 16px;
}
.ps-loader-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(212,175,55,0.4);
  animation: loaderDot 1.4s ease-in-out infinite;
}
.ps-loader-dot:nth-child(2) { animation-delay: 0.2s; }
.ps-loader-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes loaderDot {
  0%,80%,100% { transform: scale(0.6); opacity: 0.3; }
  40%          { transform: scale(1);   opacity: 1; }
}

/* ══ Universal doc letterhead ══ */
.doc-letterhead {
  background: #050A14;
  border-radius: 8px 8px 0 0;
  padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.doc-letterhead-logo { height: 46px; width: auto; display: block; }
.doc-letterhead-conf {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(212,175,55,0.7);
  border: 1px solid rgba(212,175,55,0.3);
  padding: 3px 10px; border-radius: 20px;
}
/* Portal invoice header on dark band */
.inv-doc-header {
  background: #050A14; border-radius: 8px 8px 0 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; margin-bottom: 2rem;
}
.inv-doc-from-name { color: #fff !important; }
.inv-doc-from-sub  { color: rgba(255,255,255,0.55) !important; }

/* ═══════════════════════════════════════════════════════════
   vCISO PORTAL — premium client experience
   ═══════════════════════════════════════════════════════════ */

.vciso-page {
  padding: 32px 40px;
  max-width: 1100px;
  margin: 0 auto;
  color: #cbd5e1;
}
.vciso-page h1 { font-family: Georgia, serif; font-size: 26px; color: #fff; margin: 0 0 8px; font-weight: 700; }
.vciso-page h2 { font-family: Georgia, serif; font-size: 18px; color: #fff; margin: 28px 0 12px; font-weight: 700; }
.vciso-page h3 { font-size: 13px; color: #D4AF37; text-transform: uppercase; letter-spacing: .08em; margin: 20px 0 8px; font-weight: 700; }
.vciso-page p  { line-height: 1.65; color: #cbd5e1; }
.vciso-page .lead { font-size: 15px; color: #e2e8f0; line-height: 1.65; }

/* Hero */
.vciso-hero {
  background: linear-gradient(135deg, rgba(212,175,55,0.08) 0%, rgba(13,22,37,0) 60%);
  border: 1px solid rgba(212,175,55,0.18);
  border-radius: 16px;
  padding: 32px 36px;
  margin-bottom: 24px;
}
.vciso-hero-row { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.vciso-score-circle {
  width: 140px; height: 140px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: Georgia, serif;
  flex-shrink: 0; position: relative;
}
.vciso-score-circle .score-num { font-size: 38px; font-weight: 800; line-height: 1; }
.vciso-score-circle .score-grade { font-size: 18px; margin-top: 4px; opacity: .9; }
.vciso-score-circle .score-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; opacity: .7; }
.vciso-score-A   { background: rgba(16,185,129,.12); border: 3px solid #10b981; color: #10b981; }
.vciso-score-B   { background: rgba(96,165,250,.12); border: 3px solid #60a5fa; color: #60a5fa; }
.vciso-score-C   { background: rgba(245,158,11,.12); border: 3px solid #f59e0b; color: #f59e0b; }
.vciso-score-D, .vciso-score-F { background: rgba(239,68,68,.12); border: 3px solid #ef4444; color: #ef4444; }

.vciso-hero-text { flex: 1; min-width: 280px; }
.vciso-headline { font-family: Georgia, serif; font-size: 22px; color: #fff; line-height: 1.3; margin: 0 0 10px; font-weight: 700; }

/* KPI grid */
.vciso-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 16px 0 24px;
}
.vciso-kpi {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 16px 18px;
}
.vciso-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; font-weight: 700; }
.vciso-kpi-val   { font-size: 26px; font-weight: 800; color: #fff; margin-top: 4px; line-height: 1; }
.vciso-kpi-sub   { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* Cards */
.vciso-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 14px;
}
.vciso-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.vciso-card-head h2 { margin: 0; font-size: 16px; font-family: Georgia, serif; color: #fff; flex: 1; }
.vciso-card-action { font-size: 11px; color: #D4AF37; cursor: pointer; padding: 4px 10px; border: 1px solid rgba(212,175,55,0.3); border-radius: 6px; background: transparent; font-weight: 600; }
.vciso-card-action:hover { background: rgba(212,175,55,0.08); }

/* Priority items */
.vciso-priority {
  display: flex; gap: 14px; padding: 12px 14px; background: rgba(212,175,55,0.04); border-left: 3px solid #D4AF37; border-radius: 6px; margin-bottom: 8px;
}
.vciso-priority-num {
  width: 26px; height: 26px; border-radius: 50%; background: #D4AF37; color: #050A14;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.vciso-priority-text { flex: 1; }
.vciso-priority-title { font-weight: 700; color: #fff; margin-bottom: 4px; font-size: 13px; }
.vciso-priority-why   { font-size: 12px; color: #cbd5e1; line-height: 1.55; margin-bottom: 4px; }
.vciso-priority-action { font-size: 11px; color: #D4AF37; font-weight: 600; }

/* Recommendations */
.vciso-rec {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-left-width: 4px;
  border-radius: 10px; padding: 16px 20px; margin-bottom: 12px;
}
.vciso-rec-priority-critical { border-left-color: #ef4444; }
.vciso-rec-priority-high     { border-left-color: #f87171; }
.vciso-rec-priority-medium   { border-left-color: #f59e0b; }
.vciso-rec-priority-low      { border-left-color: #60a5fa; }
.vciso-rec-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.vciso-rec-title { font-size: 15px; color: #fff; font-weight: 700; flex: 1; }
.vciso-rec-meta  { display: flex; gap: 8px; font-size: 10px; color: #94a3b8; flex-wrap: wrap; }
.vciso-rec-meta-tag { background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.vciso-rec-why { color: #cbd5e1; font-size: 13px; line-height: 1.55; margin: 8px 0; }
.vciso-rec-impact { background: rgba(239,68,68,0.06); border-left: 2px solid #ef4444; padding: 8px 12px; border-radius: 4px; font-size: 12px; color: #cbd5e1; margin: 8px 0; }
.vciso-rec-impact strong { color: #ef4444; }
.vciso-rec-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

/* Buttons */
.vciso-btn {
  background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.4);
  color: #D4AF37;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.vciso-btn:hover { background: rgba(212,175,55,0.2); border-color: #D4AF37; }
.vciso-btn-primary {
  background: linear-gradient(135deg, #D4AF37, #B8941F);
  color: #050A14;
  border: none;
  padding: 11px 22px;
  font-weight: 800;
}
.vciso-btn-primary:hover { box-shadow: 0 6px 16px rgba(212,175,55,0.3); }
.vciso-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
}
.vciso-btn-ghost:hover { background: rgba(255,255,255,0.04); }
.vciso-btn-success {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.4);
  color: #10b981;
}
.vciso-btn-success:hover { background: rgba(16,185,129,0.2); }
.vciso-btn-danger {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
}

/* Compliance grid */
.vciso-control {
  display: flex; gap: 14px; padding: 16px 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; margin-bottom: 10px;
  align-items: flex-start;
}
.vciso-control-icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.vciso-control-icon-covered { background: rgba(16,185,129,0.15); color: #10b981; }
.vciso-control-icon-progress { background: rgba(245,158,11,0.15); color: #f59e0b; }
.vciso-control-icon-not-started, .vciso-control-icon-unknown { background: rgba(156,163,175,0.15); color: #9ca3af; }
.vciso-control-icon-not-applicable { background: rgba(156,163,175,0.05); color: #6b7280; }
.vciso-control-text { flex: 1; }
.vciso-control-name { font-weight: 700; color: #fff; font-size: 14px; }
.vciso-control-desc { font-size: 12px; color: #94a3b8; margin: 4px 0 8px; line-height: 1.5; }
.vciso-control-evidence { font-size: 11px; color: #cbd5e1; padding: 6px 10px; background: rgba(255,255,255,0.03); border-radius: 4px; margin-top: 6px; font-style: italic; }

/* Audit cards */
.vciso-audit {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 10px;
}
.vciso-audit-status { display: inline-block; font-size: 10px; padding: 3px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.vciso-audit-status-requested { background: rgba(245,158,11,0.18); color: #f59e0b; }
.vciso-audit-status-scheduled { background: rgba(96,165,250,0.18); color: #60a5fa; }
.vciso-audit-status-in-progress { background: rgba(212,175,55,0.18); color: #D4AF37; }
.vciso-audit-status-completed { background: rgba(16,185,129,0.18); color: #10b981; }

/* Form */
.vciso-form { display: flex; flex-direction: column; gap: 12px; }
.vciso-form label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; display: block; margin-bottom: 5px; }
.vciso-form input, .vciso-form select, .vciso-form textarea {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  padding: 10px 14px; color: #fff; font-size: 13px; font-family: inherit;
}
.vciso-form input:focus, .vciso-form select:focus, .vciso-form textarea:focus { outline: none; border-color: #D4AF37; }

/* Chat */
.vciso-chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 500px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; overflow: hidden; }
.vciso-chat-msgs { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.vciso-chat-msg { display: flex; gap: 10px; max-width: 85%; }
.vciso-chat-msg.user      { align-self: flex-end; flex-direction: row-reverse; }
.vciso-chat-msg.assistant { align-self: flex-start; }
.vciso-chat-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; font-family: Georgia, serif; }
.vciso-chat-msg.user .vciso-chat-avatar { background: rgba(212,175,55,0.2); color: #D4AF37; }
.vciso-chat-msg.assistant .vciso-chat-avatar { background: linear-gradient(135deg, #D4AF37, #B8941F); color: #050A14; }
.vciso-chat-bubble { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px 16px; font-size: 13px; color: #e2e8f0; line-height: 1.6; white-space: pre-wrap; }
.vciso-chat-msg.user .vciso-chat-bubble { background: rgba(212,175,55,0.06); border-color: rgba(212,175,55,0.2); }
.vciso-chat-input-row { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.2); }
.vciso-chat-input { flex: 1; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 12px 16px; color: #fff; font-size: 13px; font-family: inherit; resize: none; min-height: 44px; max-height: 140px; }
.vciso-chat-suggestions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding: 24px; }
.vciso-chat-suggestion { background: rgba(212,175,55,0.05); border: 1px solid rgba(212,175,55,0.2); border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: all .15s; font-size: 13px; color: #cbd5e1; line-height: 1.5; }
.vciso-chat-suggestion:hover { background: rgba(212,175,55,0.1); border-color: #D4AF37; }

/* Decisions */
.vciso-decision { background: rgba(245,158,11,0.04); border: 1px solid rgba(245,158,11,0.2); border-left: 4px solid #f59e0b; border-radius: 10px; padding: 18px 22px; margin-bottom: 12px; }
.vciso-decision-pending strong { color: #f59e0b; }
.vciso-decision-decided { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.08); border-left-color: #10b981; opacity: 0.85; }
.vciso-decision-options { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* Threat brief */
.vciso-threat { background: rgba(96,165,250,0.04); border: 1px solid rgba(96,165,250,0.2); border-left: 3px solid #60a5fa; border-radius: 8px; padding: 14px 18px; margin-bottom: 10px; }
.vciso-threat-title { font-weight: 700; color: #fff; font-size: 13px; margin-bottom: 6px; }
.vciso-threat-applic { font-size: 12px; color: #cbd5e1; line-height: 1.55; margin: 4px 0; }
.vciso-threat-watch  { font-size: 11px; color: #f59e0b; font-style: italic; margin-top: 6px; }

/* Empty state */
.vciso-empty { text-align: center; padding: 60px 20px; color: #6b7280; font-size: 14px; }
.vciso-empty-icon { font-size: 48px; opacity: .3; margin-bottom: 14px; }


/* ═════════════════════════════════════════════════════════════════
   THEMES — CSS variables that drive the whole portal
   ═════════════════════════════════════════════════════════════════
   Default = classy (no body class needed). Other themes set body[data-theme="X"].
*/
:root {
  --t-bg: #050810;
  --t-surface: #0D1625;
  --t-surface-alt: #111B30;
  --t-border: rgba(255,255,255,0.06);
  --t-border-strong: rgba(255,255,255,0.12);
  --t-text: #f1f5f9;
  --t-text-muted: #94a3b8;
  --t-accent: #D4AF37;
  --t-accent-2: #b8941f;
  --t-success: #10b981;
  --t-warn: #f59e0b;
  --t-danger: #ef4444;
  --t-font-display: Georgia, 'Times New Roman', serif;
  --t-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  --t-radius: 10px;
  --t-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

body[data-theme="midnight"] {
  --t-bg: #000;
  --t-surface: #0a1228;
  --t-surface-alt: #0f1a3a;
  --t-text: #e0e7ff;
  --t-accent: #60a5fa;
  --t-accent-2: #3b82f6;
}

body[data-theme="daylight"] {
  --t-bg: #f1f5f9;
  --t-surface: #ffffff;
  --t-surface-alt: #f8fafc;
  --t-border: rgba(0,0,0,0.08);
  --t-border-strong: rgba(0,0,0,0.16);
  --t-text: #0f172a;
  --t-text-muted: #475569;
  --t-accent: #b45309;
  --t-accent-2: #92400e;
  --t-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

body[data-theme="arcade"] {
  --t-bg: #0a0014;
  --t-surface: #1a0033;
  --t-surface-alt: #2d004d;
  --t-border: rgba(255, 0, 255, 0.3);
  --t-border-strong: rgba(0, 255, 255, 0.5);
  --t-text: #00ffff;
  --t-text-muted: #ff66ff;
  --t-accent: #ff00ff;
  --t-accent-2: #00ffff;
  --t-success: #00ff00;
  --t-warn: #ffff00;
  --t-danger: #ff3366;
  --t-font-display: 'Press Start 2P', 'Courier New', monospace;
  --t-font-body: 'VT323', 'Courier New', monospace;
  --t-radius: 0;
  --t-shadow: 0 0 24px rgba(255, 0, 255, 0.4), inset 0 0 12px rgba(0, 255, 255, 0.18);
}
@font-face { font-family: 'Press Start 2P'; src: url('https://fonts.gstatic.com/s/pressstart2p/v15/e3t4euO8T-267oIAQAu6jDQyK3nVivM.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'VT323'; src: url('https://fonts.gstatic.com/s/vt323/v17/pxiKyp0ihIEF2isfFJU.woff2') format('woff2'); font-display: swap; }

/* Apply theme tokens — keep selectors loose so existing styles still work */
body[data-theme] { background: var(--t-bg); color: var(--t-text); font-family: var(--t-font-body); }
body[data-theme] .p-sidebar,
body[data-theme] .p-topbar,
body[data-theme] .vciso-card,
body[data-theme] .vciso-hero,
body[data-theme] .vciso-kpi,
body[data-theme] .vciso-control,
body[data-theme] .vciso-decision,
body[data-theme] .vciso-rec,
body[data-theme] .vciso-empty {
  background-color: var(--t-surface);
  border-color: var(--t-border);
  color: var(--t-text);
}
body[data-theme] h1, body[data-theme] h2, body[data-theme] h3 { font-family: var(--t-font-display); color: var(--t-text); }
body[data-theme] .vciso-headline, body[data-theme] .vciso-card-head h2 { color: var(--t-text); }

/* Arcade theme — over-the-top neon retro arcade vibes */
body[data-theme="arcade"] .p-sidebar { box-shadow: inset -2px 0 0 var(--t-accent); }
body[data-theme="arcade"] .p-nav-item { color: var(--t-accent-2); border-left: 3px solid transparent; text-shadow: 0 0 8px currentColor; transition: all .15s; }
body[data-theme="arcade"] .p-nav-item:hover, body[data-theme="arcade"] .p-nav-item.active { color: var(--t-accent); border-left-color: var(--t-accent); background: rgba(255,0,255,0.08); }
body[data-theme="arcade"] .vciso-card, body[data-theme="arcade"] .vciso-hero {
  border: 2px solid var(--t-accent);
  box-shadow: 0 0 18px rgba(255, 0, 255, 0.4), inset 0 0 12px rgba(0, 255, 255, 0.12);
  border-radius: 0;
}
body[data-theme="arcade"] h1, body[data-theme="arcade"] h2 {
  text-transform: uppercase; letter-spacing: 0.08em;
  text-shadow: 2px 2px 0 var(--t-accent), 4px 4px 0 var(--t-accent-2);
}
body[data-theme="arcade"] .vciso-btn, body[data-theme="arcade"] .p-theme-btn,
body[data-theme="arcade"] button {
  border: 2px solid var(--t-accent) !important;
  background: transparent !important;
  color: var(--t-accent-2) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 0 !important;
  font-family: 'VT323', monospace;
  text-shadow: 0 0 6px currentColor;
  transition: all .12s;
}
body[data-theme="arcade"] .vciso-btn:hover, body[data-theme="arcade"] button:hover {
  background: var(--t-accent) !important;
  color: var(--t-bg) !important;
  text-shadow: none;
  box-shadow: 0 0 18px var(--t-accent);
}
body[data-theme="arcade"] .vciso-btn-primary {
  background: linear-gradient(90deg, var(--t-accent), var(--t-accent-2)) !important;
  color: var(--t-bg) !important;
  text-shadow: none;
}
body[data-theme="arcade"] .p-topbar-avatar {
  background: var(--t-accent) !important;
  color: var(--t-bg) !important;
  border-radius: 0 !important;
  box-shadow: 0 0 12px var(--t-accent);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
}
body[data-theme="arcade"] .vciso-score-circle { animation: arcade-glow 2s ease-in-out infinite; }
@keyframes arcade-glow { 0%,100% { box-shadow: 0 0 18px var(--t-accent); } 50% { box-shadow: 0 0 32px var(--t-accent), 0 0 48px var(--t-accent-2); } }
/* Scanlines overlay for arcade mode */
body[data-theme="arcade"]::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.15), rgba(0,0,0,0.15) 1px, transparent 1px, transparent 3px);
}
body[data-theme="arcade"] .p-engagement-badge { border-color: var(--t-accent); border-style: dashed; }
body[data-theme="arcade"] .vciso-kpi-val { color: var(--t-accent) !important; text-shadow: 0 0 10px currentColor; font-family: 'Press Start 2P', monospace; font-size: 22px; }

/* Theme picker UI */
.p-theme-picker { position: relative; margin-right: 8px; }
.p-theme-btn {
  background: rgba(255,255,255,0.04); border: 1px solid var(--t-border);
  color: var(--t-text); width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.p-theme-btn svg { width: 18px; height: 18px; }
.p-theme-btn:hover { background: rgba(255,255,255,0.08); }
.p-theme-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px;
  background: var(--t-surface); border: 1px solid var(--t-border-strong);
  border-radius: 10px; padding: 10px; display: none; flex-direction: column; gap: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); z-index: 9999;
}
.p-theme-menu.open { display: flex; }
.p-theme-menu-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--t-text-muted); padding: 4px 8px 8px; }
.p-theme-opt {
  display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent;
  color: var(--t-text); padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; text-align: left;
}
.p-theme-opt:hover { background: rgba(255,255,255,0.04); border-color: var(--t-border); }
.p-theme-opt.active { background: rgba(212,175,55,0.08); border-color: var(--t-accent); }
.p-theme-swatch { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.p-theme-tag { margin-left: auto; font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--t-accent); border: 1px solid var(--t-accent); padding: 1px 5px; border-radius: 3px; }

/* ═════════════════════════════════════════════════════════════════
   SECURE DROP UI
   ═════════════════════════════════════════════════════════════════ */
.sd-banner {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(16,185,129,0.02));
  border: 1px solid rgba(16,185,129,0.25);
  border-left: 4px solid #10b981;
  border-radius: 12px; padding: 18px 22px; margin-bottom: 22px;
  display: flex; align-items: center; gap: 14px;
}
.sd-banner-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(16,185,129,0.18); color: #10b981; display: flex; align-items: center; justify-content: center; }
.sd-banner-text strong { color: var(--t-text); font-size: 14px; display: block; margin-bottom: 2px; }
.sd-banner-text span { color: var(--t-text-muted); font-size: 12px; }

.sd-dropzone {
  border: 2px dashed var(--t-border-strong); border-radius: 14px;
  padding: 50px 24px; text-align: center; transition: all .2s;
  background: rgba(255,255,255,0.02); cursor: pointer; position: relative;
}
.sd-dropzone:hover, .sd-dropzone.drag-over {
  border-color: var(--t-accent); background: rgba(212,175,55,0.04);
  transform: scale(1.005);
}
.sd-dropzone.drag-over { transform: scale(1.02); }
.sd-dropzone-icon { font-size: 36px; color: var(--t-accent); margin-bottom: 8px; }
.sd-dropzone-title { color: var(--t-text); font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.sd-dropzone-sub { color: var(--t-text-muted); font-size: 12px; }
.sd-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.sd-upload-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--t-border);
  border-left: 3px solid var(--t-accent); border-radius: 8px; margin-bottom: 8px;
}
.sd-upload-row .sd-fname { flex: 1; color: var(--t-text); font-size: 13px; font-weight: 500; }
.sd-upload-row .sd-status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.sd-upload-row.queued .sd-status { background: rgba(148,163,184,0.18); color: #94a3b8; }
.sd-upload-row.uploading .sd-status { background: rgba(245,158,11,0.18); color: #f59e0b; }
.sd-upload-row.uploaded .sd-status { background: rgba(16,185,129,0.18); color: #10b981; }
.sd-upload-row.failed .sd-status { background: rgba(239,68,68,0.18); color: #ef4444; }
.sd-progress { width: 90px; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.sd-progress-fill { height: 100%; background: var(--t-accent); transition: width .2s; }

.sd-history-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border-bottom: 1px solid var(--t-border); font-size: 13px;
}
.sd-history-row .sd-fname { flex: 1; color: var(--t-text); font-weight: 500; }
.sd-history-row .sd-meta { color: var(--t-text-muted); font-size: 11px; }
.sd-history-row .sd-action { color: var(--t-accent); font-size: 11px; }

/* ═══════════════════════════════════════════════════════════════════════
 * Asset Management (portal) — portal-asset-management.js
 * ═══════════════════════════════════════════════════════════════════════ */
.pasm-section {
  background: var(--t-card, rgba(17, 24, 39, .55));
  border: 1px solid var(--t-border, rgba(255,255,255,.08));
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
}
.pasm-h3 {
  color: var(--t-text, #ECEDF1);
  font-size: 14px;
  letter-spacing: .03em;
  margin: 0 0 6px;
}
.pasm-intro {
  color: var(--t-text-muted, #94a0bd);
  font-size: 12.5px;
  line-height: 1.55;
  margin: 0 0 16px;
}

/* Summary KPIs */
.pasm-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.pasm-kpi {
  background: rgba(17, 24, 39, .45);
  border: 1px solid var(--t-border, rgba(255,255,255,.06));
  border-radius: 6px;
  padding: 10px 12px;
}
.pasm-kpi-l {
  color: var(--t-text-muted, #94a0bd);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.pasm-kpi-v {
  color: var(--t-text, #ECEDF1);
  font-size: 22px;
  font-weight: 600;
  margin-top: 2px;
}
.pasm-kpi-crit .pasm-kpi-v { color: #F87171; }
.pasm-kpi-high .pasm-kpi-v { color: #FBBF24; }

/* Rows */
.pasm-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.pasm-row-col { align-items: flex-start; flex-direction: column; gap: 4px; }
.pasm-label {
  color: var(--t-text-muted, #94a0bd);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .06em;
  min-width: 100px;
  text-transform: uppercase;
}
.pasm-input {
  background: rgba(11, 15, 26, .65);
  border: 1px solid var(--t-border, rgba(255,255,255,.08));
  border-radius: 5px;
  color: var(--t-text, #ECEDF1);
  font-size: 13px;
  padding: 7px 10px;
  flex: 1;
  min-width: 220px;
}
.pasm-input.pasm-sort { flex: 0 0 200px; min-width: 180px; }
.pasm-file { color: var(--t-text-muted, #94a0bd); font-size: 12px; }
.pasm-paste {
  background: rgba(11, 15, 26, .65);
  border: 1px solid var(--t-border, rgba(255,255,255,.08));
  border-radius: 5px;
  color: var(--t-text, #ECEDF1);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

/* Status */
.pasm-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  min-height: 18px;
}
.pasm-status.ok      { color: #4ADE80; }
.pasm-status.error   { color: #F87171; }
.pasm-status.loading { color: var(--t-text-muted, #94a0bd); }

/* Asset table */
.pasm-table-wrap {
  background: rgba(11, 15, 26, .35);
  border: 1px solid var(--t-border, rgba(255,255,255,.06));
  border-radius: 6px;
  overflow-x: auto;
}
.pasm-table {
  border-collapse: collapse;
  width: 100%;
}
.pasm-table thead th {
  background: rgba(17, 24, 39, .55);
  border-bottom: 1px solid var(--t-border, rgba(255,255,255,.08));
  color: var(--t-text-muted, #94a0bd);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .07em;
  padding: 9px 14px;
  text-align: left;
  text-transform: uppercase;
}
.pasm-table tbody td {
  border-bottom: 1px solid var(--t-border, rgba(255,255,255,.04));
  color: var(--t-text, #ECEDF1);
  font-size: 12.5px;
  padding: 10px 14px;
  vertical-align: middle;
}
.pasm-asset-name { font-weight: 500; }
.pasm-asset-sub {
  color: var(--t-text-muted, #94a0bd);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  margin-top: 2px;
}
.pasm-type {
  background: rgba(129, 140, 248, .12);
  border-radius: 3px;
  color: #c5cdfa;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 2px 7px;
}
.pasm-risk {
  border-radius: 11px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  text-transform: uppercase;
}
.pasm-risk-critical { background: rgba(239,68,68,.13); color: #F87171; }
.pasm-risk-high     { background: rgba(249,115,22,.13); color: #FB923C; }
.pasm-risk-medium   { background: rgba(251,191,36,.13); color: #FBBF24; }
.pasm-risk-low      { background: rgba(74,222,128,.13); color: #4ADE80; }

.pasm-loading, .pasm-empty, .pasm-error {
  color: var(--t-text-muted, #94a0bd);
  padding: 24px 14px !important;
  text-align: center;
}
.pasm-error { color: #F87171; }

.pasm-row-click { cursor: pointer; transition: background .12s; }
.pasm-row-click:hover { background: rgba(129, 140, 248, .06); }
.pasm-row-click:focus { background: rgba(129, 140, 248, .08); outline: none; }

/* Detail drawer */
.pasm-drawer {
  display: none;
  position: fixed; inset: 0;
  z-index: 1200;
}
.pasm-drawer.open { display: block; }
.pasm-drawer-overlay {
  background: rgba(0, 0, 0, .55);
  position: absolute; inset: 0;
  animation: pasmFadeIn .15s ease-out;
}
.pasm-drawer-panel {
  background: var(--t-bg, #0b0f1a);
  border-left: 1px solid var(--t-border, rgba(255,255,255,.08));
  box-shadow: -10px 0 40px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column;
  max-width: 560px; width: 100%;
  height: 100%;
  margin-left: auto;
  position: relative;
  animation: pasmSlideIn .2s ease-out;
}
@keyframes pasmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pasmSlideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.pasm-drawer-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--t-border, rgba(255,255,255,.08));
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 18px 20px;
}
.pasm-drawer-title h3 {
  color: var(--t-text, #ECEDF1);
  font-size: 16px;
  margin: 0 0 6px;
}
.pasm-drawer-subt {
  color: var(--t-text-muted, #94a0bd);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}
.pasm-drawer-close {
  background: transparent;
  border: none;
  color: var(--t-text-muted, #94a0bd);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
}
.pasm-drawer-close:hover { color: var(--t-text, #ECEDF1); }

.pasm-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 30px;
}
.pasm-drawer-loading {
  color: var(--t-text-muted, #94a0bd);
  padding: 30px 20px;
  text-align: center;
}

.pasm-drawer-section {
  border-bottom: 1px solid var(--t-border, rgba(255,255,255,.05));
  padding: 14px 0 18px;
}
.pasm-drawer-section:last-child { border-bottom: none; }
.pasm-drawer-section h4 {
  color: var(--t-text, #ECEDF1);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.pasm-form-row {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 9px;
}
.pasm-form-row label {
  color: var(--t-text-muted, #94a0bd);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .05em;
  min-width: 130px;
  text-transform: uppercase;
}
.pasm-form-row-col { align-items: flex-start; flex-direction: column; gap: 4px; }
.pasm-form-row-col label { min-width: 0; }

.pasm-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  margin: 0;
}
.pasm-fact { display: contents; }
.pasm-fact dt {
  color: var(--t-text-muted, #94a0bd);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: .05em;
  padding: 4px 0;
  text-transform: uppercase;
}
.pasm-fact dd {
  color: var(--t-text, #ECEDF1);
  font-size: 12px;
  margin: 0;
  padding: 4px 0;
  text-align: right;
  word-break: break-word;
}

.pasm-fact-k {
  color: var(--t-text-muted, #94a0bd);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .05em;
  margin-right: 6px;
  text-transform: uppercase;
}
.pasm-tags { margin-bottom: 8px; }
.pasm-tag {
  background: rgba(129, 140, 248, .12);
  border-radius: 3px;
  color: #c5cdfa;
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  margin: 2px 4px 2px 0;
  padding: 2px 7px;
}

.pasm-drivers {
  color: var(--t-text, #ECEDF1);
  font-size: 12px;
  margin: 0;
  padding-left: 16px;
}
.pasm-drivers li { line-height: 1.6; }
.pasm-driver-points {
  background: rgba(249, 115, 22, .14);
  border-radius: 3px;
  color: #FB923C;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  margin-right: 6px;
  padding: 1px 5px;
}

.pasm-actions { padding-top: 18px; }
.btn-danger {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .4);
  color: #F87171;
}
.btn-danger:hover:not([disabled]) { background: rgba(239, 68, 68, .22); }
.btn-danger[disabled] { cursor: not-allowed; opacity: .5; }

/* ── Per-device security score card (portal-security-score.js) ── */
.pss-card .pss-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 14px;
}
.pss-num {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  min-width: 90px;
  letter-spacing: -1px;
}
.pss-grade {
  font-size: 18px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
  color: rgba(255,255,255,.55);
}
.pss-bar {
  flex: 1;
  height: 10px;
  background: rgba(255,255,255,.07);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.pss-bar-fill {
  height: 100%;
  transition: width 280ms ease;
}
.pss-deductions {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,.78);
}
.pss-deductions li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.pss-deductions li:first-child { border-top: none; }
.pss-pts {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  color: #EF4444;
  min-width: 36px;
}
.pss-clean {
  font-size: 13px;
  color: #10B981;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.22);
  border-radius: 8px;
  padding: 10px 12px;
}
.pss-tick { font-weight: 700; }

/* ── Drift feed (Change Feed) (portal-drift-feed.js) ── */
.pdf-wrap { padding: 20px 28px 80px; max-width: 1200px; }
.pdf-header h2 { margin: 0 0 4px; font-size: 22px; }
.pdf-header .sub { color: rgba(255,255,255,.55); font-size: 13px; max-width: 760px; margin: 0; line-height: 1.45; }
.pdf-summary {
  display: flex;
  gap: 14px;
  margin: 18px 0 14px;
  align-items: center;
  flex-wrap: wrap;
}
.pdf-stat {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 10px 16px;
  min-width: 90px;
}
.pdf-stat-v { font-family: 'JetBrains Mono', Menlo, monospace; font-size: 22px; font-weight: 700; line-height: 1; }
.pdf-stat-l { font-size: 11px; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.pdf-filter-spacer { flex: 1; }
.pdf-filter {
  background: rgba(255,255,255,.04);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
.pdf-list { display: flex; flex-direction: column; gap: 6px; }
.pdf-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms;
}
.pdf-row:hover { background: rgba(255,255,255,.05); }
.pdf-icon {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-weight: 700;
  font-size: 16px;
  min-width: 24px;
  padding-top: 2px;
}
.pdf-body { flex: 1; }
.pdf-title { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pdf-sev {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.pdf-sev-critical { background: rgba(239,68,68,.18); color: #FCA5A5; }
.pdf-sev-high     { background: rgba(245,158,11,.18); color: #FCD9A0; }
.pdf-sev-medium   { background: rgba(251,146,60,.18); color: #FED7AA; }
.pdf-sev-low      { background: rgba(148,163,184,.18); color: #CBD5E1; }
.pdf-meta {
  color: rgba(255,255,255,.55);
  font-size: 12px;
  margin-top: 3px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.pdf-sep { opacity: .35; }
.pdf-sample {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 11px;
  color: rgba(255,255,255,.7);
  margin-top: 6px;
  background: rgba(0,0,0,.25);
  padding: 6px 10px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.pdf-counts { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: 12px; }
.pdf-add { color: #10B981; font-family: 'JetBrains Mono', Menlo, monospace; }
.pdf-rem { color: #EF4444; font-family: 'JetBrains Mono', Menlo, monospace; }
.pdf-loading, .pdf-empty, .pdf-error {
  padding: 32px;
  text-align: center;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.02);
  border-radius: 8px;
  font-size: 13px;
}
.pdf-error { color: #FCA5A5; }

/* ── Encryption Coverage (portal-encryption-coverage.js) ── */
.pec-wrap { padding: 20px 28px 80px; max-width: 1200px; }
.pec-header h2 { margin: 0 0 4px; font-size: 22px; }
.pec-header .sub { color: rgba(255,255,255,.55); font-size: 13px; max-width: 760px; margin: 0; line-height: 1.45; }
.pec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0 14px;
}
@media (max-width: 1000px) { .pec-grid { grid-template-columns: 1fr; } }
.pec-card {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 16px 18px;
}
.pec-card h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.5);
  margin: 0 0 12px;
}
.pec-donut-card { text-align: center; }
.pec-headline {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
}
.pec-headline-sub {
  font-size: 12px;
  color: rgba(255,255,255,.55);
  margin: 6px 0 16px;
}
.pec-tot-row {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  font-size: 12px;
}
.pec-tot { display: flex; flex-direction: column; gap: 2px; }
.pec-tot span { color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .04em; font-size: 10px; }
.pec-tot b { font-family: 'JetBrains Mono', Menlo, monospace; font-size: 18px; font-weight: 700; }
.pec-tot-ok b  { color: #10B981; }
.pec-tot-bad b { color: #EF4444; }
.pec-tot-unk b { color: #94A3B8; }
.pec-plat { margin-bottom: 12px; }
.pec-plat:last-child { margin-bottom: 0; }
.pec-plat-h {
  font-size: 12px;
  color: rgba(255,255,255,.75);
  margin-bottom: 6px;
}
.pec-plat-bar {
  height: 8px;
  background: rgba(255,255,255,.06);
  border-radius: 4px;
  overflow: hidden;
}
.pec-plat-fill {
  height: 100%;
  transition: width 280ms ease;
}
.pec-plat-c {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
  font-family: 'JetBrains Mono', Menlo, monospace;
}
.pec-callout-warn { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.07); }
.pec-callout-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,.82);
}
.pec-callout-list li {
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.pec-callout-list li:first-child { border-top: none; }
.pec-callout-meta { color: rgba(255,255,255,.5); font-size: 11px; }
.pec-callout-more { color: rgba(255,255,255,.45); font-style: italic; }
.pec-callout-ok { font-size: 13px; color: #10B981; }
.pec-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 8px;
}
.pec-filter {
  background: rgba(255,255,255,.04);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
.pec-count {
  font-size: 12px;
  color: rgba(255,255,255,.55);
}
.pec-tablewrap {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  overflow: hidden;
}
.pec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pec-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.5);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}
.pec-table td {
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,.04);
}
.pec-row:hover td { background: rgba(255,255,255,.03); }
.pec-name { font-weight: 600; color: #fff; }
.pec-sub { font-size: 11px; color: rgba(255,255,255,.45); }
.pec-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 600;
}
.pec-detail { color: rgba(255,255,255,.7); }
.pec-time { color: rgba(255,255,255,.6); font-family: 'JetBrains Mono', Menlo, monospace; font-size: 11px; }
.pec-never { color: rgba(255,255,255,.35); font-style: italic; }
.pec-empty {
  text-align: center;
  padding: 32px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
}
.pec-loading, .pec-error {
  padding: 32px;
  text-align: center;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.02);
  border-radius: 8px;
  font-size: 13px;
}
.pec-error { color: #FCA5A5; }

/* ── Network Exposure (portal-network-exposure.js) ── */
.pne-wrap { padding: 20px 28px 80px; max-width: 1300px; }
.pne-header h2 { margin: 0 0 4px; font-size: 22px; }
.pne-header .sub { color: rgba(255,255,255,.55); font-size: 13px; max-width: 800px; margin: 0; line-height: 1.45; }
.pne-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}
@media (max-width: 900px) { .pne-kpis { grid-template-columns: repeat(2, 1fr); } }
.pne-kpi {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 14px 18px;
}
.pne-kpi-v {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.pne-kpi-l {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 6px;
}
.pne-toolbar {
  display: flex;
  gap: 12px;
  margin: 10px 0 18px;
}
.pne-search {
  flex: 1;
  background: rgba(255,255,255,.04);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}
.pne-reach-filter {
  background: rgba(255,255,255,.04);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.pne-sec-h {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.5);
  margin: 20px 0 10px;
}
.pne-port-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.pne-port-card {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 12px 14px;
}
.pne-port-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.pne-port-l { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pne-port-num {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 22px;
  font-weight: 700;
}
.pne-port-proto {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}
.pne-port-svc {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.88);
}
.pne-port-c { font-size: 12px; color: rgba(255,255,255,.6); }
.pne-port-c strong { color: #fff; font-family: 'JetBrains Mono', Menlo, monospace; font-size: 14px; }
.pne-why {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  margin-top: 8px;
  line-height: 1.4;
}
.pne-sev {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.pne-sev-critical { background: rgba(239,68,68,.18); color: #FCA5A5; }
.pne-sev-high     { background: rgba(245,158,11,.18); color: #FCD9A0; }
.pne-sev-medium   { background: rgba(251,146,60,.18); color: #FED7AA; }
.pne-sev-info     { display: none; }
.pne-tablewrap {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  overflow: hidden;
}
.pne-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pne-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.5);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}
.pne-table td {
  padding: 8px 14px;
  border-top: 1px solid rgba(255,255,255,.04);
}
.pne-mono { font-family: 'JetBrains Mono', Menlo, monospace; font-size: 12px; color: rgba(255,255,255,.85); }
.pne-name { font-weight: 600; color: #fff; }
.pne-sub { font-size: 11px; color: rgba(255,255,255,.45); }
.pne-proc { color: rgba(255,255,255,.65); }
.pne-reach {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 600;
}
.pne-truncated {
  padding: 10px 14px;
  font-size: 11px;
  color: rgba(255,255,255,.5);
  border-top: 1px solid rgba(255,255,255,.04);
  background: rgba(255,255,255,.015);
}
.pne-empty {
  text-align: center;
  padding: 28px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
}
.pne-loading, .pne-error {
  padding: 32px;
  text-align: center;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.02);
  border-radius: 8px;
  font-size: 13px;
}
.pne-error { color: #FCA5A5; }

/* ── IOC Sweeps (portal-ioc-scans.js) ── */
.pio-wrap { padding: 20px 28px 80px; max-width: 1200px; }
.pio-header h2 { margin: 0 0 4px; font-size: 22px; }
.pio-header .sub { color: rgba(255,255,255,.55); font-size: 13px; max-width: 800px; margin: 0; line-height: 1.45; }
.pio-action {
  margin: 22px 0;
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(212,175,55,.05);
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 10px;
  padding: 18px 22px;
}
.pio-run-btn {
  background: linear-gradient(180deg, #D4AF37 0%, #B8941F 100%);
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .02em;
}
.pio-run-btn:hover:not([disabled]) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(212,175,55,.3); }
.pio-run-btn[disabled] { opacity: .6; cursor: not-allowed; }
.pio-action-sub { font-size: 12px; color: rgba(255,255,255,.6); }
.pio-sec-h {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.5);
  margin: 24px 0 10px;
}
.pio-pack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.pio-pack-row {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 10px 12px;
}
.pio-pack-h { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.pio-pack-h strong { color: #fff; }
.pio-pack-id {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 10px;
  color: rgba(255,255,255,.4);
}
.pio-pack-why {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
  line-height: 1.4;
}
.pio-sweeps { display: flex; flex-direction: column; gap: 8px; }
.pio-sweep {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 14px 18px;
}
.pio-sweep-h { display: flex; justify-content: space-between; align-items: flex-start; }
.pio-sweep-t { font-weight: 600; color: #fff; }
.pio-sweep-sub { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 2px; }
.pio-sweep-arts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pio-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(212,175,55,.12);
  color: #D4AF37;
  font-size: 11px;
  font-weight: 600;
}
.pio-warn { color: #FCD9A0; }
.pio-tablewrap {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  overflow: hidden;
}
.pio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pio-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.5);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}
.pio-table td {
  padding: 8px 14px;
  border-top: 1px solid rgba(255,255,255,.04);
}
.pio-hunt-row { cursor: pointer; }
.pio-hunt-row:hover td { background: rgba(255,255,255,.03); }
.pio-mono { font-family: 'JetBrains Mono', Menlo, monospace; font-size: 12px; }
.pio-sub { font-size: 11px; color: rgba(255,255,255,.45); }
.pio-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 600;
}
.pio-time { color: rgba(255,255,255,.55); font-size: 12px; }
.pio-empty {
  text-align: center;
  padding: 22px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
}
.pio-loading, .pio-error {
  padding: 32px;
  text-align: center;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.02);
  border-radius: 8px;
  font-size: 13px;
}
.pio-error { color: #FCA5A5; }

/* ═══════════════════════════════════════
   AVATAR / ACCOUNT DROPDOWN MENU
   ═══════════════════════════════════════ */

.p-avatar-menu {
  position: relative;
}

/* The avatar button inherits the existing .p-topbar-avatar appearance */
button.p-topbar-avatar {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
}
button.p-topbar-avatar:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 2px;
}

.p-avatar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--p-surface, #1e1e2e);
  border: 1px solid var(--p-border, rgba(255,255,255,.08));
  border-radius: 12px;
  box-shadow: 0 8px 32px -8px rgba(0,0,0,.45);
  padding: 8px;
  z-index: 9999;
}
.p-avatar-dropdown.is-open {
  display: block;
}

.p-avatar-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 12px;
}
.p-avatar-dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .5px;
}
.p-avatar-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--p-text, #f8fafc);
  line-height: 1.3;
}
.p-avatar-dropdown-org {
  font-size: 11px;
  color: var(--muted, #94a3b8);
  line-height: 1.3;
  margin-top: 1px;
}

.p-avatar-dropdown-divider {
  height: 1px;
  background: var(--p-border, rgba(255,255,255,.08));
  margin: 4px 0;
}

.p-avatar-dropdown-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
  padding: 6px 12px 2px;
}

.p-avatar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--p-text, #f8fafc);
  text-decoration: none;
  cursor: pointer;
  transition: background .12s;
}
.p-avatar-dropdown-item:hover,
.p-avatar-dropdown-item:focus-visible {
  background: var(--p-hover, rgba(255,255,255,.06));
  outline: none;
  color: var(--p-text, #f8fafc);
}
.p-avatar-dropdown-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: .7;
}
.p-avatar-dropdown-item .p-nav-badge {
  margin-left: auto;
}

/* Island theme overrides */
html.theme-island .p-avatar-dropdown {
  background: var(--isl-surface, #fff);
  border-color: var(--isl-border, #ece9df);
  box-shadow: 0 8px 32px -8px rgba(15,26,61,.12);
}
html.theme-island .p-avatar-dropdown-name { color: var(--isl-text, #0f1a3d); }
html.theme-island .p-avatar-dropdown-org  { color: var(--isl-text-muted, #6b7280); }
html.theme-island .p-avatar-dropdown-item { color: var(--isl-text, #0f1a3d); }
html.theme-island .p-avatar-dropdown-item:hover { background: var(--isl-surface-3, #f3f1ea); }
html.theme-island .p-avatar-dropdown-divider { background: var(--isl-border, #ece9df); }
html.theme-island .p-avatar-dropdown-section-label { color: var(--isl-text-muted, #6b7280); }

/* ═══════════════════════════════════════
   ISLAND THEME
   Soft pastel-mesh, enterprise-mature.

   Strategy: stamp data-theme="island" on <html>+<body> when active.
   This prevents the ~1000 !important rules in theme-executive.css
   (all scoped to [data-theme="executive-black/white"]) from firing.
   We then override every --p-* and --t-* token so existing portal
   rules resolve to light values without component-by-component !important.
   ═══════════════════════════════════════ */

/* ── Token definitions ─────────────────────────────────────────── */
html.theme-island,
html[data-theme="island"],
body[data-theme="island"] {
  /* Named Island tokens */
  --isl-surface:      #ffffff;
  --isl-surface-2:    #faf9f6;
  --isl-surface-3:    #f3f1ea;
  --isl-border:       #ece9df;
  --isl-border-2:     #d8d2c0;
  --isl-text:         #0f1a3d;
  --isl-text-2:       #2b3a5c;
  --isl-text-muted:   #6b7693;
  --isl-text-faint:   #9aa3bf;
  --isl-brand:        #0f1a3d;
  --isl-brand-soft:   #eeecf8;
  --isl-accent:       #ff5d76;
  --isl-accent-soft:  #ffe5e9;
  --isl-hero-bg:
    radial-gradient(circle at 15% 25%, #ffd9c2 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, #f1e3ff 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, #cfe7fc 0%, transparent 55%),
    radial-gradient(circle at 25% 90%, #ffdfe6 0%, transparent 45%),
    linear-gradient(135deg, #fffaf6 0%, #f7f5ff 100%);
  --isl-font-display: ui-sans-serif, system-ui, -apple-system, "SF Pro Display", "Inter", sans-serif;
  --isl-font-body:    ui-sans-serif, system-ui, -apple-system, "SF Pro Text",    "Inter", sans-serif;

  /* Map ALL --p-* tokens to light values so portal.css base rules resolve correctly */
  --p-bg:            #faf9f6;
  --p-bg2:           #ffffff;
  --p-bg3:           #f3f1ea;
  --p-border:        #ece9df;
  --p-border2:       #d8d2c0;
  --p-text:          #0f1a3d;
  --p-muted:         #6b7693;
  --p-faint:         #9aa3bf;
  --p-blue:          #2f6fd4;
  --p-green:         #1a8a5a;
  --p-amber:         #b8720e;
  --p-red:           #e02f4a;
  --p-purple:        #6d40e0;
  --p-accent:        #ff5d76;
  --p-accent-bright: #ff8095;
  --p-accent-deep:   #d63050;
  --p-accent-soft:   rgba(255,93,118,0.10);
  --p-card:          #ffffff;
  --p-card-hover:    #f7f6f2;
  --p-modal-scrim:   rgba(15,26,61,0.45);
  --p-radius:        12px;
  --p-radius-sm:     8px;
  --p-radius-lg:     20px;
  --p-shadow:        0 1px 3px rgba(15,26,61,0.05), 0 8px 28px -10px rgba(15,26,61,0.09);
  --p-font-display:  var(--isl-font-display);
  --p-font-body:     var(--isl-font-body);

  /* Map --t-* tokens for the generic body[data-theme] rules in portal.css */
  --t-bg:            #faf9f6;
  --t-surface:       #ffffff;
  --t-surface-alt:   #f3f1ea;
  --t-border:        #ece9df;
  --t-border-strong: #d8d2c0;
  --t-text:          #0f1a3d;
  --t-text-muted:    #6b7693;
  --t-accent:        #ff5d76;
  --t-accent-2:      #d63050;
  --t-success:       #1a8a5a;
  --t-warn:          #b8720e;
  --t-danger:        #e02f4a;
  --t-font-display:  var(--isl-font-display);
  --t-font-body:     var(--isl-font-body);
  --t-radius:        12px;
  --t-shadow:        0 1px 3px rgba(15,26,61,0.05), 0 8px 28px -10px rgba(15,26,61,0.09);
}

/* ── Base / layout ─────────────────────────────────────────────── */
html.theme-island body,
html.theme-island .portal-body {
  background: var(--isl-surface-2);
  color: var(--isl-text);
  font-family: var(--isl-font-body);
  -webkit-font-smoothing: antialiased;
}
html.theme-island .p-main { background: var(--isl-surface-2); }

/* ── Typography ────────────────────────────────────────────────── */
html.theme-island h1 { font-family: var(--isl-font-display); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; color: var(--isl-text); }
html.theme-island h2 { font-family: var(--isl-font-display); font-weight: 700; letter-spacing: -0.02em;  line-height: 1.2; color: var(--isl-text); }
html.theme-island h3 { font-family: var(--isl-font-display); font-weight: 700; letter-spacing: -0.012em; line-height: 1.3; color: var(--isl-text); }
html.theme-island h4 { font-family: var(--isl-font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--isl-text-muted); }

/* ── Sidebar ───────────────────────────────────────────────────── */
html.theme-island .p-sidebar {
  background: var(--isl-surface);
  border-right: 1px solid var(--isl-border);
  box-shadow: none;
}
html.theme-island .p-sidebar-top    { border-bottom: 1px solid var(--isl-border); }
html.theme-island .p-sidebar-user   { border-bottom: 1px solid var(--isl-border); color: var(--isl-text); }
html.theme-island .p-sidebar-bottom { border-top:    1px solid var(--isl-border); }
html.theme-island .p-sidebar-user .p-user-name  { color: var(--isl-text); }
html.theme-island .p-sidebar-user .p-user-role,
html.theme-island .p-sidebar-user .p-user-sub   { color: var(--isl-text-muted); }
html.theme-island .p-sidebar-logo img { filter: none; }

/* ── Nav items ─────────────────────────────────────────────────── */
html.theme-island .p-nav-item                 { color: var(--isl-text-2); border-left: 3px solid transparent; }
html.theme-island .p-nav-item:hover           { background: var(--isl-surface-3); color: var(--isl-text); }
html.theme-island .p-nav-item.active          { background: var(--isl-brand-soft); color: var(--isl-brand); border-left-color: var(--isl-accent); }
html.theme-island .p-nav-item.active svg      { stroke: var(--isl-accent); }
html.theme-island .p-nav-badge.red            { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
html.theme-island .p-sidebar-help,
html.theme-island .p-sidebar-logout           { color: var(--isl-text-muted); }
html.theme-island .p-sidebar-help:hover       { background: var(--isl-surface-3); color: var(--isl-text); }
html.theme-island .p-sidebar-logout:hover     { background: #fff0f0; color: #c53030; }
html.theme-island #portalThemePill            { color: var(--isl-text-muted); }
html.theme-island #islandThemePill            { color: var(--isl-accent); font-weight: 700; }

/* ── Topbar ────────────────────────────────────────────────────── */
html.theme-island .p-topbar           { background: var(--isl-surface); border-bottom: 1px solid var(--isl-border); color: var(--isl-text); box-shadow: none; }
html.theme-island .p-topbar-avatar    { background: var(--isl-brand); color: #fff; }
html.theme-island .p-topbar button    { color: var(--isl-text-muted); }
html.theme-island .p-topbar button:hover { background: var(--isl-surface-3); color: var(--isl-text); }

/* ── Panel headers ─────────────────────────────────────────────── */
html.theme-island .p-panel-head h2  { color: var(--isl-text); }
html.theme-island .p-panel-sub      { color: var(--isl-text-muted); }

/* ── Hero gradient ─────────────────────────────────────────────── */
html.theme-island .vciso-hero,
html.theme-island [class$="-hero"] {
  background: var(--isl-hero-bg);
  color: var(--isl-text);
  border-radius: 20px;
  box-shadow: 0 20px 50px -24px rgba(15,26,61,0.15);
  border: 0;
}
html.theme-island .vciso-hero h1, html.theme-island [class$="-hero"] h1 { color: var(--isl-text); }
html.theme-island .vciso-hero p,  html.theme-island [class$="-hero"] p  { color: var(--isl-text-2); }

/* ── Cards / panels ────────────────────────────────────────────── */
html.theme-island .vciso-card,
html.theme-island .vciso-kpi,
html.theme-island .vciso-control,
html.theme-island .vciso-decision,
html.theme-island .vciso-rec {
  background: var(--isl-surface);
  border: 1px solid var(--isl-border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,26,61,0.04), 0 6px 24px -10px rgba(15,26,61,0.08);
  color: var(--isl-text);
}
html.theme-island .vciso-headline,
html.theme-island .vciso-card-head h2 { color: var(--isl-text); }
html.theme-island .vciso-empty        { color: var(--isl-text-muted); background: var(--isl-surface-3); border-color: var(--isl-border); }

/* ── Modals ────────────────────────────────────────────────────── */
html.theme-island .p-modal-overlay { background: rgba(15,26,61,0.4); backdrop-filter: blur(4px); }
html.theme-island .p-modal {
  background: var(--isl-surface);
  border: 1px solid var(--isl-border);
  border-radius: 20px;
  box-shadow: 0 8px 40px -12px rgba(15,26,61,0.14);
  color: var(--isl-text);
}
html.theme-island .p-modal-head h3       { color: var(--isl-text); }
html.theme-island .p-modal-head p        { color: var(--isl-text-muted); }
html.theme-island .p-modal-close         { color: var(--isl-text-muted); }
html.theme-island .p-modal-close:hover   { color: var(--isl-text); }
html.theme-island .p-modal-input,
html.theme-island .p-modal-select,
html.theme-island .p-modal-textarea {
  background: var(--isl-surface-2);
  border-color: var(--isl-border-2);
  color: var(--isl-text);
}
html.theme-island .p-modal-input:focus,
html.theme-island .p-modal-select:focus,
html.theme-island .p-modal-textarea:focus { border-color: var(--isl-brand); outline: none; }
html.theme-island .p-modal-label,
html.theme-island .p-modal-field label    { color: var(--isl-text-muted); }
html.theme-island .p-modal-select option  { background: var(--isl-surface); color: var(--isl-text); }
html.theme-island .p-modal-step-label     { color: var(--isl-text-muted); }

/* ── Login card ────────────────────────────────────────────────── */
html.theme-island .p-login-wrap { background: var(--isl-hero-bg); }
html.theme-island .p-login-card {
  background: var(--isl-surface);
  border: 1px solid var(--isl-border);
  border-radius: 20px;
  box-shadow: 0 8px 40px -16px rgba(15,26,61,0.14);
  color: var(--isl-text);
}
