/* ==================== DESIGN SYSTEM TOKENS ==================== */
:root {
  /* Common Banking Tokens */
  --nbe-green: #006747;
  --nbe-green-light: #00845c;
  --nbe-green-soft: #ecfdf5;
  --nbe-gold: #c59b27;
  --nbe-gold-dark: #9a7618;
  --nbe-gold-light: #dfb746;
  --nbe-gold-soft: #fefce8;

  /* Ratings */
  --r-low: #10b981;
  --r-med: #f59e0b;
  --r-high: #f97316;
  --r-vhigh: #ef4444;
  --r-crit: #991b1b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== LIGHT THEME (DEFAULT) ==================== */
:root,
[data-theme="light"] {
  --theme-mode: "light";
  --bg-page: #f4f7fb;
  --bg-banner: linear-gradient(135deg, #07162c 0%, #0d2242 55%, #004d35 100%);
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-hover: #f1f5f9;
  --surface-card: #ffffff;

  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --line-subtle: #f1f5f9;

  --text-main: #07162c;
  --text-body: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --table-head-bg: #102a43;
  --table-calc-th: #07382d;
  --table-ai-th: #423018;
  --table-sticky-bg: #f8fafc;

  --source-cell: #ffffff;
  --calc-cell: #f8fafc;
  --ai-cell: #fffbeb;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 40px -4px rgba(15, 23, 42, 0.12), 0 6px 16px -2px rgba(15, 23, 42, 0.06);
  --modal-overlay: rgba(7, 22, 44, 0.55);
}

/* ==================== DARK THEME ==================== */
[data-theme="dark"] {
  --theme-mode: "dark";
  --bg-page: #060e1a;
  --bg-banner: linear-gradient(135deg, #050d18 0%, #0a192f 55%, #013625 100%);
  --surface: #0c182b;
  --surface-alt: #102138;
  --surface-hover: #162c4b;
  --surface-card: #0c182b;

  --line: #1c3252;
  --line-strong: #2a466e;
  --line-subtle: #13243d;

  --text-main: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --table-head-bg: #091524;
  --table-calc-th: #04241d;
  --table-ai-th: #2c2010;
  --table-sticky-bg: #0c182b;

  --source-cell: #0c182b;
  --calc-cell: #0f1f36;
  --ai-cell: #1a1b14;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 45px -4px rgba(0, 0, 0, 0.65);
  --modal-overlay: rgba(2, 6, 12, 0.75);
}

/* ==================== BASE STYLES ==================== */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Direction-specific typography */
[dir="rtl"] {
  font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  direction: rtl;
}

[dir="ltr"] {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  direction: ltr;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== APPLICATION MASTER LAYOUT ==================== */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-page);
  position: relative;
}

.app-main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ==================== 1. INSTITUTIONAL BANKING SIDEBAR DRAWER ==================== */
.app-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: 320px;
  max-width: 85vw;
  background: linear-gradient(180deg, #07162c 0%, #0d2242 60%, #004d35 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-inline-end: 2px solid var(--nbe-gold);
  z-index: 120;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-base);
  transform: translateX(105%);
}

html[dir="ltr"] .app-sidebar {
  transform: translateX(-105%);
}

.app-sidebar.show {
  transform: translateX(0) !important;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 22, 44, 0.65);
  z-index: 115;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.sidebar-brand .brand-crest {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
}

.sidebar-logo {
  height: 38px;
  max-width: 165px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.sidebar-title {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.sidebar-sub {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 3px;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: 0;
  color: #cbd5e1;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  margin-inline-start: auto;
}

.sidebar-close-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-reg-badge {
  margin: 12px 14px 6px;
  padding: 6px 12px;
  background: rgba(0, 103, 71, 0.25);
  border: 1px solid rgba(0, 103, 71, 0.45);
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 7px;
}

.pulse-emerald {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
}

/* Sidebar Nav */
.sidebar-nav {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.nav-section-title {
  font-size: 9px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 8px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: start;
  text-decoration: none;
  position: relative;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

html[dir="rtl"] .sidebar-link:hover {
  transform: translateX(-2px);
}

html[dir="ltr"] .sidebar-link:hover {
  transform: translateX(2px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, var(--nbe-green), #007f57);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 3px 12px rgba(0, 103, 71, 0.45);
}

.nav-count {
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 7px;
  border-radius: 10px;
  margin-inline-start: auto;
}

.nav-badge-ai {
  font-size: 8.5px;
  font-weight: 900;
  background: linear-gradient(90deg, #d97706, #f59e0b);
  color: #07162c;
  padding: 2px 6px;
  border-radius: 4px;
  margin-inline-start: auto;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

.sidebar-auth-row {
  display: flex;
  gap: 8px;
}

.sidebar-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-auth-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-auth-btn.primary {
  background: var(--nbe-green);
  border-color: var(--nbe-green);
  color: #fff;
}

/* ==================== MASTER EXECUTIVE BANKING HEADER & NAVBAR ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: linear-gradient(135deg, #07162c 0%, #0d2242 50%, #004d35 100%);
  border-bottom: 2px solid var(--nbe-gold);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

/* Tier 1: Command & Telemetry Row */
.header-command-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 16px;
}

.command-start {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--nbe-gold);
  color: var(--nbe-gold);
}

.hamburger-btn svg {
  width: 18px;
  height: 18px;
}

.header-brand-crest {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo {
  height: 36px;
  max-width: 145px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-platform-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.2px;
}

.header-reg-seal {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 103, 71, 0.3);
  border: 1px solid rgba(0, 103, 71, 0.55);
  border-radius: var(--radius-full);
  font-size: 9.5px;
  font-weight: 800;
  color: #34d399;
}

.command-end {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tier 2: Institutional Utility & Telemetry Bar */
.header-nav-bar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 24px !important;
  background: rgba(0, 0, 0, 0.28) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  min-height: 44px !important;
  height: 44px !important;
  max-height: 44px !important;
  gap: 16px !important;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
}

.header-sub-start {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.header-sub-divider {
  width: 1px !important;
  height: 18px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  flex-shrink: 0 !important;
}

.header-sub-end {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.header-breadcrumbs {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.header-breadcrumbs .crumb-current {
  color: var(--nbe-gold-light) !important;
  font-weight: 900 !important;
}

.topbar-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--text-body);
  border-radius: var(--radius-sm);
  padding: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--nbe-green);
  border-color: var(--nbe-green);
  background: rgba(0, 103, 71, 0.05);
}

.btn-icon svg {
  width: 13px;
  height: 13px;
}

/* Vector SVGs */
.nav-svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
  flex-shrink: 0;
}

.theme-svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.btn-svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
  flex-shrink: 0;
}

.clock-svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
  flex-shrink: 0;
}

/* Institutional Live Clock Pill */
.header-clock-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  padding: 5px 12px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #ffd54f !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 7px !important;
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
  transition: all var(--transition-fast) !important;
}

.header-clock-pill:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 213, 79, 0.45) !important;
}

.header-clock-pill .clock-svg {
  color: var(--nbe-gold) !important;
}

/* Theme Switcher */
.theme-switch-group {
  display: flex !important;
  flex-direction: row !important;
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: var(--radius-sm) !important;
  padding: 3px !important;
  gap: 2px !important;
  flex-shrink: 0 !important;
}

.theme-btn {
  background: transparent !important;
  border: 0 !important;
  color: #94a3b8 !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 11px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all var(--transition-fast) !important;
}

.theme-btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

.theme-btn.active {
  background: var(--nbe-green) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 6px rgba(0, 103, 71, 0.45) !important;
}

/* Language Switcher */
.btn-lang {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  padding: 5px 12px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  transition: all var(--transition-fast) !important;
}

.btn-lang:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: var(--nbe-gold) !important;
  color: #ffd54f !important;
  transform: translateY(-1px) !important;
}

/* User Profile Badge */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 10px 4px 5px;
  border-radius: 30px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nbe-gold), #dfb746);
  color: #07162c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
}

.user-role {
  font-size: 8.5px;
  color: #94a3b8;
}

/* Header Divider */
.header-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

/* Header Auth Container */
.header-auth-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header User Profile Pill (Logged-in State) */
.header-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 4px 6px 4px 12px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
}

html[dir="rtl"] .header-user-pill {
  padding: 4px 12px 4px 6px;
}

.header-user-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--nbe-gold);
}

.header-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nbe-gold), #dfb746);
  color: #07162c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.header-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: start;
}

.header-user-name {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

.header-user-role {
  font-size: 9px;
  font-weight: 700;
  color: var(--nbe-gold-light);
  white-space: nowrap;
}

/* Header Logout Button */
.header-auth-btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-inline-start: 4px;
}

.header-auth-btn-logout svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.header-auth-btn-logout:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

/* Header Login Button (Guest State) */
.header-auth-btn-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--nbe-gold);
  background: linear-gradient(135deg, var(--nbe-green), #007a52);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 10px rgba(0, 103, 71, 0.35);
}

.header-auth-btn-login svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.header-auth-btn-login:hover {
  background: linear-gradient(135deg, #007a52, var(--nbe-green));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 103, 71, 0.5);
  border-color: #fff;
}

/* ==================== ENTERPRISE BANKING LOGIN MODAL ==================== */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 10, 20, 0.78);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease-out;
}

.login-modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface-card);
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--nbe-gold);
  border-radius: 18px;
  box-shadow: var(--shadow-lg), 0 0 50px rgba(0, 103, 71, 0.15);
  padding: 30px;
  position: relative;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px) scale(0.97);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.login-modal-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.login-modal-close:hover {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--line-strong);
}

.login-modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.login-brand-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.login-modal-logo {
  height: 42px;
  max-width: 160px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.login-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.login-modal-sub {
  margin: 5px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Alert Box */
.login-alert-box {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 16px;
  text-align: start;
}

[data-theme="dark"] .login-alert-box {
  background: rgba(127, 29, 29, 0.3);
  border-color: #991b1b;
  color: #fca5a5;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: start;
}

.login-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
}

.login-label .en-hint {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-input-icon {
  position: absolute;
  inset-inline-start: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  stroke-width: 2;
}

.login-input {
  width: 100%;
  height: 42px;
  padding: 0 38px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.login-input:focus {
  outline: none;
  border-color: var(--nbe-green);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(0, 103, 71, 0.18);
}

.login-pw-toggle {
  position: absolute;
  inset-inline-end: 10px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.login-pw-toggle:hover {
  color: var(--text-main);
}

.login-pw-toggle svg {
  width: 16px;
  height: 16px;
}

.login-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn-login-submit {
  flex: 1;
  height: 42px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--nbe-green), #007a52);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: 0 3px 12px rgba(0, 103, 71, 0.35);
}

.btn-login-submit svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #007a52, var(--nbe-green));
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(0, 103, 71, 0.45);
}

.btn-login-cancel {
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-alt);
  color: var(--text-body);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-login-cancel:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

/* Quick Demo Accounts Grid */
.login-demo-section {
  border-top: 1px solid var(--line-subtle);
  margin-top: 20px;
  padding-top: 16px;
}

.login-demo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.demo-line {
  flex: 1;
  height: 1px;
  background: var(--line-subtle);
}

.demo-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
}

.quick-login-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-login-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: start;
  transition: all var(--transition-fast);
}

.quick-login-card.full-width {
  grid-column: 1 / -1;
}

.quick-login-card:hover {
  background: var(--surface-hover);
  border-color: var(--nbe-gold);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.demo-badge-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.demo-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.demo-role {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-main);
}

.demo-user {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: monospace;
}

/* Permission Restricted Notice Banner */
.perm-restricted-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #b45309;
  margin-bottom: 16px;
}

[data-theme="dark"] .perm-restricted-banner {
  background: rgba(120, 53, 15, 0.25);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.perm-restricted-banner .banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.perm-restricted-banner .banner-text {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.6;
}

/* Read-only chip in matrix */
.matrix-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(0, 103, 71, 0.12);
  border: 1px solid rgba(0, 103, 71, 0.25);
  color: var(--nbe-green);
}

.matrix-mode-chip.read-only {
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.25);
  color: #64748b;
}

[data-theme="dark"] .matrix-mode-chip.read-only {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Central Database Status Chip */
.db-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #059669;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
}

[data-theme="dark"] .db-badge {
  color: #34d399;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

/* Buttons */
.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 10.5px;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--nbe-gold), var(--nbe-gold-light));
  color: #07162c;
  box-shadow: 0 3px 10px rgba(197, 155, 39, 0.3);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn.outline {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-body);
}

.btn.outline:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.btn.success {
  background: linear-gradient(135deg, var(--nbe-green), var(--nbe-green-light));
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 103, 71, 0.3);
}

/* Shell */
.shell {
  max-width: 1880px;
  margin: 0 auto;
  padding: 20px 28px;
  width: 100%;
  flex: 1;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== EXECUTIVE DASHBOARD VIEW ==================== */
.dash-header-banner {
  background: var(--bg-banner);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  color: #fff;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.dash-header-banner h1 {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
}

.dash-header-banner p {
  margin: 0;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.6;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 4px;
  height: 100%;
  background: var(--nbe-green);
}

.metric-card.gold::before {
  background: var(--nbe-gold);
}

.metric-card.navy::before {
  background: #2457a7;
}

.metric-card.red::before {
  background: var(--r-high);
}

.metric-card span {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.metric-card b {
  display: block;
  font-size: 22px;
  color: var(--text-main);
  margin-top: 8px;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.metric-card small {
  display: block;
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.dash-sections {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dash-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.dash-card-title {
  font-size: 13.5px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

/* 5x5 Severity Heatmap */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  background: var(--surface-alt);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.heatmap-cell {
  padding: 12px 6px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.heatmap-cell:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.hm-green {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.hm-yellow {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.hm-orange {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.hm-red {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

[data-theme="dark"] .hm-green {
  background: #064e3b;
  color: #a7f3d0;
  border-color: #047857;
}

[data-theme="dark"] .hm-yellow {
  background: #78350f;
  color: #fde68a;
  border-color: #b45309;
}

[data-theme="dark"] .hm-orange {
  background: #7c2d12;
  color: #fed7aa;
  border-color: #c2410c;
}

[data-theme="dark"] .hm-red {
  background: #7f1d1d;
  color: #fecaca;
  border-color: #b91c1c;
}

/* BU Bars */
.bu-bar-item {
  margin-bottom: 12px;
}

.bu-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 5px;
}

.bu-bar-track {
  height: 9px;
  background: var(--surface-hover);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
}

.bu-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== RCSA MATRIX & FILTERS ==================== */
.context-card,
.table-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.context-card {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.title-block span {
  font-size: 10px;
  font-weight: 900;
  color: var(--nbe-gold-dark);
  letter-spacing: 0.3px;
}

.title-block h1 {
  margin: 4px 0;
  font-size: 22px;
  color: var(--text-main);
  font-weight: 900;
}

.title-block p {
  margin: 0;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.filters {
  display: grid;
  grid-template-columns: 280px minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.field {
  display: grid;
  gap: 5px;
}

.field>span {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 800;
}

.field select,
.field input,
.field textarea {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 12px;
  outline: 0;
  color: var(--text-body);
  transition: all var(--transition-fast);
  font-size: 11px;
  font-weight: 600;
}

.field select:focus,
.field input:focus,
.field textarea:focus {
  border-color: var(--nbe-green);
  box-shadow: 0 0 0 3px rgba(0, 103, 71, 0.15);
}

.filter-pills {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  margin-top: 6px;
}

.pill {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--text-body);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill:hover {
  background: var(--surface-hover);
}

.pill.active {
  background: #102a43;
  color: #fff;
  border-color: #102a43;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.25);
}

[data-theme="dark"] .pill.active {
  background: var(--nbe-green);
  border-color: var(--nbe-green);
}

.summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 14px;
  gap: 10px;
}

.summary div {
  background: var(--surface-alt);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 9px 12px;
}

.summary span {
  display: block;
  font-size: 8.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.summary b {
  display: block;
  font-size: 12px;
  margin-top: 3px;
  color: var(--text-main);
  font-weight: 900;
}

.strategic-objective-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: stretch;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.strategic-objective-title {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  font-weight: 900;
  font-size: 11px;
  background: #f0fdf4;
  color: #166534;
  border-inline-end: 1px solid var(--line);
}

[data-theme="dark"] .strategic-objective-title {
  background: #04241d;
  color: #34d399;
}

.strategic-objective-text {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-body);
}

/* ==================== DATA TABLES ==================== */
.table-card {
  overflow: hidden;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.table-head b {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 900;
}

.table-head small {
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.legend {
  font-size: 9px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 700;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-inline-end: 4px;
}

.dot.source {
  background: #94a3b8;
}

.dot.calc {
  background: #10b981;
}

.dot.ai {
  background: #f59e0b;
}

.table-wrap {
  overflow: auto;
  max-height: 72vh;
  scrollbar-color: var(--line-strong) var(--surface-alt);
}

table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 3200px;
  width: max-content;
  font-size: 10px;
}

th,
td {
  border-inline-end: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 11px;
  vertical-align: top;
  line-height: 1.6;
  min-width: 120px;
  max-width: 250px;
  white-space: normal;
}

th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--table-head-bg);
  color: #fff;
  text-align: center;
  font-size: 9.5px;
  min-height: 50px;
  font-weight: 800;
}

th.calc {
  background: var(--table-calc-th);
}

th.ai {
  background: var(--table-ai-th);
}

th small {
  display: block;
  font-size: 7.5px;
  font-weight: 400;
  color: #94a3b8;
  margin-top: 2px;
}

.wide {
  min-width: 280px !important;
  max-width: 390px !important;
}

td.source {
  background: var(--source-cell);
  color: var(--text-body);
}

td.calc {
  background: var(--calc-cell);
  color: var(--text-body);
}

td.ai {
  background: var(--ai-cell);
  color: var(--text-body);
}

tbody tr:hover td {
  background: var(--surface-hover) !important;
  cursor: pointer;
}

/* Sticky First Column for RTL and LTR */
[dir="rtl"] td:first-child,
[dir="rtl"] th:first-child {
  position: sticky;
  right: 0;
  left: auto;
  z-index: 3;
}

[dir="rtl"] th:first-child {
  z-index: 6;
}

[dir="ltr"] td:first-child,
[dir="ltr"] th:first-child {
  position: sticky;
  left: 0;
  right: auto;
  z-index: 3;
}

[dir="ltr"] th:first-child {
  z-index: 6;
}

td:first-child {
  background: var(--table-sticky-bg);
  font-weight: 900;
  color: var(--text-main);
}

#rcsaHead .group-header th {
  top: 0;
  z-index: 7;
  vertical-align: middle;
}

#rcsaHead .sub-header th {
  top: 38px;
  z-index: 6;
}

#rcsaHead th[rowspan="2"] {
  top: 0;
  z-index: 8;
  vertical-align: middle;
}

#rcsaHead .group-title {
  font-size: 10px;
  font-weight: 900;
  min-height: 38px;
  padding: 9px;
}

#rcsaHead .group-title.inherent-group {
  background: var(--table-calc-th);
}

#rcsaHead .group-title.controls-group {
  background: var(--table-head-bg);
}

#rcsaHead .group-title.nfi-group {
  background: var(--table-ai-th);
}

#rcsaBody tr.risk-start>td {
  border-top: 2px solid var(--line-strong);
}

#rcsaBody tr.risk-continuation>td.control-detail-cell {
  border-top: 1px dashed var(--line);
}

#rcsaBody tr.risk-continuation>td.control-detail-cell:nth-child(even) {
  background: var(--surface-alt);
}

#rcsaBody td.control-detail-cell {
  vertical-align: top;
  padding: 8px 9px;
}

#rcsaBody .control-entry {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 240px;
}

#rcsaBody .control-entry b {
  display: block;
  line-height: 1.6;
  font-weight: 800;
  font-size: 10px;
  color: var(--text-main);
}

#rcsaBody .control-entry small {
  display: block;
  font-size: 8.5px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 2px;
}

#rcsaBody .control-number {
  flex: 0 0 auto;
  background: rgba(36, 87, 167, 0.12);
  color: #2457a7;
  border: 1px solid rgba(36, 87, 167, 0.3);
  border-radius: 6px;
  min-width: 20px;
  text-align: center;
  padding: 1px 4px;
  font-weight: 900;
}

#rcsaBody td.risk-spanning-cell {
  vertical-align: top;
}

/* Ratings & Badges */
.rating,
.esg,
.pending {
  display: inline-block;
  border-radius: 12px;
  padding: 3px 8px;
  font-weight: 800;
  font-size: 9px;
  white-space: nowrap;
  margin: 1px;
}

.r-Low {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.r-Medium {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.r-High {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.r-Very-High {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.r-Critical {
  background: #fce7f3;
  color: #831843;
  border: 1px solid #fbcfe8;
}

.r-Pending-Bank-Review,
.pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.esg {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

[data-theme="dark"] .r-Low {
  background: #064e3b;
  color: #a7f3d0;
  border-color: #047857;
}

[data-theme="dark"] .r-Medium {
  background: #78350f;
  color: #fde68a;
  border-color: #b45309;
}

[data-theme="dark"] .r-High {
  background: #7c2d12;
  color: #fed7aa;
  border-color: #c2410c;
}

[data-theme="dark"] .r-Very-High {
  background: #7f1d1d;
  color: #fecaca;
  border-color: #b91c1c;
}

[data-theme="dark"] .r-Critical {
  background: #701a75;
  color: #fbcfe8;
  border-color: #a21caf;
}

[data-theme="dark"] .r-Pending-Bank-Review,
[data-theme="dark"] .pending {
  background: #451a03;
  color: #fde68a;
  border-color: #78350f;
}

[data-theme="dark"] .esg {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #059669;
}

.control-status {
  display: inline-block;
  border-radius: 10px;
  padding: 3px 8px;
  font-weight: 800;
  font-size: 9px;
}

.control-status.effective {
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
}

.control-status.needs-improvement {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.control-status.ineffective {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

[data-theme="dark"] .control-status.effective {
  color: #a7f3d0;
  background: #064e3b;
  border-color: #047857;
}

[data-theme="dark"] .control-status.needs-improvement {
  color: #fde68a;
  background: #78350f;
  border-color: #b45309;
}

[data-theme="dark"] .control-status.ineffective {
  color: #fecaca;
  background: #7f1d1d;
  border-color: #b91c1c;
}

/* ==================== AI REVIEW HUB VIEW ==================== */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 18px;
}

.review-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.review-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

.review-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-subtle);
  padding-bottom: 10px;
}

.review-card-head b {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 900;
}

.review-quote {
  background: var(--surface-alt);
  border-inline-start: 3px solid var(--nbe-gold);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  line-height: 1.7;
  margin-bottom: 12px;
  color: var(--text-body);
}

.review-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
}

/* ==================== SETTINGS & GOVERNANCE VIEW ==================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 20px;
}

.settings-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.settings-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 900;
  color: var(--text-main);
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-subtle);
  font-size: 11px;
}

.settings-item:last-child {
  border-bottom: 0;
}

.settings-item-label {
  display: flex;
  flex-direction: column;
}

.settings-item-label b {
  color: var(--text-main);
  font-weight: 800;
}

.settings-item-label span {
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-val {
  font-weight: 800;
  font-size: 10.5px;
  color: var(--text-body);
}

.persona-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.persona-pill {
  padding: 12px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--surface-alt);
}

.persona-pill:hover {
  border-color: var(--nbe-gold);
}

.persona-pill.active {
  border-color: var(--nbe-green);
  background: rgba(0, 103, 71, 0.1);
  box-shadow: 0 4px 12px rgba(0, 103, 71, 0.15);
}

.persona-pill b {
  display: block;
  font-size: 10.5px;
  color: var(--text-main);
}

.persona-pill span {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==================== SLIDE-OUT DRAWER ==================== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  backdrop-filter: blur(4px);
}

.drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  width: 700px;
  max-width: 94vw;
  height: 100%;
  background: var(--surface);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
  z-index: 101;
  transition: transform var(--transition-smooth);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* RTL Drawer placement */
[dir="rtl"] .drawer {
  left: 0;
  right: auto;
  transform: translateX(-100%);
}

[dir="rtl"] .drawer.show {
  transform: none;
}

/* LTR Drawer placement */
[dir="ltr"] .drawer {
  right: 0;
  left: auto;
  transform: translateX(100%);
}

[dir="ltr"] .drawer.show {
  transform: none;
}

.drawer-head {
  padding: 20px 24px;
  background: var(--bg-banner);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--nbe-gold);
}

.drawer-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.drawer-close {
  background: rgba(255, 255, 255, 0.15);
  border: 0;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.drawer-body {
  padding: 24px;
  flex: 1;
  display: grid;
  gap: 16px;
}

.drawer-section {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.drawer-section-title {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  inset-inline-start: 24px;
  bottom: 24px;
  background: #07162c;
  color: #fff;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 120;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== SETTINGS SUB-NAVIGATION & TABS ==================== */
.settings-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.settings-subtab {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-subtab:hover {
  color: var(--text-main);
  border-color: var(--line-strong);
}

.settings-subtab.active {
  background: var(--nbe-green);
  color: #fff;
  border-color: var(--nbe-green);
  box-shadow: 0 2px 8px rgba(0, 103, 71, 0.3);
}

.settings-subpanel {
  display: none;
}

.settings-subpanel.active {
  display: block;
}

/* ==================== RBAC PERMISSION MANAGEMENT ==================== */
.rbac-header-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.role-selector-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.role-bar-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.role-pills-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.role-pill {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--text-body);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-pill:hover {
  background: var(--surface-hover);
  border-color: var(--nbe-gold);
}

.role-pill.active {
  background: var(--nbe-gold);
  color: #fff;
  border-color: var(--nbe-gold-dark);
  box-shadow: 0 2px 8px rgba(197, 155, 39, 0.35);
}

.active-role-info {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.active-role-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.active-role-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: var(--text-main);
}

.badge-lockout-safe {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
}

[data-theme="dark"] .badge-lockout-safe {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #047857;
}

.role-stats-row {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.role-stats-row b {
  color: var(--text-main);
}

.rbac-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.rbac-search input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 11px;
  background: var(--surface);
  color: var(--text-body);
  min-width: 280px;
}

.rbac-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn.sm {
  padding: 6px 12px;
  font-size: 10.5px;
}

.rbac-categories-grid {
  display: grid;
  gap: 16px;
}

.rbac-cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.rbac-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.rbac-cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.rbac-cat-actions {
  display: flex;
  gap: 6px;
}

.btn-bulk {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-bulk:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.rbac-perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.rbac-perm-item {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.rbac-perm-item:hover {
  border-color: var(--nbe-gold);
  background: var(--surface-hover);
}

.rbac-perm-item.checked {
  background: rgba(0, 103, 71, 0.05);
  border-color: var(--nbe-green);
}

[data-theme="dark"] .rbac-perm-item.checked {
  background: rgba(0, 103, 71, 0.15);
  border-color: var(--nbe-green-light);
}

.rbac-perm-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--nbe-green);
  cursor: pointer;
  margin-top: 2px;
}

.rbac-perm-info {
  flex: 1;
}

.rbac-perm-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.rbac-perm-code {
  font-size: 9px;
  color: var(--text-muted);
  font-family: monospace;
  background: var(--surface);
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

.rbac-perm-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* ==================== AUDIT LOG EXPLORER ==================== */
.audit-toolbar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.audit-filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.audit-table {
  min-width: 1300px;
}

.audit-table th {
  background: var(--table-head-bg);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 10px 12px;
  text-align: start;
}

.audit-table td {
  padding: 9px 12px;
  font-size: 10.5px;
  border-bottom: 1px solid var(--line);
}

.outcome-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.outcome-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

[data-theme="dark"] .outcome-success {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #047857;
}

.outcome-denied {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

[data-theme="dark"] .outcome-denied {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #991b1b;
}

.outcome-failure {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

[data-theme="dark"] .outcome-failure {
  background: #78350f;
  color: #fcd34d;
  border-color: #b45309;
}

.audit-json-box {
  background: #07162c;
  color: #38bdf8;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 10px;
  overflow-x: auto;
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Pagination */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==================== VIEW 0: EXECUTIVE BANKING HOMEPAGE ==================== */
#viewHome {
  display: none;
  flex-direction: column;
  gap: 24px;
}

#viewHome.active {
  display: flex;
}

/* 1. Executive Masthead */
.home-masthead {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--nbe-gold);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

.masthead-main {
  flex: 1;
}

.masthead-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.masthead-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}

.masthead-tag.nbe-tag {
  background: rgba(0, 103, 71, 0.12);
  color: var(--nbe-green);
  border: 1px solid rgba(0, 103, 71, 0.25);
}

.masthead-tag.basel-tag {
  background: rgba(197, 155, 39, 0.12);
  color: var(--nbe-gold-dark);
  border: 1px solid rgba(197, 155, 39, 0.25);
}

.masthead-tag.cbe-tag {
  background: rgba(36, 79, 128, 0.12);
  color: #244f80;
  border: 1px solid rgba(36, 79, 128, 0.25);
}

.masthead-tag.cycle-tag {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.masthead-title {
  font-size: 19px;
  font-weight: 900;
  color: var(--text-main);
  margin: 0 0 8px;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.masthead-desc {
  font-size: 12px;
  color: var(--text-body);
  max-width: 820px;
  line-height: 1.6;
  margin: 0;
}

.masthead-telemetry {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.telemetry-box {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telemetry-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.tele-svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
  color: var(--nbe-gold);
}

.telemetry-val {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-main);
}

.telemetry-sub {
  font-size: 9px;
  color: var(--text-light);
  line-height: 1.3;
}

/* 2. Capital Exposure KPI Quadrant */
.home-kpi-quadrant {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.capital-kpi-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.capital-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.capital-kpi-card.gold-border {
  border-top: 3px solid var(--nbe-gold);
}

.capital-kpi-card.emerald-border {
  border-top: 3px solid var(--nbe-green);
}

.capital-kpi-card.navy-border {
  border-top: 3px solid #244f80;
}

.capital-kpi-card.teal-border {
  border-top: 3px solid #0d9488;
}

.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.kpi-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.kpi-tag {
  font-size: 8.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.kpi-tag.gold {
  background: #fef3c7;
  color: #92400e;
}

.kpi-tag.green {
  background: #d1fae5;
  color: #065f46;
}

.kpi-tag.navy {
  background: #e0f2fe;
  color: #075985;
}

.kpi-tag.teal {
  background: #ccfbf1;
  color: #115e59;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
}

.kpi-figure {
  font-size: 23px;
  font-weight: 900;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  font-family: 'Inter', 'Cairo', sans-serif;
}

.kpi-figure.text-emerald {
  color: var(--nbe-green);
}

.kpi-figure.text-navy {
  color: #244f80;
}

.kpi-figure.text-teal {
  color: #0d9488;
}

.kpi-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-progress-bar {
  height: 5px;
  background: var(--surface-alt);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}

.kpi-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-smooth);
}

.kpi-progress-fill.gold {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.kpi-progress-fill.green {
  background: linear-gradient(90deg, var(--nbe-green), #10b981);
}

.kpi-progress-fill.navy {
  background: linear-gradient(90deg, #1e3a8a, #3b82f6);
}

.kpi-progress-fill.teal {
  background: linear-gradient(90deg, #0f766e, #14b8a6);
}

.kpi-footer-note {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.4;
}

/* 3. The Visual Signature Centerpiece */
.home-centerpiece-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--nbe-green);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  box-shadow: var(--shadow-sm);
}

.centerpiece-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.centerpiece-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 103, 71, 0.1);
  color: var(--nbe-green);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 8px;
  border: 1px solid rgba(0, 103, 71, 0.2);
}

.sig-svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.centerpiece-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--text-main);
  margin: 0 0 6px;
}

.centerpiece-subtitle {
  font-size: 12px;
  color: var(--text-body);
  max-width: 780px;
  margin: 0;
  line-height: 1.5;
}

.centerpiece-sector-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.sector-bar-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
}

.sector-pills-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bu-pill {
  background: var(--surface-card);
  border: 1px solid var(--line);
  color: var(--text-body);
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bu-pill:hover {
  border-color: var(--nbe-green);
  color: var(--nbe-green);
  background: rgba(0, 103, 71, 0.05);
}

.bu-pill.active {
  background: var(--nbe-green);
  border-color: var(--nbe-green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 103, 71, 0.35);
  font-weight: 800;
}

/* Architecture Flow Stage */
.risk-architecture-stage {
  display: grid;
  grid-template-columns: 285px 1fr 285px;
  gap: 16px;
  align-items: stretch;
}

.arch-stage-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 4px;
  text-align: center;
  letter-spacing: 0.2px;
}

.stage-tag.inflow {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.stage-tag.barrier {
  background: rgba(36, 79, 128, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(36, 79, 128, 0.25);
}

.stage-tag.residual {
  background: rgba(0, 103, 71, 0.12);
  color: var(--nbe-green);
  border: 1px solid rgba(0, 103, 71, 0.25);
}

.stage-panel {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.stage-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-panel-header b {
  font-size: 12px;
  color: var(--text-main);
  display: block;
}

.stage-panel-header small {
  font-size: 9.5px;
  color: var(--text-muted);
}

.stage-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stage-icon-wrap svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.inflow-icon {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
}

.residual-icon {
  background: rgba(0, 103, 71, 0.15);
  color: var(--nbe-green);
}

.stage-main-number {
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  font-family: 'Inter', 'Cairo', sans-serif;
}

.stage-main-number.gold-num {
  color: #d97706;
}

.stage-main-number.green-num {
  color: var(--nbe-green);
}

.stage-metric-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-body);
}

.metric-row span {
  color: var(--text-muted);
}

.stage-flow-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.flow-arrow {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

html[dir="rtl"] .flow-arrow {
  transform: rotate(180deg);
}

/* Barrier stage column */
.barriers-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.barrier-subcards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  flex: 1;
}

.barrier-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.barrier-card.tier-preventive {
  border-top: 3px solid var(--nbe-green);
}

.barrier-card.tier-detective {
  border-top: 3px solid #244f80;
}

.barrier-card.tier-corrective {
  border-top: 3px solid var(--nbe-gold);
}

.barrier-badge {
  font-size: 8.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.barrier-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
}

.barrier-svg {
  width: 14px;
  height: 14px;
  color: var(--nbe-green);
  flex-shrink: 0;
}

.barrier-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 0;
  border-top: 1px solid var(--line-subtle);
  border-bottom: 1px solid var(--line-subtle);
  color: var(--text-body);
}

.barrier-examples {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.barrier-total-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-card);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-body);
}

.mitigation-badge-inline {
  background: rgba(0, 103, 71, 0.12);
  color: var(--nbe-green);
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 800;
  border: 1px solid rgba(0, 103, 71, 0.25);
}

.btn-drill {
  width: 100%;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  padding: 10px;
}

/* 4. Strategic Priority Risk Watchlist */
.home-watchlist-section {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
}

.watchlist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.watchlist-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
  margin-bottom: 6px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.watch-svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.watchlist-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
  margin: 0 0 4px;
}

.watchlist-desc {
  font-size: 11.5px;
  color: var(--text-body);
  margin: 0;
}

.watchlist-meta {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.meta-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 4px;
}

.meta-tag.red {
  background: #fee2e2;
  color: #991b1b;
}

.meta-tag.gold {
  background: #fef3c7;
  color: #92400e;
}

.watchlist-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.watchlist-table th {
  background: var(--table-head-bg);
  color: #fff;
  padding: 10px 12px;
  text-align: start;
  font-weight: 800;
  font-size: 10.5px;
  border-bottom: 2px solid var(--nbe-gold);
}

.watchlist-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-body);
  vertical-align: middle;
}

.watchlist-table tr:hover td {
  background: var(--surface-hover);
}

.risk-code-pill {
  font-family: monospace;
  font-weight: 800;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}

.reassess-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.reassess-badge.active {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.reassess-badge.stable {
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--line);
}

/* 5. Executive Gateway Cards */
.home-gateways-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.gateway-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.gateway-card:hover {
  border-color: var(--nbe-green);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.gateway-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.gateway-icon-wrap svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.icon-matrix {
  background: #1e3a8a;
}

.icon-dash {
  background: #0284c7;
}

.icon-ai {
  background: var(--nbe-gold);
}

.icon-controls {
  background: var(--nbe-green);
}

.icon-settings {
  background: #475569;
}

.gateway-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 6px;
}

.gateway-desc {
  font-size: 10.5px;
  color: var(--text-body);
  line-height: 1.45;
  margin: 0;
}

.gateway-arrow {
  display: flex;
  justify-content: flex-end;
  color: var(--text-light);
  transition: transform var(--transition-fast);
}

.gateway-arrow svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.gateway-card:hover .gateway-arrow {
  color: var(--nbe-green);
  transform: translateX(-4px);
}

html[dir="ltr"] .gateway-card:hover .gateway-arrow {
  transform: translateX(4px);
}

html[dir="rtl"] .gateway-arrow svg {
  transform: rotate(180deg);
}

/* 6. Institutional Compliance & Governance Seal */
.home-compliance-seal {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-size: 11px;
  box-shadow: var(--shadow-sm);
}

.seal-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 65%;
}

.seal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--nbe-green);
  font-weight: 800;
  font-size: 11px;
}

.seal-svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.seal-text {
  color: var(--text-body);
  line-height: 1.5;
  margin: 0;
}

.seal-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: start;
  font-size: 10px;
  color: var(--text-muted);
}

.seal-meta-item {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Dark Theme Overrides for Homepage Components */
[data-theme="dark"] .kpi-tag.gold {
  background: #78350f;
  color: #fde68a;
}

[data-theme="dark"] .kpi-tag.green {
  background: #064e3b;
  color: #6ee7b7;
}

[data-theme="dark"] .kpi-tag.navy {
  background: #0c4a6e;
  color: #7dd3fc;
}

[data-theme="dark"] .kpi-tag.teal {
  background: #134e4a;
  color: #5eead4;
}

[data-theme="dark"] .stage-tag.inflow {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border-color: rgba(217, 119, 6, 0.4);
}

[data-theme="dark"] .stage-tag.barrier {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .stage-tag.residual {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .meta-tag.red {
  background: #7f1d1d;
  color: #fca5a5;
}

[data-theme="dark"] .meta-tag.gold {
  background: #78350f;
  color: #fde68a;
}

[data-theme="dark"] .reassess-badge.active {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #b91c1c;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .home-kpi-quadrant {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-gateways-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .risk-architecture-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    transform: translateX(105%);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.4);
  }

  html[dir="ltr"] .app-sidebar {
    transform: translateX(-105%);
  }

  .app-sidebar.show {
    transform: translateX(0) !important;
  }

  .sidebar-overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 22, 44, 0.65);
    z-index: 55;
    backdrop-filter: blur(4px);
  }

  .sidebar-close-btn {
    display: flex;
  }

  .hamburger-btn {
    display: flex;
  }

  .app-topbar {
    padding: 0 16px;
  }

  .shell {
    padding: 16px;
  }

  .home-masthead {
    flex-direction: column;
    padding: 20px;
  }

  .masthead-telemetry {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .telemetry-box {
    flex: 1;
    min-width: 140px;
  }

  .barrier-subcards-grid {
    grid-template-columns: 1fr;
  }

  .home-compliance-seal {
    flex-direction: column;
    align-items: flex-start;
  }

  .seal-left {
    max-width: 100%;
  }

  .context-card {
    grid-template-columns: 1fr;
  }

  .dash-sections {
    grid-template-columns: 1fr;
  }

  .strategic-objective-card {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .home-kpi-quadrant {
    grid-template-columns: 1fr;
  }

  .home-gateways-grid {
    grid-template-columns: 1fr;
  }

  .header-nav-bar {
    padding: 6px 12px;
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-sub-divider,
  .header-breadcrumbs {
    display: none;
  }

  .header-brand-text {
    display: none;
  }

  .header-reg-seal {
    display: none;
  }

  .header-breadcrumbs {
    display: none;
  }
}

@media print {

  .topbar,
  .filters,
  .legend,
  .top-nav,
  .drawer-overlay,
  .btn,
  .filter-pills,
  .theme-switch-group,
  .btn-lang {
    display: none !important;
  }

  table {
    font-size: 5px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==================== RBAC & AUDIT COMPREHENSIVE STYLING ==================== */
.role-manage-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.role-manage-actions .btn {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.role-pill {
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.role-pill.active {
  background: var(--nbe-green) !important;
  color: #fff !important;
  border-color: var(--nbe-green) !important;
  box-shadow: 0 4px 12px rgba(0, 104, 55, 0.25);
}

.rbac-scope-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.rbac-scope-badge.scope-read {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.rbac-scope-badge.scope-mutation {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.rbac-scope-badge.scope-governance {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.rbac-scope-badge.scope-export {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.rbac-scope-badge.scope-sensitive {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.api-endpoint-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9.5px;
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  direction: ltr !important;
  unicode-bidi: isolate;
}

.audit-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
}

.audit-category-badge.cat-auth {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
}

.audit-category-badge.cat-rbac {
  background: rgba(168, 85, 247, 0.12);
  color: #9333ea;
}

.audit-category-badge.cat-ai {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.audit-category-badge.cat-rcsa {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.audit-category-badge.cat-audit {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.audit-category-badge.cat-security {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

/* Before and After Audit Forensics Diff View */
.audit-diff-card {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}

.audit-diff-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.diff-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.diff-col-header {
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.diff-col.before .diff-col-header {
  color: #dc2626;
}

.diff-col.after .diff-col-header {
  color: #16a34a;
}

.diff-item {
  font-size: 10.5px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
  font-family: inherit;
}

.diff-tag-added {
  display: inline-block;
  background: rgba(22, 163, 74, 0.15);
  color: #16a34a;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  margin: 2px;
}

.diff-tag-removed {
  display: inline-block;
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  margin: 2px;
  text-decoration: line-through;
}

.forensics-json-box {
  background: #0f172a;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  direction: ltr !important;
  unicode-bidi: isolate;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 200px;
}

/* Directional Alignment Utilities */
html[dir="ltr"] table th,
html[dir="ltr"] table td {
  text-align: left;
}
html[dir="rtl"] table th,
html[dir="rtl"] table td {
  text-align: right;
}
html[dir="ltr"] .login-label,
html[dir="ltr"] .field > span,
html[dir="ltr"] .settings-item-label,
html[dir="ltr"] .rbac-cat-title,
html[dir="ltr"] .audit-toolbar-card,
html[dir="ltr"] .active-role-info,
html[dir="ltr"] .centerpiece-title-group {
  text-align: left;
}
html[dir="rtl"] .login-label,
html[dir="rtl"] .field > span,
html[dir="rtl"] .settings-item-label,
html[dir="rtl"] .rbac-cat-title,
html[dir="rtl"] .audit-toolbar-card,
html[dir="rtl"] .active-role-info,
html[dir="rtl"] .centerpiece-title-group {
  text-align: right;
}

/* ==================== 14. ENTERPRISE AUTH GUARD GATE ==================== */
.auth-guard-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(2, 44, 34, 0.84) 0%, rgba(3, 20, 14, 0.90) 50%, rgba(6, 78, 59, 0.82) 100%),
              url('nbe-login-scene.webp') center center / cover no-repeat fixed;
  padding: 24px;
  overflow-y: auto;
  box-sizing: border-box;
}

[data-theme="light"] .auth-guard-gate {
  background: linear-gradient(135deg, rgba(4, 120, 87, 0.80) 0%, rgba(6, 95, 70, 0.86) 50%, rgba(2, 44, 34, 0.90) 100%),
              url('nbe-login-scene.webp') center center / cover no-repeat fixed;
}

.auth-guard-container {
  width: 100%;
  max-width: 480px;
  margin: auto;
}

.auth-guard-card {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 50px rgba(16, 185, 129, 0.15);
  border-radius: 20px;
  padding: 36px 32px;
  color: #fff;
  text-align: center;
}

[data-theme="light"] .auth-guard-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
  color: #0f172a;
}

.auth-guard-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-guard-logo {
  max-width: 190px;
  height: 44px;
  object-fit: contain;
  display: block;
}

[data-theme="light"] .auth-guard-logo {
  filter: brightness(0.2) contrast(1.5);
}

.auth-guard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

[data-theme="light"] .auth-guard-badge {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  border-color: rgba(5, 150, 105, 0.25);
}

.auth-guard-header h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: #fff;
}

[data-theme="light"] .auth-guard-header h2 {
  color: #064e3b;
}

.auth-guard-header p {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 20px 0;
}

[data-theme="light"] .auth-guard-header p {
  color: #475569;
}

.auth-guard-form {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

[dir="ltr"] .auth-guard-form {
  text-align: left;
}

.auth-guard-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-theme="light"] .auth-guard-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.auth-guard-compliance {
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
  text-align: center;
}

[data-theme="light"] .auth-guard-compliance {
  color: #64748b;
}

.auth-guard-tools {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.gate-tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gate-tool-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(212, 175, 55, 0.5);
}

[data-theme="light"] .gate-tool-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .gate-tool-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ==================== RBAC SUBNAV & BANKING USERS ==================== */
.rbac-subnav-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 2px;
}

.rbac-subtab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
}

.rbac-subtab:hover {
  color: var(--text-main);
  background: var(--surface-hover);
}

.rbac-subtab.active {
  color: var(--nbe-green);
  border-bottom-color: var(--nbe-green);
  background: var(--surface);
}

.user-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--line);
}

.rbac-subtab.active .user-count-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--nbe-green);
  border-color: rgba(16, 185, 129, 0.3);
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid transparent;
}

.user-role-badge.role-admin {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.user-role-badge.role-cro {
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.25);
}

.user-role-badge.role-risk_officer {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.user-role-badge.role-internal_auditor {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.25);
}

.user-role-badge.role-viewer {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.25);
}

.user-role-badge.role-custom {
  background: rgba(168, 85, 247, 0.12);
  color: #9333ea;
  border-color: rgba(168, 85, 247, 0.25);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}

.status-pill.active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.inactive {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}