/* =============================================
   NetImpact Workflow Engine — Admin UI
   USWDS-Inspired Design System
   ============================================= */

/* === DESIGN TOKENS === */
:root {
  /* Brand palette */
  --uswds-blue-5:  #eef6fd;
  --uswds-blue-10: #d0e8f7;
  --uswds-blue-60: #5fa8e8;
  --uswds-blue-70: #1a4480;
  --uswds-blue-80: #162e51;
  --uswds-green-50: #16a34a;
  --uswds-green-60: #15803d;
  --uswds-gold-20: #fef3c7;
  --uswds-gold-50: #d97706;
  --uswds-gold-60: #b45309;
  --uswds-red-50:  #e02424;
  --uswds-red-60:  #b91c1c;
  --uswds-gray-2:  #f4f7fb;
  --uswds-gray-5:  #e9eef5;
  --uswds-gray-10: #dce3ed;
  --uswds-gray-30: #a0aec0;
  --uswds-gray-50: #6b7a8d;
  --uswds-gray-70: #3d4f66;
  --uswds-gray-90: #0d1b2a;

  /* Semantic aliases — brand-aligned */
  --c-primary:      #162e51;
  --c-primary-dark: #0c1e38;
  --c-accent:       #5fa8e8;
  --c-accent-tint:  rgba(95,168,232,0.10);
  --c-bg:           #f4f7fb;
  --c-surface:      #ffffff;
  --c-sidebar:      #162e51;
  --c-text:         #0d1b2a;
  --c-text-muted:   #6b7a8d;
  --c-border:       #dce3ed;
  --c-success:      #16a34a;
  --c-success-bg:   #f0fdf4;
  --c-warning:      #d97706;
  --c-warning-bg:   #fffbeb;
  --c-danger:       #e02424;
  --c-danger-bg:    #fff0f0;
  --c-info-bg:      #eef6fd;

  /* Typography — Syne headings + DM Sans body */
  --font-heading: 'Syne', sans-serif;
  --font: 'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;

  /* Spacing (8px grid) */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;
  --sp-4: 1rem;     --sp-5: 1.25rem;  --sp-6: 1.5rem;
  --sp-8: 2rem;     --sp-10: 2.5rem;  --sp-12: 3rem;

  /* Shape */
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(22,46,81,0.06);
  --shadow:    0 2px 8px rgba(22,46,81,0.08), 0 1px 3px rgba(22,46,81,0.06);
  --shadow-lg: 0 8px 24px rgba(22,46,81,0.12), 0 2px 6px rgba(22,46,81,0.08);

  --sidebar-w: 260px;
  --sidebar-collapsed-w: 72px;
  --header-h:  60px;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  margin: 0; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); font-weight: 700; color: var(--c-text); margin: 0 0 var(--sp-4); line-height: 1.3; }
p { margin: 0 0 var(--sp-4); line-height: 1.6; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--c-primary-dark); }
code,pre { font-family: var(--font-mono); font-size: 0.875rem; }

/* === LAYOUT === */
.usa-layout { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* --- Sidebar --- */
.usa-body-wrapper {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
}
.usa-sidebar {
  width: var(--sidebar-w);
  height: 100%;
  background: var(--c-sidebar);
  display: flex; flex-direction: column; flex-shrink: 0;
  z-index: 100; overflow-y: auto;
  transition: width 0.25s ease, transform 0.25s ease;
}
.usa-sidebar__brand {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.usa-sidebar__brand-icon { font-size: 1.5rem; color: #7dc3f5; flex-shrink: 0; }
.usa-sidebar__brand-name  { display: block; font-size: 1rem; font-weight: 700; color: white; }
.usa-sidebar__brand-sub   { display: block; font-size: 0.7rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .08em; }
.usa-nav { flex: 1; padding: var(--sp-3) var(--sp-2) var(--sp-4); overflow-y: auto; }
.usa-nav__section {
  padding: 20px var(--sp-3) var(--sp-2);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
}
.usa-nav__section:first-child { padding-top: var(--sp-4); }
.usa-nav__link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 14px; color: rgba(255,255,255,0.65);
  border-radius: var(--radius); margin: 2px var(--sp-1);
  font-size: 0.875rem; font-weight: 500; font-family: var(--font);
  transition: background .15s, color .15s; text-decoration: none;
  position: relative; border-left: 3px solid transparent;
  color: rgb(245, 245, 245);
}
.usa-nav__link:hover  { background: rgba(255,255,255,0.05); color: white; text-decoration: none; }
.usa-nav__link.active {
  background: rgba(95,168,232,0.18);
  color: white;
  border-left-color: #5fa8e8;
  font-weight: 600;
}
.usa-nav__link.active .nav-icon { color: #5fa8e8; opacity: 1; }
.usa-nav__link .nav-icon { width: 18px; text-align: center; font-size: 15px; opacity: .65; color: rgba(255,255,255,0.65); }
/* --- Sidebar bottom collapse toggle --- */
.sidebar-collapse-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  width: 100%; padding: var(--sp-3) var(--sp-4);
  background: none; border: none; border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45); cursor: pointer; font-size: 0.8rem;
  font-family: var(--font); font-weight: 500;
  transition: background .15s, color .15s;
  text-align: left;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.75); }
.sidebar-collapse-btn .collapse-icon { font-size: 13px; transition: transform 0.25s ease; margin-left: auto; }
.usa-sidebar.sidebar-collapsed .sidebar-collapse-btn .collapse-icon { transform: rotate(180deg); }
.usa-sidebar.sidebar-collapsed .sidebar-collapse-btn span { display: none; }

/* User card row */
.sidebar-user-card {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2); border-radius: var(--radius);
}
.sidebar-user-card__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.15);
}
.sidebar-user-card__info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.sidebar-user-card__name {
  font-size: .8rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-card__role {
  font-size: .68rem; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .04em;
}
.sidebar-theme-btn {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.55); border-radius: 6px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; font-size: .8rem;
  transition: background .15s, color .15s;
}
.sidebar-theme-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Sign-out button */
.sidebar-signout-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 9px var(--sp-3);
  background: rgba(229,34,7,.12);
  border: 1px solid rgba(229,34,7,.25);
  border-radius: var(--radius);
  color: rgba(255,255,255,.65);
  font-size: .82rem; font-weight: 500;
  text-decoration: none; letter-spacing: .02em;
  transition: background .18s, color .18s, border-color .18s;
}
.sidebar-signout-btn i { font-size: .85rem; }
.sidebar-signout-btn:hover {
  background: rgba(229,34,7,.28);
  border-color: rgba(229,34,7,.5);
  color: #ffa89a;
  text-decoration: none;
}
.sidebar-signout-btn:active { background: rgba(229,34,7,.4); }

/* keep old class working if referenced elsewhere */
.usa-sidebar__logout { display: none; }

/* --- Main wrapper --- */
.usa-main-wrapper {
  flex: 1;
  display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow-y: auto;
}

/* --- Header --- */
.usa-header {
  height: var(--header-h); background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; padding: 0 var(--sp-5); gap: var(--sp-3);
  flex-shrink: 0; position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 4px rgba(22,46,81,0.06);
  width: 100%; overflow: visible;
}
/* Left slot: hamburger + logo */
.usa-header__left  { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
/* Center slot: search bar — expands to fill available space */
.usa-header__center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 var(--sp-4); min-width: 0; }
/* Right slot: always pinned to far right */
.usa-header__right { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; margin-left: auto; }

/* When layout uses brand div directly (without left/right wrappers) */
.usa-header__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.usa-header > .usa-header__brand { flex: 1; }

/* Menu toggle — hidden on desktop, shown on mobile */
.usa-menu-toggle {
  display: flex;
  align-items: center; justify-content: center;
  background: none; border: none; padding: var(--sp-2); width: 36px; height: 36px;
  color: var(--c-text-muted); cursor: pointer; font-size: 1rem;
  border-radius: var(--radius); transition: background .15s, color .15s;
  flex-shrink: 0;
}
.usa-menu-toggle:hover { background: var(--c-bg); color: var(--c-primary); }

/* User profile in header */
.usa-user-profile { display: flex; align-items: center; gap: var(--sp-3); }
.usa-user-profile__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
  font-family: var(--font-heading);
}
.usa-user-profile__info { line-height: 1.25; }
.usa-user-profile__name { display: block; font-size: 0.875rem; font-weight: 500; color: var(--c-text); font-family: var(--font); white-space: nowrap; }
.usa-user-profile__role { display: block; font-size: 0.7rem; color: var(--c-text-muted); text-transform: capitalize; }

/* --- Main content --- */
/* --- Main content area --- */
.usa-main { flex: 1; padding: var(--sp-8) var(--sp-6); overflow-y: auto; min-width: 0; min-height: 0; }

/* Header brand lockup — icon tile + wordmark + sub */
.usa-header__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.usa-header__brand:hover { text-decoration: none; }
.usa-header__brand-tile {
  width: 38px; height: 38px; border-radius: 12px;
  background: #162e51; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.usa-header__brand-tile svg { width: 22px; height: 22px; display: block; }
.usa-header__brand-text { display: flex; flex-direction: column; gap: 1px; }
.usa-header__brand-name { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; color: var(--c-text); line-height: 1.1; letter-spacing: -0.2px; }
.usa-header__brand-sub { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--c-text-muted); line-height: 1; }

/* === NAVBAR PROFILE (details/summary dropdown) === */
.navbar-profile {
  position: relative;
  display: inline-block;
  list-style: none;
}
.navbar-profile_container {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-3);
  list-style: none;
}
.navbar-profile__trigger {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 6px var(--sp-2); border-radius: var(--radius);
  cursor: pointer; user-select: none; list-style: none;
  transition: background .15s;
  /* No fixed margins — stays pinned by parent flex container */
}
.navbar-profile__trigger::-webkit-details-marker { display: none; }
.navbar-profile__trigger::marker { display: none; }
.navbar-profile:hover > .navbar-profile__trigger,
.navbar-profile[open] > .navbar-profile__trigger { background: var(--uswds-blue-5); }
.navbar-profile__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
  font-family: var(--font-heading);
}
.navbar-profile__info { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.navbar-profile__name { display: block; font-size: 0.875rem; font-weight: 500; color: var(--c-text); white-space: nowrap; font-family: var(--font); }
.navbar-profile__role { display: block; font-size: 0.7rem; color: var(--c-text-muted); text-transform: capitalize; }
.navbar-profile__chevron {
  font-size: 0.65rem; color: var(--c-text-muted);
  transition: transform .2s ease;
}
.navbar-profile[open] .navbar-profile__chevron { transform: rotate(180deg); }
.navbar-profile__dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  z-index: 300; overflow: hidden;
  animation: fadeInUp .15s ease;
}
.navbar-profile__dropdown-item {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.875rem; text-decoration: none; color: var(--c-text);
  transition: background .12s; font-family: var(--font);
}
.navbar-profile__dropdown-item:hover { background: var(--uswds-blue-5); text-decoration: none; }
.navbar-profile__dropdown-item--danger { color: var(--c-danger); }
.navbar-profile__dropdown-item--danger:hover { background: var(--c-danger-bg); }

/* === PAGE HEADER === */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--sp-6); gap: var(--sp-4); flex-wrap: wrap;
}
.page-header__body { flex: 1; }
.page-title    { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 800; margin: 0; color: var(--c-text); letter-spacing: -0.3px; }
.page-subtitle { font-size: 0.875rem; color: var(--c-text-muted); margin: var(--sp-1) 0 0; font-family: var(--font); }

/* === STATS GRID === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-6); }
/* 5-column KPI row variant */
.stats-grid.stats-grid--kpi { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.stats-grid.stats-grid--kpi .stat-card { padding: var(--sp-4); gap: var(--sp-3); min-width: 0; }
.stats-grid.stats-grid--kpi .stat-card__icon { width: 40px; height: 40px; font-size: 1rem; border-radius: 10px; flex-shrink: 0; }
.stats-grid.stats-grid--kpi .stat-card__value { font-size: 1.6rem; }
.stats-grid.stats-grid--kpi .stat-card__label { font-size: 0.68rem; margin-top: 2px; }
.stats-grid.stats-grid--kpi .stat-card__trend { font-size: 0.7rem; margin-top: 2px; }
@media (max-width: 1200px) { .stats-grid.stats-grid--kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px)  { .stats-grid.stats-grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .stats-grid.stats-grid--kpi { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--c-surface); border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg); padding: var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s cubic-bezier(.4,0,.2,1), transform .2s cubic-bezier(.4,0,.2,1);
  border-top: 3px solid transparent;
  position: relative; overflow: hidden;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(22,46,81,0.10); transform: translateY(-2px); }
.stat-card__icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-card--blue   { border-top-color: #5fa8e8; }
.stat-card--green  { border-top-color: #16a34a; }
.stat-card--amber  { border-top-color: #d97706; }
.stat-card--red    { border-top-color: #e02424; }
.stat-card--purple { border-top-color: #7c3aed; }
.stat-card--teal   { border-top-color: #0891b2; }
.stat-card--blue   .stat-card__icon { background: rgba(95,168,232,0.10); color: #5fa8e8; }
.stat-card--green  .stat-card__icon { background: #f0fdf4; color: #16a34a; }
.stat-card--amber  .stat-card__icon { background: #fffbeb; color: #d97706; }
.stat-card--red    .stat-card__icon { background: #fff0f0; color: #e02424; }
.stat-card--purple .stat-card__icon { background: #f5f3ff; color: #7c3aed; }
.stat-card--teal   .stat-card__icon { background: #ecfeff; color: #0891b2; }
.stat-card__value  { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 800; line-height: 1; margin: 0; color: var(--c-text); }
.stat-card__label  { font-size: 0.7rem; color: var(--c-text-muted); margin: var(--sp-1) 0 0; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.stat-card__trend  { font-size: 0.75rem; margin-top: var(--sp-1); }

/* === SECTION === */
.section { margin-bottom: var(--sp-8); }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--c-border);
}
.section-title { font-size: 1rem; font-weight: 700; margin: 0; }

/* === CARDS === */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: var(--sp-5);
  box-shadow: var(--shadow-sm); margin-bottom: var(--sp-4);
}
.card-header {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}
.card-title { font-size: 1rem; font-weight: 700; margin: 0; }
.card-icon   { width: 36px; height: 36px; border-radius: var(--radius); background: var(--c-info-bg); color: var(--c-primary); display: flex; align-items: center; justify-content: center; }

/* Detail field grid */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4) var(--sp-6); }
.detail-field { }
.detail-field dt { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--c-text-muted); margin-bottom: var(--sp-1); }
.detail-field dd { font-size: 0.9rem; color: var(--c-text); margin: 0; }
.detail-field dd.mono { font-family: var(--font-mono); font-size: 0.75rem; background: var(--c-bg); padding: var(--sp-1) var(--sp-2); border-radius: var(--radius); word-break: break-all; display: inline-block; }

/* === QUICK LINKS === */
.quick-links { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.quick-link {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: var(--sp-2) var(--sp-4);
  font-size: 0.875rem; font-weight: 500; color: var(--c-primary);
  box-shadow: var(--shadow-sm); transition: background .12s, box-shadow .12s;
  display: inline-flex; align-items: center; gap: var(--sp-2);
}
.quick-link:hover { background: var(--c-info-bg); box-shadow: var(--shadow); text-decoration: none; }

/* ============================================================
   ENTERPRISE BUTTON SYSTEM
   Base → .btn  Variants → -primary -secondary -success -warning -danger -ghost
   Sizes → -sm (default) -md -lg   Modifier → -block
   USWDS aliases: .usa-button .usa-button--outline .usa-button--small
   ============================================================ */
.btn,
.usa-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  padding: 0.4375rem 1rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-size: 0.8125rem; font-weight: 600; font-family: var(--font);
  letter-spacing: 0.01em; line-height: 1.4;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease,
              box-shadow 0.14s ease, color 0.14s ease, transform 0.1s ease;
  user-select: none; vertical-align: middle;
}
.btn:focus-visible,
.usa-button:focus-visible {
  outline: 2.5px solid var(--c-primary); outline-offset: 2px;
}
.btn:active:not(:disabled),
.usa-button:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[disabled],
.usa-button:disabled { opacity: 0.48; cursor: not-allowed; pointer-events: none; }

/* Primary */
.btn-primary,
.usa-button:not(.usa-button--outline):not(.usa-button--unstyled) {
  background: var(--c-primary); color: #fff; border-color: var(--c-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.08);
}
.btn-primary:hover,
.usa-button:not(.usa-button--outline):not(.usa-button--unstyled):hover {
  background: var(--c-primary-dark); border-color: var(--c-primary-dark);
  box-shadow: 0 2px 6px rgba(0,94,162,.35); color: #fff; text-decoration: none;
}

/* Secondary / outline */
.btn-secondary,
.usa-button--outline {
  background: var(--c-surface); color: var(--c-primary);
  border-color: var(--c-primary);
}
.btn-secondary:hover,
.usa-button--outline:hover {
  background: var(--c-info-bg); border-color: var(--c-primary-dark);
  color: var(--c-primary-dark); text-decoration: none;
}

/* Success */
.btn-success { background: var(--c-success); color: #fff; border-color: var(--c-success); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.btn-success:hover { background: var(--uswds-green-60); border-color: var(--uswds-green-60); color: #fff; text-decoration: none; box-shadow: 0 2px 6px rgba(0,169,28,.3); }

/* Warning */
.btn-warning { background: var(--c-warning); color: #fff; border-color: var(--c-warning); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.btn-warning:hover { background: var(--uswds-gold-60); border-color: var(--uswds-gold-60); color: #fff; text-decoration: none; }

/* Danger */
.btn-danger { background: var(--c-danger); color: #fff; border-color: var(--c-danger); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.btn-danger:hover { background: var(--uswds-red-60); border-color: var(--uswds-red-60); color: #fff; text-decoration: none; box-shadow: 0 2px 6px rgba(229,34,7,.3); }

/* Ghost */
.btn-ghost { background: transparent; color: var(--c-text-muted); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-bg); color: var(--c-text); border-color: var(--c-text-muted); text-decoration: none; }

/* Sizes */
.btn-sm, .usa-button--small { padding: 0.3rem 0.75rem; font-size: 0.75rem; }
.btn-md { padding: 0.4375rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.625rem 1.375rem; font-size: 0.9375rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: inline-flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

/* ============================================================
   ENTERPRISE FORM CONTROLS
   ============================================================ */
.form-group   { margin-bottom: var(--sp-5); }
.form-label   { display: block; font-weight: 600; margin-bottom: var(--sp-1); font-size: 0.8rem; color: var(--c-text); letter-spacing: .01em; }
.form-hint    { font-size: 0.72rem; color: var(--c-text-muted); margin-bottom: var(--sp-1); }

/* Shared input/select/textarea base */
.form-control,
.usa-input,
.usa-select,
.usa-textarea {
  display: block; width: 100%;
  padding: 0.4375rem 0.75rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  font-size: 0.8125rem; font-family: var(--font); color: var(--c-text);
  line-height: 1.5; outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
}
.form-control:hover, .usa-input:hover, .usa-select:hover {
  border-color: var(--c-text-muted);
}
.form-control:focus, .usa-input:focus, .usa-select:focus, .usa-textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0,94,162,.15), inset 0 1px 2px rgba(0,0,0,.04);
  outline: none;
}
.form-control::placeholder, .usa-input::placeholder { color: var(--c-text-muted); opacity: 0.7; }

/* Select with custom chevron */
select.form-control,
.usa-select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.625rem center;
  background-size: 14px; padding-right: 2rem; cursor: pointer;
}
select.form-control:focus, .usa-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23005ea2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
textarea.form-control, .usa-textarea { resize: vertical; min-height: 96px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); }

/* === AUTH / LOGIN PAGE === */

/* Full-screen split layout */
.auth-page {
  display: flex;
  min-height: 100vh;
  font-family: var(--font);
}

/* ── Left brand panel ── */
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 42%;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--uswds-blue-80) 0%, var(--uswds-blue-70) 60%, var(--c-primary) 100%);
  color: #fff;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.auth-brand__content { position: relative; }
.auth-brand__logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  backdrop-filter: blur(4px);
}
.auth-brand__name {
  font-size: 1.875rem; font-weight: 700;
  margin: 0 0 .375rem; letter-spacing: -.02em;
}
.auth-brand__tagline {
  font-size: .9375rem; opacity: .8; margin: 0 0 2.5rem;
  font-weight: 300; letter-spacing: .01em;
}
.auth-brand__features {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .875rem;
}
.auth-brand__features li {
  display: flex; align-items: center; gap: .75rem;
  font-size: .9375rem; opacity: .9;
}
.auth-brand__features li i { font-size: .875rem; opacity: .85; flex-shrink: 0; }
.auth-brand__footer {
  position: relative; font-size: .75rem; opacity: .5; margin: 0;
}

/* ── Right form panel ── */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fb;
  padding: 2rem 1.5rem;
  min-height: 100vh;
}

.auth-form-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 12px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07), 0 8px 32px rgba(0,0,0,.06);
}

.auth-form-card__header { text-align: center; margin-bottom: 1.875rem; }
.auth-form-card__icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--uswds-blue-5);
  color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin: 0 auto 1rem;
  border: 2px solid var(--uswds-blue-10);
}
.auth-form-card__header h2 {
  font-size: 1.375rem; font-weight: 700; color: var(--c-text);
  margin: 0 0 .375rem;
}
.auth-form-card__header p {
  font-size: .875rem; color: var(--c-text-muted); margin: 0;
}

/* ── Auth alert ── */
.auth-alert {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .875rem 1rem;
  border-radius: 6px;
  border-left: 4px solid;
  margin-bottom: 1.25rem;
  font-size: .875rem;
  animation: auth-shake .35s ease;
}
.auth-alert i { flex-shrink: 0; margin-top: .1em; font-size: 1rem; }
.auth-alert div { display: flex; flex-direction: column; gap: .125rem; }
.auth-alert strong { font-weight: 600; display: block; }
.auth-alert--error {
  background: var(--c-danger-bg);
  color: var(--uswds-red-60);
  border-color: var(--c-danger);
}
@keyframes auth-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  60%      { transform: translateX(5px); }
}

/* ── Auth field ── */
.auth-field { margin-bottom: 1.25rem; }
.auth-field__label {
  display: block;
  font-size: .875rem; font-weight: 600;
  color: var(--c-text); margin-bottom: .375rem;
}
.auth-field__required { color: var(--c-danger); margin-left: .125rem; }
.auth-field__wrap {
  position: relative; display: flex; align-items: center;
}
.auth-field__icon {
  position: absolute; left: .875rem;
  color: var(--c-text-muted); font-size: .875rem;
  pointer-events: none; transition: color .15s;
}
.auth-field__input {
  width: 100%; padding: .6875rem .875rem .6875rem 2.5rem;
  font-size: .9375rem; font-family: var(--font);
  border: 1.5px solid var(--c-border);
  border-radius: 6px;
  background: #fff; color: var(--c-text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.auth-field__input--has-toggle { padding-right: 2.75rem; }
.auth-field__input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0,94,162,.15);
}
.auth-field__input:focus ~ .auth-field__icon,
.auth-field__wrap:focus-within .auth-field__icon { color: var(--c-primary); }

/* status icons (check / x) */
.auth-field__status {
  position: absolute; right: .875rem;
  font-size: .875rem; display: none; pointer-events: none;
}
.auth-field__status--ok  { color: var(--c-success); }
.auth-field__status--err { color: var(--c-danger);  }

/* valid state */
.auth-field--valid .auth-field__input {
  border-color: var(--c-success);
  box-shadow: 0 0 0 3px rgba(0,169,28,.1);
}
.auth-field--valid .auth-field__status--ok { display: block; }

/* invalid state */
.auth-field--invalid .auth-field__input {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px rgba(229,34,7,.1);
}
.auth-field--invalid .auth-field__status--err { display: block; }
.auth-field--invalid .auth-field__icon        { color: var(--c-danger); }

/* hint text */
.auth-field__hint {
  display: block; margin-top: .3125rem;
  font-size: .8125rem; min-height: 1.1em;
  color: var(--c-danger);
}
.auth-field--valid .auth-field__hint { color: var(--c-success); }

/* password toggle button */
.auth-field__toggle {
  position: absolute; right: 0;
  height: 100%; width: 2.75rem;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--c-text-muted); font-size: .875rem;
  transition: color .15s;
}
.auth-field__toggle:hover { color: var(--c-primary); }

/* ── Submit button ── */
.auth-submit {
  width: 100%; margin-top: .5rem;
  display: flex; align-items: center; justify-content: center; gap: .625rem;
  padding: .75rem 1.5rem;
  font-size: 1rem; font-weight: 600; font-family: var(--font);
  background: var(--c-primary); color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(0,94,162,.35);
}
.auth-submit:hover  { background: var(--c-primary-dark); box-shadow: 0 4px 12px rgba(0,94,162,.4); }
.auth-submit:active { transform: translateY(1px); box-shadow: 0 1px 3px rgba(0,94,162,.3); }
.auth-submit:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.auth-submit__arrow { transition: transform .15s; }
.auth-submit:hover .auth-submit__arrow { transform: translateX(3px); }
.auth-submit--loading .auth-submit__arrow { display: none; }
.auth-submit__spinner { font-size: .9rem; }

/* ── Mobile: hide brand panel, center form ── */
@media (max-width: 768px) {
  .auth-brand { display: none; }
  .auth-form-panel { background: var(--c-sidebar); padding: 1.5rem 1rem; }
  .auth-form-card { padding: 2rem 1.5rem; }
}
@media (max-width: 400px) {
  .auth-form-card { padding: 1.5rem 1.125rem; border-radius: 8px; }
}

/* === ALERTS === */
.alert {
  padding: var(--sp-4); border-radius: var(--radius);
  margin-bottom: var(--sp-4); font-size: 0.875rem;
  display: flex; align-items: flex-start; gap: var(--sp-3);
  border-left: 4px solid;
}
.alert-danger  { background: var(--c-danger-bg);  color: var(--uswds-red-60);   border-color: var(--c-danger);  }
.alert-success { background: var(--c-success-bg); color: var(--uswds-green-60); border-color: var(--c-success); }
.alert-warning { background: var(--c-warning-bg); color: var(--uswds-gold-60);  border-color: var(--c-warning); }
.alert-info    { background: var(--c-info-bg);    color: var(--c-primary-dark); border-color: var(--c-primary); }

/* Credential reveal box */
.credential-box {
  background: var(--uswds-blue-80); color: white;
  border-radius: var(--radius-lg); padding: var(--sp-5); margin-top: var(--sp-4);
}
.credential-box h4 { color: white; margin-bottom: var(--sp-3); font-size: 1rem; }
.credential-row  { display: flex; align-items: baseline; gap: var(--sp-2); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.credential-label { font-size: 0.7rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .07em; min-width: 80px; flex-shrink: 0; }
.credential-value { font-family: var(--font-mono); font-size: 0.75rem; background: rgba(255,255,255,.12); padding: var(--sp-1) var(--sp-2); border-radius: var(--radius); word-break: break-all; }

/* === TABLES === */
.table-container { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-toolbar {
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--c-bg); font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--c-text-muted);
  padding: 0.75rem 1rem; text-align: left;
  border-bottom: 2px solid var(--c-border); white-space: nowrap;
}
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--c-border); font-size: 0.875rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--c-bg); }
.td-primary   { font-weight: 600; }
.td-mono      { font-family: var(--font-mono); font-size: 0.75rem; }
.link-action  { color: var(--c-primary); font-weight: 600; font-size: 0.8rem; }
.link-action:hover { text-decoration: underline; }
.entity-cell  { display: flex; align-items: center; gap: var(--sp-2); }
.entity-icon  {
  width: 32px; height: 32px; border-radius: var(--radius);
  background: var(--c-info-bg); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center; font-size: 0.875rem; flex-shrink: 0;
}

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 3px;
  font-size: 0.7rem; font-weight: 700; line-height: 1.6; white-space: nowrap;
}
.badge--green  { background: var(--c-success-bg); color: var(--uswds-green-60); }
.badge--amber  { background: var(--c-warning-bg); color: var(--uswds-gold-60);  }
.badge--red    { background: var(--c-danger-bg);  color: var(--uswds-red-60);   }
.badge--grey   { background: var(--uswds-gray-5); color: var(--c-text-muted);   }
.badge--blue   { background: var(--c-info-bg);    color: var(--c-primary);      }
.badge--dark   { background: var(--c-text);       color: var(--c-surface);      }
.badge--purple { background: #f3e8ff;             color: #7c3aed;               }
.badge--teal   { background: #ccfbf1;             color: #0f766e;               }
.badge--indigo { background: #e0e7ff;             color: #4338ca;               }

/* === LOADING / EMPTY === */
.loading-spinner {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-3); padding: var(--sp-10); color: var(--c-text-muted); font-size: 0.875rem;
}
.loading-spinner .spinner {
  width: 20px; height: 20px; border: 2px solid var(--c-border);
  border-top-color: var(--c-primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-4); padding: var(--sp-12); color: var(--c-text-muted); text-align: center;
}
.empty-state__icon    { font-size: 2.5rem; opacity: .4; }
.empty-state__title   { font-size: 1.125rem; font-weight: 700; color: var(--c-text); margin: 0; }
.empty-state__message { font-size: 0.875rem; max-width: 360px; margin: 0; }

/* === LIFECYCLE STEPPER === */
.lifecycle-stepper {
  display: flex; align-items: flex-start; gap: 0;
  margin-bottom: var(--sp-8); overflow-x: auto; padding-bottom: var(--sp-2);
}
.lifecycle-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 90px; position: relative;
}
.lifecycle-step:not(:last-child)::after {
  content: ''; position: absolute;
  top: 19px; left: 50%; width: 100%; height: 2px;
  background: var(--c-border); z-index: 0;
}
.lifecycle-step.step--completed:not(:last-child)::after { background: var(--c-success); }
.lifecycle-step.step--active:not(:last-child)::after {
  background: linear-gradient(to right, var(--c-success) 50%, var(--c-border) 50%);
}
.lifecycle-step__node {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  border: 2px solid var(--c-border); background: var(--c-surface); color: var(--c-text-muted);
  z-index: 1; position: relative; transition: all .2s;
}
.lifecycle-step.step--completed .lifecycle-step__node { background: var(--c-success); border-color: var(--c-success); color: white; }
.lifecycle-step.step--active    .lifecycle-step__node { background: var(--c-primary); border-color: var(--c-primary); color: white; box-shadow: 0 0 0 4px var(--c-info-bg); }
.lifecycle-step.step--stalled   .lifecycle-step__node { background: var(--c-danger-bg); border-color: var(--c-danger); color: var(--c-danger); }
.lifecycle-step.step--skipped   .lifecycle-step__node { background: var(--c-bg); border-color: var(--c-border); color: var(--c-text-muted); opacity: .6; }
.lifecycle-step.step--rejected  .lifecycle-step__node { background: var(--c-danger); border-color: var(--c-danger); color: white; }
.lifecycle-step.step--reverted  .lifecycle-step__node { background: #f59e0b; border-color: #f59e0b; color: white; }
.lifecycle-step__label {
  margin-top: var(--sp-2); text-align: center;
  font-size: 0.7rem; font-weight: 500; color: var(--c-text-muted);
  line-height: 1.3; max-width: 80px;
}
.lifecycle-step.step--active    .lifecycle-step__label { color: var(--c-primary); font-weight: 700; }
.lifecycle-step.step--completed .lifecycle-step__label { color: var(--c-success); }
.lifecycle-step.step--stalled   .lifecycle-step__label { color: var(--c-danger); }
.lifecycle-step.step--rejected  .lifecycle-step__label { color: var(--c-danger); font-weight: 700; }
.lifecycle-step.step--reverted  .lifecycle-step__label { color: #b45309; }
.lifecycle-step.step--rejected:not(:last-child)::after { background: var(--c-danger); }
.lifecycle-step.step--reverted:not(:last-child)::after { background: #f59e0b; }
.lifecycle-step__sublabel { font-size: 0.65rem; color: var(--c-text-muted); text-align: center; max-width: 80px; margin-top: 2px; }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: var(--sp-4);
}
.modal {
  background: var(--c-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-width: 640px; width: 100%;
  max-height: 80vh; display: flex; flex-direction: column;
}
.modal-header {
  padding: var(--sp-5); border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: var(--sp-3);
}
.modal-title { font-size: 1.125rem; font-weight: 700; margin: 0; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--c-text-muted); font-size: 1.25rem; border-radius: var(--radius); padding: var(--sp-1); }
.modal-close:hover { background: var(--c-bg); color: var(--c-text); }
.modal-body   { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.modal-footer { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--c-border); display: flex; gap: var(--sp-3); justify-content: flex-end; }

/* Document items */
.doc-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.doc-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg); border-radius: var(--radius); border: 1px solid var(--c-border);
}
.doc-item__icon    { color: var(--c-primary); font-size: 1.25rem; flex-shrink: 0; }
.doc-item__name    { font-weight: 600; font-size: 0.875rem; }
.doc-item__meta    { font-size: 0.75rem; color: var(--c-text-muted); }
.doc-item__actions { margin-left: auto; }

/* === ACTIVITY TIMELINE === */
.timeline { position: relative; padding-left: var(--sp-8); }
.timeline::before {
  content: ''; position: absolute;
  left: calc(var(--sp-3) + 6px); top: var(--sp-2); bottom: 0;
  width: 2px; background: var(--c-border);
}
.timeline-item { position: relative; margin-bottom: var(--sp-5); padding-bottom: var(--sp-5); border-bottom: 1px solid var(--c-border); }
.timeline-item:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute;
  left: calc(-1 * var(--sp-8) + var(--sp-3)); top: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--c-surface); border: 2px solid var(--c-border);
}
.timeline-item.tl--success::before { border-color: var(--c-success); background: var(--c-success); }
.timeline-item.tl--active::before  { border-color: var(--c-primary); background: var(--c-primary); }
.timeline-item.tl--danger::before  { border-color: var(--c-danger);  background: var(--c-danger);  }
.timeline-meta  { font-size: 0.75rem; color: var(--c-text-muted); margin-bottom: var(--sp-1); display: flex; align-items: center; gap: var(--sp-2); }
.timeline-title { font-weight: 600; font-size: 0.875rem; margin-bottom: var(--sp-1); }
.timeline-body  { font-size: 0.875rem; color: var(--c-text-muted); }

/* === TABS === */
.tabs { border-bottom: 2px solid var(--c-border); margin-bottom: var(--sp-6); display: flex; gap: 0; }
.tab-btn {
  background: none; border: none; border-bottom: 3px solid transparent;
  padding: var(--sp-3) var(--sp-5); font-size: 0.875rem; font-weight: 600;
  color: var(--c-text-muted); cursor: pointer; margin-bottom: -2px;
  font-family: var(--font); transition: color .15s, border-color .15s;
}
.tab-btn:hover  { color: var(--c-text); }
.tab-btn.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* === ENTERPRISE FILTER TOOLBAR === */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  margin-bottom: 1.25rem;
}
/* Search input — styled to match chart-filter-select */
.filter-bar__search-wrap {
  display: flex; align-items: center; gap: .45rem;
  padding: 0.25rem 0.625rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  height: 1.875rem;
  flex: 0 1 240px; min-width: 140px;
  transition: border-color .13s, box-shadow .13s;
}
.filter-bar__search-wrap:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0,94,162,.15);
}
.filter-bar__search-icon { color: var(--c-text-muted); font-size: .8rem; flex-shrink: 0; }
.filter-bar__input {
  border: none; background: transparent; outline: none;
  font-size: 0.75rem; font-family: var(--font); font-weight: 500;
  color: var(--c-text); width: 100%; padding: 0;
}
.filter-bar__input::placeholder { color: var(--c-text-muted); opacity: .75; }
/* Divider between groups */
.filter-bar__sep {
  width: 1px; height: 18px; background: var(--c-border);
  flex-shrink: 0; margin: 0 var(--sp-1);
}
/* Label + select group */
.filter-bar__field {
  display: flex; align-items: center; gap: .35rem;
  flex-shrink: 0;
}
.filter-bar__label {
  font-size: .7rem; font-weight: 700; color: var(--c-text-muted);
  white-space: nowrap; text-transform: uppercase; letter-spacing: .05em;
}
/* Select — identical look to .chart-filter-select */
.filter-bar__select {
  font-size: 0.75rem; font-family: var(--font); font-weight: 500;
  padding: 0.25rem 1.75rem 0.25rem 0.625rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  height: 1.875rem;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 12px;
  transition: border-color .13s, box-shadow .13s;
}
.filter-bar__select:hover { border-color: var(--c-text-muted); }
.filter-bar__select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0,94,162,.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23005ea2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.filter-bar__spacer { flex: 1 1 0; min-width: var(--sp-2); }
.filter-bar__count {
  font-size: .72rem; font-weight: 600; color: var(--c-text-muted);
  white-space: nowrap; padding: 3px 10px;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: 99px; flex-shrink: 0;
}
/* Legacy overrides so old .usa-select / .usa-input inside filter-bar don't go full-width */
.filter-bar .form-group { margin-bottom: 0; min-width: 180px; }
.filter-bar .form-label { font-size: 0.75rem; }

/* === ACTION PORTAL — Request Type Cards === */
.request-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-6); }
.request-type-card {
  background: var(--c-surface); border: 2px solid var(--c-border);
  border-radius: var(--radius-lg); padding: var(--sp-5); text-align: center; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  text-decoration: none; color: var(--c-text);
}
.request-type-card:hover { border-color: var(--c-primary); box-shadow: var(--shadow); text-decoration: none; color: var(--c-text); }
.request-type-card__icon  { font-size: 1.75rem; margin-bottom: var(--sp-2); }
.request-type-card__name  { font-weight: 700; font-size: 0.875rem; }
.request-type-card__count { font-size: 0.75rem; color: var(--c-text-muted); margin-top: var(--sp-1); }

/* Action portal action card */
.action-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-border);
  border-radius: var(--radius-lg); padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-sm); margin-bottom: var(--sp-3);
  display: flex; align-items: flex-start; gap: var(--sp-4);
  transition: box-shadow .15s, border-color .15s;
}
.action-card:hover { box-shadow: var(--shadow); }
.action-card--pending    { border-left-color: var(--c-text-muted); }
.action-card--inprogress { border-left-color: var(--c-primary); }
.action-card--completed  { border-left-color: var(--c-success); }
.action-card--expired    { border-left-color: var(--c-warning); }
.action-card--stalled    { border-left-color: var(--c-danger); }
.action-card__icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
  background: var(--c-info-bg); color: var(--c-primary);
}
.action-card__body    { flex: 1; min-width: 0; }
.action-card__title   { font-weight: 700; font-size: 1rem; margin-bottom: var(--sp-1); }
.action-card__meta    { font-size: 0.8rem; color: var(--c-text-muted); display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.action-card__actions { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }

/* === BLAZOR ERROR UI === */
#blazor-error-ui {
  background: var(--c-danger); bottom: 0; display: none; left: 0;
  padding: 0.6rem 1.25rem; position: fixed; width: 100%; z-index: 9999;
  color: white; font-size: 0.875rem;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { background: var(--c-danger-bg); color: var(--uswds-red-60); padding: 1rem; border-radius: var(--radius); border-left: 4px solid var(--c-danger); }
.blazor-error-boundary::after { content: "An error has occurred." }

/* === VALIDATION === */
.valid.modified:not([type=checkbox]) { border-color: var(--c-success); }
.invalid  { border-color: var(--c-danger); outline: none; }
.validation-message { color: var(--c-danger); font-size: 0.75rem; margin-top: var(--sp-1); }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .usa-main { padding: var(--sp-4); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
}

/* Legacy --color-* block removed; all rules now use --c-* brand tokens */

/* ============================================================
   NEW SCREENS — Instance Monitor, Request Management, etc.
   ============================================================ */

/* === Monitor two-column layout === */
.monitor-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--sp-4);
  align-items: start;
}
@media (max-width: 960px) {
  .monitor-layout { grid-template-columns: 1fr; }
}

/* === Panel === */
.panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); overflow: hidden; }
.panel--empty { display: flex; align-items: center; justify-content: center; min-height: 300px; }
.panel__header { padding: var(--sp-4) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--c-border); display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.panel__title { font-size: 1rem; font-weight: 700; color: var(--c-text); margin: 0; }
.panel__body { padding: var(--sp-4); }

/* === Detail list === */
.detail-list { display: grid; grid-template-columns: 140px 1fr; gap: var(--sp-1) var(--sp-3); margin: 0; font-size: .875rem; }
.detail-list dt { color: var(--c-text-muted); font-weight: 600; padding-top: var(--sp-1); }
.detail-list dd { margin: 0; padding-top: var(--sp-1); word-break: break-word; }

/* === Step timeline === */
.step-timeline { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-2); }
.step-timeline__item { display: flex; gap: var(--sp-3); align-items: flex-start; }
.step-timeline__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-border); margin-top: 4px; flex-shrink: 0; }
.step-timeline__item--active .step-timeline__dot { background: var(--c-primary); }
.step-timeline__item--completed .step-timeline__dot { background: var(--c-success); }
.step-timeline__item--stalled .step-timeline__dot { background: var(--c-warning); }
.step-timeline__body { display: flex; flex-direction: column; gap: 2px; }
.step-timeline__name { font-weight: 600; font-size: .875rem; }
.step-timeline__status { font-size: .75rem; color: var(--c-text-muted); }
.step-timeline__time { font-size: .75rem; color: var(--c-text-muted); }

/* filter-bar secondary alias — kept for legacy pages that still use .usa-input/.usa-select inside filter-bar */
.filter-bar .usa-input, .filter-bar .usa-select { width: auto; flex: 0 0 auto; display: inline-flex; }
.filter-bar .usa-input { min-width: 200px; max-width: 280px; }
.filter-bar .usa-select { min-width: 140px; }

/* === Row states === */
.row--selected td { background: var(--uswds-blue-5) !important; }
.row--overdue td { background: #fff5f5 !important; }

/* === Nav badges === */
.nav-badge { display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font-size: .7rem; font-weight: 700; margin-left: auto; }
.nav-badge--amber { background: var(--c-warning-bg); color: var(--c-warning); }
.nav-badge--blue { background: var(--uswds-blue-5); color: var(--c-primary); }
.nav-badge--red { background: var(--c-danger-bg); color: var(--c-danger); }

/* === User avatar === */
.user-avatar { display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--c-primary);
  color: #fff; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.user-avatar--sm { width: 28px; height: 28px; font-size: .75rem; }
.user-avatar--lg { width: 44px; height: 44px; font-size: 1rem; }

/* === Profile card (sidebar footer) === */
.profile-card { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  cursor: pointer; border-radius: var(--radius); transition: background .15s; }
.profile-card:hover { background: rgba(255,255,255,.08); }
.profile-card__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.profile-card__name { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card__role { font-size: .7rem; }

/* === Profile dropdown === */
.profile-dropdown { background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); margin: 0 var(--sp-4) var(--sp-2);
  overflow: hidden; }
.profile-dropdown__env { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--c-border); }
.profile-dropdown__item { display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); font-size: .875rem; color: var(--c-text);
  text-decoration: none; transition: background .15s; }
.profile-dropdown__item:hover { background: var(--uswds-blue-5); }
.profile-dropdown__item--danger { color: var(--c-danger); }
.profile-dropdown__item--danger:hover { background: var(--c-danger-bg); }
.profile-dropdown__divider { border: none; border-top: 1px solid var(--c-border); margin: 0; }
.env-pill { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }

/* === Step builder === */
.step-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.step-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); overflow: hidden; }
.step-card--editing { border-color: var(--c-primary); }
.step-card__header { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
.step-card__order { width: 24px; height: 24px; border-radius: 50%; background: var(--uswds-blue-5);
  color: var(--c-primary); display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.step-card__name { font-weight: 600; font-size: .9rem; flex: 1; }
.step-card__actions { display: flex; gap: var(--sp-2); margin-left: auto; }
.step-card__form { padding: var(--sp-4); border-top: 1px solid var(--c-border); background: var(--uswds-gray-2); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-3); }

/* === Icon buttons === */
.btn-icon { display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius); border: 1px solid var(--c-border);
  background: transparent; cursor: pointer; color: var(--c-text-muted); font-size: .8rem; transition: all .15s; }
.btn-icon:hover { background: var(--uswds-blue-5); border-color: var(--c-primary); color: var(--c-primary); }
.btn-icon--danger:hover { background: var(--c-danger-bg); border-color: var(--c-danger); color: var(--c-danger); }

/* === File icons === */
.file-icon { width: 28px; height: 28px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; }
.file-icon--pdf { background: #fce8e8; color: var(--c-danger); }
.file-icon--docx { background: #e8f0f8; color: var(--c-primary); }
.file-icon--img { background: #ecf3ec; color: var(--c-success); }
.file-icon--file { background: var(--uswds-gray-2); color: var(--c-text-muted); }

/* === Alerts === */
.alert { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); font-size: .875rem; margin-bottom: var(--sp-3); }
.alert--error { background: var(--c-danger-bg); color: var(--c-danger); border: 1px solid var(--c-danger); }
.alert--success { background: var(--c-success-bg); color: #00652a; border: 1px solid var(--c-success); }
.alert--info { background: var(--c-info-bg); color: var(--c-primary); border: 1px solid var(--uswds-blue-10); }
.text-danger { color: var(--c-danger); }

/* === Compact stats grid === */
.stats-grid--compact { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stats-grid--compact .stat-card { padding: var(--sp-3); }
.stats-grid--compact .stat-card__value { font-size: 1.4rem; }

/* Legacy Bootstrap overrides removed; all styles now use brand design tokens */
/* ============================================================
   PHASE 2 — Obs 1-7 Execution Instructions
   Dark mode, Charts, Dashboard, Notifications, Search,
   Lifecycle, Activity feed, Animations, Component Library
   ============================================================ */

/* === DARK MODE TOKENS === */
[data-theme="dark"] {
  --c-bg:       #0d1117;
  --c-surface:  #161b22;
  --c-border:   #30363d;
  --c-text:     #e6edf3;
  --c-text-muted: #8b949e;
  --c-primary:  #58a6ff;
  --c-primary-dark: #388bfd;
  --c-sidebar:  #0d1117;
  --c-info-bg:  #112d45;
  --c-success-bg: #0f2d1a;
  --c-warning-bg: #2d1f00;
  --c-danger-bg:  #2d0f0f;
  --uswds-blue-5:  #112d45;
  --uswds-gray-2:  #1c2128;
}
[data-theme="dark"] .usa-sidebar { background: #010409; border-right: 1px solid #30363d; }
[data-theme="dark"] .usa-header  { background: #161b22; border-color: #30363d; }
[data-theme="dark"] .data-table tr:hover td { background: #1c2128; }

/* === TRANSITIONS & ANIMATIONS === */
.usa-nav__link, .stat-card, .panel, .usa-button, .btn-icon, .quick-action-btn {
  transition: all .2s cubic-bezier(.4,0,.2,1);
}
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes slideInRight {
  from { opacity:0; transform:translateX(16px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes pulse {
  0%,100% { opacity:1; } 50% { opacity:.4; }
}
@keyframes spin { to { transform:rotate(360deg); } }
.fa-spin { animation: spin 1s linear infinite; }
.fade-in-up { animation: fadeInUp .3s ease both; }
.slide-in-right { animation: slideInRight .25s ease both; }

.stat-card { animation: fadeInUp .3s ease both; }
.stat-card:nth-child(1) { animation-delay:.05s; }
.stat-card:nth-child(2) { animation-delay:.1s; }
.stat-card:nth-child(3) { animation-delay:.15s; }
.stat-card:nth-child(4) { animation-delay:.2s; }

/* === SKELETON LOADING === */
.dashboard-skeleton {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: var(--sp-4); margin-bottom: var(--sp-8);
}
.skeleton-card {
  height: 96px; border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--uswds-gray-2) 25%, var(--uswds-gray-5) 50%, var(--uswds-gray-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* === DASHBOARD CHARTS === */
.dashboard-charts {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
@media (max-width: 1280px) {
  .dashboard-charts { grid-template-columns: 1fr 1fr; }
  .chart-card--wide { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .dashboard-charts { grid-template-columns: 1fr; }
}
.chart-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  animation: fadeInUp .35s ease both;
}
.chart-card:nth-child(2) { animation-delay:.1s; }
.chart-card:nth-child(3) { animation-delay:.2s; }
.chart-card__header {
  padding: var(--sp-4) var(--sp-5) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
}
.chart-card__header-content { flex: 1; }
.chart-card__title { font-family: var(--font-heading); font-size: .95rem; font-weight: 700; margin: 0; color: var(--c-text); }
.chart-card__body { padding: var(--sp-4); }
.chart-card__body--center { display: flex; justify-content: center; align-items: center; }

/* === DASHBOARD BOTTOM LAYOUT === */
.dashboard-bottom {
  display: grid; grid-template-columns: 1fr 380px; gap: var(--sp-4); margin-bottom: var(--sp-6);
}
@media (max-width: 960px) { .dashboard-bottom { grid-template-columns: 1fr; } }

/* === KPI CARD TREND === */
.kpi-card .stat-card__body { flex: 1; }
.trend--up   { color: var(--c-success); }
.trend--down { color: var(--c-danger); }
.trend--neutral { color: var(--c-text-muted); }
.stat-card__trend { font-size: .7rem; margin-top: var(--sp-2); }

/* === ACTIVITY FEED === */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border); align-items: flex-start;
  transition: background .15s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--uswds-blue-5); }
.activity-item__icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0;
}
.activity-icon--blue   { background: var(--c-info-bg); color: var(--c-primary); }
.activity-icon--green  { background: var(--c-success-bg); color: var(--c-success); }
.activity-icon--amber  { background: var(--c-warning-bg); color: var(--c-warning); }
.activity-icon--red    { background: var(--c-danger-bg); color: var(--c-danger); }
.activity-item__body { flex: 1; min-width: 0; }
.activity-item__title { font-size: .8rem; color: var(--c-text); line-height: 1.4; }
.activity-item__meta  { font-size: .72rem; color: var(--c-text-muted); margin-top: 2px; display: flex; align-items: center; gap: var(--sp-2); }

/* === CATEGORY ROW (Dashboard) === */
.category-row {
  display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3);
}
.category-row__icon {
  width: 28px; height: 28px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0;
}
.category-row__info { flex: 1; min-width: 0; }
.category-row__name { font-size: .8rem; font-weight: 600; margin-bottom: 3px; }
.category-row__bar { height: 4px; background: var(--c-border); border-radius: 2px; overflow: hidden; }
.category-row__fill { height: 100%; border-radius: 2px; transition: width .5s ease; }
.category-row__count { font-size: .8rem; font-weight: 700; color: var(--c-text-muted); flex-shrink: 0; }

/* === QUICK ACTION BUTTONS === */
.quick-action-btn {
  display: flex; align-items: center; gap: var(--sp-2); justify-content: center;
  padding: var(--sp-3) var(--sp-2); border-radius: var(--radius);
  background: var(--uswds-blue-5); color: var(--c-primary); font-size: .8rem; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; gap: var(--sp-2);
}
.quick-action-btn:hover { background: var(--c-primary); color: #fff; text-decoration: none; }
.quick-action-btn--highlight { background: var(--c-primary); color: #fff; }
.quick-action-btn--highlight:hover { background: var(--c-primary-dark); }

/* === NOTIFICATIONS === */
.notif-wrapper { position: relative; }
.header-icon-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--c-border);
  background: transparent; cursor: pointer; color: var(--c-text-muted); font-size: .95rem;
  transition: all .15s;
}
.header-icon-btn:hover { background: var(--uswds-blue-5); color: var(--c-primary); border-color: var(--c-primary); }
.notif-dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--c-danger); color: #fff; font-size: .62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
  border: 2px solid var(--c-surface);
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 200;
  animation: slideInRight .2s ease;
}
.notif-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--c-border);
  font-size: .875rem;
}
.notif-item {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--c-border);
  text-decoration: none; color: var(--c-text);
}
.notif-item:hover { background: var(--uswds-blue-5); }
.notif-item--warn { border-left: 3px solid var(--c-warning); }
.notif-item--info { border-left: 3px solid var(--c-primary); }
.notif-item i { margin-top: 2px; width: 16px; flex-shrink: 0; }
.notif-item--warn i { color: var(--c-warning); }
.notif-item--info i { color: var(--c-primary); }
.notif-item__title { font-size: .85rem; font-weight: 600; }
.notif-item__meta  { font-size: .75rem; color: var(--c-text-muted); margin-top: 2px; }
.notif-empty { padding: var(--sp-4); text-align: center; font-size: .85rem; color: var(--c-text-muted); display: flex; align-items: center; justify-content: center; gap: var(--sp-2); }
.btn-icon--sm { width: 24px; height: 24px; font-size: .75rem; }

/* === GLOBAL SEARCH === */
.header-search { display: flex; align-items: center; gap: var(--sp-2); position: relative; }
.header-search__toggle { background: none; border: none; cursor: pointer; color: var(--c-text-muted); font-size: .95rem; padding: var(--sp-2); border-radius: var(--radius); transition: color .15s; }
.header-search__toggle:hover { color: var(--c-primary); }
.header-search__input {
  width: 260px; height: 34px; border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 0 var(--sp-3); font-size: .875rem; background: var(--c-surface); color: var(--c-text);
  outline: none; transition: border-color .15s;
}
.header-search__input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(0,94,162,.15); }
/* === HEADER SEARCH WRAPPER + DROPDOWN === */
.header-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 460px;
}
.header-search-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--c-bg); border: 1.5px solid var(--c-border);
  border-radius: var(--radius); padding: 0 var(--sp-3);
  height: 38px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.header-search-bar--active,
.header-search-bar:focus-within {
  border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(95,168,232,0.15);
}
.header-search-bar__icon { color: var(--c-text-muted); font-size: 13px; flex-shrink: 0; }
.header-search-bar__input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 0.875rem; font-family: var(--font); color: var(--c-text);
}
.header-search-bar__input::placeholder { color: var(--c-text-muted); }
.header-search-bar__clear {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: var(--c-text-muted); border-radius: 4px; line-height: 1;
  font-size: .8rem; flex-shrink: 0;
  transition: color .12s, background .12s;
}
.header-search-bar__clear:hover { color: var(--c-danger); background: var(--c-danger-bg); }

/* Dropdown panel */
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 300;
  animation: fadeInUp .12s ease; overflow: hidden;
}
/* Category group header */
.search-dropdown__group { }
.search-dropdown__group-label {
  padding: 8px var(--sp-4) 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-border);
}
.search-dropdown__group:first-child .search-dropdown__group-label { border-top: none; }
/* Result row */
.search-dropdown__item {
  display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-4);
  text-decoration: none; color: var(--c-text);
  transition: background .1s;
}
.search-dropdown__item:hover { background: var(--uswds-blue-5); text-decoration: none; }
.search-dropdown__icon-wrap {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--c-bg); border: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: .8rem; color: var(--c-accent);
}
.search-dropdown__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.search-dropdown__title {
  font-size: .875rem; font-weight: 500; color: var(--c-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-dropdown__sub {
  font-size: .72rem; color: var(--c-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-dropdown__arrow { font-size: .65rem; color: var(--c-text-muted); flex-shrink: 0; opacity: 0; transition: opacity .12s; }
.search-dropdown__item:hover .search-dropdown__arrow { opacity: 1; }
/* Empty state */
.search-dropdown__empty {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4); color: var(--c-text-muted);
  font-size: .875rem;
}
.search-dropdown__empty i { font-size: 1.1rem; opacity: .4; }
/* Footer hint */
.search-dropdown__footer {
  padding: 7px var(--sp-4);
  font-size: .72rem; color: var(--c-text-muted);
  border-top: 1px solid var(--c-border);
  text-align: center;
}

/* === SIDEBAR OVERLAY (mobile) === */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 90;
}
html.sidebar-open .sidebar-overlay { display: block; }

/* Desktop: collapse sidebar to icon-only (≥ 769px) */
@media (min-width: 769px) {
  .sidebar-overlay { display: none !important; }
  html.sidebar-collapsed .usa-sidebar,
  .usa-sidebar.sidebar-collapsed {
    width: var(--sidebar-collapsed-w);
    overflow: hidden;
  }
  html.sidebar-collapsed .usa-sidebar .usa-nav__section,
  .usa-sidebar.sidebar-collapsed .usa-nav__section { display: none; }
  html.sidebar-collapsed .usa-sidebar .usa-nav__link span,
  .usa-sidebar.sidebar-collapsed .usa-nav__link span { display: none; }
  html.sidebar-collapsed .usa-sidebar .usa-nav__link,
  .usa-sidebar.sidebar-collapsed .usa-nav__link {
    justify-content: center; padding: var(--sp-3) 0; gap: 0;
    margin: 2px var(--sp-1); border-left-color: transparent;
  }
  html.sidebar-collapsed .usa-sidebar .nav-icon,
  .usa-sidebar.sidebar-collapsed .nav-icon { width: auto; font-size: 1.1rem; opacity: 1; }
  html.sidebar-collapsed .usa-sidebar .nav-badge,
  .usa-sidebar.sidebar-collapsed .nav-badge { display: none; }
  html.sidebar-collapsed .usa-sidebar .sidebar-user-card__info,
  .usa-sidebar.sidebar-collapsed .sidebar-user-card__info { display: none; }
}

/* Mobile: slide-in sidebar overlay (≤ 768px) */
@media (max-width: 768px) {
  .usa-sidebar { transform: translateX(-100%); transition: transform .25s ease; position: fixed; height: calc(100vh - var(--header-h)); z-index: 100; top: var(--header-h); left: 0; }
  html.sidebar-open .usa-sidebar,
  .usa-sidebar.sidebar-active { transform: translateX(0); }
  .usa-menu-toggle { display: flex !important; }
  .sidebar-collapse-btn { display: none; }

  /* Sidebar becomes a fixed overlay panel */
  .usa-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    height: calc(100dvh - var(--header-h));
    width: var(--sidebar-w);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  /* Sidebar open = slides in */
  .usa-sidebar.sidebar-active { transform: translateX(0); }
  /* When sidebar is open, show the dark overlay behind it */
  .sidebar-overlay.active { display: block; }

  /* Main content takes full width — no gap left by sidebar */
  .usa-body-wrapper { position: relative; }
}

/* === REQUEST LIFECYCLE STAGES === */
.lifecycle-strip {
  display: flex; align-items: center; margin-bottom: var(--sp-4);
  overflow-x: auto; padding-bottom: var(--sp-2);
  gap: 0;
}
.lifecycle-stage {
  display: flex; align-items: center; flex-shrink: 0; position: relative;
}
.lifecycle-stage__pill {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); border-radius: 20px;
  font-size: .8rem; font-weight: 600; white-space: nowrap;
  border: 2px solid var(--c-border); background: var(--c-surface); color: var(--c-text-muted);
  transition: all .2s;
}
.lifecycle-stage--done .lifecycle-stage__pill {
  background: var(--c-success-bg); border-color: var(--c-success); color: var(--c-success);
}
.lifecycle-stage--active .lifecycle-stage__pill {
  background: var(--c-primary); border-color: var(--c-primary); color: #fff;
  box-shadow: 0 0 0 3px rgba(0,94,162,.2);
}
.lifecycle-stage--active .lifecycle-stage__pill::after {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.7); animation: pulse 1.5s infinite;
}
.lifecycle-stage__connector {
  width: 28px; height: 2px; background: var(--c-border); flex-shrink: 0;
}
.lifecycle-stage--done + .lifecycle-stage .lifecycle-stage__connector,
.lifecycle-stage--done .lifecycle-stage__connector { background: var(--c-success); }

/* === INSTANCE MONITOR FLOW === */
.flow-steps {
  display: flex; flex-direction: column; gap: 0;
  position: relative; padding-left: var(--sp-4);
}
.flow-step {
  display: flex; gap: var(--sp-3); padding: var(--sp-2) 0;
  position: relative;
}
.flow-step::before {
  content: ''; position: absolute; left: -16px; top: 18px;
  bottom: -8px; width: 2px; background: var(--c-border);
}
.flow-step:last-child::before { display: none; }
.flow-step__dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; color: #fff; position: relative; z-index: 1;
  margin-top: 2px; border: 2px solid var(--c-surface);
}
.flow-step--completed .flow-step__dot { background: var(--c-success); }
.flow-step--inprogress .flow-step__dot { background: var(--c-primary); animation: pulse 2s infinite; }
.flow-step--pending    .flow-step__dot { background: var(--c-border); }
.flow-step--stalled    .flow-step__dot { background: var(--c-warning); }
.flow-step--cancelled  .flow-step__dot { background: var(--c-danger); }
.flow-step__content { flex: 1; }
.flow-step__name   { font-size: .875rem; font-weight: 600; }
.flow-step__meta   { font-size: .75rem; color: var(--c-text-muted); }
.flow-step__time   { font-size: .72rem; color: var(--c-text-muted); margin-top: 2px; }

/* === DOCUMENT PREVIEW MODAL === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 500;
  display: flex; align-items: center; justify-content: center;
  animation: fadeInUp .2s ease;
}
.modal {
  background: var(--c-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: min(900px, 95vw);
  max-height: 90vh; display: flex; flex-direction: column;
  animation: fadeInUp .25s ease;
}
.modal--fullscreen {
  width: 98vw; max-height: 97vh;
}
.modal__header {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--c-border); flex-shrink: 0;
}
.modal__title { font-size: 1rem; font-weight: 700; flex: 1; margin: 0; }
.modal__body  { flex: 1; overflow: auto; padding: var(--sp-4); }
.modal__footer { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--c-border); display: flex; gap: var(--sp-2); justify-content: flex-end; }
.doc-preview-frame { width: 100%; height: 500px; border: 1px solid var(--c-border); border-radius: var(--radius); }
.doc-preview-frame--fullscreen { height: calc(97vh - 140px); }
.doc-preview-img   { max-width: 100%; max-height: 500px; object-fit: contain; display: block; margin: 0 auto; }
.doc-preview-img--fullscreen   { max-height: calc(97vh - 140px); }

/* === INSTANCE MONITOR ENHANCEMENTS === */
.instance-status-strip {
  display: flex; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap;
}
.status-pill {
  display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border-radius: 20px; border: 2px solid; font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.status-pill--blue  { border-color: var(--c-primary); color: var(--c-primary); background: var(--uswds-blue-5); }
.status-pill--green { border-color: var(--c-success); color: var(--c-success); background: var(--c-success-bg); }
.status-pill--amber { border-color: var(--c-warning); color: var(--c-warning); background: var(--c-warning-bg); }
.status-pill--grey  { border-color: var(--c-border); color: var(--c-text-muted); background: var(--uswds-gray-2); }
.status-pill.active { box-shadow: 0 0 0 3px rgba(0,94,162,.2); }

/* === EMPTY STATE COMPONENT === */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--sp-12) var(--sp-8); text-align: center;
}
.empty-state__icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--uswds-gray-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--c-text-muted); margin-bottom: var(--sp-4);
}
.empty-state__title   { font-size: 1rem; font-weight: 700; margin: 0 0 var(--sp-2); }
.empty-state__message { font-size: .875rem; color: var(--c-text-muted); margin: 0; }

/* === KANBAN BOARD === */
.kanban-board {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: var(--sp-4);
}
.kanban-col { background: var(--uswds-gray-2); border-radius: var(--radius-lg); padding: var(--sp-3); }
.kanban-col__header {
  display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-1) var(--sp-3);
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.kanban-card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: var(--sp-3); margin-bottom: var(--sp-2); cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card__title { font-size: .875rem; font-weight: 600; margin-bottom: var(--sp-1); }
.kanban-card__meta  { font-size: .75rem; color: var(--c-text-muted); }

/* === PROGRESS INDICATOR === */
.progress-bar { height: 6px; background: var(--c-border); border-radius: 3px; overflow: hidden; margin: var(--sp-2) 0; }
.progress-bar__fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.progress-bar__fill--blue  { background: var(--c-primary); }
.progress-bar__fill--green { background: var(--c-success); }
.progress-bar__fill--amber { background: var(--c-warning); }
.progress-bar__fill--red   { background: var(--c-danger); }

/* === SLA INDICATORS === */
.sla-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 12px; font-size: .72rem; font-weight: 600;
}
.sla-chip--ok      { background: var(--c-success-bg); color: var(--c-success); }
.sla-chip--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.sla-chip--overdue { background: var(--c-danger-bg);  color: var(--c-danger); animation: pulse 1.5s infinite; }

/* === RICH TABLE ENHANCEMENTS === */
.data-table td { transition: background .1s; }
.data-table .td-primary { font-weight: 600; }
.data-table .td-mono    { font-family: var(--font-mono); font-size: .8rem; }
.data-table .td-secondary { font-size: .75rem; color: var(--c-text-muted); }
.data-table .link-action { color: var(--c-primary); font-size: .8rem; font-weight: 600; }
.data-table .link-action:hover { text-decoration: underline; }
.table-toolbar {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border); background: var(--uswds-gray-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* === ENTITY ICON CELL === */
.entity-cell { display: flex; align-items: center; gap: var(--sp-2); }
.entity-icon {
  width: 28px; height: 28px; border-radius: var(--radius); background: var(--uswds-blue-5);
  color: var(--c-primary); display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0;
}

/* === FORM ENHANCEMENTS === */
/* focus already handled by the enterprise form-control block above */
.usa-input:focus, .usa-select:focus, .usa-textarea:focus {
  border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0,94,162,.15); outline: none;
}
.form-group { display: flex; flex-direction: column; gap: var(--sp-1); }
.form-label { font-size: .8rem; font-weight: 600; color: var(--c-text); }
.form-hint  { font-size: .75rem; color: var(--c-text-muted); }

/* === SUCCESS STATE === */
.success-state {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--sp-10); text-align: center;
}
.success-state__icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--c-success-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; color: var(--c-success); margin-bottom: var(--sp-4);
  animation: fadeInUp .3s ease;
}

/* === SECTION HEADERS === */
.section { margin-bottom: var(--sp-8); }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--c-border);
}
.section-title { font-size: 1rem; font-weight: 700; margin: 0; }

/* === TOOLTIPS === */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%); background: var(--uswds-gray-90); color: #fff;
  padding: 4px 8px; border-radius: var(--radius); font-size: .72rem; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* === WORKFLOW DEFINITION CARD === */
.workflow-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: var(--sp-4); box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.workflow-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.workflow-card__header { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.workflow-card__icon {
  width: 40px; height: 40px; border-radius: var(--radius); background: var(--c-info-bg);
  color: var(--c-primary); display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.workflow-card__title { font-weight: 700; font-size: .95rem; margin: 0; }
.workflow-card__sub   { font-size: .75rem; color: var(--c-text-muted); margin-top: 2px; }

/* === SPINNER === */
.spinner {
  display: inline-block; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--c-border); border-top-color: var(--c-primary);
  animation: spin .7s linear infinite; vertical-align: middle; margin-right: var(--sp-2);
}


/* ── Dashboard Chart Filters ─────────────────────────────────── */
.chart-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
.chart-filters__group {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.chart-filters__label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-text-muted);
  white-space: nowrap;
}
.chart-filters__updated {
  margin-left: auto;
  font-size: .72rem;
  color: var(--c-text-muted);
}
.chart-filter-btn {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.72rem; font-weight: 600; font-family: var(--font);
  letter-spacing: .02em;
  border: 1.5px solid var(--c-border);
  border-radius: 20px;
  background: var(--c-surface);
  color: var(--c-text-muted);
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
  white-space: nowrap; line-height: 1.5;
}
.chart-filter-btn:hover { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-info-bg); }
.chart-filter-btn--active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 700; }

/* Segmented period control */
.segmented-control {
  display: flex;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 12px;
  font-size: 0.72rem; font-weight: 600; font-family: var(--font);
  border: none; border-radius: 6px;
  background: transparent;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: background .13s, color .13s, box-shadow .13s;
  white-space: nowrap; line-height: 1.5;
}
.seg-btn:hover { background: #fff; color: var(--c-text); }
.seg-btn--active {
  background: var(--c-primary);
  color: #fff; font-weight: 700;
  box-shadow: 0 1px 4px rgba(22,46,81,0.20);
}
.chart-filter-select {
  font-size: 0.75rem; font-family: var(--font); font-weight: 500;
  padding: 0.25rem 1.75rem 0.25rem 0.625rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  height: 1.875rem;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 12px;
  transition: border-color .13s, box-shadow .13s;
}
.chart-filter-select:hover { border-color: var(--c-text-muted); }
.chart-filter-select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0,94,162,.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23005ea2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* ── 4-card Charts Grid: full-width line + 3-col bottom row ─── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  margin-bottom: var(--sp-6);
}
.chart-card--full       { grid-column: 1 / -1; }
.chart-card--status     { grid-column: 1 / 2; }
.chart-card--completion { grid-column: 2 / 3; }
.chart-card--tenant     { grid-column: 3 / 4; }
@media (max-width: 1100px) {
  .charts-grid { grid-template-columns: 1fr 1fr; }
  .chart-card--full { grid-column: 1 / -1; }
  .chart-card--status { grid-column: 1 / 2; }
  .chart-card--completion { grid-column: 2 / 3; }
  .chart-card--tenant { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card--full, .chart-card--status,
  .chart-card--completion, .chart-card--tenant { grid-column: 1 / -1; }
}
.chart-card__sub {
  font-size: .7rem;
  color: var(--c-text-muted);
  margin-left: auto;
  font-weight: 400;
  white-space: nowrap;
}
.chart-card__body { padding: var(--sp-4); min-height: 200px; position: relative; }
.chart-card__body--center { display: flex; justify-content: center; align-items: center; }
.chart-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 180px; gap: var(--sp-3);
  color: var(--c-text-muted); text-align: center;
}
.chart-empty__icon { font-size: 2rem; opacity: .35; color: var(--c-accent); }
.chart-empty__msg  { font-size: .875rem; font-weight: 500; }

/* Dark mode adjustments */
[data-theme="dark"] .chart-filter-btn      { background: var(--c-surface); color: var(--c-text-muted); border-color: var(--c-border); }
[data-theme="dark"] .chart-filter-btn:hover { color: #60a5fa; border-color: #60a5fa; }
[data-theme="dark"] .chart-filter-btn--active { background: #3b82f6; border-color: #3b82f6; color: #fff; }
[data-theme="dark"] .chart-filter-select   { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }

/* ====================================================
   Instance Monitor v2 — Global Redesign
   ==================================================== */

/* ── KPI Strip ── */
.monitor-kpi-strip {
  display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.monitor-kpi {
  display: flex; align-items: center; gap: .65rem;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: .6rem 1rem;
  cursor: pointer; transition: all .15s; min-width: 110px;
}
.monitor-kpi:hover { border-color: var(--c-primary); box-shadow: var(--shadow); }
.monitor-kpi--active { border-color: var(--c-primary); background: var(--c-info-bg); }
.monitor-kpi--blue.monitor-kpi--active   { border-color: var(--c-primary);  background: #e8f0fb; }
.monitor-kpi--amber.monitor-kpi--active  { border-color: var(--c-warning);  background: var(--c-warning-bg); }
.monitor-kpi--green.monitor-kpi--active  { border-color: var(--c-success);  background: var(--c-success-bg); }
.monitor-kpi--grey.monitor-kpi--active   { border-color: var(--c-text-muted); background: var(--uswds-gray-2); }
.monitor-kpi__icon { font-size: 1.1rem; color: var(--c-text-muted); }
.monitor-kpi--blue  .monitor-kpi__icon { color: var(--c-primary); }
.monitor-kpi--amber .monitor-kpi__icon { color: var(--c-warning); }
.monitor-kpi--green .monitor-kpi__icon { color: var(--c-success); }
.monitor-kpi__val   { display: block; font-size: 1.2rem; font-weight: 700; line-height: 1; }
.monitor-kpi__lbl   { display: block; font-size: .7rem; color: var(--c-text-muted); margin-top: .1rem; }

/* ── Filter Bar ── */
.monitor-filter-bar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: .6rem .75rem; margin-bottom: 1rem;
}
.monitor-filter-bar__search {
  display: flex; align-items: center; gap: .4rem;
  flex: 1; min-width: 200px;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: .35rem .6rem;
}
.monitor-filter-bar__search i { color: var(--c-text-muted); font-size: .85rem; }
.monitor-filter-bar__search input {
  border: none; background: transparent; outline: none;
  font-size: .85rem; width: 100%; color: var(--c-text);
}
.monitor-filter-bar__select {
  font-size: .8rem; padding: .35rem .5rem;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-bg); color: var(--c-text); cursor: pointer;
}
.monitor-filter-bar__date {
  font-size: .8rem; padding: .35rem .5rem;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-bg); color: var(--c-text);
}
.monitor-filter-bar__clear {
  display: flex; align-items: center; gap: .3rem;
  font-size: .8rem; padding: .35rem .7rem;
  background: var(--c-danger-bg); color: var(--c-danger);
  border: 1px solid var(--c-danger); border-radius: var(--radius);
  cursor: pointer; font-weight: 600; transition: background .15s;
}
.monitor-filter-bar__clear:hover { background: var(--c-danger); color: #fff; }

/* ── Split Layout ── */
.monitor-split {
  display: flex; gap: 0; min-height: 600px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.monitor-split__list {
  width: 100%; min-width: 0;
  border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column;
  transition: width .2s ease;
}
.monitor-split__list--narrow { width: 380px; flex-shrink: 0; }
.monitor-split__detail {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  overflow: hidden;
}
.monitor-split__empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
}

/* ── List header ── */
.monitor-list-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .6rem .75rem; border-bottom: 1px solid var(--c-border);
  background: var(--uswds-gray-2);
}
.monitor-list-header__count {
  font-size: .75rem; font-weight: 700; color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.monitor-list-scroll { overflow-y: auto; flex: 1; }

/* ── Request Card ── */
.request-card {
  display: flex; cursor: pointer;
  border-bottom: 1px solid var(--c-border);
  transition: background .12s;
  position: relative;
}
.request-card:hover { background: var(--c-info-bg); }
.request-card--selected { background: #e8f0fb !important; }
.request-card__priority {
  width: 4px; flex-shrink: 0;
  background: var(--c-border);
}
.request-card__priority--high   { background: var(--c-danger); }
.request-card__priority--medium { background: var(--c-warning); }
.request-card__priority--low    { background: var(--c-border); }
.request-card__body { flex: 1; padding: .65rem .75rem; min-width: 0; }
.request-card__header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: .4rem; margin-bottom: .3rem;
}
.request-card__ref {
  font-size: .82rem; font-weight: 700; color: var(--c-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 180px;
}
.request-card__workflow {
  font-size: .78rem; color: var(--c-text-muted); margin-bottom: .25rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.request-card__meta-row {
  display: flex; gap: .5rem; flex-wrap: wrap;
  font-size: .72rem; color: var(--c-text-muted); margin-bottom: .25rem;
}
.request-card__tenant  { color: var(--c-text-muted); }
.request-card__stage   { color: var(--c-primary); font-weight: 600; }
.request-card__footer  { display: flex; justify-content: space-between; align-items: center; }
.request-card__date    { font-size: .7rem; color: var(--c-text-muted); }
.request-card__priority-chip {
  font-size: .65rem; font-weight: 700; color: var(--c-danger);
  background: var(--c-danger-bg); border-radius: 4px; padding: .1rem .4rem;
}

/* ── Request card skeleton ── */
.request-card-skeleton {
  padding: .75rem; border-bottom: 1px solid var(--c-border);
}
.skeleton {
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 4px; height: 12px;
}
.skeleton--line  { display: block; }
.skeleton--w60   { width: 60%; }
.skeleton--w40   { width: 40%; }
.skeleton--w80   { width: 80%; }
@keyframes skeleton-shimmer { to { background-position: -200% 0; } }

/* ── Monitor empty states ── */
.monitor-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 3rem 1rem; color: var(--c-text-muted);
  gap: .5rem; text-align: center;
}
.monitor-empty i { font-size: 2rem; }
.monitor-empty p { margin: 0; font-size: .85rem; }
.monitor-empty--sm { padding: 1rem; }
.monitor-empty--sm i { font-size: 1.2rem; }
.monitor-empty-detail {
  text-align: center; padding: 3rem 2rem;
}
.monitor-empty-detail__icon {
  font-size: 3rem; color: var(--c-border); margin-bottom: 1rem;
}
.monitor-empty-detail__title {
  font-size: 1rem; font-weight: 700; color: var(--c-text); margin-bottom: .25rem;
}
.monitor-empty-detail__sub {
  font-size: .85rem; color: var(--c-text-muted); max-width: 300px; margin: 0 auto;
}
.monitor-loading {
  display: flex; align-items: center; gap: .5rem; padding: 1.5rem;
  font-size: .85rem; color: var(--c-text-muted);
}

/* ── Detail Header ── */
.monitor-detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: .5rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--c-border);
  background: var(--c-surface); flex-shrink: 0;
}
.monitor-detail-header__left  { display: flex; align-items: flex-start; gap: .6rem; }
.monitor-detail-header__right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.monitor-detail-close {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: var(--uswds-gray-5); color: var(--c-text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .85rem; flex-shrink: 0; margin-top: .1rem;
}
.monitor-detail-close:hover { background: var(--c-danger-bg); color: var(--c-danger); }
.monitor-detail-header__ref { font-size: .9rem; font-weight: 700; color: var(--c-text); }
.monitor-detail-header__sub { font-size: .75rem; color: var(--c-text-muted); margin-top: .15rem; }
.monitor-detail-header__sep { margin: 0 .25rem; }

/* ── Monitor Alert ── */
.monitor-alert {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem; font-size: .82rem; flex-shrink: 0;
}
.monitor-alert--warning {
  background: var(--c-warning-bg); border-bottom: 1px solid var(--uswds-gold-50);
  color: #7a5000;
}
.monitor-alert strong { font-weight: 700; margin-right: .4rem; }

/* ── Detail Tabs ── */
.detail-tabs {
  display: flex; border-bottom: 1px solid var(--c-border);
  background: var(--uswds-gray-2); flex-shrink: 0; overflow-x: auto;
}
.detail-tab {
  display: flex; align-items: center; gap: .4rem;
  padding: .6rem 1rem; font-size: .78rem; font-weight: 600;
  color: var(--c-text-muted); background: transparent; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.detail-tab:hover { color: var(--c-primary); background: rgba(0,94,162,.04); }
.detail-tab--active { color: var(--c-primary); border-bottom-color: var(--c-primary); background: var(--c-surface); }
.detail-tab__badge {
  background: var(--c-border); color: var(--c-text-muted);
  border-radius: 10px; padding: .05rem .4rem; font-size: .65rem;
}
.detail-tab--active .detail-tab__badge { background: var(--c-primary); color: #fff; }

/* ── Tab Content ── */
.detail-tab-content {
  flex: 1; overflow-y: auto; padding: 1rem;
}

/* ── Detail Grid / Cards ── */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .75rem;
}
.detail-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.detail-card--full { grid-column: 1 / -1; }
.detail-card__header {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .75rem; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--c-text-muted); background: var(--uswds-gray-2);
  border-bottom: 1px solid var(--c-border);
}
.detail-card__body { padding: .75rem; }
.detail-dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .75rem; margin: 0; }
.detail-dl dt { font-size: .72rem; font-weight: 700; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .04em; align-self: start; padding-top: .1rem; white-space: nowrap; }
.detail-dl dd { font-size: .82rem; color: var(--c-text); margin: 0; }
.detail-json {
  font-family: var(--font-mono); font-size: .72rem; color: var(--c-text);
  background: var(--c-bg); border-radius: var(--radius);
  padding: .75rem; overflow-x: auto; margin: 0; max-height: 220px;
  overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}

/* ── Section title ── */
.detail-section-title {
  display: flex; align-items: center; gap: .4rem;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--c-text-muted);
  margin-bottom: .6rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--c-border);
}

/* ── Animated Stepper ── */
.stepper-container { padding: .25rem 0; }
.stepper { display: flex; flex-direction: column; }
.stepper__item {
  display: flex; gap: 0; position: relative;
  opacity: 1; transition: opacity .2s;
}
.stepper__item--pending { opacity: .55; }
.stepper__left {
  display: flex; flex-direction: column; align-items: center;
  width: 36px; flex-shrink: 0;
}
.stepper__dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; flex-shrink: 0;
  border: 2px solid var(--c-border); background: var(--c-surface);
  color: var(--c-text-muted); transition: all .2s; z-index: 1;
}
.stepper__item--completed .stepper__dot {
  background: var(--c-success); border-color: var(--c-success);
  color: #fff;
}
.stepper__item--active .stepper__dot {
  background: var(--c-primary); border-color: var(--c-primary);
  color: #fff; box-shadow: 0 0 0 4px rgba(0,94,162,.2);
  animation: stepper-pulse 2s infinite;
}
.stepper__item--stalled .stepper__dot {
  background: var(--c-warning); border-color: var(--c-warning); color: #fff;
}
.stepper__item--skipped .stepper__dot {
  background: var(--c-border); border-color: var(--c-border); color: var(--c-text-muted);
}
@keyframes stepper-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(0,94,162,.2); }
  50%       { box-shadow: 0 0 0 8px rgba(0,94,162,.08); }
}
.stepper__num { font-size: .75rem; }
.stepper__line {
  width: 2px; flex: 1; min-height: 16px; margin: 2px 0;
  background: var(--c-border); transition: background .2s;
}
.stepper__item--completed + .stepper__item .stepper__left .stepper__line,
.stepper__item--completed .stepper__line { background: var(--c-success); }
.stepper__content {
  flex: 1; padding: .35rem .75rem .85rem; min-width: 0;
}
.stepper__name {
  font-size: .85rem; font-weight: 700; color: var(--c-text);
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-bottom: .2rem;
}
.stepper__item--pending .stepper__name { color: var(--c-text-muted); }
.stepper__current-chip {
  font-size: .65rem; font-weight: 700; color: var(--c-primary);
  background: var(--c-info-bg); border: 1px solid rgba(0,94,162,.2);
  border-radius: 4px; padding: .1rem .4rem;
}
.stepper__role-chip {
  font-size: .65rem; color: var(--c-text-muted);
  background: var(--uswds-gray-2); border: 1px solid var(--c-border);
  border-radius: 4px; padding: .1rem .4rem;
}
.stepper__type {
  font-size: .73rem; color: var(--c-text-muted);
  display: flex; align-items: center; gap: .3rem; margin-bottom: .2rem;
}
.stepper__sla { color: var(--c-warning); font-weight: 600; }
.stepper__dates {
  display: flex; flex-wrap: wrap; gap: .4rem;
  font-size: .7rem; color: var(--c-text-muted);
}
.stepper__sla-chip {
  font-size: .67rem; font-weight: 600; border-radius: 4px;
  padding: .1rem .35rem; display: inline-flex; align-items: center; gap: .2rem;
}
.stepper__sla-chip--ok     { background: var(--c-success-bg); color: var(--c-success); }
.stepper__sla-chip--overdue{ background: var(--c-danger-bg);  color: var(--c-danger);  }

/* ── Activity Timeline ── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline__item {
  display: flex; gap: .75rem; position: relative; padding-bottom: .85rem;
}
.timeline__item::before {
  content: ''; position: absolute; left: 15px; top: 28px;
  bottom: 0; width: 2px; background: var(--c-border);
}
.timeline__item:last-child::before { display: none; }
.timeline__dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; z-index: 1;
}
.timeline__dot--blue   { background: var(--c-info-bg);     color: var(--c-primary); }
.timeline__dot--green  { background: var(--c-success-bg);  color: var(--c-success); }
.timeline__dot--red    { background: var(--c-danger-bg);   color: var(--c-danger);  }
.timeline__dot--purple { background: #f3e8ff;              color: #7c3aed;          }
.timeline__dot--gray   { background: var(--uswds-gray-2);  color: var(--c-text-muted); }
.timeline__content { flex: 1; padding-top: .25rem; min-width: 0; }
.timeline__title {
  font-size: .82rem; font-weight: 700; color: var(--c-text);
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.timeline__entity {
  font-size: .68rem; color: var(--c-text-muted);
  background: var(--uswds-gray-2); border-radius: 3px;
  padding: .05rem .35rem; font-weight: 400;
}
.timeline__actor {
  font-size: .75rem; color: var(--c-text-muted);
  display: flex; align-items: center; gap: .3rem; margin-top: .2rem;
}
.timeline__role {
  font-size: .65rem; background: var(--c-info-bg);
  color: var(--c-primary); border-radius: 3px; padding: .05rem .3rem;
}
.timeline__time {
  font-size: .7rem; color: var(--c-text-muted); margin-top: .15rem;
}

/* ── Notification Table ── */
.notif-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--c-border); }
.notif-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.notif-table thead tr { background: var(--uswds-gray-2); }
.notif-table th { padding: .45rem .65rem; text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-muted); border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.notif-table td { padding: .5rem .65rem; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.notif-table tr:last-child td { border-bottom: none; }
.notif-table tr:hover td { background: var(--c-info-bg); }

/* ── Reissue Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 1000; animation: fadeIn .15s;
}
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--c-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 1001;
  display: flex; flex-direction: column; max-height: 90vh;
  animation: slideUp .2s ease;
}
.modal--md { width: min(540px, 95vw); }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translate(-50%, -46%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.modal__header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 1.1rem 1.25rem .8rem; border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.modal__title { font-size: 1rem; font-weight: 700; margin: 0 0 .15rem; display: flex; align-items: center; gap: .4rem; }
.modal__sub   { font-size: .8rem; color: var(--c-text-muted); margin: 0; }
.modal__close {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--uswds-gray-5);
  cursor: pointer; color: var(--c-text-muted); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.modal__close:hover { background: var(--c-danger-bg); color: var(--c-danger); }
.modal__body   { padding: 1rem 1.25rem; overflow-y: auto; flex: 1; }
.modal__footer {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: .85rem 1.25rem; border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}

/* ── Reissue Context Card ── */
.reissue-context-card {
  background: var(--c-info-bg); border: 1px solid rgba(0,94,162,.2);
  border-radius: var(--radius-lg); padding: .75rem 1rem; margin-bottom: .5rem;
}
.reissue-context-card__row {
  display: flex; gap: .5rem; font-size: .8rem;
  padding: .2rem 0; border-bottom: 1px solid rgba(0,94,162,.1);
}
.reissue-context-card__row:last-child { border-bottom: none; }
.reissue-context-card__label { font-weight: 700; color: var(--c-primary); min-width: 100px; }
.reissue-context-card__val   { color: var(--c-text); }

/* ── Reissue Success ── */
.reissue-success {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: .5rem 0 1rem;
}
.reissue-success__icon { font-size: 2.5rem; color: var(--c-success); margin-bottom: .75rem; }
.reissue-success__title { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; }
.reissue-success__sub   { font-size: .82rem; color: var(--c-text-muted); margin-bottom: 1rem; }
.reissue-link-box {
  width: 100%; background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: .65rem .75rem; margin-bottom: .75rem;
  overflow-x: auto;
}
.reissue-link-box__url {
  font-family: var(--font-mono); font-size: .7rem; color: var(--c-primary);
  word-break: break-all;
}
.reissue-success__meta {
  display: flex; gap: 1rem; font-size: .78rem; color: var(--c-text-muted);
  flex-wrap: wrap; justify-content: center;
}
.reissue-success__meta span { display: flex; align-items: center; gap: .3rem; }

/* ── Form utilities ── */
.form-field { margin-bottom: .75rem; }
.form-label {
  display: block; font-size: .78rem; font-weight: 700;
  color: var(--c-text); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em;
}



/* ============================================================
   Instance Monitor v3 — Operations Console  (light theme)
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────── */

.monitor-console {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--header-h,56px) - 4rem);
  min-height: 560px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: 0 1px 6px rgba(0,0,0,.08), 0 4px 20px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
}

/* ── LEFT PANEL ──────────────────────────────────────────── */

.mc-lp {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-right: 1px solid rgba(0,0,0,.08);
  min-width: 0;
  overflow: hidden;   /* required for inner flex scroll to work */
  min-height: 0;
}

.mc-lp-top {
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  flex-shrink: 0;
}

/* Brand row */
.mc-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
/* User-filter banner shown when navigated from User Management */
.mc-user-filter-banner {
  display: flex; align-items: center; gap: .45rem;
  background: var(--c-info-bg); border: 1px solid var(--uswds-blue-10, #d1e6f7);
  border-radius: var(--radius); padding: .38rem .65rem;
  font-size: .72rem; color: var(--c-primary); margin-bottom: 10px;
}
.mc-user-filter-banner strong { font-weight: 700; color: var(--c-text); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.mc-ufb-clear { margin-left: auto; width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--uswds-blue-10,#d1e6f7); background: transparent; color: var(--c-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .65rem; transition: all .13s; flex-shrink: 0; }
.mc-ufb-clear:hover { background: var(--c-danger-bg); border-color: var(--c-danger); color: var(--c-danger); }
.mc-brand-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mc-brand-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.mc-brand-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -.01em;
}
.mc-icon-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(0,0,0,.12);
  color: #6b7280; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: all .15s;
}
.mc-icon-btn:hover { background: #f1f5f9; color: #111827; border-color: rgba(0,0,0,.2); }

/* Status tabs */
.mc-stabs {
  display: flex;
  gap: 3px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 12px;
}
.mc-stab {
  flex: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  color: #6b7280;
  padding: 5px 3px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  transition: all .15s;
  line-height: 1.2;
  font-family: inherit;
}
.mc-stab:hover { color: #374151; }
.mc-stab--on {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.mc-stab-n { font-size: 12px; font-weight: 700; color: inherit; }
.mc-stab--ip.mc-stab--on { color: #1d4ed8; }
.mc-stab--st.mc-stab--on { color: #92400e; }
.mc-stab--cp.mc-stab--on { color: #15803d; }
.mc-stab--cc.mc-stab--on { color: #6b7280; }

/* Search */
.mc-srch { position: relative; margin-bottom: 8px; }
.mc-srch i {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%);
  font-size: 11px; color: #9ca3af; pointer-events: none;
}
.mc-srch input {
  width: 100%;
  padding: 7px 10px 7px 28px;
  background: #f8fafc;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
  font-size: 12px; font-family: inherit;
  color: #111827; outline: none;
  transition: border .15s, background .15s;
}
.mc-srch input::placeholder { color: #9ca3af; }
.mc-srch input:focus { border-color: rgba(37,99,235,.4); background: #fff; }

/* Filter row */
.mc-frow { display: flex; gap: 5px; }
.mc-fsel {
  flex: 1;
  padding: 5px 7px;
  background: #f8fafc;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
  font-size: 11px; font-family: inherit;
  color: #374151; outline: none; cursor: pointer; min-width: 0;
}
.mc-fsel:focus { border-color: rgba(37,99,235,.4); }

/* List */
.mc-llist { flex: 1; overflow-y: auto; padding: 4px 0; }
.mc-llist::-webkit-scrollbar { width: 3px; }
.mc-llist::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

/* Instance row */
.mc-inst-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .1s, border-color .15s;
  animation: mc-ri .2s ease both;
}
.mc-inst-row:hover { background: #f8fafc; }
.mc-inst-row--sel {
  background: #f0f7ff;
  border-left-color: #2563eb;
}
@keyframes mc-ri { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.mc-row-av {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
  letter-spacing: .02em;
}
.mc-row-body { flex: 1; min-width: 0; }
.mc-row-top {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 6px; margin-bottom: 1px;
}
.mc-row-id {
  font-size: 11px; font-weight: 700;
  font-family: var(--font-mono, 'Roboto Mono', monospace);
  color: #111827; letter-spacing: .02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-row-wf {
  font-size: 11px; color: #6b7280;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.mc-row-meta {
  font-size: 10px; color: #9ca3af;
  display: flex; align-items: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Status dots */
.mc-dot {
  display: inline-block; width: 5px; height: 5px;
  border-radius: 50%; vertical-align: middle;
  margin-right: 4px; flex-shrink: 0;
}
.mc-dot--ip { background: #2563eb; }
.mc-dot--st { background: #d97706; }
.mc-dot--cp { background: #16a34a; }
.mc-dot--cc { background: #9ca3af; }

/* Pills */
.mc-pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px;
  letter-spacing: .01em; white-space: nowrap;
}
.mc-p-ip, .mc-p-inprogress { background: #dbeafe; color: #1d4ed8; }
.mc-p-st, .mc-p-stalled    { background: #fef3c7; color: #92400e; }
.mc-p-cp, .mc-p-completed  { background: #dcfce7; color: #15803d; }
.mc-p-cc, .mc-p-cancelled  { background: #f3f4f6; color: #6b7280; }
.mc-p-red                  { background: #fee2e2; color: #b91c1c; }
.mc-p-purple               { background: #ede9fe; color: #6d28d9; }
.mc-p-teal                 { background: #ccfbf1; color: #0f766e; }
.mc-p-blue                 { background: #dbeafe; color: #1d4ed8; }
.mc-p-green                { background: #dcfce7; color: #15803d; }
.mc-p-amber                { background: #fef3c7; color: #92400e; }
.mc-p-gray                 { background: #f3f4f6; color: #6b7280; }
.mc-pill--lg  { font-size: 11px; padding: 3px 10px; }
.mc-pill--xs  { font-size: 9px;  padding: 1px 5px;  }

/* Skeleton loaders */
.mc-row-skel { display: flex; align-items: center; gap: 10px; padding: 9px 14px; }
.mc-skel-av { width: 30px; height: 30px; border-radius: 8px; }
.mc-skel-body { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.mc-skel-line { border-radius: 4px; }
.mc-skel { background: linear-gradient(90deg,#e8edf2 25%,#f5f8fb 50%,#e8edf2 75%); background-size:200% 100%; animation: mc-shim 1.5s infinite; }
@keyframes mc-shim { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Empty state */
.mc-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; color: #9ca3af; padding: 32px 0;
}
.mc-empty i { font-size: 24px; opacity: .5; }
.mc-empty p { font-size: 12px; margin: 0; }

/* Error */
.mc-error { display: flex; align-items: center; gap: 8px; padding: 16px; font-size: 12px; color: #b91c1c; }

/* ── RIGHT PANEL ─────────────────────────────────────────── */

.mc-rp {
  display: flex; flex-direction: column;
  background: #f8fafc; overflow: hidden;
  position: relative;
  min-height: 0;   /* ensure grid cell bounded so placeholder centers */
}

/* Placeholder */
.mc-ph {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  padding: 32px;
  background: radial-gradient(circle at 50% 38%, rgba(37,99,235,.05) 0%, transparent 62%), #f8fafc;
}
.mc-ph-icon {
  width: 68px; height: 68px; border-radius: 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  display: flex; align-items: center; justify-content: center;
  color: #2563eb; font-size: 28px;
  box-shadow: 0 6px 20px rgba(37,99,235,.14), 0 0 0 6px rgba(37,99,235,.07);
  animation: mc-ph-float 4s ease-in-out infinite;
}
@keyframes mc-ph-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.mc-ph-t { font-size: 14px; font-weight: 700; color: #1e293b; letter-spacing: -.02em; margin-top: 2px; }
.mc-ph-s { font-size: 12px; color: #94a3b8; text-align: center; max-width: 240px; line-height: 1.7; }
.mc-ph-hint {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  font-size: 11px; color: #94a3b8;
  background: rgba(37,99,235,.06); padding: 6px 14px;
  border-radius: 20px; border: 1px solid rgba(37,99,235,.1);
}
.mc-ph-hint i { font-size: 10px; color: #2563eb; }

/* Stalled banner */
.mc-stall-banner {
  padding: 10px 16px;
  background: #fffbeb; border-bottom: 1px solid #fde68a;
  font-size: 12px; color: #92400e;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.mc-stall-banner i { color: #d97706; }

.mc-cancel-banner {
  padding: 12px 16px;
  background: #fef2f2; border-bottom: 1px solid #fecaca;
  font-size: 12px; color: #7f1d1d;
  display: flex; align-items: flex-start; gap: 10px; flex-shrink: 0;
}
.mc-cancel-banner i { color: #dc2626; margin-top: 2px; }
.mc-cancel-banner div { display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }
.mc-cancel-banner strong { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

/* Detail head */
.mc-dhead {
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: #fff; flex-shrink: 0;
  border-top: 3px solid #2563eb;
}
.mc-dhead-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px;
}
.mc-dhead-body { flex: 1; min-width: 0; }
.mc-dh-id {
  font-size: 10px;
  font-family: var(--font-mono,'Roboto Mono',monospace);
  color: #9ca3af; margin-bottom: 3px; letter-spacing: .04em;
}
.mc-dh-wf {
  font-size: 15px; font-weight: 700; color: #111827;
  margin-bottom: 5px; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-dh-meta {
  font-size: 11px; color: #6b7280;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.mc-dh-meta i { opacity: .6; font-size: 10px; }
.mc-meta-sep { color: #9ca3af; font-size: 10px; }

/* Progress bar */
.mc-prog-wrap {
  height: 3px; background: #e8eef4;
  border-radius: 3px; margin-top: 8px; overflow: hidden;
}
.mc-prog-bar {
  height: 100%; border-radius: 3px;
  transition: width .8s cubic-bezier(.22,.68,0,1.2);
}
.mc-prog--blue  { background: #2563eb; }
.mc-prog--green { background: #16a34a; }
.mc-prog--red   { background: #dc2626; }

/* ── Tabs ────────────────────────────────────────────────── */

.mc-tabs {
  display: flex; border-bottom: 1px solid rgba(0,0,0,.08);
  padding: 0 16px; background: #fff; flex-shrink: 0;
  overflow-x: auto; scrollbar-width: none;
}
.mc-tabs::-webkit-scrollbar { display: none; }

.mc-tab {
  padding: 10px 13px; font-size: 12px; font-weight: 500; color: #6b7280;
  border: none; background: transparent; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .15s;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; font-family: inherit;
}
.mc-tab:hover { color: #111827; }
.mc-tab--on { color: #111827; border-bottom-color: #2563eb; }
.mc-tab i { font-size: 11px; }
.mc-tbadge {
  background: #f1f5f9; border-radius: 20px;
  padding: 1px 6px; font-size: 10px; color: #6b7280;
  transition: background .15s;
}
.mc-tab--on .mc-tbadge { background: #dbeafe; color: #1d4ed8; }

/* Tab body */
.mc-tbody {
  flex: 1; overflow-y: auto;
  padding: 16px; padding-bottom: 64px;
  display: flex; flex-direction: column;
}
.mc-tbody::-webkit-scrollbar { width: 3px; }
.mc-tbody::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

/* ── WORKFLOW STEPPER ────────────────────────────────────── */

.mc-wft { display: flex; flex-direction: column; }

.mc-wft-item {
  display: flex; gap: 13px; position: relative;
  animation: mc-ni .4s cubic-bezier(.22,.68,0,1.2) both;
  border-radius: 10px; transition: background .15s;
  padding: 2px 4px;
}
.mc-wft-item:hover { background: rgba(0,0,0,.025); }
.mc-wft-item.mc-s-ac { background: rgba(37,99,235,.04); }
.mc-wft-item.mc-s-ac:hover { background: rgba(37,99,235,.07); }
@keyframes mc-ni { from{opacity:0;transform:translateX(-12px)} to{opacity:1;transform:none} }

.mc-wft-rail {
  width: 32px;
  display: flex; flex-direction: column; align-items: center; flex-shrink: 0;
}

.mc-wft-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; z-index: 1; font-size: 12px;
  transition: all .4s cubic-bezier(.22,.68,0,1.2);
}

.mc-wft-conn {
  width: 1px; flex: 1; min-height: 18px;
  transition: background .5s .15s;
  animation: mc-conn-draw .4s ease both;
}
@keyframes mc-conn-draw { from{transform:scaleY(0);transform-origin:top} to{transform:scaleY(1);transform-origin:top} }

/* Step state variants */
.mc-wft-item.mc-s-cp .mc-wft-dot { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }
.mc-wft-item.mc-s-rj .mc-wft-dot { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; }
.mc-wft-item.mc-s-rj .mc-wft-name { color: #b91c1c; }
.mc-wft-item.mc-s-rj { background: rgba(239,68,68,.04); }
.mc-wft-item.mc-s-ac .mc-wft-dot { background: #dbeafe; border: 1px solid #2563eb; color: #1d4ed8; animation: mc-wft-pulse 2s ease-in-out infinite; }
.mc-wft-item.mc-s-st .mc-wft-dot { background: #fef3c7; border: 1px solid #fbbf24; color: #92400e; }
.mc-wft-item.mc-s-sk .mc-wft-dot { background: #f3f4f6; border: 1px solid #d1d5db; color: #9ca3af; }
.mc-wft-item.mc-s-pn .mc-wft-dot { background: #f9fafb; border: 1.5px dashed #cbd5e1; color: #94a3b8; }
.mc-wft-item.mc-s-pn { opacity: .45; filter: grayscale(0.25); }

@keyframes mc-wft-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(37,99,235,.3); }
  50%      { box-shadow: 0 0 0 8px rgba(37,99,235,0); }
}

.mc-conn-cp { background: #86efac; }
.mc-conn-rj { background: #fca5a5; }
.mc-conn-ac { background: linear-gradient(180deg,#93c5fd 0%,#dbeafe 100%); }
.mc-conn-pn {
  background: repeating-linear-gradient(
    to bottom,
    #cbd5e1 0, #cbd5e1 4px,
    transparent 4px, transparent 9px
  );
  width: 1px;
}

/* Pulse ring (active step) */
.mc-pring {
  position: absolute; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid #2563eb;
  animation: mc-pr 1.8s infinite; pointer-events: none;
}
@keyframes mc-pr { 0%{transform:scale(1);opacity:.6} 100%{transform:scale(1.9);opacity:0} }

/* Step body */
.mc-wft-body { flex: 1; padding-bottom: 18px; min-width: 0; }

.mc-wft-head {
  display: flex; align-items: center; gap: 7px;
  padding-top: 5px; flex-wrap: wrap; margin-bottom: 4px;
}
.mc-wft-name { font-size: 13px; font-weight: 700; color: #111827; letter-spacing: -.01em; }
.mc-wft-item.mc-s-sk .mc-wft-name { text-decoration: line-through; color: #9ca3af; }
.mc-wft-item.mc-s-cp .mc-wft-name { color: #374151; }
.mc-wft-item.mc-s-pn .mc-wft-name { color: #94a3b8; font-weight: 600; }

/* Upcoming / not-yet-reached badge */
.mc-upcoming-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f1f5f9; color: #94a3b8;
  font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: 20px; border: 1px dashed #cbd5e1;
  letter-spacing: .02em;
}

.mc-active-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #dbeafe; color: #1d4ed8;
  font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: 20px; border: 1px solid #bfdbfe;
}
.mc-pulse-dot {
  width: 5px; height: 5px; border-radius: 50%; background: #2563eb;
  animation: mc-pd 1.5s infinite;
}
@keyframes mc-pd { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.3;transform:scale(.6)} }

.mc-type-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
}
.mc-tb-ap, .mc-tb-approval     { background: #ede9fe; color: #6d28d9; }
.mc-tb-nt, .mc-tb-notification { background: #fef3c7; color: #92400e; }
.mc-tb-ac, .mc-tb-action       { background: #ccfbf1; color: #0f766e; }

.mc-wft-role {
  font-size: 11px; color: #6b7280;
  display: flex; align-items: center; gap: 5px; margin-bottom: 6px;
}
.mc-wft-role i { opacity: .55; font-size: 10px; }
.mc-wft-assignee {
  display: inline-flex; align-items: center;
  color: #0f766e; background: #ccfbf1; border: 1px solid #99f6e4;
  border-radius: 999px; padding: 2px 7px; font-size: 10px; font-weight: 700;
  line-height: 1.2;
}

.mc-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.mc-chip {
  font-size: 10px; display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 6px;
  border: 1px solid rgba(0,0,0,.08); color: #6b7280; background: #f8fafc;
}
.mc-chip i { font-size: 9px; }
.mc-chip--active   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.mc-chip--rejected { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; font-weight: 600; }
.mc-chip--approved { background: #dcfce7; color: #15803d; border-color: #86efac; font-weight: 600; }
.mc-chip--ov       { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }

.mc-wft-trans {
  padding: 7px 10px; background: #f8fafc;
  border: 1px solid rgba(0,0,0,.08); border-radius: 8px;
  font-family: var(--font-mono,'Roboto Mono',monospace);
  font-size: 10px; color: #6b7280; letter-spacing: .02em; margin-top: 2px;
}
.mc-arrow { color: #2563eb; margin: 0 5px; }

/* Step number for pending */
.mc-wft-step-n { font-size: 10px; font-weight: 700; color: #9ca3af; font-family: var(--font-mono,monospace); }

/* ── INFO GRID ───────────────────────────────────────────── */

.mc-igrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; animation: mc-fi .2s ease both; }
.mc-icard {
  background: #fff; border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px; padding: 12px 14px;
  transition: box-shadow .2s, transform .15s;
}
.mc-icard:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.mc-icard--full { grid-column: 1 / -1; }
.mc-icard-h {
  font-size: 10px; font-weight: 700; color: #6b7280;
  margin-bottom: 10px; display: flex; align-items: center; gap: 5px;
  text-transform: uppercase; letter-spacing: .08em;
}
.mc-icard-h i { color: #2563eb; font-size: 11px; }
.mc-idl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 12px; }
.mc-idl dt { color: #9ca3af; font-weight: 500; }
.mc-idl dd { color: #374151; font-weight: 600; text-align: right; margin: 0; }
.mc-idl a  { color: #2563eb; }

/* JSON block */
.mc-json {
  margin: 0; padding: 10px;
  font-family: var(--font-mono,'Roboto Mono',monospace);
  font-size: 10px; line-height: 1.6; color: #374151;
  background: #f8fafc; max-height: 200px; overflow: auto; white-space: pre;
}

/* ── ACTIVITY TIMELINE ───────────────────────────────────── */

.mc-tl-item { display: flex; gap: 10px; padding: 8px 6px 14px; border-radius: 8px; animation: mc-fi .25s ease both; transition: background .15s; }
.mc-tl-item:hover { background: rgba(0,0,0,.025); }
.mc-tl-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 11px;
}
.mc-tl-d-blue   { background: #dbeafe; color: #1d4ed8; }
.mc-tl-d-green  { background: #dcfce7; color: #15803d; }
.mc-tl-d-red    { background: #fee2e2; color: #b91c1c; }
.mc-tl-d-gray   { background: #f3f4f6; color: #6b7280; }
.mc-tl-d-amber  { background: #fef3c7; color: #92400e; }
.mc-tl-d-purple { background: #ede9fe; color: #6d28d9; }
.mc-tl-title { font-size: 12px; font-weight: 700; color: #111827; margin-bottom: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.mc-tl-entity { font-size: 10px; font-weight: 400; color: #9ca3af; background: #f3f4f6; border-radius: 4px; padding: 1px 5px; }
.mc-tl-actor { font-size: 11px; color: #6b7280; margin-bottom: 1px; display: flex; align-items: center; gap: 4px; }
.mc-tl-actor i { opacity: .5; font-size: 10px; }
.mc-tl-role { font-size: 10px; background: #dbeafe; color: #1d4ed8; border-radius: 4px; padding: 1px 5px; font-weight: 600; }
.mc-tl-time { font-size: 10px; color: #9ca3af; font-family: var(--font-mono,monospace); }

/* ── DELIVERIES ──────────────────────────────────────────── */

.mc-sec-h {
  font-size: 10px; font-weight: 700; color: #6b7280;
  margin: 0 0 8px; display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: .08em;
}
.mc-sec-h i { color: #2563eb; }
.mc-sc { background: #f1f5f9; border-radius: 20px; padding: 1px 7px; font-size: 11px; color: #6b7280; font-weight: 400; text-transform: none; letter-spacing: 0; }
.mc-tbl-wrap { background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.mc-dt { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mc-dt th { font-size: 10px; font-weight: 700; color: #9ca3af; text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,.08); text-transform: uppercase; letter-spacing: .06em; background: #f8fafc; }
.mc-dt td { padding: 7px 10px; border-bottom: 1px solid rgba(0,0,0,.06); color: #374151; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-dt tr:last-child td { border-bottom: none; }
.mc-dt tr:hover td { background: #f8fafc; }

/* ── OPERATOR BAR ────────────────────────────────────────── */

.mc-opbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid rgba(0,0,0,.08);
  padding: 10px 14px;
  display: flex; gap: 6px; align-items: center;
  box-shadow: 0 -2px 8px rgba(0,0,0,.05);
}
.mc-op {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  border: 1px solid rgba(0,0,0,.1);
  font-family: inherit; white-space: nowrap;
}
.mc-op i { font-size: 11px; }
.mc-op-g { background: #f8fafc; color: #374151; border-color: rgba(0,0,0,.1); }
.mc-op-g:hover { background: #e2e8f0; }
.mc-op-p { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); color: #fff; border-color: #2563eb; box-shadow: 0 2px 6px rgba(37,99,235,.3); }
.mc-op-p:hover { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); box-shadow: 0 3px 10px rgba(37,99,235,.4); }
.mc-op-d { background: #fff5f5; color: #b91c1c; border-color: #fecaca; }
.mc-op-d:hover { background: #fee2e2; }
.mc-op-w { background: #fffdf0; color: #92400e; border-color: #fde68a; }
.mc-op-w:hover { background: #fef9c3; }
.mc-op-spacer { flex: 1; }

/* ── Loading ─────────────────────────────────────────────── */

.mc-loading { display: flex; align-items: center; gap: 8px; padding: 24px 16px; font-size: 12px; color: #9ca3af; }
.mc-spinner { width: 16px; height: 16px; border: 2px solid #e2e8f0; border-top-color: #2563eb; border-radius: 50%; animation: mc-spin .7s linear infinite; }
@keyframes mc-spin { to { transform: rotate(360deg); } }

/* Fade-in animation */
@keyframes mc-fi { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }
.mc-fade-in { animation: mc-fi .2s ease both; }

/* Mono small */
.mc-mono-sm { font-family: var(--font-mono,'Roboto Mono',monospace); font-size: 10px; color: #6b7280; }

/* ================================================================
   TENANT LIST & DETAIL — Custom components
   ================================================================ */

/* ── Tenant avatar ── */
.tn-avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 800; letter-spacing: -.02em;
  transition: transform .15s;
}
.tn-row:hover .tn-avatar { transform: scale(1.08); }
.tn-avatar--sm  { width: 28px; height: 28px; border-radius: 8px; font-size: .75rem; }
.tn-avatar--lg  { width: 56px; height: 56px; border-radius: 16px; font-size: 1.5rem; }

.tn-avatar--blue   { background: #dbeafe; color: #1d4ed8; }
.tn-avatar--green  { background: #dcfce7; color: #15803d; }
.tn-avatar--amber  { background: #fef3c7; color: #92400e; }
.tn-avatar--purple { background: #f3e8ff; color: #7c3aed; }
.tn-avatar--teal   { background: #ccfbf1; color: #0f766e; }
.tn-avatar--rose   { background: #ffe4e6; color: #be123c; }
.tn-avatar--indigo { background: #e0e7ff; color: #4338ca; }

/* ── Filter bar ── */
.tn-filter-bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: .875rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

/* ── Search box ── */
.tn-search-wrap {
  position: relative; display: flex; align-items: center;
  flex: 1; min-width: 220px; max-width: 340px;
}
.tn-search-ico {
  position: absolute; left: .75rem; font-size: .8rem; color: var(--c-text-muted);
  pointer-events: none;
}
.tn-search-input {
  width: 100%; padding: .45rem .75rem .45rem 2.2rem;
  border: 1.5px solid var(--c-border); border-radius: 8px;
  font-size: .875rem; background: var(--c-bg); color: var(--c-text);
  outline: none; transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
}
.tn-search-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0, 94, 162, .12);
}
.tn-search-clear {
  position: absolute; right: .5rem;
  background: none; border: none; cursor: pointer;
  color: var(--c-text-muted); font-size: .75rem; padding: .2rem .35rem;
  border-radius: 4px; transition: background .1s;
}
.tn-search-clear:hover { background: var(--c-border); color: var(--c-text); }

/* ── Status pills ── */
.tn-pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.tn-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .32rem .75rem; border-radius: 20px;
  border: 1.5px solid var(--c-border); background: var(--c-bg);
  font-size: .75rem; font-weight: 600; color: var(--c-text-muted);
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.tn-pill:hover { border-color: #9ca3af; color: var(--c-text); }
.tn-pill--active { border-color: var(--c-primary); background: var(--c-info-bg); color: var(--c-primary); }
.tn-pill--active.tn-pill--green { border-color: var(--c-success); background: var(--c-success-bg); color: var(--uswds-green-60); }
.tn-pill--active.tn-pill--amber { border-color: var(--c-warning); background: var(--c-warning-bg); color: var(--uswds-gold-60); }
.tn-pill--active.tn-pill--red   { border-color: var(--c-danger);  background: var(--c-danger-bg);  color: var(--uswds-red-60); }
.tn-pill-ct {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: rgba(0,0,0,.07); border-radius: 10px;
  font-size: .68rem; font-weight: 700;
}
.tn-pill-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.tn-filter-info {
  margin-left: auto; font-size: .78rem; color: var(--c-text-muted);
  display: flex; align-items: center; gap: .4rem; white-space: nowrap;
}

/* ── Clickable table rows ── */
.tn-table tbody tr.tn-row { cursor: pointer; }
.tn-table tbody tr.tn-row td { transition: background .1s; }
.tn-table tbody tr.tn-row:hover td {
  background: #f0f6ff;
}

/* ── Count chips ── */
.count-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .55rem; border-radius: 6px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.count-chip--grey   { background: var(--uswds-gray-5);   color: var(--uswds-gray-70); }
.count-chip--blue   { background: var(--c-info-bg);       color: var(--c-primary); }
.count-chip--green  { background: var(--c-success-bg);    color: var(--uswds-green-60); }
.count-chip--amber  { background: var(--c-warning-bg);    color: var(--uswds-gold-60); }
.count-chip--red    { background: var(--c-danger-bg);     color: var(--uswds-red-60); }
.count-chip--purple { background: #f3e8ff;                color: #7c3aed; }

/* ── Webhook chip ── */
.wh-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 6px;
  font-size: .72rem; font-weight: 600;
}
.wh-chip--on  { background: #dcfce7; color: #15803d; }
.wh-chip--off { background: var(--uswds-gray-5); color: var(--uswds-gray-50); }
.wh-chip--sm  { font-size: .7rem; padding: .15rem .5rem; }

/* ── Pagination bar ── */
.pg-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
  padding: .625rem 1rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.pg-info { font-size: .8rem; color: var(--c-text-muted); }
.pg-btns { display: flex; gap: .35rem; flex-wrap: wrap; }
.pg-btn {
  min-width: 32px; height: 32px; padding: 0 .5rem;
  border: 1.5px solid var(--c-border); border-radius: 7px;
  background: var(--c-surface); color: var(--c-text-muted);
  font-size: .8rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-info-bg); }
.pg-btn--active { border-color: var(--c-primary); background: var(--c-primary); color: #fff; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Tab count badge ── */
.tab-btn .tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--uswds-gray-5);
  color: var(--c-text-muted);
  border-radius: 10px; font-size: .68rem; font-weight: 700;
  margin-left: .3rem;
}
.tab-btn.active .tab-count {
  background: var(--c-info-bg); color: var(--c-primary);
}

/* ── Tenant hero (detail page) ── */
.tn-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #162e51 0%, #1a4480 60%, #005ea2 100%);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: .25rem;
  box-shadow: 0 4px 20px rgba(0,94,162,.25);
}
.tn-hero__glow {
  position: absolute; top: -40px; right: -40px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
  pointer-events: none;
}
.tn-hero__content {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.tn-hero__info { flex: 1; min-width: 0; }
.tn-hero__title {
  font-size: 1.5rem; font-weight: 800; color: #fff;
  margin: 0 0 .4rem; letter-spacing: -.02em; line-height: 1.2;
}
.tn-hero__meta {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  font-size: .8rem; color: rgba(255,255,255,.75);
}
.tn-hero__meta code { color: rgba(255,255,255,.9); }
.tn-hero__sep { opacity: .4; }
.tn-hero .badge { border: 1px solid rgba(255,255,255,.25); }
.tn-hero .tn-avatar--lg { box-shadow: 0 0 0 4px rgba(255,255,255,.15); }


/* ================================================================
   MODALS
   ================================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
  animation: mc-fi .15s ease;
}
.modal-panel {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  max-height: 90vh; overflow: hidden;
  animation: modal-in .2s ease;
  width: 100%;
}
.modal-panel--sm  { max-width: 440px; }
.modal-panel--md  { max-width: 580px; }
.modal-panel--lg  { max-width: 760px; }

@keyframes modal-in {
  from { transform: translateY(-16px) scale(.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.modal-header {
  display: flex; align-items: flex-start; gap: .875rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--c-border);
}
.modal-header__icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.modal-title {
  font-size: 1.05rem; font-weight: 700; color: var(--c-text);
  margin: 0 0 .15rem;
}
.modal-subtitle {
  font-size: .8rem; color: var(--c-text-muted); margin: 0;
}
.modal-close {
  margin-left: auto; background: none; border: none;
  color: var(--c-text-muted); cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; transition: background .12s, color .12s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--c-border); color: var(--c-text); }
.modal-body { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: .875rem 1.5rem;
  border-top: 1px solid var(--c-border);
  display: flex; justify-content: flex-end; gap: .5rem;
  background: var(--c-bg);
}

/* ================================================================
   FORMS  (inside modals and elsewhere)
   ================================================================ */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.form-field { display: flex; flex-direction: column; gap: .35rem; }
.form-field--full { grid-column: 1 / -1; }
.form-label {
  font-size: .8rem; font-weight: 600; color: var(--c-text);
}
.form-required { color: var(--c-danger); margin-left: .15rem; }
.form-input {
  padding: .45rem .75rem;
  border: 1.5px solid var(--c-border); border-radius: var(--radius-lg);
  font-size: .875rem; font-family: var(--font); color: var(--c-text);
  background: var(--c-bg); outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0,94,162,.12);
  background: var(--c-surface);
}
.form-input:disabled { opacity: .55; cursor: not-allowed; }
textarea.form-input { resize: vertical; min-height: 60px; }

.form-radio-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.form-radio {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; border-radius: 8px;
  border: 1.5px solid var(--c-border); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.form-radio input[type=radio] { display: none; }
.form-radio:hover { border-color: #9ca3af; }
.form-radio--active { border-color: var(--c-primary); background: var(--c-info-bg); }

/* ================================================================
   ROW ACTION BUTTONS
   ================================================================ */
.row-actions {
  display: flex; gap: .3rem; justify-content: center; align-items: center;
}
.row-action-btn {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1.5px solid transparent; background: transparent;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; transition: all .13s;
}
.row-action-btn:disabled { opacity: .35; cursor: not-allowed; }
.row-action-btn--blue  { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.row-action-btn--blue:hover:not(:disabled)  { background: #dbeafe; border-color: #93c5fd; }
.row-action-btn--amber { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.row-action-btn--amber:hover:not(:disabled) { background: #fef3c7; border-color: #fcd34d; }
.row-action-btn--green { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.row-action-btn--green:hover:not(:disabled) { background: #dcfce7; border-color: #86efac; }
.row-action-btn--red   { color: #be123c; border-color: #fecdd3; background: #fff1f2; }
.row-action-btn--red:hover:not(:disabled)   { background: #ffe4e6; border-color: #fda4af; }

/* ================================================================
   WORKFLOW DEFINITION ICON (list page)
   ================================================================ */
.wf-def-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}
.wf-def-icon--green  { background: #dcfce7; color: #15803d; }
.wf-def-icon--amber  { background: #fef3c7; color: #92400e; }
.wf-def-icon--red    { background: #ffe4e6; color: #be123c; }
.wf-def-icon--grey   { background: var(--uswds-gray-5); color: var(--c-text-muted); }

/* ── td-secondary ── */
.td-secondary {
  font-size: .73rem; color: var(--c-text-muted);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ================================================================
   WORKFLOW HERO ICON (detail page)
   ================================================================ */
.wf-hero-icon {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: rgba(255,255,255,.18);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.12);
}

/* ================================================================
   STEP PIPELINE  (horizontal scroll cards)
   ================================================================ */
.step-pipeline {
  display: flex; align-items: stretch; gap: 0;
  overflow-x: auto; padding-bottom: .5rem;
  margin-bottom: .25rem;
}
.step-card {
  position: relative;
  display: flex; flex-direction: column; gap: .5rem;
  min-width: 200px; max-width: 240px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  flex-shrink: 0;
  transition: box-shadow .15s, border-color .15s;
}
.step-card:hover { box-shadow: var(--shadow); }
.step-card--blue   { border-top: 3px solid #2563eb; }
.step-card--green  { border-top: 3px solid #16a34a; }
.step-card--purple { border-top: 3px solid #7c3aed; }
.step-card--grey   { border-top: 3px solid #9ca3af; }

.step-card__order {
  position: absolute; top: -.7rem; left: .75rem;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  font-size: .7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,94,162,.3);
}
.step-card--blue .step-card__order   { background: #2563eb; }
.step-card--green .step-card__order  { background: #16a34a; }
.step-card--purple .step-card__order { background: #7c3aed; }

.step-card__icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}
.step-card--blue .step-card__icon   { background: #dbeafe; color: #1d4ed8; }
.step-card--green .step-card__icon  { background: #dcfce7; color: #15803d; }
.step-card--purple .step-card__icon { background: #f3e8ff; color: #7c3aed; }
.step-card--grey .step-card__icon   { background: var(--uswds-gray-5); color: var(--c-text-muted); }

.step-card__name {
  font-size: .875rem; font-weight: 700; color: var(--c-text);
  line-height: 1.25;
}
.step-card__meta { display: flex; flex-wrap: wrap; gap: .25rem; }

.step-card__statuses { margin-top: .25rem; }
.step-status-flow {
  display: flex; align-items: center; gap: .3rem; flex-wrap: wrap;
}
.step-status-badge {
  display: inline-block; padding: .12rem .45rem; border-radius: 5px;
  font-size: .68rem; font-weight: 700; white-space: nowrap;
}
.step-status-badge--load   { background: #e0e7ff; color: #4338ca; }
.step-status-badge--target { background: #dcfce7; color: #15803d; }
.step-status-badge--alt    { background: #ffe4e6; color: #be123c; }

.step-card__actions {
  display: flex; gap: .3rem; justify-content: flex-end; margin-top: auto;
}

.step-connector {
  display: flex; align-items: center; padding: 0 .35rem;
  color: var(--c-text-muted); font-size: .7rem;
  align-self: center; flex-shrink: 0;
}

/* ================================================================
   TOAST  (success / error floating notification)
   ================================================================ */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 2000;
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1.25rem; border-radius: var(--radius-lg);
  font-size: .875rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: toast-in .25s ease, toast-out .25s ease 2.75s forwards;
  max-width: 360px;
}
.toast--success { background: #15803d; color: #fff; }
.toast--error   { background: #be123c; color: #fff; }
@keyframes toast-in  { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(8px); } }

/* ================================================================
   SPINNER sm (inside buttons)
   ================================================================ */
.spinner--sm {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  animation: mc-spin .6s linear infinite;
  display: inline-block;
}

/* ====================================================
   Portal (Action Portal merged into AdminUI)
   ==================================================== */

/* Portal Identity Banner */
.portal-identity-banner {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    border-radius: 10px; 
    padding: 1rem 1.25rem; 
    margin-bottom: 1.5rem; 
    flex-wrap: wrap;
}
.portal-identity-banner__left  { display: flex; align-items: center; gap: 0.875rem; }
.portal-identity-banner__avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.35);
    color: #fff; font-size: 1.1rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; text-transform: uppercase;
}
.portal-identity-banner__info  { display: flex; flex-direction: column; gap: 3px; }
.portal-identity-banner__name  { font-size: 1rem; font-weight: 700; color: #fff; text-transform: capitalize; }
.portal-identity-banner__email { font-size: 0.825rem; color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: 0.35rem; }
.portal-identity-banner__right { display: flex; align-items: center; }
.portal-identity-banner__badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
    border-radius: 99px; font-size: 0.775rem; font-weight: 600; color: rgba(255,255,255,0.9);
}

/* Inbox Header */
.inbox-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.inbox-header__left  { display: flex; align-items: center; gap: 1rem; }
.inbox-header__right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.inbox-header__icon-wrap {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--c-info-bg); color: var(--c-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0; border: 1px solid rgba(0,94,162,0.15);
}
.inbox-search-wrap  { position: relative; display: flex; align-items: center; }
.inbox-search-icon  { position: absolute; left: 0.75rem; color: var(--c-text-muted); font-size: 0.8rem; pointer-events: none; }
.inbox-search {
    padding: 0.5rem 0.75rem 0.5rem 2.25rem; border: 1.5px solid var(--c-border);
    border-radius: 6px; background: var(--c-surface); font-size: 0.875rem;
    font-family: var(--font); color: var(--c-text); outline: none; width: 200px;
    transition: border-color 0.15s, box-shadow 0.15s, width 0.2s;
}
.inbox-search:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0,94,162,0.15); width: 250px; }
.inbox-filter-wrap  { position: relative; display: flex; align-items: center; }
.inbox-filter-icon  { position: absolute; left: 0.75rem; color: var(--c-text-muted); font-size: 0.8rem; pointer-events: none; }
.inbox-select {
    padding: 0.5rem 2.25rem 0.5rem 2.25rem; border: 1.5px solid var(--c-border);
    border-radius: 6px; background: var(--c-surface); font-size: 0.875rem;
    font-family: var(--font); color: var(--c-text); outline: none; cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.65rem center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.inbox-select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0,94,162,0.15); }
.inbox-clear-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 0.875rem; border: 1.5px solid var(--c-border);
    border-radius: 6px; background: var(--c-surface); font-size: 0.8rem;
    font-family: var(--font); color: var(--c-text-muted); cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s; white-space: nowrap;
}
.inbox-clear-btn:hover { background: var(--c-danger-bg); color: var(--c-danger); border-color: var(--c-danger); }

/* KPI Strip */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpi-strip { grid-template-columns: 1fr; } }
.kpi-card {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px;
    padding: 1rem 1.25rem; display: flex; align-items: center; gap: 0.875rem;
    box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.15s;
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-card__icon { width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.kpi-card__body  { display: flex; flex-direction: column; gap: 2px; }
.kpi-card__value { font-size: 1.625rem; font-weight: 700; line-height: 1; }
.kpi-card__label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-muted); }
.kpi-card--amber .kpi-card__icon  { background: var(--c-warning-bg); color: var(--c-warning); }
.kpi-card--amber .kpi-card__value { color: var(--c-warning); }
.kpi-card--blue  .kpi-card__icon  { background: var(--c-info-bg); color: var(--c-primary); }
.kpi-card--blue  .kpi-card__value { color: var(--c-primary); }
.kpi-card--green .kpi-card__icon  { background: var(--c-success-bg); color: var(--c-success); }
.kpi-card--green .kpi-card__value { color: var(--c-success); }
.kpi-card--red   .kpi-card__icon  { background: var(--c-danger-bg); color: var(--c-danger); }
.kpi-card--red   .kpi-card__value { color: var(--c-danger); }
.kpi-card--active { box-shadow: 0 0 0 2px var(--c-primary), var(--shadow) !important; transform: translateY(-1px); }

/* Portal Loading / Empty */
.inbox-loading { display: flex; align-items: center; gap: 0.75rem; padding: 3rem; justify-content: center; color: var(--c-text-muted); font-size: 0.875rem; }
.inbox-loading__spinner { width: 20px; height: 20px; border: 2px solid var(--c-border); border-top-color: var(--c-primary); border-radius: 50%; animation: portal-spin 0.75s linear infinite; flex-shrink: 0; }
@keyframes portal-spin { to { transform: rotate(360deg); } }
.inbox-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem 2rem; text-align: center; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; }
.inbox-empty__icon  { font-size: 2.5rem; color: var(--c-border); margin-bottom: 1rem; }
.inbox-empty__title { font-size: 1rem; font-weight: 700; color: var(--c-text); margin: 0 0 0.25rem; }
.inbox-empty__sub   { font-size: 0.875rem; color: var(--c-text-muted); margin: 0; }

/* Linked-only banner */
.linked-only-banner {
    display: flex; align-items: center; gap: 0.6rem;
    background: #eef4ff; border: 1px solid rgba(0,94,162,0.25);
    border-radius: 8px; padding: 0.6rem 1rem; margin-bottom: 1rem;
    font-size: 0.875rem; color: var(--c-primary); font-weight: 500;
}
.linked-only-banner__dismiss {
    margin-left: auto; display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--c-primary); color: #fff; border: none; border-radius: 6px;
    padding: 0.3rem 0.75rem; font-size: 0.8rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s;
}
.linked-only-banner__dismiss:hover { background: #003d73; }

/* Action Card Extensions */
.action-card--linked { border-left-color: var(--c-primary) !important; box-shadow: 0 0 0 2px rgba(0,94,162,0.25), var(--shadow) !important; background: #f0f6ff; }
.action-card--overdue { border-left-color: var(--c-danger) !important; }
.action-card__linked-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.7rem; font-weight: 600; color: var(--c-primary);
    background: var(--c-info-bg); border: 1px solid rgba(0,94,162,0.2);
    border-radius: 4px; padding: 0.1rem 0.4rem; margin-left: 0.5rem; vertical-align: middle;
}
.action-card__ref { font-size: 0.8rem; color: var(--c-text-muted); display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.action-card__overdue-badge { color: var(--c-danger); font-weight: 600; }

/* ====================================================
   Actions Table — Sort, Pagination, Row highlights
   ==================================================== */
.sort-th { cursor: pointer; user-select: none; }
.sort-th:hover { color: var(--c-primary); background: var(--c-info-bg); }
.sort-icon { margin-left: 4px; font-size: 0.65em; opacity: 0.3; vertical-align: middle; }
.sort-icon--active { opacity: 1; color: var(--c-primary); }

.page-size-wrap {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; color: var(--c-text-muted);
}
.page-size-select {
    padding: 0.3rem 1.75rem 0.3rem 0.6rem;
    border: 1.5px solid var(--c-border); border-radius: 4px;
    background: var(--c-surface); font-size: 0.8rem; font-family: var(--font);
    color: var(--c-text); cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.4rem center;
}
.page-size-select:focus { border-color: var(--c-primary); outline: none; }

.pagination-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; border-top: 1px solid var(--c-border);
    gap: 1rem; flex-wrap: wrap; border-radius: 0 0 8px 8px;
}
.pagination-info { font-size: .78rem; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.pagination-pages { display: flex; align-items: center; gap: 0.25rem; }
.pagination-btn {
    min-width: 32px; height: 32px; padding: 0 0.5rem;
    border: 1.5px solid var(--c-border); border-radius: 4px;
    background: var(--c-surface); color: var(--c-text-muted);
    font-size: 0.8rem; font-family: var(--font); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s, border-color .12s;
}
.pagination-btn:hover:not(:disabled) { background: var(--c-info-bg); color: var(--c-primary); border-color: var(--c-primary); }
.pagination-btn--active { background: var(--c-primary) !important; color: #fff !important; border-color: var(--c-primary) !important; }
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }

.tr-linked td { background: #f0f6ff !important; }
.tr-overdue td:first-child { border-left: 3px solid var(--c-danger); }

/* ================================================================
   GLOBAL RESPONSIVE OVERRIDES
   ================================================================ */

/* Chart filter bar stacking on small screens */
@media (max-width: 768px) {
  .chart-filters {
    flex-direction: column;
    align-items: flex-start;
  }
  .chart-filters__updated { margin-left: 0; }
}

/* Stats grid stacking on mobile */
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .usa-main { padding: var(--sp-4); }
}
@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Page header wraps on small screens */
@media (max-width: 600px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }
  .page-header__actions { width: 100%; justify-content: flex-start; }
}

/* Header search bar collapses on small screens */
@media (max-width: 680px) {
  .usa-header__center { display: none; }
}

/* Tablet: profile text hides, only avatar shows */
@media (max-width: 480px) {
  .navbar-profile__info { display: none; }
  .navbar-profile__chevron { display: none; }
  .navbar-profile__trigger { padding: 4px; }
}

/* Nav menu fills screen height without internal scroll */
.usa-nav {
  overflow-y: auto;
  /* scrollbar only appears when content overflows — not a fixed height */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.usa-nav::-webkit-scrollbar { width: 4px; }
.usa-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

