/* ═══════════════════════════════════════════════════════════════
   ACREDIFY — BASE STYLESHEET
   Shared variables, reset, typography, and utility components
   ═══════════════════════════════════════════════════════════════ */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  /* Brand */
  --blue:        #2563eb;
  --blue-dark:   #1d4ed8;
  --blue-light:  #eff6ff;
  --blue-mid:    #dbeafe;

  /* Neutrals */
  --text:        #0f172a;
  --text-muted:  #64748b;
  --text-light:  #94a3b8;
  --bg:          #f8fafc;
  --bg-white:    #ffffff;
  --border:      #e2e8f0;
  --border-mid:  #cbd5e1;

  /* Status */
  --green:       #16a34a;
  --green-bg:    #f0fdf4;
  --green-border:#86efac;
  --amber:       #d97706;
  --amber-bg:    #fffbeb;
  --amber-border:#fcd34d;
  --red:         #dc2626;
  --red-bg:      #fef2f2;
  --red-border:  #fca5a5;

  /* Shadows */
  --shadow-sm:   0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 1px 3px rgba(0,0,0,.08),0 4px 16px rgba(0,0,0,.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,.10),0 12px 32px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.12),0 24px 64px rgba(0,0,0,.10);

  /* Radius */
  --r-sm: 6px;
  --r:    10px;
  --r-md: 14px;
  --r-lg: 20px;

  /* Typography */
  --font: system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono: 'SF Mono','Fira Code',monospace;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* ── TYPOGRAPHY ── */
h1,h2,h3,h4,h5,h6 { line-height: 1.2; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(28px,5vw,52px); font-weight: 800; }
h2 { font-size: clamp(22px,3.5vw,36px); font-weight: 800; }
h3 { font-size: clamp(17px,2.5vw,22px); font-weight: 700; }
h4 { font-size: 15px; font-weight: 700; }
p  { color: var(--text-muted); line-height: 1.7; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── SHARED NAV (cross-page) ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex; align-items: center;
  transition: box-shadow .3s;
}
.site-nav.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.08); }
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-size: 18px; font-weight: 700; letter-spacing: -.02em;
  flex-shrink: 0;
}
.nav-links {
  display: flex; align-items: center; gap: 4px;
  margin: 0 auto;
}
.nav-link {
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--text-muted); padding: 8px 14px; border-radius: var(--r-sm);
  transition: color .2s, background .2s; text-decoration: none;
  display: inline-block;
}
.nav-link:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.nav-link.active { color: var(--blue); background: var(--blue-light); }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; border: none; cursor: pointer;
  font-family: var(--font); font-weight: 600;
  border-radius: var(--r); transition: all .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--blue); color: #fff;
  padding: 9px 20px; font-size: 14px;
  box-shadow: 0 1px 3px rgba(37,99,235,.25);
}
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 4px 12px rgba(37,99,235,.35); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border); padding: 9px 20px; font-size: 14px;
}
.btn-ghost:hover { border-color: var(--border-mid); background: var(--bg); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--r-md); }
.btn-xl { padding: 15px 36px; font-size: 16px; border-radius: var(--r-md); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.badge-red    { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border); }
.badge-green  { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-amber  { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-blue   { background: var(--blue-light); color: var(--blue); border: 1px solid rgba(37,99,235,.2); }
.badge-gray   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── CARDS ── */
.card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 24px;
  box-shadow: var(--shadow);
}
.card-sm { padding: 16px; border-radius: var(--r); }
.card-hover { transition: transform .2s, box-shadow .2s, border-color .2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-mid); }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--bg-white); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-input::placeholder { color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ── TABLE ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 9px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  background: var(--bg); white-space: nowrap;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg); }

/* ── PROGRESS BAR ── */
.progress-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 3px; transition: width .8s ease; }

/* ── SKELETON ── */
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skel {
  background: linear-gradient(90deg,#e2e8f0 25%,#f1f5f9 50%,#e2e8f0 75%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

/* ── ALERT ── */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--r-sm);
  font-size: 13px; line-height: 1.6; border: 1px solid;
}
.alert-amber { background: var(--amber-bg); border-color: var(--amber-border); color: #92400e; }
.alert-red   { background: var(--red-bg);   border-color: var(--red-border);   color: #991b1b; }
.alert-blue  { background: var(--blue-light);border-color: rgba(37,99,235,.2); color: #1e40af; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); border: none; margin: 24px 0; }

/* ── VISUALLY HIDDEN ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── LIVE PULSE ── */
@keyframes livepulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.4)} }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); animation: livepulse 1.5s ease-in-out infinite;
  display: inline-block; flex-shrink: 0;
}
.live-dot.red   { background: var(--red); }
.live-dot.amber { background: var(--amber); }

/* ── FOOTER ── */
.site-footer-mini {
  border-top: 1px solid var(--border);
  padding: 24px; text-align: center;
  font-size: 12px; color: var(--text-muted); background: var(--bg-white);
}
.site-footer-mini a { color: var(--text-muted); }
.site-footer-mini a:hover { color: var(--blue); text-decoration: none; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hide-mobile { display: none !important; }
}
@media (max-width: 480px) {
  .hide-sm { display: none !important; }
}

/* === APP DASHBOARD STYLES === */
/* ═══════════════════════════════════════════════════════════════
   ACREDIFY — APP DASHBOARD STYLESHEET
   ═══════════════════════════════════════════════════════════════ */

/* ── LAYOUT ── */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 56px 1fr;
  min-height: 100vh;
  background: #f0f4f8;
}

/* ── TOP BAR ── */
.app-topbar {
  grid-column: 1 / -1;
  background: #0d1f3c;
  display: flex; align-items: center;
  padding: 0 20px; gap: 16px;
  height: 56px; position: sticky; top: 0; z-index: 100;
}
.app-topbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.app-brand-name { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.app-brand-tag  { font-size: 10px; color: rgba(255,255,255,.4); font-weight: 500; margin-top: 1px; }

.app-topbar-divider { width: 1px; height: 28px; background: rgba(255,255,255,.1); flex-shrink: 0; }

.app-hospital-identity { flex: 1; min-width: 0; }
.app-hospital-name { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-hospital-loc  { font-size: 11px; color: rgba(255,255,255,.45); }

.app-topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-shrink: 0; }

.app-session-badge {
  display: flex; align-items: center; gap: 6px;
  background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.25);
  border-radius: 20px; padding: 4px 10px;
  font-size: 11px; color: #6ee7b7; font-weight: 600; letter-spacing: .03em;
  white-space: nowrap;
}
.app-session-dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; animation: livepulse 2s ease-in-out infinite; flex-shrink: 0; }

.app-live-clock { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; white-space: nowrap; }

.app-user-chip {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 8px; border-radius: 8px;
  transition: background .2s;
}
.app-user-chip:hover { background: rgba(255,255,255,.08); }
.app-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.app-user-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.app-user-role { font-size: 10.5px; color: rgba(255,255,255,.45); }

.app-logout-btn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6); border-radius: 6px; padding: 5px 10px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all .2s;
}
.app-logout-btn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ── SIDEBAR ── */
.app-sidebar {
  background: #fdfdfe; border-right: 1px solid #eef0f4;
  display: flex; flex-direction: column;
  overflow-y: auto; padding: 16px 0; position: sticky; top: 56px;
  height: calc(100vh - 56px);
}
.app-sidebar-section { margin-bottom: 4px; }
.app-sidebar-label {
  font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #94a3b8; padding: 12px 20px 4px;
}
.app-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: #64748b;
  border-radius: 0; transition: all .15s;
  border: none; background: none; width: 100%; text-align: left;
  font-family: inherit; text-decoration: none;
  position: relative;
}
.app-nav-item:hover { background: #f8fafc; color: #0f172a; text-decoration: none; }
.app-nav-item.active {
  background: #f0f4fd; color: #2563eb; font-weight: 600;
}
.app-nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: #2563eb; border-radius: 0 2px 2px 0;
}
.app-nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.app-nav-badge {
  margin-left: auto; background: #fef2f2; color: #dc2626;
  border-radius: 999px; padding: 1px 7px; font-size: 10px; font-weight: 700;
  border: 1px solid #fca5a5;
}
.app-nav-badge.amber { background: #fffbeb; color: #d97706; border-color: #fcd34d; }
.app-nav-badge.green { background: #f0fdf4; color: #16a34a; border-color: #86efac; }
.app-nav-badge.blue  { background: #eff6ff; color: #2563eb; border-color: rgba(37,99,235,.2); }

.sidebar-bottom {
  margin-top: auto; padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
}
.pilot-cta-mini {
  background: linear-gradient(135deg, #0B1D3A, #1a3a6b);
  border-radius: 10px; padding: 14px;
}
.pilot-cta-mini p { font-size: 12px; color: rgba(255,255,255,.65); line-height: 1.5; margin-bottom: 10px; }
.pilot-cta-mini a {
  display: block; text-align: center; background: #2563eb;
  color: #fff; border-radius: 7px; padding: 8px;
  font-size: 12px; font-weight: 700; text-decoration: none;
  transition: background .2s;
}
.pilot-cta-mini a:hover { background: #1d4ed8; text-decoration: none; }

/* ── MAIN CONTENT ── */
.app-main {
  overflow-y: auto; padding: 0;
  display: flex; flex-direction: column;
}

/* ── MODULE PANELS ── */
.mod-panel { display: none; flex-direction: column; flex: 1; animation: fadein .2s ease; }
.mod-panel.active { display: flex; }
@keyframes fadein { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }

.mod-header {
  background: #fff; border-bottom: 1px solid #eef0f4;
  padding: 20px 28px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.mod-header-left {}
.mod-header-title {
  font-size: 20px; font-weight: 800; color: #0f172a;
  letter-spacing: -.02em; line-height: 1.2;
}
.mod-header-sub { font-size: 13px; color: #64748b; margin-top: 2px; }
.mod-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.mod-body { padding: 28px 32px; flex: 1; }

/* ── STATS ROW ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 16px 18px; box-shadow: none;
}
.stat-card-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; margin-bottom: 8px; }
.stat-card-val   { font-size: 28px; font-weight: 900; color: #0f172a; line-height: 1; margin-bottom: 4px; letter-spacing: -.03em; }
.stat-card-sub   { font-size: 12px; color: #64748b; }
.stat-card.alert  { border-left: 3px solid #ef4444; }
.stat-card.warn   { border-left: 3px solid #d97706; }
.stat-card.good   { border-left: 3px solid #16a34a; }
.stat-card.blue   { border-left: 3px solid #2563eb; }

/* ── SCORE GAUGE ── */
.score-gauge-wrap {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 24px; display: flex; align-items: center; gap: 28px;
  margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  flex-wrap: wrap;
}
.score-gauge {
  width: 80px; height: 80px; border-radius: 50%;
  background: conic-gradient(#2563eb var(--p,0deg), #f1f5f9 var(--p,0deg));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
}
.score-gauge::before {
  content: ''; position: absolute; inset: 9px;
  background: #fdfdfe; border-radius: 50%;
}
.score-gauge-num {
  position: relative; z-index: 1;
  font-size: 20px; font-weight: 800; color: #0f172a;
}
.score-gauge-info { flex: 1; min-width: 200px; }
.score-gauge-title { font-size: 16px; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.score-gauge-desc  { font-size: 13px; color: #64748b; line-height: 1.6; }

/* ── CHAPTER TABLE ── */
.chapter-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.chapter-row {
  background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 8px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
}
.chapter-icon { font-size: 18px; width: 24px; flex-shrink: 0; }
.chapter-name { font-size: 14px; font-weight: 600; color: #0f172a; flex: 1; min-width: 0; }
.chapter-sub  { font-size: 11.5px; color: #94a3b8; margin-top: 1px; }
.chapter-pct  { font-size: 14px; font-weight: 800; width: 42px; text-align: right; flex-shrink: 0; }
.chapter-bar  { width: 120px; flex-shrink: 0; }
.chapter-pct.good  { color: #16a34a; }
.chapter-pct.warn  { color: #d97706; }
.chapter-pct.alert { color: #dc2626; }

/* ── CAPA TABLE ── */
.capa-table-wrap { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; margin-bottom: 24px; }
.capa-table-head {
  padding: 14px 20px; background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
}
.capa-table-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.capa-table-scroll { overflow-x: auto; }

/* ── INCIDENT ROW ── */
.incident-row {
  display: flex; gap: 14px; padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9; align-items: flex-start;
}
.incident-row:last-child { border-bottom: none; }
.incident-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.incident-dot.high   { background: #ef4444; }
.incident-dot.medium { background: #f59e0b; }
.incident-dot.low    { background: #3b82f6; }
.incident-body { flex: 1; min-width: 0; }
.incident-title  { font-size: 14px; font-weight: 600; color: #0f172a; line-height: 1.4; }
.incident-meta   { font-size: 11.5px; color: #94a3b8; margin-top: 3px; }
.incident-status { flex-shrink: 0; }

/* ── BMW CHAIN ── */
.bmw-chain-row {
  display: flex; align-items: center; gap: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 20px; margin-bottom: 20px; overflow-x: auto;
}
.bmw-node {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; min-width: 90px; padding: 0 8px;
}
.bmw-node-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.bmw-node-icon.ok     { background: #f8fafc; }
.bmw-node-icon.warn   { background: #fefce8; }
.bmw-node-icon.alert  { background: #fef2f2; }
.bmw-node-label { font-size: 11px; font-weight: 600; color: #0f172a; text-align: center; line-height: 1.3; }
.bmw-node-status{ font-size: 10px; text-align: center; }
.bmw-arrow { color: #94a3b8; font-size: 18px; flex-shrink: 0; padding: 0 4px; margin-top: -8px; }

/* ── VENDOR TABLE ── */
.vendor-row {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid #f1f5f9;
}
.vendor-row:last-child { border-bottom: none; }
.vendor-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.vendor-name  { font-size: 14px; font-weight: 600; color: #0f172a; }
.vendor-type  { font-size: 11.5px; color: #94a3b8; }
.vendor-expiry{ font-size: 12px; font-weight: 600; margin-left: auto; white-space: nowrap; }
.vendor-expiry.ok    { color: #16a34a; }
.vendor-expiry.warn  { color: #d97706; }
.vendor-expiry.alert { color: #dc2626; }

/* ── FEED PANEL ── */
.feed-clockbar {
  background: #0d1f3c;
  border-radius: 8px; padding: 9px 14px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.feed-clockbar-left { display: flex; align-items: center; gap: 8px; }
.feed-clockbar-label{ font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6ee7b7; }
.feed-clockbar-time { font-size: 13px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.feed-clockbar-right{ font-size: 11px; color: rgba(255,255,255,.4); }

.feed-risk-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.feed-risk-card {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 14px; flex: 1; min-width: 180px;
}
.feed-risk-title { font-size: 12.5px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.feed-risk-desc  { font-size: 11.5px; color: #64748b; line-height: 1.5; }

.feed-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.feed-filter-btn {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 20px;
  padding: 5px 14px; font-size: 12.5px; font-weight: 500; color: #64748b;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.feed-filter-btn:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.feed-filter-btn.active { background: #eff6ff; color: #2563eb; border-color: rgba(37,99,235,.3); font-weight: 600; }

/* ── EXEC DASHBOARD ── */
.exec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.exec-card { background: #fff; border: 1px solid #eef0f4; border-radius: 12px; padding: 20px; }
.exec-card-title { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.exec-metric-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.exec-metric-val { font-size: 32px; font-weight: 900; color: #0f172a; letter-spacing: -.04em; line-height: 1; }
.exec-metric-unit{ font-size: 14px; color: #94a3b8; font-weight: 500; }
.exec-metric-trend{ font-size: 12px; font-weight: 600; }
.exec-metric-trend.up   { color: #16a34a; }
.exec-metric-trend.down { color: #dc2626; }
.exec-divider { height: 1px; background: #f1f5f9; margin: 12px 0; }

/* ── TRAINING ── */
.training-dept-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid #f1f5f9;
}
.training-dept-row:last-child { border-bottom: none; }
.training-dept-name { font-size: 13.5px; font-weight: 600; color: #0f172a; min-width: 140px; flex-shrink: 0; }
.training-dept-pct  { font-size: 13px; font-weight: 700; width: 40px; text-align: right; flex-shrink: 0; }
.training-dept-bar  { flex: 1; }
.training-dept-overdue{ font-size: 11.5px; color: #dc2626; font-weight: 600; width: 80px; text-align: right; flex-shrink: 0; }

/* ── UTILITY MONITOR ── */
.utility-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.utility-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px;
  text-align: center;
}
.utility-icon  { font-size: 28px; margin-bottom: 10px; }
.utility-val   { font-size: 26px; font-weight: 900; color: #0f172a; letter-spacing: -.03em; line-height: 1; margin-bottom: 4px; }
.utility-unit  { font-size: 11px; color: #94a3b8; font-weight: 600; margin-bottom: 6px; }
.utility-trend { font-size: 12px; font-weight: 600; }
.utility-trend.good { color: #16a34a; }
.utility-trend.bad  { color: #dc2626; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 200px 1fr; }
  .exec-grid  { grid-template-columns: 1fr; }
  .utility-grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: 56px auto 1fr; }
  .app-sidebar {
    grid-column: 1; position: static; height: auto;
    display: flex; flex-direction: row; flex-wrap: wrap;
    padding: 8px; gap: 4px; border-right: none; border-bottom: 1px solid #e2e8f0;
    overflow-x: auto; overflow-y: visible;
  }
  .app-sidebar-section { margin-bottom: 0; }
  .app-sidebar-label   { display: none; }
  .app-nav-item { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
  .app-nav-item.active::before { display: none; }
  .sidebar-bottom { display: none; }
  .mod-body { padding: 16px; }
  .mod-header { padding: 14px 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .bmw-chain-row { padding: 14px; }
  .app-session-badge { display: none; }
  .app-live-clock { display: none; }
  .utility-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .app-topbar { padding: 0 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   ROLE DEMO SYSTEM
   ═══════════════════════════════════════════════════════════════ */

/* ── Role overlay + modal ── */
.role-overlay {
  position: fixed; inset: 0; background: rgba(11,29,58,.6);
  backdrop-filter: blur(4px); z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.role-overlay.open { opacity: 1; pointer-events: all; }
.role-modal {
  background: #fff; border-radius: 20px; padding: 36px; max-width: 580px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  transform: translateY(10px); transition: transform .22s;
}
.role-overlay.open .role-modal { transform: translateY(0); }
.role-modal-title { font-size: 20px; font-weight: 800; color: #0f172a; margin-bottom: 6px; letter-spacing: -.02em; }
.role-modal-sub   { font-size: 13.5px; color: #64748b; line-height: 1.6; margin-bottom: 24px; }
.role-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px;
}
.role-card {
  border: 2px solid #e2e8f0; border-radius: 12px; padding: 14px 16px;
  cursor: pointer; transition: all .15s; text-align: left;
  background: none; font-family: var(--font); width: 100%;
}
.role-card:hover   { border-color: #2563eb; background: #eff6ff; }
.role-card.selected{ border-color: #2563eb; background: #eff6ff; }
.role-card-icon  { font-size: 22px; margin-bottom: 7px; }
.role-card-title { font-size: 13.5px; font-weight: 700; color: #0f172a; margin-bottom: 3px; }
.role-card-desc  { font-size: 11.5px; color: #64748b; line-height: 1.45; }
.role-email-row  { display: flex; gap: 10px; margin-bottom: 14px; }
.role-email-input {
  flex: 1; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px;
  font-family: var(--font); font-size: 14px; color: #0f172a; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.role-email-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.role-email-input::placeholder { color: #94a3b8; }
.role-submit-btn {
  background: #2563eb; color: #fff; border: none; border-radius: 8px;
  padding: 10px 22px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: var(--font); white-space: nowrap; transition: background .2s;
}
.role-submit-btn:hover    { background: #1d4ed8; }
.role-submit-btn:disabled { opacity: .55; cursor: not-allowed; }
.role-modal-fine { font-size: 11.5px; color: #94a3b8; text-align: center; line-height: 1.6; }

/* ── "View by Role" topbar button — GLOW CTA ── */
.view-role-btn {
  display: flex; align-items: center; gap: 7px;
  background: #00D4B6;
  border: none;
  border-radius: 20px; padding: 7px 16px;
  font-size: 12px; font-weight: 800; color: #07101f;
  cursor: pointer; font-family: var(--font);
  transition: background .2s, transform .15s, box-shadow .2s;
  white-space: nowrap; flex-shrink: 0;
  position: relative;
  animation: role-glow-pulse 2.2s ease-in-out infinite;
  letter-spacing: .01em;
}
.view-role-btn::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 23px;
  background: transparent;
  border: 2px solid rgba(0,212,182,.45);
  animation: role-ring-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes role-glow-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,212,182,.55), 0 4px 14px rgba(0,212,182,.35); }
  50%      { box-shadow: 0 0 0 8px rgba(0,212,182,0), 0 4px 22px rgba(0,212,182,.55); }
}
@keyframes role-ring-pulse {
  0%,100% { transform: scale(1); opacity: .7; }
  50%      { transform: scale(1.1); opacity: 0; }
}
.view-role-btn:hover {
  background: #00f0ce;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,212,182,.55) !important;
  animation: none;
}
.view-role-btn:hover::before { opacity: 0; animation: none; }

/* ── Active role badge ── */
.role-active-badge {
  display: none; align-items: center; gap: 6px;
  background: rgba(37,99,235,.25); border: 1px solid rgba(37,99,235,.4);
  border-radius: 20px; padding: 5px 14px;
  font-size: 11.5px; font-weight: 700; color: #93c5fd;
  cursor: pointer; font-family: var(--font); transition: all .15s; flex-shrink: 0;
}
.role-active-badge:hover { background: rgba(37,99,235,.35); }

/* ── Role panels ── */
.role-panel { display: none; flex-direction: column; flex: 1; animation: fadein .2s ease; }
.role-panel.active { display: flex; }

/* ── Role panel header label ── */
.role-panel-label {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eff6ff; border: 1px solid rgba(37,99,235,.2);
  border-radius: 20px; padding: 3px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: #2563eb;
}

/* ── Financial exposure cards ── */
.exposure-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 20px; border-top: 3px solid #ef4444;
}
.exposure-card.amber { border-top-color: #d97706; }
.exposure-card.blue  { border-top-color: #2563eb; }
.exposure-card.green { border-top-color: #16a34a; }
.exposure-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; margin-bottom: 8px; }
.exposure-val   { font-size: 28px; font-weight: 900; color: #0f172a; letter-spacing: -.03em; line-height: 1; margin-bottom: 4px; }
.exposure-sub   { font-size: 12px; color: #64748b; line-height: 1.5; }

/* ── Department accountability heatmap ── */
.dept-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid #f1f5f9;
}
.dept-row:last-child { border-bottom: none; }
.dept-name { font-size: 13.5px; font-weight: 600; color: #0f172a; min-width: 160px; flex-shrink: 0; }
.dept-owner{ font-size: 11.5px; color: #94a3b8; min-width: 120px; flex-shrink: 0; }
.dept-bar  { flex: 1; }
.dept-risk { font-size: 12px; font-weight: 700; width: 60px; text-align: right; flex-shrink: 0; }

/* ── Evidence completeness table ── */
.evidence-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.evidence-row:last-child { border-bottom: none; }
.evidence-chapter { font-size: 13px; font-weight: 600; color: #0f172a; flex: 1; min-width: 0; }
.evidence-count   { font-size: 12px; color: #64748b; width: 80px; text-align: right; flex-shrink: 0; }
.evidence-status  { width: 90px; text-align: right; flex-shrink: 0; }

@media (max-width: 768px) {
  .role-cards { grid-template-columns: 1fr; }
  .role-modal { padding: 24px 20px; }
  .view-role-btn { display: none; }
  .dept-owner { display: none; }
}
