/* ============================================================================
   index.css — self-contained stylesheet for /index.html
   Page does NOT load GB-portal/style.css; every class the page uses is defined
   below. Other pages continue to use style.css as normal.

   Structure:
     SECTION A — legacy primitives ported verbatim from GB-portal/style.css
       (line references in section headers, source v95)
     SECTION B — RESKIN classes (portfolio grid site-cards, clean-paper nav
       modal, severity explainer, facts-first layout, Urgent/Attention/Watch/
       Healthy band vocab). Scoped via `.portfolio-grid`, `#nav-modal`, and
       `#severity-modal` ancestors to avoid colliding with legacy classes.
   ========================================================================= */

/* =============================== SECTION A =============================== */

/* -- Reset + base (style.css:1-2) -- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: #f4f6fa; color: #1a1d2e; min-height: 100vh; }

/* -- Topbar (style.css:6-11, :12-27) -- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; height: 64px; border-bottom: 1px solid rgba(0,0,0,0.08); background: #fff; }
.brand-logo { height: 32px; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.portal-hub-btn {
  background: transparent;
  color: #6b7280;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.85rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.portal-hub-btn:hover {
  background: #f0f2f8;
  color: #4f6ef7;
  border-color: rgba(79,110,247,0.3);
}

/* -- Dashboard hero (style.css:31-48) — used by client-selection mode; the
   reskin overrides hero copy but keeps these primitives in place.              */
.dash-hero { padding: 2rem 2rem 0; }
.back-btn { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 500; color: #6b7280; text-decoration: none; }
.back-btn:hover { color: #4f6ef7; }
.dash-greeting { font-size: 0.85rem; color: #6b7280; margin-bottom: 0.3rem; margin-top: 1rem; }
.dash-greeting strong { color: #1a1d2e; font-weight: 600; }
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.25rem; }
.dash-stats-3 { grid-template-columns: repeat(3, 1fr); }
.dash-stat { background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 14px; padding: 1.25rem 1.5rem; }
.dash-stat-val { font-size: 2rem; font-weight: 700; line-height: 1; color: #1a1d2e; }
.dash-stat-lbl { font-size: 0.78rem; color: #6b7280; margin-top: 0.4rem; }
.dash-stat.attention .dash-stat-val { color: #e07c00; }
.dash-stat.online .dash-stat-val { color: #16a34a; }
@media (max-width: 640px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

/* -- Section (style.css:52-58) -- */
.section { padding: 2rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-head h2 { font-size: 1rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.alert-count { color: #e07c00; margin-left: 6px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; flex-wrap: wrap; gap: 0.75rem; }
.section-title-row .dash-greeting { margin-top: 0; }

/* -- Legacy site-grid / site-card (style.css:61-75)
   Used by client-selection splash. Reskin portfolio cards are defined
   separately under .portfolio-grid .site-card later in SECTION B.           */
.site-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.site-card { display: flex; align-items: center; gap: 1rem; background: #fff; border: 2px solid #cbd2e0; border-radius: 14px; padding: 1rem 1.25rem; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; position: relative; }
.site-card:hover { border-color: #4f6ef7; box-shadow: 0 4px 12px rgba(79,110,247,0.12); }
.card-icon-wrap { width: 40px; height: 40px; border-radius: 10px; background: rgba(79,110,247,0.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-icon-wrap svg { width: 20px; height: 20px; fill: none; stroke: #4f6ef7; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-icon-wrap.ic-high { background: rgba(224,124,0,0.1); } .card-icon-wrap.ic-high svg { stroke: #e07c00; }
.card-icon-wrap.ic-info { background: rgba(79,110,247,0.1); } .card-icon-wrap.ic-info svg { stroke: #4f6ef7; }
.card-icon-wrap.ic-ppm  { background: rgba(22,163,74,0.1);  } .card-icon-wrap.ic-ppm svg  { stroke: #16a34a; }
.card-e-main { flex: 1; min-width: 0; }
.card-e-name { font-weight: 600; font-size: 0.95rem; color: #1a1d2e; }
.card-e-addr { font-size: 0.78rem; color: #6b7280; margin-top: 0.2rem; }
.card-e-meta { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.4rem; }
.card-e-sub { font-size: 0.8rem; color: #6b7280; }
.card-e-arrow { display: flex; align-items: center; flex-shrink: 0; }
.card-e-arrow svg { width: 18px; height: 18px; stroke: #6b7280; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* -- Severity badges (style.css:79-128) -- */
.s-badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; font-weight: 500; padding: 0.25rem 0.6rem; border-radius: 999px; }
.s-critical { background: rgba(185,28,28,0.1);  color: #b91c1c; }
/* Severity classes — aligned to the traffic-light reskin palette
   (high=red, medium=orange, low=green). See `--r-hi/md/lo` above. */
.s-high     { background: rgba(220,38,38,0.10);  color: #dc2626; }
.s-medium   { background: rgba(249,115,22,0.10); color: #c2410c; }
.s-low      { background: rgba(22,163,74,0.10);  color: #15803d; }
.s-dot { width: 6px; height: 6px; border-radius: 50%; }
.s-dot-critical { background: #b91c1c; }
.s-dot-high     { background: #dc2626; }
.s-dot-medium   { background: #f97316; }
.s-dot-low      { background: #16a34a; }
.s-open          { background: rgba(79,110,247,0.1);  color: #4f6ef7; }
.s-client_review { background: rgba(234,179,8,0.12);  color: #a16207; }
.s-closed        { background: rgba(107,114,128,0.1); color: #6b7280; }
.s-disregarded   { background: rgba(107,114,128,.12); color: #4b5563; }
.s-dot-disregarded { background: #9ca3af; }
.s-online     { background: rgba(22,163,74,0.1);   color: #16a34a; }
.s-alert      { background: rgba(224,124,0,0.1);   color: #e07c00; }
.s-ppm        { background: rgba(22,163,74,0.15);  color: #16a34a; }
.s-ok         { background: rgba(22,163,74,0.15);  color: #16a34a; }
.s-inspection { background: rgba(56,189,248,0.15); color: #0ea5e9; }
.s-dot-online { background: #16a34a; }
.s-badge.split-badge { padding: 0; overflow: hidden; gap: 0; }
.s-badge.split-badge .split-left  { padding: 0.25rem 0.6rem; background: transparent; }
.s-badge.split-badge .split-right {
  padding: 0.25rem 0.6rem;
  background: #dc2626; color: #fff; font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.35rem;
  border-left: 1px solid rgba(255,255,255,0.35);
}
.s-badge.split-badge .split-right::before {
  content: ""; display: inline-block;
  width: 5px; height: 5px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.6);
  animation: split-pulse-dot 2s ease-out infinite;
}
@keyframes split-pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.65); }
  70%  { box-shadow: 0 0 0 5px rgba(255,255,255,0);   }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0);     }
}

/* -- Notif badge (style.css:132) -- */
.notif-badge { position: absolute; top: -8px; right: -8px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; padding: 0 5px; box-sizing: border-box; border: 2px solid #fff; }

/* -- Landing (style.css:146-151) -- */
.landing-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.landing-card { background: #fff; border: 2px solid #cbd2e0; border-radius: 20px; padding: 2.5rem; width: 100%; max-width: 420px; }
.landing-logo { height: 36px; margin-bottom: 2rem; }
.landing-title { font-size: 1.3rem; font-weight: 700; color: #1a1d2e; margin-bottom: 0.4rem; }
.landing-sub { font-size: 0.85rem; color: #6b7280; margin-bottom: 2rem; line-height: 1.6; }
.landing-actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }

/* -- Footer (style.css:156-158) -- */
.site-footer { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 2rem; border-top: 1px solid rgba(0,0,0,0.08); font-size: 0.78rem; color: #6b7280; margin-top: 4rem; }
.site-footer a { color: #6b7280; text-decoration: none; transition: color 0.15s; }
.site-footer a:hover { color: #4f6ef7; }

/* -- Shared modal (style.css:183-226) -- */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 100; align-items: center; justify-content: center; padding: 1.5rem; }
.overlay.open { display: flex; }
.modal { background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 24px; width: 90vw; max-width: 1100px; overflow: hidden; max-height: 88vh; display: flex; flex-direction: column; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-hero { padding: 1.75rem 1.75rem 1.25rem; position: relative; border-bottom: 1px solid rgba(0,0,0,0.08); flex-shrink: 0; }
.modal-close { position: absolute; top: 1.25rem; right: 1.25rem; background: #f0f2f8; border: none; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.modal-close svg { width: 16px; height: 16px; stroke: #1a1d2e; fill: none; stroke-width: 2; stroke-linecap: round; }
.modal-site-name { font-size: 1.2rem; font-weight: 700; color: #1a1d2e; padding-right: 2rem; }
.modal-site-addr { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: #6b7280; margin-top: 0.4rem; flex-wrap: wrap; }
.modal-site-addr svg { width: 13px; height: 13px; stroke: #6b7280; fill: none; stroke-width: 2; flex-shrink: 0; }
.modal-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.spec-chip { font-size: 0.75rem; background: #f0f2f8; border-radius: 999px; padding: 0.25rem 0.65rem; color: #4b5563; }
.modal-body { padding: 1.5rem 1.75rem 2rem; overflow-y: auto; }
.modal-body h3 { font-size: 0.85rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.modal-body .card { overflow-x: auto; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.option-btn { display: flex; flex-direction: column; gap: 0.25rem; background: #f4f6fa; border: 1px solid rgba(0,0,0,0.08); border-radius: 14px; padding: 1rem 1.1rem; text-decoration: none; color: inherit; transition: background 0.15s; position: relative; }
.option-btn:hover { background: #e8ecf5; }
.opt-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.4rem; }
.opt-icon svg { width: 17px; height: 17px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-alerts   { background: rgba(224,124,0,0.12); }  .ic-alerts svg   { stroke: #e07c00; }
.ic-tickets  { background: rgba(79,110,247,0.12); }  .ic-tickets svg  { stroke: #4f6ef7; }
.ic-ppm      { background: rgba(22,163,74,0.12); }   .ic-ppm svg      { stroke: #16a34a; }
.ic-services { background: rgba(147,51,234,0.12); }  .ic-services svg { stroke: #9333ea; }
.ic-finance  { background: rgba(22,163,74,0.12); }   .ic-finance svg  { stroke: #16a34a; }
.ic-hs       { background: rgba(224,124,0,0.12); }   .ic-hs svg       { stroke: #e07c00; }
.ic-access   { background: rgba(79,110,247,0.12); }  .ic-access svg   { stroke: #4f6ef7; }
.ic-monitoring { background: rgba(56,189,248,0.12); } .ic-monitoring svg { stroke: #0ea5e9; }
.opt-label { font-size: 0.9rem; font-weight: 600; color: #1a1d2e; }
.opt-desc { font-size: 0.75rem; color: #6b7280; }
.opt-arrow { position: absolute; top: 1rem; right: 1rem; }
.opt-arrow svg { width: 14px; height: 14px; stroke: #6b7280; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.modal-stats .dash-stat { padding: 0.75rem 1rem; border: 1px solid rgba(0,0,0,0.08); border-radius: 14px; background: #fff; }
.modal-stats .dash-stat-val { font-size: 1.1rem; }
.modal-stats .dash-stat-lbl { font-size: 0.72rem; }

/* -- Content cards used inside severity explainer fallback (style.css:436-441) -- */
.card { background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 14px; margin-bottom: 1.25rem; }
.card-padded { padding: 1.5rem; }
.card-title { font-size: 1rem; font-weight: 700; color: #1a1d2e; margin-bottom: 0.5rem; }
.card-body { font-size: 0.9rem; color: #4b5563; line-height: 1.7; }
.analogy-box { background: #f0f2f8; border-radius: 10px; padding: 1rem 1.25rem; margin-top: 1rem; font-size: 0.875rem; color: #4b5563; line-height: 1.6; }
.analogy-box strong { color: #1a1d2e; }

/* -- Score bands / task types / rule rows (style.css:445-478) -- */
.score-band { display: grid; grid-template-columns: 1fr 220px; align-items: center; padding: 0.85rem 1.25rem; border-bottom: 1px solid rgba(0,0,0,0.06); }
.score-band:last-child { border-bottom: none; }
.band-content { min-width: 0; }
.band-title { font-size: 0.9rem; font-weight: 600; color: #1a1d2e; margin-bottom: 0.25rem; }
.band-desc { font-size: 0.85rem; color: #4b5563; line-height: 1.6; }
.band-actions { display: flex; gap: 0.5rem; align-items: center; border-left: 2px solid rgba(0,0,0,0.08); padding-left: 1rem; }
.band-content .band-actions { border-left: none; padding-left: 0; margin-top: 0.75rem; }
.task-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 1rem; }
.task-type { border-radius: 10px; padding: 1rem; text-align: center; }
.task-type.high-t { background: rgba(194,65,12,0.08); }
.task-type.med-t  { background: rgba(161,98,7,0.08); }
.task-type.low-t  { background: rgba(21,128,61,0.08); }
.task-weight { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.2rem; }
.task-type.high-t .task-weight, .task-type.high-t .task-type-label { color: #c2410c; }
.task-type.med-t .task-weight,  .task-type.med-t .task-type-label  { color: #a16207; }
.task-type.low-t .task-weight,  .task-type.low-t .task-type-label  { color: #15803d; }
.task-type-label { font-size: 0.8rem; font-weight: 700; margin-bottom: 0.3rem; }
.task-type-desc  { font-size: 0.78rem; color: #4b5563; line-height: 1.5; }
.rule-row { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0; border-bottom: 1px solid rgba(0,0,0,0.06); font-size: 0.875rem; }
.rule-row:last-child { border-bottom: none; }
.rule-icon { width: 28px; height: 28px; border-radius: 8px; background: #f0f2f8; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.rule-text { color: #4b5563; line-height: 1.6; }
.rule-text strong { color: #1a1d2e; }

/* -- Breadcrumbs (style.css:500-509) -- */
.breadcrumbs { background: #fff; border-bottom: 1px solid #e8e8e8; padding: 0 2rem; }
.breadcrumb-list { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0.65rem 0; font-size: 0.8rem; }
.breadcrumb-item a { color: #6b7280; text-decoration: none; transition: color 0.15s; }
.breadcrumb-item a:hover { color: #111; }
.breadcrumb-item.active { color: #111; font-weight: 500; }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; color: #d1d5db; margin-right: 0.25rem; }
.breadcrumb-hub-link { margin-left:auto; }
.breadcrumb-hub-link::before { content:none !important; }
.breadcrumb-hub-link a { color:#4f6ef7; font-weight:500; text-decoration:none; transition:color .15s; }
.breadcrumb-hub-link a:hover { color:#2563eb; }

/* -- Mobile modal mediaquery (style.css:531-542) -- */
@media (max-width: 600px) {
  .modal-stats { grid-template-columns: repeat(2, 1fr); }
  .modal-body .card { overflow-x: auto; }
  .modal { width: calc(100vw - 2rem); max-width: calc(100vw - 2rem); }
  .overlay { padding: 1rem; }
  .modal-body { padding: 1rem; }
  .modal-hero { padding: 1.25rem 1rem; }
}

/* -- Profile button + avatar (style.css:546-557) -- */
.profile-btn { display:flex; align-items:center; gap:0.6rem; background:#f0f2f8; border:1px solid rgba(0,0,0,0.08); border-radius:999px; padding:0.3rem 0.9rem 0.3rem 0.3rem; cursor:pointer; transition:background 0.15s; }
.profile-btn:hover { background:#e2e6ef; }
.profile-avatar { width:32px; height:32px; border-radius:50%; background:#4f6ef7; display:flex; align-items:center; justify-content:center; font-size:0.72rem; font-weight:700; color:#fff; flex-shrink:0; overflow:hidden; }
.profile-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.profile-name { font-size:0.85rem; font-weight:500; color:#1a1d2e; }
.profile-modal-avatar-wrap { display:flex; flex-direction:column; align-items:center; gap:0.75rem; margin-bottom:1.5rem; }
.profile-modal-avatar { width:80px; height:80px; border-radius:50%; background:#4f6ef7; display:flex; align-items:center; justify-content:center; font-size:1.4rem; font-weight:700; color:#fff; overflow:hidden; flex-shrink:0; position:relative; cursor:pointer; }
.profile-modal-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.profile-modal-avatar-overlay { position:absolute; inset:0; background:rgba(0,0,0,0.4); border-radius:50%; display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity 0.15s; }
.profile-modal-avatar:hover .profile-modal-avatar-overlay { opacity:1; }
.profile-modal-avatar-overlay svg { width:22px; height:22px; stroke:#fff; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.profile-upload-hint { font-size:0.75rem; color:#9ca3af; }

/* -- Notification preferences inside profile modal (style.css:561-582) -- */
.notif-divider { border:none; border-top:1px solid rgba(0,0,0,0.08); margin:0.5rem 0 1rem; }
.notif-toggle-row { display:flex; align-items:center; justify-content:space-between; padding:0.5rem 0; margin-bottom:0.25rem; }
.notif-toggle-row .form-label { margin:0; font-size:0.8rem; display:flex; align-items:center; gap:0.5rem; }
.notif-toggle-row .form-label svg { width:16px; height:16px; stroke:#6b7280; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.toggle-switch { position:relative; width:40px; height:22px; flex-shrink:0; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; inset:0; background:#e2e6ef; border-radius:999px; cursor:pointer; transition:background 0.2s; }
.toggle-slider::before { content:""; position:absolute; left:2px; top:2px; width:18px; height:18px; background:#fff; border-radius:50%; transition:transform 0.2s; box-shadow:0 1px 3px rgba(0,0,0,0.15); }
.toggle-switch input:checked + .toggle-slider { background:#4f6ef7; }
.toggle-switch input:checked + .toggle-slider::before { transform:translateX(18px); }
.notif-settings-toggle { display:flex; align-items:center; gap:0.35rem; background:none; border:none; cursor:pointer; font-family:inherit; font-size:0.75rem; font-weight:500; color:#9ca3af; padding:0.25rem 0; transition:color 0.15s; }
.notif-settings-toggle:hover { color:#6b7280; }
.notif-settings-toggle svg { width:12px; height:12px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transition:transform 0.2s; }
.notif-settings-toggle.open svg { transform:rotate(90deg); }
.notif-settings-panel { max-height:0; overflow:hidden; transition:max-height 0.25s ease-out, opacity 0.2s; opacity:0; }
.notif-settings-panel.open { max-height:500px; opacity:1; transition:max-height 0.35s ease-in, opacity 0.2s; }
.notif-settings-inner { padding:0.75rem 0 0.25rem; }
.notif-sub-label { font-size:0.75rem; font-weight:600; color:#6b7280; text-transform:uppercase; letter-spacing:0.04em; margin-bottom:0.5rem; }
.notif-check-list { display:flex; flex-direction:column; gap:0.4rem; margin-bottom:1rem; }
.notif-check-item { display:flex; align-items:center; gap:0.6rem; font-size:0.82rem; color:#1a1d2e; cursor:pointer; }
.notif-check-item input[type="checkbox"], .notif-check-item input[type="radio"] { accent-color:#4f6ef7; width:15px; height:15px; cursor:pointer; flex-shrink:0; }
.notif-site-list { display:flex; flex-direction:column; gap:0.35rem; padding:0.5rem 0 0.25rem 1.4rem; border-left:2px solid #e2e6ef; margin-left:0.45rem; margin-top:-0.25rem; margin-bottom:0.75rem; }
/* Notification banner — injected by notifications.js:checkPermissionBanner()
   when push permission is missing. Without these size constraints the bell
   SVG inside expands to fill the page. */
.notif-banner { display:flex; align-items:center; gap:0.75rem; background:rgba(79,110,247,0.06); border:1px solid rgba(79,110,247,0.18); border-radius:14px; padding:0.75rem 1.25rem; margin:1rem 2rem 0; cursor:pointer; transition:background 0.15s, border-color 0.15s; }
.notif-banner:hover { background:rgba(79,110,247,0.1); border-color:rgba(79,110,247,0.3); }
.notif-banner svg { width:20px; height:20px; stroke:#4f6ef7; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.notif-banner span { font-size:0.82rem; color:#1a1d2e; line-height:1.4; flex:1; }
.notif-banner-close { background:none; border:none; font-size:1.2rem; color:#9ca3af; cursor:pointer; padding:0 0.25rem; line-height:1; flex-shrink:0; transition:color 0.15s; }
.notif-banner-close:hover { color:#1a1d2e; }
.notif-banner--blocked { background:rgba(224,124,0,0.06); border-color:rgba(224,124,0,0.18); cursor:default; }
.notif-banner--blocked:hover { background:rgba(224,124,0,0.08); border-color:rgba(224,124,0,0.25); }
.notif-banner--blocked svg { stroke:#e07c00; }

/* -- iOS install prompt (style.css:596-606) -- */
.notif-ios-card { background:#f8fafc; border:1px solid #e5e7eb; border-radius:10px; padding:1rem; margin-bottom:.75rem; }
.notif-ios-card-hdr { display:flex; align-items:center; gap:.45rem; font-weight:600; font-size:.88rem; color:#1a1d2e; margin-bottom:.5rem; }
.notif-ios-card-hdr svg { width:17px; height:17px; stroke:#ea580c; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.notif-ios-intro { font-size:.81rem; color:#6b7280; margin-bottom:.6rem; line-height:1.5; }
.notif-ios-steps { margin:0; padding-left:1.15rem; font-size:.81rem; color:#374151; line-height:1.8; }
.notif-share-icon { display:inline-block; vertical-align:middle; width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; margin:0 1px; }
.notif-ios-banner-icon { width:18px; height:18px; flex-shrink:0; stroke:#ea580c; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; margin-top:1px; }
.notif-ios-banner-close { background:none; border:none; font-size:1.2rem; color:#d97706; cursor:pointer; padding:0 0.25rem; line-height:1; flex-shrink:0; }
.notif-ios-banner-close:hover { color:#92400e; }

/* -- Buttons (style.css:368-379) -- */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; font-family: inherit; font-size: 0.85rem; font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px; border: none; cursor: pointer; transition: background 0.15s; }
.btn-primary { background: #4f6ef7; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #3b5be0; }
.btn-primary:disabled { background: #c7d0f9; color: rgba(255,255,255,0.7); cursor: not-allowed; }
.btn-ghost { background: #f0f2f8; color: #6b7280; }
.btn-ghost:hover { background: #e2e6ef; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn-icon { padding: .4rem; }

/* -- Form primitives (style.css:382-399) -- */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-label { font-size: 0.8rem; font-weight: 600; color: #1a1d2e; }
.form-input, .form-select { border: 1.5px solid #e2e6ef; border-radius: 10px; padding: 0.6rem 0.85rem; font-family: inherit; font-size: 0.875rem; color: #1a1d2e; background: #f4f6fa; outline: none; transition: border-color 0.15s; width: 100%; }
.form-input:focus, .form-select:focus { border-color: #4f6ef7; }
.form-textarea { flex: 1; border: 1.5px solid #e2e6ef; border-radius: 10px; padding: 0.6rem 0.85rem; font-family: inherit; font-size: 0.875rem; color: #1a1d2e; background: #f4f6fa; resize: none; outline: none; transition: border-color 0.15s; width: 100%; }
.form-textarea:focus { border-color: #4f6ef7; }
.form-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.5rem; }
.form-error { font-size: .78rem; color: #b91c1c; margin-top: .25rem; }

/* -- Notification bell (style.css:1343-1347) -- */
.notif-bell-btn { position:relative; background:none; border:none; cursor:pointer; padding:6px; border-radius:10px; transition:background .15s; display:flex; align-items:center; justify-content:center; }
.notif-bell-btn:hover { background:rgba(0,0,0,.04); }
.notif-bell-btn svg { width:20px; height:20px; color:#1a1d2e; }
.notif-bell-badge { position:absolute; top:-2px; right:-4px; background:#ef4444; color:#fff; font-size:10px; font-weight:700; min-width:18px; height:18px; border-radius:9px; display:flex; align-items:center; justify-content:center; padding:0 4px; border:2px solid #fff; animation:notif-pulse 2s ease-in-out infinite; }
@keyframes notif-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }

/* -- Notification overlay (style.css:1349-1412) -- */
.notif-overlay-backdrop { position:fixed; inset:0; background:rgba(15,18,36,.55); backdrop-filter:blur(4px); z-index:200; display:flex; align-items:flex-end; justify-content:center; opacity:0; pointer-events:none; transition:opacity .25s ease; }
.notif-overlay-backdrop.open { opacity:1; pointer-events:all; }
.notif-overlay-panel { width:100%; max-width:420px; background:#fff; border-radius:24px 24px 0 0; padding:0 0 32px; transform:translateY(100%); transition:transform .35s cubic-bezier(.32,.72,0,1); max-height:92vh; overflow-y:auto; }
.notif-overlay-backdrop.open .notif-overlay-panel { transform:translateY(0); }
@media (min-width:768px) {
  .notif-overlay-backdrop { align-items:center; }
  .notif-overlay-panel { border-radius:20px; padding:0 0 24px; max-height:80vh; transform:scale(.95); opacity:0; }
  .notif-overlay-backdrop.open .notif-overlay-panel { transform:scale(1); opacity:1; }
}
.notif-overlay-handle { width:36px; height:4px; background:#e4e6ed; border-radius:2px; margin:12px auto 0; }
.notif-overlay-header { display:flex; align-items:center; justify-content:space-between; padding:16px 20px 12px; border-bottom:1px solid #e4e6ed; position:sticky; top:0; background:#fff; z-index:1; }
.notif-overlay-title { font-size:17px; font-weight:700; color:#1a1d2e; display:flex; align-items:center; gap:10px; }
.notif-overlay-total { background:#ef4444; color:#fff; font-size:12px; font-weight:700; padding:2px 8px; border-radius:100px; }
.notif-overlay-close { width:30px; height:30px; border-radius:50%; background:#f0f1f5; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#8a8fa8; font-size:16px; transition:background .15s; }
.notif-overlay-close:hover { background:#e4e6ed; }
.notif-overlay-body { padding:16px 20px 0; }
.notif-overlay-group { margin-bottom:20px; }
.notif-overlay-group-label { font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:#8a8fa8; margin-bottom:8px; padding:0 2px; }
.notif-overlay-divider { height:1px; background:#e4e6ed; margin:4px 0 20px; }
.notif-overlay-item { display:flex; align-items:center; gap:14px; padding:14px 16px; border-radius:14px; border:1px solid #e4e6ed; margin-bottom:8px; cursor:pointer; transition:all .15s ease; background:#fff; }
.notif-overlay-item:hover { border-color:#2563eb; box-shadow:0 2px 12px rgba(37,99,235,.08); transform:translateY(-1px); }
.notif-overlay-item--dimmed { opacity:.45; }
.notif-overlay-item--dimmed:hover { opacity:.6; }
.notif-overlay-item-icon { width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.notif-overlay-item-content { flex:1; min-width:0; }
.notif-overlay-item-name { font-size:14px; font-weight:600; color:#1a1d2e; }
.notif-overlay-item-count { font-size:13px; font-weight:700; min-width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; padding:0 6px; }
.notif-overlay-item-chevron { color:#8a8fa8; font-size:14px; flex-shrink:0; cursor:pointer; user-select:none; }
.notif-overlay-item--accent  .notif-overlay-item-icon  { background:#eff4ff; color:#2563eb; }
.notif-overlay-item--accent  .notif-overlay-item-count { background:#eff4ff; color:#2563eb; }
.notif-overlay-item--purple  .notif-overlay-item-icon  { background:#f3f0ff; color:#7c3aed; }
.notif-overlay-item--purple  .notif-overlay-item-count { background:#f3f0ff; color:#7c3aed; }
.notif-overlay-item--warning .notif-overlay-item-icon  { background:#fef9c3; color:#a16207; }
.notif-overlay-item--warning .notif-overlay-item-count { background:#fef9c3; color:#a16207; }
.notif-overlay-item--orange  .notif-overlay-item-icon  { background:#fff7ed; color:#ea580c; }
.notif-overlay-item--orange  .notif-overlay-item-count { background:#fff7ed; color:#ea580c; }
.notif-overlay-item--danger  .notif-overlay-item-icon  { background:#fee2e2; color:#ef4444; }
.notif-overlay-item--danger  .notif-overlay-item-count { background:#fee2e2; color:#ef4444; }
.notif-overlay-item--teal    .notif-overlay-item-icon  { background:#f0fdfa; color:#0d9488; }
.notif-overlay-item--teal    .notif-overlay-item-count { background:#f0fdfa; color:#0d9488; }
.notif-overlay-mark-all { width:100%; background:none; border:1.5px solid #e4e6ed; border-radius:12px; padding:12px; font-family:inherit; font-size:14px; font-weight:600; color:#8a8fa8; cursor:pointer; margin-top:4px; transition:all .15s; }
.notif-overlay-mark-all:hover { border-color:#2563eb; color:#2563eb; background:#eff4ff; }
.notif-overlay-subitems { padding:0 16px 8px 54px; }
.notif-overlay-subrow { display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:8px; font-size:12px; margin-bottom:2px; background:#f8f9fb; transition:background .15s, box-shadow .15s; }
.notif-overlay-subrow--clickable:hover { background:#eff4ff; box-shadow:inset 0 0 0 1px #2563eb33; }
.notif-overlay-subrow-label { flex:1; color:#4b5563; font-weight:500; }
.notif-overlay-subrow-count { font-weight:700; color:#1a1d2e; min-width:24px; text-align:right; }
.notif-overlay-subrow-mark { background:none; border:1.5px solid #e4e6ed; border-radius:6px; width:26px; height:26px; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:12px; color:#8a8fa8; transition:all .15s; flex-shrink:0; }
.notif-overlay-subrow-mark:hover { border-color:#22c55e; color:#22c55e; background:#f0fdf4; }

/* -- Badge popover (style.css:1414-1420, :1591) -- */
.badge-popover-wrap { animation:badge-pop-in .15s ease; }
@keyframes badge-pop-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.badge-popover { background:#fff; border:1px solid #e4e6ed; border-radius:12px; padding:8px 12px; box-shadow:0 4px 16px rgba(0,0,0,.12); min-width:180px; }
.badge-popover-row { display:flex; align-items:center; gap:8px; padding:4px 0; font-size:12px; }
.badge-popover-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.badge-popover-label { flex:1; color:#4b5563; font-weight:500; }
.badge-popover-count { font-weight:700; color:#1a1d2e; min-width:20px; text-align:right; }


/* =============================== SECTION B =============================== */
/* RESKIN classes — portfolio grid site-cards, clean-paper nav modal,
   severity explainer, facts-first layout, Urgent/Attention/Watch/Healthy
   health-word vocabulary. Scoped to the reskin hotspots with ancestor
   selectors so they don't leak into the legacy modes on the same page.
   ========================================================================= */

/* -- Reskin vocabulary -- */
.portfolio-root {
  --r-ink: #1a1d2e;
  --r-ink-soft: #292524;
  --r-muted: #6b7280;
  --r-muted-2: #9ca3af;
  --r-rule: #e5e7eb;
  --r-canvas: #f7f8fb;
  --r-paper: #ffffff;
  --r-accent: #2563eb;
  /* Severity palette — shared traffic-light with tickets reskin
     (high=red, medium=orange, low=green). See tickets.css `--rs-*`. */
  --r-hi: #dc2626;
  --r-md: #f97316;
  --r-lo: #16a34a;
  --r-purple: #7c3aed;
  --r-teal: #0d9488;
  --r-sky: #0284c7;
  --r-amber: #b45309;
  /* Scope-category swatches are picked at runtime by _sgSwatch(category_id) in
     index.html — deterministic palette-hash, no meaning attached. Kept out of
     CSS so they don't imply that specific categories map to specific colours. */
  --r-shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 2px 6px rgba(15,23,42,0.05);
  --r-shadow-md: 0 4px 12px rgba(15,23,42,0.08), 0 2px 4px rgba(15,23,42,0.04);
  --r-shadow-lg: 0 20px 40px rgba(15,23,42,0.12), 0 8px 16px rgba(15,23,42,0.06);
}

/* -- Portfolio grid container -- */
/* auto-fit (not auto-fill) so the populated cards expand to fill the row when
   there are fewer cards than would otherwise fit. Padding is 0 because the
   parent .portfolio-root already provides the page padding. */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1rem;
  padding: 0;
}
@media (max-width: 780px) {
  .portfolio-grid { grid-template-columns: 1fr; gap: 0.75rem; }
}

/* -- Portfolio site card (scoped to override legacy .site-card) -- */
.portfolio-grid .site-card {
  background: var(--r-paper);
  border: 1px solid var(--r-rule);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  cursor: pointer;
  position: relative;
  display: block;
  gap: 0;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease;
  box-shadow: var(--r-shadow-sm);
}
.portfolio-grid .site-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--r-shadow-md);
  border-color: #cbd5e1;
}
.portfolio-grid .site-card > * { pointer-events: none; }
.portfolio-grid .site-card .sc-notif,
.portfolio-grid .site-card .sev-band { pointer-events: auto; }

/* Card header */
.sc-head { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 0.75rem; margin-bottom: 0.7rem; }
.sc-head-meta { min-width: 0; }
.sc-name { font-weight: 700; font-size: 1.05rem; color: var(--r-ink); line-height: 1.2; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-sub { font-size: 0.72rem; color: var(--r-muted); }

/* Notify badge (top-right) on reskin card.
   Element carries both .sc-notif (reskin styling) and .notif-badge (behaviour
   hook — common.js _showBadgePopover reads data-breakdown from any element
   with the right markup). We neutralise the legacy .notif-badge absolute
   positioning so the badge stays inline in the header grid — the popover
   itself is rendered floating by common.js, so no local popover rules needed. */
.sc-notif {
  position: relative;
  top: auto;
  right: auto;
  background: var(--r-hi);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  padding: 0 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  animation: bubble-pulse 2.2s ease-in-out infinite;
}
@keyframes bubble-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* Stat-block label + stat tiles (facts-first layout) */
.sc-stats-label { font-size: 0.58rem; font-weight: 700; color: var(--r-muted-2); text-transform: uppercase; letter-spacing: 0.08em; margin: 0.2rem 0 0.35rem; }
.sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.sc-stat { background: var(--r-canvas); padding: 0.45rem 0.5rem; border-radius: 9px; text-align: left; border-left: 3px solid transparent; }
.sc-stat-v { font-size: 1.05rem; font-weight: 800; color: var(--r-ink); display: block; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sc-stat-l { font-size: 0.58rem; font-weight: 700; color: var(--r-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sc-stat-hi { border-left-color: var(--r-hi); } .sc-stat-hi .sc-stat-v { color: var(--r-hi); }
.sc-stat-md { border-left-color: var(--r-md); } .sc-stat-md .sc-stat-v { color: var(--r-md); }
.sc-stat-lo { border-left-color: var(--r-lo); } .sc-stat-lo .sc-stat-v { color: var(--r-lo); }

/* Conclusion row (derived health band with large pill) */
.sc-conclusion {
  display: flex; align-items: center; gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0.8rem 0 0.1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--r-rule);
}
.sc-conclusion-text { font-size: 0.72rem; color: var(--r-muted); flex: 1; line-height: 1.35; min-width: 180px; }
.sc-conclusion-arrow { color: var(--r-muted-2); font-weight: 800; font-size: 1rem; }

/* Severity pill — clickable, reskin rules */
.sev-band {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.sev-band:hover { transform: translateY(-1px); }
.sev-band::before {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
}
.sev-band-low      { background: rgba(22,163,74,0.12);  color: #15803d; }
.sev-band-medium   { background: rgba(224,124,0,0.15);  color: #a16207; }
.sev-band-high     { background: rgba(220,38,38,0.12);  color: #b91c1c; }
.sev-band-critical { background: var(--r-hi); color: #fff; box-shadow: 0 4px 12px rgba(220,38,38,0.35); }
.sev-band-critical::before { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }

/* Section labels inside card */
.sc-section-label { font-size: 0.62rem; font-weight: 700; color: var(--r-accent); text-transform: uppercase; letter-spacing: 0.07em; margin: 0.65rem 0 0.3rem; }
.sc-section-label.ppm { color: var(--r-purple); }
.sc-section-label.manual { color: var(--r-accent); }
.sc-section-more { font-size: 0.66rem; font-weight: 600; color: var(--r-muted-2); margin-top: 0.25rem; font-style: italic; }
.sc-section-empty { color: var(--r-muted-2); font-size: 0.75rem; font-style: italic; padding: 0.3rem 0 0.5rem; }

/* Manual ticket row */
.sc-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px dashed var(--r-rule);
  font-size: 0.78rem;
}
.sc-row:last-child { border-bottom: none; }
.sc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sc-dot-hi { background: var(--r-hi); }
.sc-dot-md { background: var(--r-md); }
.sc-dot-lo { background: var(--r-lo); }
.sc-dot-null { background: var(--r-purple); animation: triage-glow 2.2s ease-in-out infinite; }
@keyframes triage-glow { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.sc-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 0.25rem; }

/* Category chip (per-ticket) */
.cat-chip { font-size: 0.58rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.cat-chip-immediate   { background: var(--r-hi); color: #fff; }
.cat-chip-additional  { background: var(--r-md); color: #fff; }
.cat-chip-contracted  { background: var(--r-sky); color: #fff; }
.cat-chip-thirdparty  { background: var(--r-purple); color: #fff; }
.cat-chip-unset       { background: #e5e7eb; color: var(--r-muted); }

/* Age chip */
.age-chip { font-size: 0.66rem; font-weight: 600; color: var(--r-muted); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.age-chip-stale { color: var(--r-hi); font-weight: 700; }

/* PPM group row */
.sc-pg {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.42rem 0.2rem;
  border-bottom: 1px dashed var(--r-rule);
  font-size: 0.78rem;
}
.sc-pg:last-child { border-bottom: none; }
.sc-pg-swatch { width: 4px; height: 28px; border-radius: 2px; align-self: center; }
.sc-pg-name { font-weight: 600; color: var(--r-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.72rem; }
.sc-pg-pips { display: flex; gap: 0.3rem; align-items: center; flex-shrink: 0; }
.sc-pg-pip { font-size: 0.62rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.sc-pg-pip-hi { background: rgba(220,38,38,0.12); color: var(--r-hi); }
.sc-pg-pip-md { background: rgba(224,124,0,0.15); color: #a16207; }
.sc-pg-pip-lo { background: rgba(22,163,74,0.12); color: #15803d; }

/* Unclassified scope group — amber warning treatment */
.sc-pg.unclassified { background: rgba(180, 83, 9, 0.04); }
.sc-pg.unclassified .sc-pg-swatch {
  background: repeating-linear-gradient(135deg, var(--r-amber) 0 3px, transparent 3px 6px);
  background-color: transparent;
  width: 4px;
}
.sc-pg.unclassified .sc-pg-name { color: var(--r-amber); }
.sc-pg-warn { font-size: 0.58rem; font-weight: 800; color: var(--r-amber); background: rgba(180, 83, 9, 0.1); padding: 0.08rem 0.4rem; border-radius: 4px; margin-left: 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; }

/* -- Nav modal (clean-paper — scoped to #nav-modal) -- */
#nav-modal.overlay {
  background: rgba(15,18,36,0.55);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  padding: 2.5rem 1rem;
  overflow-y: auto;
}
#nav-modal .modal {
  border-radius: 18px;
  width: 100%;
  max-width: 720px;
  box-shadow: var(--r-shadow-lg);
  overflow: hidden;
  border: none;
  display: block;
  max-height: none;
}
#nav-modal .modal-hero {
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: none;
  position: relative;
}
#nav-modal .modal-close {
  top: 0.9rem; right: 0.9rem;
  width: 30px; height: 30px;
  background: rgba(15,18,36,0.06);
  color: var(--r-ink);
  border-radius: 50%;
  font-size: 1rem;
  transition: background 0.15s ease;
}
#nav-modal .modal-close:hover { background: rgba(15,18,36,0.12); }
#nav-modal .modal-site-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.7rem;
  line-height: 1.15;
  color: var(--r-ink);
  padding-right: 2.5rem;
  font-weight: 400;
}
#nav-modal .modal-site-addr {
  font-size: 0.82rem;
  color: var(--r-muted);
  margin-top: 0.25rem;
}
#nav-modal .modal-meta-ribbon {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  font-size: 0.7rem;
}
#nav-modal .modal-meta-item {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--r-canvas);
  padding: 0.36rem 0.7rem;
  border-radius: 8px;
  color: var(--r-muted);
}
#nav-modal .modal-meta-item strong { font-weight: 700; margin-right: 0.15rem; color: var(--r-ink); }
#nav-modal .modal-meta-item.sev-badge-chip {
  gap: 0.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.66rem;
  cursor: pointer;
  transition: transform 0.1s ease;
}
#nav-modal .modal-meta-item.sev-badge-chip:hover { transform: translateY(-1px); }
.sev-badge-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.sev-badge-low      { background: rgba(22,163,74,0.12);  color: #15803d; }
.sev-badge-low      .sev-badge-dot { background: #16a34a; }
.sev-badge-medium   { background: rgba(224,124,0,0.15);  color: #a16207; }
.sev-badge-medium   .sev-badge-dot { background: #e07c00; }
.sev-badge-high     { background: rgba(220,38,38,0.12);  color: #b91c1c; }
.sev-badge-high     .sev-badge-dot { background: #dc2626; }
.sev-badge-critical { background: var(--r-hi); color: #fff; }
.sev-badge-critical .sev-badge-dot { background: #fff; }
#nav-modal .modal-divider { border: none; border-top: 1px solid var(--r-rule); margin: 0 1.75rem; }
#nav-modal .modal-body { padding: 1.25rem 1.75rem 1.75rem; overflow-y: visible; }

/* Page-tile grid inside nav modal */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}
.page-tile {
  background: var(--r-paper);
  border: 1.5px solid var(--r-rule);
  border-radius: 12px;
  padding: 1rem 0.9rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease, background 0.15s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.page-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--r-shadow-md);
  border-color: transparent;
}
.page-tile-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.page-tile-icon svg { width: 20px; height: 20px; }
.page-tile-name { font-weight: 700; font-size: 0.95rem; color: var(--r-ink); }
.page-tile-sub { font-size: 0.7rem; color: var(--r-muted); margin-top: 1px; }
.page-tile-arrow { color: var(--r-muted-2); transition: transform 0.15s ease; }
.page-tile:hover .page-tile-arrow { transform: translateX(3px); color: var(--r-ink); }
.pt-tickets .page-tile-icon { background: rgba(26,29,46,0.08);   color: var(--r-ink); }
.pt-ppm     .page-tile-icon { background: rgba(124,58,237,0.12); color: var(--r-purple); }
.pt-finance .page-tile-icon { background: rgba(224,124,0,0.14);  color: var(--r-md); }
.pt-hs      .page-tile-icon { background: rgba(220,38,38,0.12);  color: var(--r-hi); }
.pt-access  .page-tile-icon { background: rgba(100,116,139,0.15); color: #475569; }
.pt-alerts  .page-tile-icon { background: rgba(13,148,136,0.14); color: var(--r-teal); }
.pt-services .page-tile-icon { background: rgba(147,51,234,0.12); color: var(--r-purple); }
.page-tile-pip {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  background: var(--r-hi);
  color: #fff;
  font-size: 0.62rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
}
.page-tile-pip.low { background: var(--r-ink-soft); }

/* -- Severity explainer modal (clean-paper — scoped to #severity-modal) -- */
#severity-modal.overlay {
  background: rgba(15,18,36,0.55);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  padding: 2.5rem 1rem;
  overflow-y: auto;
}
#severity-modal .modal {
  border-radius: 18px;
  width: 100%;
  max-width: 720px;
  box-shadow: var(--r-shadow-lg);
  overflow: hidden;
  border: none;
  display: block;
  max-height: none;
}
#severity-modal .modal-hero {
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: none;
  position: relative;
}
#severity-modal .modal-close {
  top: 0.9rem; right: 0.9rem;
  width: 30px; height: 30px;
  background: rgba(15,18,36,0.06);
  color: var(--r-ink);
  border-radius: 50%;
  font-size: 1rem;
}
#severity-modal .modal-close:hover { background: rgba(15,18,36,0.12); }
#severity-modal .modal-site-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.7rem;
  line-height: 1.15;
  color: var(--r-ink);
  padding-right: 2.5rem;
  font-weight: 400;
}
#severity-modal .modal-site-addr {
  font-size: 0.82rem;
  color: var(--r-muted);
  margin-top: 0.25rem;
}
#severity-modal .modal-divider { border: none; border-top: 1px solid var(--r-rule); margin: 0 1.75rem; }
#severity-modal .modal-body { padding: 1.25rem 1.75rem 1.75rem; overflow-y: visible; }

.sev-explainer-lead { font-size: 0.88rem; color: var(--r-ink); line-height: 1.55; margin: 0 0 0.9rem; }
.sev-explainer-note { background: #fef3c7; border: 1px solid #fde68a; border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.8rem; color: #7c2d12; margin: 0 0 1.1rem; }
.sev-explainer-note strong { color: #451a03; }
.sev-band-table { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem 0.9rem; align-items: center; font-size: 0.8rem; }
.sev-band-table .sev-band-row { display: contents; }
.sev-band-table .sev-band-row > * { padding: 0.45rem 0; border-bottom: 1px dashed var(--r-rule); }
.sev-band-table .sev-band-row:last-child > * { border-bottom: none; }
.sev-band-table .sbt-pill {
  font-size: 0.66rem; font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  justify-self: start;
}
.sev-band-table .sbt-pill.sev-band-low      { background: rgba(22,163,74,0.12); color: #15803d; }
.sev-band-table .sbt-pill.sev-band-medium   { background: rgba(224,124,0,0.15); color: #a16207; }
.sev-band-table .sbt-pill.sev-band-high     { background: rgba(220,38,38,0.12); color: #b91c1c; }
.sev-band-table .sbt-pill.sev-band-critical { background: var(--r-hi); color: #fff; }
.sev-band-table .sbt-desc { color: var(--r-muted); line-height: 1.45; }
.sev-band-table .sbt-score { font-weight: 700; color: var(--r-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* =============================================================================
   RESKIN dashboard hero + stats overrides
   Legacy rules (ported in SECTION A) style these classes as a full-width
   padded block with a 4-col grid of large card tiles. The reskin instead
   wants a bordered paper card with the greeting left and a compact flex row
   of tile pills right-aligned, all inside a 1440px-max container centred on
   the canvas. These overrides are scoped to .portfolio-root so the legacy
   client-selection / portal-hub modes keep using the old rules.
   ========================================================================= */

/* Container: constrain + centre the reskin content */
.portfolio-root {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
}
@media (max-width: 780px) {
  .portfolio-root { padding: 1rem 1rem 2rem; }
}

/* Hero as bordered paper card */
.portfolio-root .dash-hero {
  background: var(--r-paper);
  border: 1px solid var(--r-rule);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  box-shadow: var(--r-shadow-sm);
}
@media (max-width: 780px) {
  .portfolio-root .dash-hero { grid-template-columns: 1fr; gap: 0.75rem; padding: 1rem; }
}

/* Greeting — serif title + optional muted subtitle (injected via <small>) */
.portfolio-root .dash-greeting {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--r-ink);
  margin: 0;
}
.portfolio-root .dash-greeting strong { font-weight: inherit; color: inherit; }
.portfolio-root .dash-greeting small {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--r-muted);
  font-weight: 500;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Stats row — compact flex right-aligned (overrides the legacy 4-col grid) */
.portfolio-root .dash-stats {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  grid-template-columns: none;
  margin-top: 0;
}
@media (max-width: 780px) {
  .portfolio-root .dash-stats { justify-content: flex-start; }
}

/* Stat pill — compact canvas bg, label above value (via flex-direction) */
.portfolio-root .dash-stat {
  background: var(--r-canvas);
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  min-width: 90px;
  text-align: center;
  display: flex;
  flex-direction: column-reverse;  /* flips val/lbl so label sits on top */
}
.portfolio-root .dash-stat-lbl {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--r-muted);
  letter-spacing: 0.05em;
  margin-top: 0;
  line-height: 1.2;
}
.portfolio-root .dash-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--r-ink);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
/* "sites are in good health" hero tile — green value colour */
.portfolio-root .dash-stat.sites-healthy .dash-stat-val { color: #15803d; }
