/* =============================================================================
   AIDF PREMIUM v2 — Enterprise Banking Design System Upgrade Layer
   Loads last; overrides and extends aidf-enterprise.css
   Palette: Navy #0a2249 | Gold #c9a43b | Royal #1358c8 | Slate #5f6f8d
   ============================================================================= */

/* ─── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Core brand */
  --p-navy:        #0a2249;
  --p-navy-deep:   #061629;
  --p-navy-mid:    #0d2d5e;
  --p-royal:       #1358c8;
  --p-royal-light: #1d6fe8;
  --p-gold:        #c9a43b;
  --p-gold-light:  #e0bc62;
  --p-gold-deep:   #a8852e;
  --p-slate:       #5f6f8d;
  --p-slate-light: #8898b3;
  --p-teal:        #0f6a73;

  /* Surfaces */
  --p-bg:          #f2f5fb;
  --p-surface:     #ffffff;
  --p-surface-2:   #f8faff;
  --p-surface-3:   #eef3fc;
  --p-border:      #d5dff0;
  --p-border-soft: #e4eaf6;

  /* Semantics */
  --p-success:     #15794a;
  --p-success-bg:  #edf8f2;
  --p-danger:      #b03535;
  --p-danger-bg:   #fdf1f1;
  --p-warning:     #a87010;
  --p-warning-bg:  #fdf6e8;
  --p-info:        #1358c8;
  --p-info-bg:     #eef4ff;

  /* Role accents */
  --p-accent-customer:   #1358c8;
  --p-accent-teller:     #0f6a73;
  --p-accent-manager:    #6b4f9e;
  --p-accent-auditor:    #b03535;
  --p-accent-admin:      #c9a43b;
  --p-accent-superadmin: #0a2249;

  /* Typography scale */
  --p-text-xs:   0.7rem;
  --p-text-sm:   0.78rem;
  --p-text-base: 0.875rem;
  --p-text-md:   0.95rem;
  --p-text-lg:   1.05rem;
  --p-text-xl:   1.2rem;
  --p-text-2xl:  1.45rem;
  --p-text-3xl:  1.75rem;

  /* Spacing */
  --p-space-1: 0.25rem;
  --p-space-2: 0.5rem;
  --p-space-3: 0.75rem;
  --p-space-4: 1rem;
  --p-space-5: 1.25rem;
  --p-space-6: 1.5rem;
  --p-space-8: 2rem;

  /* Shape */
  --p-radius-xs: 4px;
  --p-radius-sm: 6px;
  --p-radius:    10px;
  --p-radius-md: 14px;
  --p-radius-lg: 18px;
  --p-radius-xl: 24px;

  /* Shadows */
  --p-shadow-xs: 0 2px 6px rgba(10, 34, 73, 0.06);
  --p-shadow-sm: 0 4px 12px rgba(10, 34, 73, 0.08);
  --p-shadow:    0 8px 24px rgba(10, 34, 73, 0.10);
  --p-shadow-md: 0 12px 36px rgba(10, 34, 73, 0.12);
  --p-shadow-lg: 0 20px 56px rgba(10, 34, 73, 0.14);

  /* Transitions */
  --p-trans-fast: 120ms ease;
  --p-trans:      200ms ease;
  --p-trans-slow: 350ms ease;

  /* Sidebar dimensions */
  --p-sidebar-w:         220px;
  --p-sidebar-collapsed: 60px;
  --p-topbar-h:          56px;
}

/* ─── Base / Reset Refinements ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.aidf-enterprise {
  font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--p-text-base);
  line-height: 1.5;
  color: var(--p-navy);
  background: var(--p-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Shell Layout ───────────────────────────────────────────────────────────── */
.aidf-shell {
  display: grid;
  grid-template-columns: var(--p-sidebar-w) 1fr;
  min-height: 100vh;
}

.aidf-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.aidf-content {
  flex: 1;
  padding: 1.25rem 1.5rem 2rem;
  max-width: 100%;
  overflow-x: hidden;
}

/* ─── Premium Sidebar ────────────────────────────────────────────────────────── */
.aidf-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--p-sidebar-w);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--p-navy);
  border-right: 1px solid rgba(255,255,255,0.06);
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.aidf-sidebar::-webkit-scrollbar { width: 3px; }
.aidf-sidebar::-webkit-scrollbar-track { background: transparent; }
.aidf-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* Brand block */
.aidf-portal-brand-block {
  padding: 1.1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.aidf-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
}

.aidf-brand-mark {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--p-gold-light) 0%, var(--p-gold) 100%);
  border-radius: var(--p-radius-sm);
  font-size: 1rem;
  color: var(--p-navy-deep);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(201,164,59,0.3);
}

.aidf-brand strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: #fff;
}

.aidf-brand small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sidebar nav items */
.aidf-sidebar .sidebar-title {
  padding: 0.9rem 1rem 0.3rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.aidf-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.52rem 1rem;
  margin: 0.08rem 0.5rem;
  border-radius: var(--p-radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--p-trans-fast), color var(--p-trans-fast);
  white-space: nowrap;
  overflow: hidden;
}

.aidf-sidebar a i {
  font-size: 0.95rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  color: rgba(255,255,255,0.45);
  transition: color var(--p-trans-fast);
}

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

.aidf-sidebar a:hover i {
  color: var(--p-gold);
}

.aidf-sidebar a.active {
  background: linear-gradient(135deg, rgba(19,88,200,0.7) 0%, rgba(29,111,232,0.55) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--p-gold);
}

.aidf-sidebar a.active i {
  color: var(--p-gold);
}

/* Role-specific sidebar accent stripes */
.aidf-sidebar.admin a.active   { box-shadow: inset 3px 0 0 var(--p-gold); }
.aidf-sidebar.staff a.active   { box-shadow: inset 3px 0 0 var(--p-teal); }

/* Sidebar footer (logout / version) */
.aidf-sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.aidf-sidebar-footer a {
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  padding: 0.4rem 0.5rem;
  border-radius: var(--p-radius-sm);
  margin: 0;
}

.aidf-sidebar-footer a:hover { color: var(--p-danger); background: rgba(176,53,53,0.12); }
.aidf-sidebar-version {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.2);
  margin-top: 0.4rem;
  text-align: center;
}

/* ─── Premium Topbar ─────────────────────────────────────────────────────────── */
.aidf-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--p-topbar-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--p-border-soft);
  box-shadow: 0 1px 4px rgba(10,34,73,0.06);
}

.aidf-portal-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p-slate);
  padding: 0.2rem 0.55rem;
  background: var(--p-surface-3);
  border-radius: 999px;
  border: 1px solid var(--p-border);
}

.aidf-topbar .search-input {
  max-width: 360px;
  border-radius: 999px;
  border-color: var(--p-border);
  background: var(--p-surface-2);
  font-size: var(--p-text-sm);
  padding-left: 1rem;
}

.aidf-topbar .search-input:focus {
  border-color: var(--p-royal);
  box-shadow: 0 0 0 3px rgba(19,88,200,0.1);
  background: #fff;
}

.aidf-topbar-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--p-border);
  background: var(--p-surface-2);
  color: var(--p-slate);
  font-size: 0.95rem;
  transition: all var(--p-trans-fast);
}

.aidf-topbar-icon-btn:hover {
  background: var(--p-surface-3);
  border-color: var(--p-royal);
  color: var(--p-royal);
}

.aidf-topbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem 0.3rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--p-border);
  background: var(--p-surface-2);
  color: var(--p-navy);
  font-size: var(--p-text-sm);
  font-weight: 600;
}

.aidf-topbar-user-btn::after { margin-left: 0.2rem; }
.aidf-topbar-user-btn:hover { border-color: var(--p-royal); background: var(--p-info-bg); }

.aidf-mobile-nav-toggle {
  border-radius: 6px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--p-border);
  background: transparent;
  color: var(--p-slate);
}

/* ─── Breadcrumb ─────────────────────────────────────────────────────────────── */
.aidf-breadcrumb, .breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--p-slate-light);
  margin-bottom: 0.75rem;
  padding: 0;
  list-style: none;
  background: none;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  color: var(--p-border);
  padding: 0 0.2rem;
}

.breadcrumb-item.active { color: var(--p-navy); font-weight: 600; }

/* ─── Page Header ────────────────────────────────────────────────────────────── */
.aidf-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--p-navy) 0%, var(--p-navy-mid) 100%);
  border-radius: var(--p-radius-md);
  margin-bottom: 1.25rem;
  border: none;
  position: relative;
  overflow: hidden;
}

.aidf-page-header::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 140px;
  height: 140px;
  background: rgba(201,164,59,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.aidf-page-header .aidf-page-title,
.aidf-page-header h1 {
  font-size: var(--p-text-xl);
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.2rem;
  line-height: 1.2;
}

.aidf-page-header .aidf-subtitle,
.aidf-page-header p {
  font-size: var(--p-text-sm);
  color: rgba(255,255,255,0.65);
  margin: 0;
}

.aidf-page-header .aidf-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ─── Premium Cards ──────────────────────────────────────────────────────────── */
.card,
.aidf-card {
  border: 1px solid var(--p-border-soft);
  border-radius: var(--p-radius-md);
  background: var(--p-surface);
  box-shadow: var(--p-shadow-xs);
  transition: box-shadow var(--p-trans), transform var(--p-trans);
}

.card:hover { box-shadow: var(--p-shadow-sm); }

.aidf-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--p-border-soft);
}

.aidf-section-title {
  font-size: var(--p-text-sm);
  font-weight: 700;
  color: var(--p-navy);
  letter-spacing: 0.01em;
  margin: 0;
}

/* ─── Executive KPI Tiles ────────────────────────────────────────────────────── */
.aidf-kpi-tile {
  background: var(--p-surface);
  border: 1px solid var(--p-border-soft);
  border-radius: var(--p-radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--p-trans), transform var(--p-trans);
  box-shadow: var(--p-shadow-xs);
}

.aidf-kpi-tile::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--p-radius-md) var(--p-radius-md) 0 0;
  background: var(--p-royal);
}

.aidf-kpi-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--p-shadow-sm);
}

.aidf-kpi-tile__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--p-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--p-info-bg);
  color: var(--p-royal);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.aidf-kpi-tile__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p-slate);
}

.aidf-kpi-tile__value {
  font-size: var(--p-text-2xl);
  font-weight: 800;
  color: var(--p-navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.aidf-kpi-tile__hint {
  font-size: 0.68rem;
  color: var(--p-slate-light);
}

.aidf-kpi-tile__delta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
}

.aidf-kpi-tile__delta.up   { background: var(--p-success-bg); color: var(--p-success); }
.aidf-kpi-tile__delta.down { background: var(--p-danger-bg);  color: var(--p-danger); }

/* Colour variants */
.aidf-kpi-tile--blue  { --kpi-color: var(--p-royal);   --kpi-bg: var(--p-info-bg); }
.aidf-kpi-tile--navy  { --kpi-color: var(--p-navy);    --kpi-bg: var(--p-surface-3); }
.aidf-kpi-tile--gold  { --kpi-color: var(--p-gold);    --kpi-bg: #fdf8ec; }
.aidf-kpi-tile--teal  { --kpi-color: var(--p-teal);    --kpi-bg: #edf8f9; }
.aidf-kpi-tile--green { --kpi-color: var(--p-success); --kpi-bg: var(--p-success-bg); }
.aidf-kpi-tile--red   { --kpi-color: var(--p-danger);  --kpi-bg: var(--p-danger-bg); }

.aidf-kpi-tile--blue::after  { background: var(--p-royal); }
.aidf-kpi-tile--navy::after  { background: var(--p-navy); }
.aidf-kpi-tile--gold::after  { background: var(--p-gold); }
.aidf-kpi-tile--teal::after  { background: var(--p-teal); }
.aidf-kpi-tile--green::after { background: var(--p-success); }
.aidf-kpi-tile--red::after   { background: var(--p-danger); }

[class*="aidf-kpi-tile--"] .aidf-kpi-tile__icon {
  background: var(--kpi-bg);
  color: var(--kpi-color);
}

[class*="aidf-kpi-tile--"] .aidf-kpi-tile__value {
  color: var(--kpi-color);
}

/* ─── Stat Cards (compact) ───────────────────────────────────────────────────── */
.aidf-stat-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border-soft);
  border-radius: var(--p-radius);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--p-shadow-xs);
}

.aidf-stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--p-radius-sm);
  background: var(--p-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--p-royal);
  flex-shrink: 0;
}

.aidf-stat-card__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--p-slate);
  margin-bottom: 0.1rem;
}

.aidf-stat-card__value {
  font-size: var(--p-text-lg);
  font-weight: 800;
  color: var(--p-navy);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.aidf-stat-card__hint {
  font-size: 0.65rem;
  color: var(--p-slate-light);
  margin-top: 0.1rem;
}

/* ─── Account Card ───────────────────────────────────────────────────────────── */
.aidf-account-card {
  background: linear-gradient(135deg, var(--p-navy-deep) 0%, var(--p-navy-mid) 55%, #1358c8 100%);
  border-radius: var(--p-radius-md);
  padding: 1.2rem 1.25rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--p-shadow-md);
}

.aidf-account-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.aidf-account-card::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -30px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(201,164,59,0.07);
  pointer-events: none;
}

.aidf-account-card__type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.75rem;
}

.aidf-account-card__balance-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.1rem;
}

.aidf-account-card__balance {
  font-size: var(--p-text-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.8rem;
}

.aidf-account-card__number {
  font-size: var(--p-text-sm);
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.75);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.5rem;
}

.aidf-account-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.aidf-account-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
}

.aidf-account-card__status.active { background: rgba(21,121,74,0.35); color: #7ef5b0; }

/* ─── Transaction Timeline ───────────────────────────────────────────────────── */
.aidf-tx-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.aidf-tx-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 0.6rem;
  align-items: start;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--p-border-soft);
  position: relative;
}

.aidf-tx-item:last-child { border-bottom: none; }

.aidf-tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: var(--p-surface-3);
  color: var(--p-slate);
}

.aidf-tx-icon.credit { background: var(--p-success-bg); color: var(--p-success); }
.aidf-tx-icon.debit  { background: var(--p-danger-bg);  color: var(--p-danger); }

.aidf-tx-info__ref {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--p-navy);
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aidf-tx-info__narration {
  font-size: 0.68rem;
  color: var(--p-slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aidf-tx-info__date {
  font-size: 0.62rem;
  color: var(--p-slate-light);
  margin-top: 0.1rem;
}

.aidf-tx-amount {
  text-align: right;
  flex-shrink: 0;
}

.aidf-tx-amount__value {
  font-size: var(--p-text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.aidf-tx-amount__value.credit { color: var(--p-success); }
.aidf-tx-amount__value.debit  { color: var(--p-danger); }

/* ─── Enterprise Tables ──────────────────────────────────────────────────────── */
.table.aidf-table {
  font-size: var(--p-text-sm);
  --bs-table-bg: transparent;
  margin: 0;
}

.table.aidf-table thead th {
  background: var(--p-surface-2);
  color: var(--p-slate);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--p-border);
  padding: 0.55rem 0.75rem;
  white-space: nowrap;
}

.table.aidf-table tbody td {
  padding: 0.6rem 0.75rem;
  vertical-align: middle;
  border-color: var(--p-border-soft);
  color: var(--p-navy);
  font-size: var(--p-text-sm);
}

.table.aidf-table tbody tr {
  transition: background var(--p-trans-fast);
}

.table.aidf-table tbody tr:hover { background: var(--p-surface-2); }

/* Compact table variant */
.aidf-table-compact tbody td { padding: 0.4rem 0.65rem; }

/* ─── Status Badges ──────────────────────────────────────────────────────────── */
.aidf-badge, .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.aidf-badge-success, .badge-success { background: var(--p-success-bg); color: var(--p-success); border-color: rgba(21,121,74,0.2); }
.aidf-badge-danger,  .badge-danger  { background: var(--p-danger-bg);  color: var(--p-danger);  border-color: rgba(176,53,53,0.2); }
.aidf-badge-warning, .badge-warning { background: var(--p-warning-bg); color: var(--p-warning); border-color: rgba(168,112,16,0.2); }
.aidf-badge-info,    .badge-info    { background: var(--p-info-bg);    color: var(--p-royal);   border-color: rgba(19,88,200,0.2); }
.aidf-badge-navy,    .badge-navy    { background: var(--p-surface-3);  color: var(--p-navy);    border-color: var(--p-border); }
.aidf-badge-gold                    { background: #fdf8ec; color: var(--p-gold-deep); border-color: rgba(201,164,59,0.3); }

/* ─── Alerts ─────────────────────────────────────────────────────────────────── */
.aidf-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: var(--p-radius);
  font-size: var(--p-text-sm);
  border: 1px solid transparent;
  margin-bottom: 0.75rem;
}

.aidf-alert i { font-size: 1rem; flex-shrink: 0; margin-top: 0.05rem; }

.aidf-alert-success { background: var(--p-success-bg); color: var(--p-success); border-color: rgba(21,121,74,0.2); }
.aidf-alert-danger  { background: var(--p-danger-bg);  color: var(--p-danger);  border-color: rgba(176,53,53,0.2); }
.aidf-alert-warning { background: var(--p-warning-bg); color: var(--p-warning); border-color: rgba(168,112,16,0.2); }
.aidf-alert-info    { background: var(--p-info-bg);    color: var(--p-royal);   border-color: rgba(19,88,200,0.15); }

/* ─── Premium Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--p-text-sm);
  letter-spacing: 0.01em;
  transition: all var(--p-trans-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0e3f92 0%, #165dcc 100%);
  border-color: #165dcc;
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0b357e 0%, #1451b2 100%);
  border-color: #1451b2;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14,63,146,0.3);
}

.btn-outline-primary {
  border-color: #c5d5ed;
  color: var(--p-royal);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--p-info-bg);
  border-color: var(--p-royal);
  color: var(--p-royal);
}

.btn-outline-secondary {
  border-color: var(--p-border);
  color: var(--p-slate);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--p-surface-2);
  border-color: var(--p-slate);
  color: var(--p-navy);
}

.btn-gold {
  background: linear-gradient(135deg, var(--p-gold-light) 0%, var(--p-gold) 100%);
  border-color: var(--p-gold);
  color: var(--p-navy-deep);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--p-gold) 0%, var(--p-gold-deep) 100%);
  color: var(--p-navy-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,164,59,0.35);
}

.btn-sm {
  font-size: var(--p-text-xs);
  padding: 0.28rem 0.75rem;
}

.btn-xs {
  font-size: 0.65rem;
  padding: 0.18rem 0.55rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

/* Loading state */
.aidf-btn-loading {
  opacity: 0.75;
  pointer-events: none;
  position: relative;
}

.aidf-btn-loading::after {
  content: '';
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: p-spin 0.7s linear infinite;
}

@keyframes p-spin { to { transform: rotate(360deg); } }

/* ─── Activity Feed ──────────────────────────────────────────────────────────── */
.aidf-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.aidf-activity-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--p-border-soft);
  position: relative;
}

.aidf-activity-item:last-child { border-bottom: none; }

.aidf-activity-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.aidf-activity-dot.blue  { background: var(--p-info-bg);    color: var(--p-royal); }
.aidf-activity-dot.green { background: var(--p-success-bg); color: var(--p-success); }
.aidf-activity-dot.red   { background: var(--p-danger-bg);  color: var(--p-danger); }
.aidf-activity-dot.gold  { background: #fdf8ec; color: var(--p-gold-deep); }
.aidf-activity-dot.slate { background: var(--p-surface-3);  color: var(--p-slate); }

.aidf-activity-body__action {
  font-size: var(--p-text-sm);
  font-weight: 600;
  color: var(--p-navy);
  line-height: 1.3;
}

.aidf-activity-body__meta {
  font-size: 0.68rem;
  color: var(--p-slate-light);
  margin-top: 0.15rem;
}

/* ─── Empty States ───────────────────────────────────────────────────────────── */
.aidf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  text-align: center;
  border: 1.5px dashed var(--p-border);
  border-radius: var(--p-radius-md);
  background: var(--p-surface-2);
  color: var(--p-slate);
}

.aidf-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--p-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--p-slate-light);
  margin-bottom: 0.25rem;
}

.aidf-empty__title {
  font-size: var(--p-text-sm);
  font-weight: 700;
  color: var(--p-navy);
}

.aidf-empty__message {
  font-size: var(--p-text-xs);
  color: var(--p-slate-light);
  max-width: 260px;
}

/* ─── Form Controls ──────────────────────────────────────────────────────────── */
.form-control,
.form-select {
  border-radius: var(--p-radius-sm);
  border-color: var(--p-border);
  font-size: var(--p-text-sm);
  color: var(--p-navy);
  background: var(--p-surface-2);
  transition: border-color var(--p-trans-fast), box-shadow var(--p-trans-fast);
  min-height: 38px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--p-royal);
  box-shadow: 0 0 0 3px rgba(19,88,200,0.1);
  background: #fff;
  outline: none;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--p-navy-mid);
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
}

.form-control::placeholder { color: var(--p-slate-light); }

.form-check-input:checked {
  background-color: var(--p-royal);
  border-color: var(--p-royal);
}

/* Input with icon shell */
.aidf-admin-input-shell {
  display: flex;
  align-items: center;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  background: var(--p-surface-2);
  overflow: hidden;
  transition: border-color var(--p-trans-fast), box-shadow var(--p-trans-fast);
}

.aidf-admin-input-shell:focus-within {
  border-color: var(--p-royal);
  box-shadow: 0 0 0 3px rgba(19,88,200,0.1);
  background: #fff;
}

.aidf-admin-input-shell > i {
  width: 38px;
  text-align: center;
  color: var(--p-slate);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.aidf-admin-input-shell .form-control {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 38px;
  flex: 1;
}

.aidf-admin-input-shell .form-control:focus {
  box-shadow: none;
  border: none;
}

.aidf-admin-input-shell .btn {
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--p-slate);
  padding: 0 0.65rem;
  font-size: 0.9rem;
}

/* ─── Admin Portal Login ─────────────────────────────────────────────────────── */
.aidf-admin-login-btn {
  background: linear-gradient(135deg, #0e3f92 0%, #165dcc 100%);
  border: none;
  border-radius: var(--p-radius-sm);
  color: #fff;
  font-weight: 700;
  font-size: var(--p-text-sm);
  min-height: 42px;
  transition: all var(--p-trans-fast);
}

.aidf-admin-login-btn:hover {
  background: linear-gradient(135deg, #0b357e 0%, #1451b2 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14,63,146,0.28);
}

.aidf-admin-login-head {
  padding: 1.2rem 1.4rem 0.6rem;
}

.aidf-auth-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--p-navy);
  margin: 0.3rem 0 0.4rem;
  line-height: 1.2;
}

.aidf-admin-login-head p {
  font-size: var(--p-text-sm);
  color: var(--p-slate);
  margin: 0;
}

.aidf-admin-login-form {
  padding: 0.75rem 1.4rem 1.2rem;
}

.aidf-admin-login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.4rem 0 0.75rem;
  font-size: var(--p-text-sm);
}

.aidf-admin-login-options a {
  color: var(--p-royal);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
}

.aidf-admin-login-assurance {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.aidf-admin-login-assurance span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: var(--p-slate);
  background: var(--p-surface-2);
  border: 1px solid var(--p-border-soft);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.aidf-admin-security-copy {
  font-size: 0.68rem;
  color: var(--p-slate-light);
  padding: 0.6rem 1.4rem 1rem;
}

.aidf-portal-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.aidf-portal-tag.customer { background: var(--p-info-bg);    color: var(--p-royal); }
.aidf-portal-tag.admin    { background: #fdf8ec;              color: var(--p-gold-deep); }
.aidf-portal-tag.staff    { background: #edf8f9;              color: var(--p-teal); }

/* ─── Auth Shell Improvements ────────────────────────────────────────────────── */
.aidf-auth-shell {
  display: grid;
  min-height: 100vh;
}

.aidf-auth-shell.admin,
.aidf-auth-shell.staff {
  grid-template-columns: 40% 1fr;
}

.aidf-auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 2rem;
}

.aidf-auth-visual.admin,
.aidf-auth-visual.staff {
  background: linear-gradient(160deg, var(--p-navy-deep) 0%, var(--p-navy) 55%, var(--p-navy-mid) 100%);
}

.aidf-admin-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.aidf-admin-auth-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--p-radius-sm);
  background: linear-gradient(135deg, var(--p-gold-light) 0%, var(--p-gold) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--p-navy-deep);
  font-size: 1rem;
}

.aidf-admin-auth-kicker {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--p-gold);
  margin: 1.5rem 0 0.4rem;
}

.aidf-admin-auth-copy h1 {
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.aidf-admin-auth-copy p {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  max-width: 340px;
  line-height: 1.6;
}

.aidf-admin-auth-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.aidf-admin-auth-matrix > span {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem;
  border-radius: var(--p-radius);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.aidf-admin-auth-matrix > span i {
  font-size: 1.1rem;
  color: var(--p-gold);
}

.aidf-admin-auth-matrix > span strong {
  font-size: 0.78rem;
  color: #fff;
  font-weight: 700;
}

.aidf-admin-auth-matrix > span small {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
}

.aidf-auth-card-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
  background: #fff;
}

.aidf-auth-card {
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--p-border-soft);
  border-radius: var(--p-radius-md);
  background: #fff;
  box-shadow: var(--p-shadow-sm);
  overflow: hidden;
}

.aidf-auth-card .aidf-admin-login-form {
  padding: 0.5rem 1.4rem 1rem;
}

.aidf-security-note {
  font-size: 0.68rem;
  color: var(--p-royal);
  background: var(--p-info-bg);
  border: 1px solid rgba(19,88,200,0.12);
  border-radius: var(--p-radius-sm);
  padding: 0.45rem 0.7rem;
  margin-top: 0.75rem;
}

/* ─── Quick Action Grid ───────────────────────────────────────────────────────── */
.aidf-portal-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.aidf-dashboard-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border-soft);
  border-radius: var(--p-radius-md);
  padding: 1rem;
  transition: all var(--p-trans);
  cursor: pointer;
  box-shadow: var(--p-shadow-xs);
  position: relative;
  overflow: hidden;
}

.aidf-dashboard-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--p-royal), var(--p-gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--p-trans);
}

.aidf-dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--p-shadow-sm);
  border-color: var(--p-royal);
}

.aidf-dashboard-card:hover::before { transform: scaleX(1); }

.aidf-dashboard-card strong {
  display: block;
  font-size: var(--p-text-sm);
  font-weight: 700;
  color: var(--p-navy);
  margin-bottom: 0.3rem;
}

/* ─── Section Label / Subtitle ───────────────────────────────────────────────── */
.aidf-subtitle {
  font-size: var(--p-text-sm);
  color: var(--p-slate);
  margin: 0;
}

.h5, h5 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--p-navy);
}

/* ─── Dropdown ───────────────────────────────────────────────────────────────── */
.dropdown-menu {
  border-radius: var(--p-radius);
  border: 1px solid var(--p-border-soft);
  box-shadow: var(--p-shadow-md);
  font-size: var(--p-text-sm);
  padding: 0.4rem;
}

.dropdown-item {
  border-radius: var(--p-radius-sm);
  padding: 0.45rem 0.75rem;
  color: var(--p-navy);
  transition: background var(--p-trans-fast);
}

.dropdown-item:hover { background: var(--p-surface-3); color: var(--p-navy); }
.dropdown-divider { margin: 0.3rem 0; border-color: var(--p-border-soft); }

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-content {
  border-radius: var(--p-radius-md);
  border: 1px solid var(--p-border-soft);
  box-shadow: var(--p-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--p-border-soft);
  padding: 1rem 1.25rem;
}

.modal-title {
  font-size: var(--p-text-md);
  font-weight: 800;
  color: var(--p-navy);
}

.modal-footer {
  border-top: 1px solid var(--p-border-soft);
  padding: 0.75rem 1.25rem;
}

/* ─── Role-Specific Sidebar Themes ──────────────────────────────────────────── */
.aidf-sidebar.customer-portal { background: #041a3d; }
.aidf-sidebar.teller-portal   { background: #052b2d; }
.aidf-sidebar.manager-portal  { background: #1f1245; }
.aidf-sidebar.auditor-portal  { background: #2d1010; }
.aidf-sidebar.admin-portal    { background: #0a2249; }

/* ─── Loading / Skeleton ─────────────────────────────────────────────────────── */
@keyframes p-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.aidf-skeleton {
  background: linear-gradient(90deg, #eef2f9 25%, #e0e8f5 50%, #eef2f9 75%);
  background-size: 800px 100%;
  animation: p-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--p-radius-sm);
}

.aidf-skeleton-text { height: 0.85rem; margin-bottom: 0.4rem; }
.aidf-skeleton-title { height: 1.1rem; width: 60%; }
.aidf-skeleton-value { height: 1.5rem; width: 40%; }
.aidf-skeleton-card {
  height: 80px;
  border-radius: var(--p-radius-md);
  margin-bottom: 0.75rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root { --p-sidebar-w: 200px; }
  .aidf-content { padding: 1rem 1.25rem 2rem; }
}

@media (max-width: 992px) {
  :root { --p-sidebar-w: 0px; }

  .aidf-shell { grid-template-columns: 1fr; }

  .aidf-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform var(--p-trans);
    z-index: 1050;
    box-shadow: var(--p-shadow-lg);
  }

  .aidf-shell.sidebar-open .aidf-sidebar {
    transform: translateX(0);
  }

  .aidf-shell.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(10,34,73,0.45);
    z-index: 1049;
  }

  .aidf-portal-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .aidf-auth-shell.admin,
  .aidf-auth-shell.staff {
    grid-template-columns: 1fr;
  }

  .aidf-auth-visual.admin,
  .aidf-auth-visual.staff {
    padding: 1.5rem;
    min-height: auto;
  }

  .aidf-admin-auth-copy h1 { font-size: 1.4rem; }
  .aidf-admin-auth-matrix { grid-template-columns: 1fr 1fr; }

  .aidf-auth-card-wrap {
    padding: 1.5rem 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .aidf-content { padding: 0.75rem 0.75rem 2rem; }

  .aidf-kpi-tile__value { font-size: 1.2rem; }

  .aidf-page-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .aidf-page-header .aidf-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 576px) {
  .aidf-portal-quick-grid { grid-template-columns: 1fr; }
  .aidf-auth-card { border-radius: 0; }
  .aidf-topbar { padding: 0 0.75rem; }
}

/* ─── Print Styles ───────────────────────────────────────────────────────────── */
@media print {
  .aidf-sidebar,
  .aidf-topbar,
  .aidf-breadcrumb,
  .aidf-portal-quick-grid,
  .btn,
  .aidf-mobile-nav-toggle,
  .aidf-security-note { display: none !important; }

  body.aidf-enterprise { background: #fff; color: #000; font-size: 11pt; }

  .aidf-shell { display: block; }
  .aidf-content { padding: 0; }

  .card, .aidf-card {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 1rem;
  }

  .aidf-kpi-tile {
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .table.aidf-table thead th {
    background: #f0f0f0 !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
  }

  .aidf-page-header {
    background: #0a2249 !important;
    -webkit-print-color-adjust: exact;
  }

  a[href]::after { content: none; }

  .aidf-print-header {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #0a2249;
    margin-bottom: 1rem;
  }
}

/* Hide print header on screen */
.aidf-print-header { display: none; }

/* ─── Topbar notification badge ─────────────────────────────────────────────── */
.aidf-notif-wrapper {
  position: relative;
}

.aidf-notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--p-danger);
  border: 2px solid #fff;
  font-size: 0;
}

/* ─── Teal button (staff/teller) ─────────────────────────────────────────────── */
.btn-teal {
  background: linear-gradient(135deg, #0d7d88 0%, var(--p-teal) 100%);
  border-color: var(--p-teal);
  color: #fff;
  font-weight: 700;
}

.btn-teal:hover {
  background: linear-gradient(135deg, #0b6b75 0%, #0b5960 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,106,115,0.3);
}

/* ─── Misc Utilities ─────────────────────────────────────────────────────────── */
.text-gold    { color: var(--p-gold) !important; }
.text-navy    { color: var(--p-navy) !important; }
.text-royal   { color: var(--p-royal) !important; }
.text-slate   { color: var(--p-slate) !important; }
.text-success { color: var(--p-success) !important; }
.text-danger  { color: var(--p-danger) !important; }

.bg-navy   { background: var(--p-navy) !important; }
.bg-gold   { background: var(--p-gold) !important; }
.bg-soft   { background: var(--p-surface-2) !important; }

.border-gold { border-color: var(--p-gold) !important; }
.border-navy { border-color: var(--p-navy) !important; }

.fw-800 { font-weight: 800; }
.fw-700 { font-weight: 700; }

.aidf-divider {
  border: none;
  border-top: 1px solid var(--p-border-soft);
  margin: 0.75rem 0;
}

.aidf-gold-line {
  width: 36px;
  height: 3px;
  background: var(--p-gold);
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM SIDEBAR  (BEM: .p-sidebar)
   ═══════════════════════════════════════════════════════════════════════════ */

.p-sidebar {
  display: flex;
  flex-direction: column;
  width: var(--p-sidebar-w);
  min-height: 100vh;
  background: var(--p-navy);
  color: #fff;
  position: sticky;
  top: 0;
  transition: width 0.22s ease;
  overflow: hidden;
  z-index: 200;
  flex-shrink: 0;
}

/* Role-tinted sidebar backgrounds */
.p-sidebar--customer    { background: #041a3d; }
.p-sidebar--teller      { background: #052b2d; }
.p-sidebar--manager     { background: #1f1245; }
.p-sidebar--auditor     { background: #2d1010; }
.p-sidebar--admin       { background: #0a2249; }
.p-sidebar--superadmin  { background: #0a2249; }

/* Brand block */
.p-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.p-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
}

.p-sidebar__logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--p-gold);
  color: var(--p-navy);
  border-radius: 8px;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.p-sidebar__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
}

.p-sidebar__logo-text strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.p-sidebar__logo-text small {
  font-size: 0.67rem;
  color: rgba(255,255,255,.55);
  font-weight: 400;
}

.p-sidebar__collapse-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}
.p-sidebar__collapse-btn:hover { color: #fff; }

/* Nav */
.p-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0;
}

.p-sidebar__nav::-webkit-scrollbar { width: 3px; }
.p-sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.p-sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

.p-sidebar__section-label {
  padding: 0.65rem 0.85rem 0.25rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.35);
}

.p-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  margin: 0 0.4rem;
  border-radius: 6px;
}

.p-sidebar__link i {
  font-size: 1rem;
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
}

.p-sidebar__link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.p-sidebar__link.is-active {
  background: var(--p-gold);
  color: var(--p-navy);
  font-weight: 700;
}

.p-sidebar__link.is-active i { color: var(--p-navy); }

/* Footer */
.p-sidebar__footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.p-sidebar__user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  flex: 1;
}

.p-sidebar__user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.p-sidebar__user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.p-sidebar__user-info strong {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-sidebar__user-info small {
  font-size: 0.62rem;
  color: rgba(255,255,255,.45);
}

.p-sidebar__logout {
  color: rgba(255,255,255,.4);
  font-size: 1rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s;
}
.p-sidebar__logout:hover { color: var(--p-danger-light, #f87171); }

/* Collapsed state */
.p-sidebar.is-collapsed {
  width: var(--p-sidebar-collapsed);
}
.p-sidebar.is-collapsed .p-sidebar__logo-text,
.p-sidebar.is-collapsed .p-sidebar__section-label,
.p-sidebar.is-collapsed .p-sidebar__link span,
.p-sidebar.is-collapsed .p-sidebar__user-info,
.p-sidebar.is-collapsed .p-sidebar__collapse-btn i { display: none; }
.p-sidebar.is-collapsed .p-sidebar__link { justify-content: center; margin: 0 0.25rem; }
.p-sidebar.is-collapsed .p-sidebar__logo { justify-content: center; }
.p-sidebar.is-collapsed .p-sidebar__user-chip { justify-content: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM TOPBAR  (BEM: .p-topbar)
   ═══════════════════════════════════════════════════════════════════════════ */

.p-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--p-topbar-h);
  padding: 0 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--p-border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.p-topbar__left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.p-topbar__menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--p-slate);
  font-size: 1.2rem;
  padding: 0.2rem 0.35rem;
  border-radius: 5px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.p-topbar__menu-btn:hover { background: var(--p-surface-2); color: var(--p-navy); }

.p-topbar__portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--p-royal);
  background: rgba(26,65,148,.07);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  text-transform: capitalize;
}

/* Search */
.p-topbar__search {
  flex: 1;
  max-width: 480px;
}

.p-topbar__search-wrap {
  position: relative;
}

.p-topbar__search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--p-slate);
  font-size: 0.85rem;
  pointer-events: none;
}

.p-topbar__search-input {
  width: 100%;
  padding: 0.4rem 0.75rem 0.4rem 2rem;
  border: 1px solid var(--p-border-soft);
  border-radius: 20px;
  font-size: 0.8rem;
  background: var(--p-surface-2);
  color: var(--p-navy);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.p-topbar__search-input::placeholder { color: var(--p-slate); }
.p-topbar__search-input:focus {
  border-color: var(--p-royal);
  box-shadow: 0 0 0 3px rgba(26,65,148,.1);
  background: #fff;
}

/* Right cluster */
.p-topbar__right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: auto;
}

.p-topbar__icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--p-slate);
  font-size: 1.1rem;
  padding: 0.35rem 0.4rem;
  border-radius: 7px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.p-topbar__icon-btn:hover { background: var(--p-surface-2); color: var(--p-navy); }

.p-topbar__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--p-danger, #dc2626);
  color: #fff;
  border-radius: 10px;
  line-height: 14px;
  text-align: center;
  display: none; /* shown by JS when count > 0 */
}

.p-topbar__secure-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--p-success, #16a34a);
  background: rgba(22,163,74,.08);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

/* Notification panel */
.p-topbar__notif-panel {
  width: 320px;
  padding: 0;
  border: 1px solid var(--p-border-soft);
  border-radius: var(--p-radius-md);
  box-shadow: var(--p-shadow-lg);
}

.p-topbar__notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--p-border-soft);
  font-size: 0.82rem;
}

.p-topbar__notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  color: var(--p-slate);
  font-size: 0.8rem;
}
.p-topbar__notif-empty i { font-size: 1.5rem; }

/* User button */
.p-topbar__user-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--p-border-soft);
  border-radius: 24px;
  padding: 0.25rem 0.65rem 0.25rem 0.25rem;
  cursor: pointer;
  color: var(--p-navy);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.p-topbar__user-btn:hover { background: var(--p-surface-2); border-color: var(--p-royal); }
.p-topbar__user-btn::after { display: none; } /* remove BS caret — use icon */

.p-topbar__user-avatar {
  width: 26px;
  height: 26px;
  background: var(--p-royal);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.p-topbar__user-name { font-size: 0.78rem; font-weight: 600; color: var(--p-navy); }

.p-topbar__user-menu {
  min-width: 190px;
  padding: 0;
  border: 1px solid var(--p-border-soft);
  border-radius: var(--p-radius-md);
  box-shadow: var(--p-shadow-md);
  overflow: hidden;
}

.p-topbar__user-menu-header {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.85rem;
}
.p-topbar__user-menu-header strong { font-size: 0.82rem; color: var(--p-navy); }

.p-topbar__user-menu .dropdown-item {
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  color: var(--p-navy);
}
.p-topbar__user-menu .dropdown-item:hover { background: var(--p-surface-2); }
.p-topbar__user-menu .dropdown-item.text-danger { color: #dc2626 !important; }
.p-topbar__user-menu .dropdown-item.text-danger:hover { background: #fef2f2; }

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM CUSTOMER DASHBOARD COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Account card (replaces plain border box) */
.p-account-card {
  background: linear-gradient(135deg, var(--p-navy) 0%, var(--p-royal) 100%);
  color: #fff;
  border-radius: var(--p-radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.p-account-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}

.p-account-card__type {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-gold);
  margin-bottom: 0.4rem;
}

.p-account-card__number {
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  color: rgba(255,255,255,.7);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.p-account-card__balance-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,.5);
  margin-bottom: 0.15rem;
}

.p-account-card__balance {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.p-account-card__status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(255,255,255,.12);
  color: #fff;
  text-transform: uppercase;
}
.p-account-card__status.active { background: rgba(22,163,74,.3); color: #86efac; }
.p-account-card__status.inactive,
.p-account-card__status.frozen  { background: rgba(220,38,38,.25); color: #fca5a5; }

/* KPI tile */
.p-kpi-tile {
  background: #fff;
  border: 1px solid var(--p-border-soft);
  border-radius: var(--p-radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.p-kpi-tile__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--p-slate);
}

.p-kpi-tile__value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--p-navy);
  line-height: 1.1;
}

.p-kpi-tile__hint {
  font-size: 0.68rem;
  color: var(--p-slate);
}

.p-kpi-tile--gold { border-top: 3px solid var(--p-gold); }
.p-kpi-tile--royal { border-top: 3px solid var(--p-royal); }
.p-kpi-tile--teal  { border-top: 3px solid var(--p-teal, #0d9488); }
.p-kpi-tile--slate { border-top: 3px solid var(--p-slate); }

/* Transaction timeline */
.p-txn-timeline { list-style: none; padding: 0; margin: 0; }

.p-txn-timeline__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--p-border-soft);
}
.p-txn-timeline__item:last-child { border-bottom: none; }

.p-txn-timeline__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: var(--p-surface-2);
  color: var(--p-slate);
}
.p-txn-timeline__icon.credit { background: rgba(22,163,74,.1); color: #16a34a; }
.p-txn-timeline__icon.debit  { background: rgba(220,38,38,.1); color: #dc2626; }
.p-txn-timeline__icon.transfer { background: rgba(26,65,148,.1); color: var(--p-royal); }

.p-txn-timeline__body { flex: 1; min-width: 0; }

.p-txn-timeline__ref {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--p-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-txn-timeline__meta {
  font-size: 0.67rem;
  color: var(--p-slate);
}

.p-txn-timeline__amount {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.p-txn-timeline__amount.credit { color: #16a34a; }
.p-txn-timeline__amount.debit  { color: #dc2626; }

/* Quick-action bar */
.p-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.p-quick-actions .btn { border-radius: 20px; font-size: 0.78rem; padding: 0.35rem 0.9rem; }

/* Teller metric row */
.p-teller-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--p-border-soft);
  font-size: 0.82rem;
}
.p-teller-metric:last-child { border-bottom: none; }
.p-teller-metric__label { color: var(--p-slate); font-weight: 500; }
.p-teller-metric__value { font-weight: 700; color: var(--p-navy); }

/* Approval queue item */
.p-approval-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--p-border-soft);
}
.p-approval-item:last-child { border-bottom: none; }
.p-approval-item__icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(26,65,148,.08); color: var(--p-royal);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
}
.p-approval-item__body { flex: 1; min-width: 0; }
.p-approval-item__ref { font-size: 0.78rem; font-weight: 600; color: var(--p-navy); }
.p-approval-item__meta { font-size: 0.67rem; color: var(--p-slate); }

/* AML / audit flag item */
.p-flag-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--p-border-soft);
}
.p-flag-item:last-child { border-bottom: none; }
.p-flag-item__dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 0.3rem; flex-shrink: 0;
  background: var(--p-danger, #dc2626);
}
.p-flag-item__dot.warning { background: var(--p-warning, #d97706); }
.p-flag-item__dot.info    { background: var(--p-royal); }
.p-flag-item__body { flex: 1; }
.p-flag-item__ref  { font-size: 0.78rem; font-weight: 600; color: var(--p-navy); }
.p-flag-item__meta { font-size: 0.67rem; color: var(--p-slate); }

/* System health row */
.p-health-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--p-border-soft);
  font-size: 0.8rem;
}
.p-health-row:last-child { border-bottom: none; }
.p-health-row__indicator {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: #16a34a;
}
.p-health-row__indicator.warn { background: #d97706; }
.p-health-row__indicator.err  { background: #dc2626; }
.p-health-row__label { flex: 1; color: var(--p-slate); }
.p-health-row__value { font-weight: 700; color: var(--p-navy); font-size: 0.78rem; }

/* Responsive: sidebar collapses to overlay on mobile */
@media (max-width: 768px) {
  .p-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease, width 0.22s ease;
    z-index: 1050;
  }
  .p-sidebar.is-open {
    transform: translateX(0);
  }
  .p-topbar__search { display: none; }
}

@media (max-width: 576px) {
  .p-topbar { padding: 0 0.75rem; }
  .p-topbar__portal-badge { display: none; }
}
