/* ============================================================
   EdoBuild 360° — Compiled Application CSS
   Edo State Government Building Project Monitoring System
   Primary: Forest Green (#0A3D2E) | Accent: Nigerian Gold (#B8860B)
   Font: Century Gothic
   ============================================================ */

/* ============================================================
   1. CSS CUSTOM PROPERTIES — DESIGN TOKEN SYSTEM
   ============================================================ */
:root {
  /* Primary (Forest Green) Scale */
  --primary-50:  #EEF5F1;
  --primary-100: #D5E8DC;
  --primary-200: #ABCFB9;
  --primary-300: #7EB896;
  --primary-400: #2E8B6F;
  --primary-500: #1E7459;
  --primary-600: #1A5C42;
  --primary-700: #145030;
  --primary-800: #0E3E24;
  --primary-900: #0A3D2E;
  --primary-950: #051C14;

  /* Gold Scale */
  --gold-50:  #FDF8EC;
  --gold-100: #F5E6C0;
  --gold-200: #EDD08F;
  --gold-300: #E4BB5E;
  --gold-400: #CFA030;
  --gold-500: #B8860B;
  --gold-600: #9B6F09;
  --gold-700: #7D5807;
  --gold-800: #5E4205;
  --gold-900: #3F2D03;

  /* Success Scale */
  --success-50:  #F0FDF4;
  --success-100: #DCFCE7;
  --success-200: #BBF7D0;
  --success-500: #16A34A;
  --success-600: #15803D;
  --success-700: #166534;

  /* Warning Scale */
  --warning-50:  #FFFBEB;
  --warning-100: #FEF3C7;
  --warning-200: #FDE68A;
  --warning-400: #FBBF24;
  --warning-500: #F59E0B;
  --warning-600: #D97706;

  /* Danger Scale */
  --danger-50:  #FEF2F2;
  --danger-100: #FEE2E2;
  --danger-200: #FECACA;
  --danger-500: #EF4444;
  --danger-600: #DC2626;
  --danger-700: #B91C1C;

  /* Info Scale */
  --info-50:  #EFF6FF;
  --info-100: #DBEAFE;
  --info-200: #BFDBFE;
  --info-500: #3B82F6;
  --info-600: #2563EB;
  --info-700: #1D4ED8;

  /* Gray Scale */
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Typography Tokens */
  --font-sans: "Century Gothic", CenturyGothic, AppleGothic, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Courier New", Courier, monospace;
  --text-display: 3rem;
  --text-h1:    2.25rem;
  --text-h2:    1.75rem;
  --text-h3:    1.375rem;
  --text-h4:    1.125rem;
  --text-body:  1rem;
  --text-sm:    0.9375rem;
  --text-xs:    0.75rem;
  --text-label: 0.6875rem;

  /* Spacing / Layout Tokens */
  --sidebar-width:           280px;
  --sidebar-collapsed-width: 72px;
  --topbar-height:           64px;
  --page-padding:            1.5rem;
  --card-padding:            1.5rem;
  --card-padding-sm:         1rem;

  /* Shadow Tokens */
  --shadow-xs:           0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:           0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:           0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:           0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.06);
  --shadow-xl:           0 20px 25px rgba(0,0,0,0.10), 0 8px 10px rgba(0,0,0,0.06);
  --shadow-card:         0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-card-lg:      0 4px 6px rgba(0,0,0,0.05), 0 10px 30px rgba(0,0,0,0.08);
  --shadow-card-hover:   0 8px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-sidebar:      4px 0 24px rgba(0,0,0,0.20);
  --shadow-nav:          0 1px 4px rgba(0,0,0,0.08);
  --shadow-button:       0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-button-hover: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-toast:        0 8px 32px rgba(0,0,0,0.16);

  /* Border Radius Tokens */
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  20px;
  --radius-full: 9999px;

  /* Transition Tokens */
  --transition-fast:    100ms ease;
  --transition-base:    150ms ease;
  --transition-slow:    250ms ease;
  --transition-sidebar: 260ms cubic-bezier(0.4,0,0.2,1);
  --transition-all:     all 150ms cubic-bezier(0.4,0,0.2,1);

  /* Z-Index Tokens */
  --z-below:    -1;
  --z-base:      0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-popover:  500;
  --z-toast:    600;
  --z-tooltip:  700;
}

/* ============================================================
   2. BASE / RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1 { font-size: var(--text-h1); line-height: 1.2; font-weight: 700; color: var(--gray-900); }
h2 { font-size: var(--text-h2); line-height: 1.3; font-weight: 600; color: var(--gray-900); }
h3 { font-size: var(--text-h3); line-height: 1.4; font-weight: 600; color: var(--gray-800); }
h4 { font-size: var(--text-h4); line-height: 1.4; font-weight: 600; color: var(--gray-800); }

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-base);
}
a:hover { color: var(--primary-800); }

img, svg { display: block; max-width: 100%; }
ul, ol   { list-style: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
}

input, textarea, select { font-family: var(--font-sans); }

/* Custom scrollbar */
::-webkit-scrollbar             { width: 6px; height: 6px; }
::-webkit-scrollbar-track       { background: var(--gray-100); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb       { background: var(--primary-400); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-600); }
*                               { scrollbar-width: thin; scrollbar-color: var(--primary-400) var(--gray-100); }

/* ============================================================
   3. LAYOUT COMPONENTS
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background-color: var(--gray-50);
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, #0A3D2E 0%, #083325 50%, #051C14 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width var(--transition-sidebar), min-width var(--transition-sidebar);
  box-shadow: var(--shadow-sidebar);
  position: relative;
  z-index: var(--z-sticky);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-footer-text,
.sidebar.collapsed .nav-logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: var(--shadow-nav);
  position: sticky;
  top: 0;
  z-index: var(--z-raised);
  gap: 1rem;
}

.page-content {
  flex: 1;
  padding: var(--page-padding);
  max-width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title   { font-size: var(--text-h2); font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.page-subtitle { font-size: var(--text-sm); color: var(--gray-500); margin-top: 0.25rem; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.breadcrumb-sep { color: var(--gray-300); }

/* ============================================================
   4. NAVIGATION — SIDEBAR
   ============================================================ */
.nav-logo {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(184,134,11,0.25);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
  flex-shrink: 0;
}

.nav-logo-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-300) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(184,134,11,0.35);
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  transition: opacity var(--transition-slow);
}

.nav-logo-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-logo-sub {
  font-size: 0.625rem;
  color: var(--gold-300);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.nav-section { margin-bottom: 0.25rem; }

.nav-section-divider {
  height: 1px;
  margin: 0.625rem 1rem;
  background: rgba(255, 255, 255, 0.08);
}

.nav-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-400);
  padding: 0.75rem 1rem 0.375rem;
  display: block;
  transition: opacity var(--transition-slow);
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  margin: 0.125rem 0.5rem;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.72);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-all);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(46,139,111,0.30);
  color: #ffffff;
  font-weight: 600;
  border-left-color: var(--gold-400);
  padding-left: calc(1rem - 3px);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity var(--transition-base);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

.nav-label {
  flex: 1;
  overflow: hidden;
  transition: opacity var(--transition-slow);
}

.nav-badge {
  background: var(--danger-600);
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
  transition: opacity var(--transition-slow);
}

.nav-badge-gold { background: var(--gold-500); color: var(--primary-950); }

.nav-footer {
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-footer-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  border: 2px solid rgba(184,134,11,0.4);
}

.nav-footer-text {
  flex: 1;
  overflow: hidden;
  transition: opacity var(--transition-slow);
}

.nav-footer-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-footer-role {
  font-size: 0.6875rem;
  color: var(--gold-300);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: calc(var(--z-sticky) - 1);
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* ============================================================
   5. CARDS
   ============================================================ */
.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--card-padding);
  border: 1px solid var(--gray-100);
  transition: box-shadow var(--transition-slow), transform var(--transition-slow);
}

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

.card-sm { padding: var(--card-padding-sm); }

.card-glass {
  background: rgba(255,255,255,0.70);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.50);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
}

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

.card-title    { font-size: var(--text-h4); font-weight: 600; color: var(--gray-900); }
.card-subtitle { font-size: var(--text-xs); color: var(--gray-500); margin-top: 0.125rem; }

.card-stat {
  border-left: 4px solid var(--primary-500);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  padding: var(--card-padding);
  transition: box-shadow var(--transition-slow), transform var(--transition-slow);
}

.card-stat:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

.card-stat-green   { border-left-color: var(--success-500); }
.card-stat-amber   { border-left-color: var(--warning-500); }
.card-stat-red     { border-left-color: var(--danger-500);  }
.card-stat-gold    { border-left-color: var(--gold-500);    }
.card-stat-blue    { border-left-color: var(--info-500);    }
.card-stat-primary { border-left-color: var(--primary-500); }

/* ============================================================
   6. KPI / METRIC CARDS
   ============================================================ */
.kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--card-padding);
  border: 1px solid var(--gray-100);
  transition: box-shadow var(--transition-slow), transform var(--transition-slow);
}

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

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.375rem;
}

.kpi-green   { background: var(--success-50);  color: var(--success-600); }
.kpi-amber   { background: var(--warning-50);  color: var(--warning-600); }
.kpi-red     { background: var(--danger-50);   color: var(--danger-600);  }
.kpi-gold    { background: var(--gold-50);     color: var(--gold-600);    }
.kpi-blue    { background: var(--info-50);     color: var(--info-600);    }
.kpi-primary { background: var(--primary-50);  color: var(--primary-700); }

.kpi-body { flex: 1; min-width: 0; }

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-900);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.kpi-label {
  font-size: var(--text-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
}

.kpi-delta-up      { color: var(--success-600); background: var(--success-50); }
.kpi-delta-down    { color: var(--danger-600);  background: var(--danger-50);  }
.kpi-delta-neutral { color: var(--gray-500);    background: var(--gray-100);   }

/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5625rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-all);
  outline: none;
  position: relative;
  user-select: none;
  letter-spacing: 0.01em;
}

.btn:focus-visible { outline: 2px solid var(--primary-400); outline-offset: 2px; }

.btn:disabled,
.btn[disabled] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-900) 100%);
  color: #ffffff;
  border-color: var(--primary-800);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-button); }

.btn-secondary {
  background: transparent;
  color: var(--primary-700);
  border-color: var(--primary-400);
}

.btn-secondary:hover {
  background: var(--primary-50);
  border-color: var(--primary-600);
  color: var(--primary-800);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-500) 0%, var(--danger-700) 100%);
  color: #ffffff;
  border-color: var(--danger-600);
  box-shadow: var(--shadow-button);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--danger-600) 0%, var(--danger-700) 100%);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-600) 100%);
  color: var(--primary-950);
  border-color: var(--gold-500);
  box-shadow: var(--shadow-button);
  font-weight: 700;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-300) 0%, var(--gold-500) 100%);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
  color: var(--primary-950);
}

.btn-ghost { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-sm { font-size: 0.8125rem; padding: 0.375rem 0.75rem; border-radius: var(--radius-sm); }
.btn-lg { font-size: 1rem; padding: 0.75rem 1.5rem; }

.btn-icon    { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-md); flex-shrink: 0; }
.btn-icon-sm { width: 28px; height: 28px; padding: 0; border-radius: var(--radius-sm); }

.btn-loading { pointer-events: none; opacity: 0.80; }

.btn-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

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

/* ============================================================
   8. STATUS BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-green,
.badge-success { background: var(--success-50);  color: var(--success-700); border: 1px solid var(--success-100); }
.badge-amber,
.badge-warning { background: var(--warning-50);  color: var(--warning-600); border: 1px solid var(--warning-100); }
.badge-red,
.badge-danger  { background: var(--danger-50);   color: var(--danger-700);  border: 1px solid var(--danger-100);  }
.badge-gray    { background: var(--gray-100);    color: var(--gray-600);    border: 1px solid var(--gray-200);    }
.badge-gold    { background: var(--gold-50);     color: var(--gold-700);    border: 1px solid var(--gold-100);    }
.badge-blue,
.badge-info    { background: var(--info-50);     color: var(--info-700);    border: 1px solid var(--info-100);    }
.badge-primary { background: var(--primary-50);  color: var(--primary-700); border: 1px solid var(--primary-100); }

.badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-lg { font-size: 0.75rem; padding: 0.3125rem 0.75rem; }

/* ============================================================
   9. DATA TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.data-table thead {
  position: sticky;
  top: 0;
  z-index: var(--z-raised);
  background: var(--primary-50);
}

.data-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-700);
  border-bottom: 2px solid var(--primary-200);
  white-space: nowrap;
  user-select: none;
}

.data-table thead th.sortable               { cursor: pointer; }
.data-table thead th.sortable:hover         { color: var(--primary-900); background: var(--primary-100); }
.data-table tbody tr                        { border-bottom: 1px solid var(--gray-100); transition: background-color var(--transition-fast); }
.data-table tbody tr:last-child             { border-bottom: none; }
.data-table tbody tr:hover                  { background: rgba(14,62,36,0.03); }
.data-table tbody td                        { padding: 0.875rem 1rem; color: var(--gray-700); vertical-align: middle; }

.td-mono    { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--primary-700); font-weight: 600; }
.td-actions { display: flex; align-items: center; gap: 0.375rem; }
.td-primary { font-weight: 600; color: var(--gray-900); }

.data-table tfoot td {
  padding: 0.75rem 1rem;
  font-weight: 600;
  background: var(--gray-50);
  border-top: 2px solid var(--gray-200);
  color: var(--gray-700);
}

/* ============================================================
   10. FORM COMPONENTS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1.25rem; }
.form-label { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); }
.form-label-required::after { content: ' *'; color: var(--danger-500); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5625rem 0.875rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--gray-800);
  background: #ffffff;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  line-height: 1.5;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--gray-400); }

.form-input:hover,
.form-select:hover,
.form-textarea:hover { border-color: var(--gray-400); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(30,116,89,0.12);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger-500);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.10);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' 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.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.form-textarea { min-height: 120px; resize: vertical; }

.form-error { font-size: 0.75rem; color: var(--danger-600); display: flex; align-items: center; gap: 0.25rem; }
.form-hint  { font-size: 0.75rem; color: var(--gray-500); }

.form-addon { display: flex; }
.form-addon .form-input { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

.form-addon-prefix,
.form-addon-suffix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-300);
  color: var(--gray-500);
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.form-addon-prefix { border-right: none; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.form-addon-suffix { border-left: none;  border-radius: 0 var(--radius-md) var(--radius-md) 0; }

.form-check { display: flex; align-items: center; gap: 0.625rem; cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary-600); cursor: pointer; flex-shrink: 0; }
.form-check-label { font-size: 0.875rem; color: var(--gray-700); }

.input-group { display: flex; gap: 0; }
.input-group .form-input { border-radius: var(--radius-md) 0 0 var(--radius-md); border-right: none; }
.input-group .btn        { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ============================================================
   11. ALERTS / NOTIFICATIONS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  font-size: 0.875rem;
  line-height: 1.5;
}

.alert-icon  { flex-shrink: 0; width: 20px; height: 20px; margin-top: 0.0625rem; }
.alert-body  { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 0.25rem; }

.alert-success { background: var(--success-50); border-color: var(--success-500); color: var(--success-700); }
.alert-warning { background: var(--warning-50); border-color: var(--warning-500); color: var(--warning-600); }
.alert-danger  { background: var(--danger-50);  border-color: var(--danger-500);  color: var(--danger-700);  }
.alert-info    { background: var(--info-50);    border-color: var(--info-500);    color: var(--info-700);    }

.alert-dismissible { padding-right: 2.5rem; position: relative; }

.alert-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-base);
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.alert-close:hover { opacity: 1; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: 380px;
  width: calc(100vw - 2.5rem);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-toast);
  border: 1px solid var(--gray-100);
  animation: slideInRight 0.25s ease-out;
  position: relative;
  overflow: hidden;
  pointer-events: auto;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast-success::before { background: var(--success-500); }
.toast-error::before   { background: var(--danger-500);  }
.toast-warning::before { background: var(--warning-500); }
.toast-info::before    { background: var(--info-500);    }

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 0.0625rem; }
.toast-success .toast-icon { color: var(--success-500); }
.toast-error   .toast-icon { color: var(--danger-500);  }
.toast-warning .toast-icon { color: var(--warning-500); }
.toast-info    .toast-icon { color: var(--info-500);    }

.toast-body    { flex: 1; min-width: 0; }
.toast-title   { font-weight: 600; font-size: 0.875rem; color: var(--gray-900); margin-bottom: 0.125rem; }
.toast-message { font-size: 0.8125rem; color: var(--gray-600); line-height: 1.4; }

.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity var(--transition-base);
  color: var(--gray-500);
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover { opacity: 1; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-300));
  transition: width 5s linear;
}

/* Stop Work Banner */
.stop-work-banner {
  background: linear-gradient(90deg, var(--danger-700) 0%, var(--danger-600) 100%);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  animation: pulseBanner 2s ease-in-out infinite;
}

@keyframes pulseBanner {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.85; }
}

.stop-work-badge {
  background: rgba(255,255,255,0.2);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* ============================================================
   12. TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 1.5rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5625rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-200), var(--gray-200));
}

.timeline-item { position: relative; display: flex; gap: 1rem; padding-bottom: 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-500);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--primary-200);
  z-index: 1;
}

.timeline-dot-success { background: var(--success-500); box-shadow: 0 0 0 2px var(--success-100); }
.timeline-dot-warning { background: var(--warning-500); box-shadow: 0 0 0 2px var(--warning-100); }
.timeline-dot-danger  { background: var(--danger-500);  box-shadow: 0 0 0 2px var(--danger-100);  }
.timeline-dot-gold    { background: var(--gold-500);    box-shadow: 0 0 0 2px var(--gold-100);    }

.timeline-content { flex: 1; padding-bottom: 0.25rem; }
.timeline-date    { font-size: 0.75rem; color: var(--gray-400); font-weight: 500; margin-bottom: 0.25rem; }
.timeline-title   { font-size: 0.875rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.25rem; }
.timeline-text    { font-size: 0.8125rem; color: var(--gray-600); line-height: 1.5; }

/* ============================================================
   13. PROGRESS BARS
   ============================================================ */
.progress-bar    { width: 100%; height: 8px; background: var(--gray-200); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar-sm { height: 4px; }
.progress-bar-lg { height: 12px; }

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
}

.progress-green { background: linear-gradient(90deg, var(--success-600), var(--success-500)); }
.progress-amber { background: linear-gradient(90deg, var(--warning-600), var(--warning-400)); }
.progress-red   { background: linear-gradient(90deg, var(--danger-700),  var(--danger-500));  }
.progress-gold  { background: linear-gradient(90deg, var(--gold-600),    var(--gold-400));    }
.progress-blue  { background: linear-gradient(90deg, var(--info-700),    var(--info-500));    }

.progress-stripe {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.15) 0px, rgba(255,255,255,0.15) 4px, transparent 4px, transparent 10px);
  animation: progressStripe 0.8s linear infinite;
}

@keyframes progressStripe {
  from { background-position: 0 0; }
  to   { background-position: 20px 0; }
}

/* ============================================================
   14. SKELETON LOADERS
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text   { height: 0.875rem; border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
.skeleton-title  { height: 1.375rem; border-radius: var(--radius-sm); margin-bottom: 0.75rem; }
.skeleton-card   { height: 120px; border-radius: var(--radius-lg); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   15. MAP CONTAINER
   ============================================================ */
.map-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
}

.map-overlay {
  position: absolute;
  z-index: var(--z-raised);
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-lg);
  padding: 0.75rem 1rem;
  pointer-events: none;
  max-width: 240px;
}

.map-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: var(--z-raised);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.map-legend {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: var(--z-raised);
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 0.75rem;
  font-size: 0.75rem;
}

/* ============================================================
   16. MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: var(--z-overlay);
    transition: left var(--transition-sidebar);
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
  }

  .sidebar.mobile-open { left: 0; }
  .sidebar-overlay        { display: none; }
  .sidebar-overlay.active { display: block; }

  .main-content { width: 100%; flex: 1; }
  .page-content { padding: 1rem; }
  .topbar       { padding: 0 1rem; }
  .kpi-grid     { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .data-table thead th,
  .data-table tbody td { padding: 0.625rem 0.75rem; }

  .toast-container {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .btn      { font-size: 0.8125rem; padding: 0.5rem 0.875rem; }
  .card     { padding: 1rem; }
  .kpi-value { font-size: 1.625rem; }
}

/* ============================================================
   17. PRINT STYLES
   ============================================================ */
@media print {
  .sidebar,
  .topbar,
  .toast-container,
  .btn,
  .alert-close,
  .nav-footer,
  .stop-work-banner,
  .sidebar-overlay { display: none !important; }

  .main-content { width: 100% !important; overflow: visible !important; }
  .app-shell    { display: block; }
  .page-content { padding: 0; }

  .card { box-shadow: none; border: 1px solid var(--gray-200); break-inside: avoid; }

  body { background: #ffffff; }
  a    { text-decoration: underline; }
}

/* ============================================================
   18. ANIMATIONS
   ============================================================ */
@keyframes fadeIn      { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp     { from { opacity: 0; transform: translateY(8px);  } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown   { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight{ from { opacity: 0; transform: translateX(24px);  } to { opacity: 1; transform: translateX(0); } }

@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bounceIn {
  0%   { transform: scale(0.9);  opacity: 0; }
  60%  { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

.animate-fade-in        { animation: fadeIn 0.2s ease-out; }
.animate-slide-up       { animation: slideUp 0.3s ease-out; }
.animate-slide-down     { animation: slideDown 0.25s ease-out; }
.animate-slide-in-left  { animation: slideInLeft 0.25s ease-out; }
.animate-slide-in-right { animation: slideInRight 0.25s ease-out; }
.animate-count-up       { animation: countUp 0.5s cubic-bezier(0.34,1.56,0.64,1); }
.animate-bounce-in      { animation: bounceIn 0.5s ease-out; }
.animate-pulse-slow     { animation: pulseBanner 3s cubic-bezier(0.4,0,0.6,1) infinite; }

/* ============================================================
   19. PUBLIC SITE SPECIFIC
   ============================================================ */
.gov-bar {
  background: linear-gradient(90deg, var(--primary-900) 0%, var(--primary-800) 100%);
  padding: 0.375rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.80);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--gold-500);
}

.gov-bar-logo { display: flex; align-items: center; gap: 0.5rem; color: #ffffff; }

.public-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 1.5rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-nav);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.public-hero {
  width: 100%;
  min-height: 520px;
  background: linear-gradient(135deg, var(--primary-950) 0%, var(--primary-800) 60%, var(--primary-700) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.public-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(184,134,11,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(46,139,111,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.public-hero-content   { position: relative; z-index: 1; max-width: 800px; }
.public-hero-title     { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; color: #ffffff; line-height: 1.1; margin-bottom: 1.25rem; }
.public-hero-subtitle  { font-size: 1.125rem; color: rgba(255,255,255,0.75); margin-bottom: 2rem; line-height: 1.6; }
.hero-gold-accent      { color: var(--gold-300); }

.project-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-100);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.project-card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--primary-800), var(--primary-600));
  overflow: hidden;
  position: relative;
}

.project-card-body  { padding: 1.25rem; }
.project-card-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.5rem; }
.project-card-meta  { font-size: 0.8125rem; color: var(--gray-500); display: flex; align-items: center; gap: 0.5rem; }

.stat-counter       { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 700; color: var(--primary-900); line-height: 1; letter-spacing: -0.03em; }
.stat-counter-gold  { color: var(--gold-600); }
.stat-counter-white { color: #ffffff; }

/* ============================================================
   20. UTILITY / HELPERS
   ============================================================ */
.text-truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider          { border: none; border-top: 1px solid var(--gray-200); margin: 1.25rem 0; }
.divider-vertical { width: 1px; background: var(--gray-200); align-self: stretch; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 0.6875rem; }
.avatar-md { width: 36px; height: 36px; font-size: 0.8125rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.25rem; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1.5rem; text-align: center; }

.empty-state-icon {
  width: 64px;
  height: 64px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--gray-400);
  font-size: 1.5rem;
}

.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.5rem; }
.empty-state-text  { font-size: 0.875rem; color: var(--gray-500); max-width: 320px; margin-bottom: 1.5rem; }

.dropdown-menu {
  position: absolute;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-lg);
  border: 1px solid var(--gray-100);
  padding: 0.375rem;
  min-width: 180px;
  z-index: var(--z-dropdown);
  animation: slideDown 0.15s ease-out;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  text-decoration: none;
}

.dropdown-item:hover          { background: var(--gray-50); color: var(--gray-900); }
.dropdown-item-danger         { color: var(--danger-600); }
.dropdown-item-danger:hover   { background: var(--danger-50); color: var(--danger-700); }
.dropdown-separator           { height: 1px; background: var(--gray-100); margin: 0.25rem 0.375rem; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.50);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease-out;
}

.modal {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.modal-title  { font-size: 1.125rem; font-weight: 700; color: var(--gray-900); }
.modal-body   { flex: 1; padding: 1.5rem; overflow-y: auto; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 1.5rem; }

.tab-item {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition-base), border-color var(--transition-base);
  white-space: nowrap;
}

.tab-item:hover { color: var(--gray-700); }
.tab-item.active { color: var(--primary-700); border-bottom-color: var(--primary-600); }

/* Tooltip */
.tooltip         { position: relative; display: inline-flex; }
.tooltip-content {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.3125rem 0.625rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: var(--z-tooltip);
}

.tooltip:hover .tooltip-content { opacity: 1; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 0.25rem; }

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-all);
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
  background: #ffffff;
  text-decoration: none;
}

.page-btn:hover  { background: var(--primary-50); border-color: var(--primary-300); color: var(--primary-700); }
.page-btn.active { background: var(--primary-700); border-color: var(--primary-700); color: #ffffff; }

/* Grid helpers */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.grid-2   { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   21. MOBILE HEADER — comprehensive fixes
   ============================================================ */

/* Prevent any header element from causing horizontal scroll */
header, .topbar, .gov-bar, .sidebar, nav {
  box-sizing: border-box;
}

/* Topbar: reduce height slightly on very small screens */
@media (max-width: 480px) {
  .topbar {
    height: 56px;
    min-height: 56px;
    padding: 0 0.75rem;
    gap: 0.5rem;
  }
}

/* Dropdown panels: never overflow viewport width */
@media (max-width: 640px) {
  /* Notification and user dropdowns */
  [x-show][class*="absolute"][class*="right-0"],
  .dropdown-panel {
    right: -0.5rem !important;
    max-width: calc(100vw - 1rem) !important;
    left: auto !important;
  }

  /* Stop-work banner — tighter padding on mobile */
  .stop-work-banner {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    margin: 0.5rem 0.75rem;
  }

  /* Page content — reduce padding on mobile */
  .page-content {
    padding: 0.875rem 0.75rem;
  }

  /* Topbar: hide breadcrumbs to save space on tiny screens */
  .topbar nav[aria-label="Breadcrumb"] {
    display: none;
  }
}

/* ============================================================
   22. COMPLIANCE — KANBAN BOARD & SEVERITY BADGES
   ============================================================ */

/* Kanban board: horizontally scrolling flex row of columns */
.kanban-board {
  display: flex;
  gap: 0.875rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
}

.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }

/* Each Kanban column */
.kanban-column {
  flex: 0 0 264px;
  min-width: 264px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  scroll-snap-align: start;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}

.kanban-column::-webkit-scrollbar { width: 4px; }
.kanban-column::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }

/* Each card within a column */
.kanban-card {
  display: block;
  background: #ffffff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-decoration: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
  color: inherit;
}

.kanban-card:hover {
  border-color: var(--primary-300);
  box-shadow: 0 2px 8px rgba(10, 61, 46, 0.10);
  transform: translateY(-1px);
}

/* Severity badges */
.severity-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1;
}

.severity-critical {
  background: var(--danger-100);
  color: var(--danger-700);
  border: 1px solid var(--danger-200);
}

.severity-high {
  background: #FFF0E6;
  color: #C2410C;
  border: 1px solid #FDBA74;
}

.severity-medium {
  background: var(--warning-100);
  color: var(--warning-600);
  border: 1px solid var(--warning-200);
}

.severity-low {
  background: var(--success-100);
  color: var(--success-700);
  border: 1px solid var(--success-200);
}

/* Border-left colour utilities used in compliance show */
.border-l-4         { border-left-width: 4px !important; }
.border-l-info-400    { border-left-color: var(--info-500) !important; }
.border-l-success-400 { border-left-color: var(--success-500) !important; }

@media (max-width: 640px) {
  .kanban-board    { gap: 0.625rem; padding-bottom: 0.75rem; }
  .kanban-column   { flex: 0 0 240px; min-width: 240px; }
}

/* Public nav header: ensure no overflow at any breakpoint */
@media (max-width: 767px) {
  /* Gov bar: ensure text truncation */
  .gov-bar-text-full {
    display: none;
  }
  .gov-bar-text-short {
    display: inline;
  }

  /* Public nav: full-width mobile panel */
  #mobile-nav nav {
    padding-bottom: 0;
  }

  /* Public nav CTA button — full width */
  #mobile-nav a[href="/login"] {
    display: flex;
  }
}

/* Fix the public mobile nav height on very small screens */
@media (max-width: 360px) {
  /* Public header — compact mode */
  header .flex.items-center.justify-between {
    gap: 0.5rem;
  }

  /* Topbar avatar — smaller */
  .topbar .w-7 {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.625rem;
  }
}

/* Ensure sticky headers don't have sub-pixel rendering issues on iOS */
.sticky, header.sticky {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

/* Prevent pull-to-refresh interfering with sticky headers on iOS Safari */
html {
  overscroll-behavior: none;
}
body {
  overscroll-behavior-y: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM COMPONENT LAYER — BMEIS enterprise UI (2026-07)
   Extends the existing green/gold system. Light-theme only by design.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --eb-surface:      #ffffff;
  --eb-surface-2:    #f6f9f7;
  --eb-surface-3:    #eef4f0;
  --eb-border:       #e2ebe6;
  --eb-border-2:     #d3e0d8;
  --eb-ink:          #14231c;
  --eb-ink-2:        #46564e;
  --eb-ink-faint:    #7d8b84;
  --eb-ring:         rgba(46,139,111,0.35);
  --eb-shadow-sm:    0 1px 2px rgba(10,61,46,0.05), 0 1px 3px rgba(10,61,46,0.04);
  --eb-shadow:       0 2px 6px rgba(10,61,46,0.06), 0 8px 24px rgba(10,61,46,0.06);
  --eb-shadow-lg:    0 8px 20px rgba(10,61,46,0.10), 0 24px 48px rgba(10,61,46,0.08);
}

/* ── Elevated stat tile (KPI) ────────────────────────────────────────────── */
.stat-tile {
  position: relative; overflow: hidden; min-width: 0;
  background: var(--eb-surface);
  border: 1px solid var(--eb-border);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--eb-shadow-sm);
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s ease, border-color .18s ease;
}
.stat-tile__label, .stat-tile__value, .stat-tile__meta { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--eb-shadow); border-color: var(--eb-border-2); }
.stat-tile::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:4px;
  background: linear-gradient(180deg, var(--primary-400), var(--primary-700));
}
.stat-tile.is-gold::before   { background: linear-gradient(180deg, var(--gold-400), var(--gold-600)); }
.stat-tile.is-danger::before { background: linear-gradient(180deg, #F87171, #DC2626); }
.stat-tile.is-warning::before{ background: linear-gradient(180deg, var(--warning-400), var(--warning-600)); }
.stat-tile.is-info::before   { background: linear-gradient(180deg, #60A5FA, #1D4ED8); }
.stat-tile__label { font-size: .7rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color: var(--eb-ink-faint); padding-right: 3.25rem; }
.stat-tile__value { font-size: 2rem; line-height:1.05; font-weight:800; color: var(--primary-900); margin-top:.35rem; font-variant-numeric: tabular-nums; letter-spacing:-.01em; }
.stat-tile__meta  { font-size:.8rem; color: var(--eb-ink-2); margin-top:.4rem; display:flex; align-items:center; gap:.35rem; }
.stat-tile__icon  { position:absolute; right:1rem; top:1rem; width:38px; height:38px; border-radius:11px; display:grid; place-items:center;
                    background: var(--primary-50); color: var(--primary-600); }
.stat-tile.is-gold .stat-tile__icon    { background: var(--gold-50); color: var(--gold-600); }
.stat-tile.is-danger .stat-tile__icon  { background: #FEF2F2; color: #DC2626; }
.stat-tile.is-warning .stat-tile__icon { background: var(--warning-50); color: var(--warning-600); }
.stat-tile.is-info .stat-tile__icon    { background: #EFF6FF; color: #1D4ED8; }
.stat-trend { font-size:.72rem; font-weight:700; padding:.1rem .4rem; border-radius:6px; }
.stat-trend.up   { color:#15803D; background:#DCFCE7; }
.stat-trend.down { color:#B91C1C; background:#FEE2E2; }
/* Phones: tighter stat tiles so 2-up grids never overflow a narrow viewport. */
@media (max-width: 640px) {
  .stat-tile { padding: .85rem .9rem; border-radius: 13px; }
  .stat-tile__value { font-size: 1.5rem; }
  .stat-tile__icon  { width: 30px; height: 30px; right: .65rem; top: .65rem; }
  .stat-tile__label { font-size: .62rem; letter-spacing: .05em; padding-right: 34px; }
  .stat-tile__meta  { font-size: .72rem; }
}

/* ── Elevated / premium card ─────────────────────────────────────────────── */
.card-premium {
  background: var(--eb-surface); border:1px solid var(--eb-border); border-radius:16px;
  box-shadow: var(--eb-shadow-sm); overflow:hidden; transition: box-shadow .2s ease, transform .2s ease;
}
.card-premium:hover { box-shadow: var(--eb-shadow); }
.card-premium__head { padding:1rem 1.25rem; border-bottom:1px solid var(--eb-border); display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
.card-premium__title { font-weight:700; color: var(--primary-900); font-size:.98rem; }
.card-premium__body { padding:1.25rem; }
.section-eyebrow { font-size:.68rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color: var(--gold-600); }

/* ── Status pill with severity dot ───────────────────────────────────────── */
.pill { display:inline-flex; align-items:center; gap:.4rem; padding:.22rem .6rem; border-radius:999px; font-size:.72rem; font-weight:700; letter-spacing:.01em; line-height:1; white-space:nowrap; }
.pill::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; opacity:.9; }
.pill--green  { color:#166534; background:#DCFCE7; }
.pill--red    { color:#B91C1C; background:#FEE2E2; }
.pill--amber  { color:#92400E; background:#FEF3C7; }
.pill--blue   { color:#1D4ED8; background:#DBEAFE; }
.pill--gray   { color:#475467; background:#EEF2F1; }
.pill--gold   { color:#7D5807; background:#F5E6C0; }
.pill--purple { color:#6D28D9; background:#EDE9FE; }
.pill.is-solid.pill--red { color:#fff; background:#DC2626; }

/* severity stripe on a row/card left edge */
.sev-stripe { position:relative; padding-left:.9rem; }
.sev-stripe::before { content:''; position:absolute; left:0; top:.3rem; bottom:.3rem; width:3px; border-radius:3px; background: var(--eb-border-2); }
.sev-stripe.critical::before { background:#DC2626; }
.sev-stripe.major::before, .sev-stripe.high::before { background:#F59E0B; }
.sev-stripe.minor::before, .sev-stripe.low::before  { background:#3B82F6; }

/* ── Data table polish ───────────────────────────────────────────────────── */
.table-premium { width:100%; border-collapse:separate; border-spacing:0; font-size:.875rem; }
.table-premium thead th {
  text-align:left; font-size:.68rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color: var(--eb-ink-faint); padding:.7rem 1rem; background: var(--eb-surface-2);
  border-bottom:1px solid var(--eb-border); position:sticky; top:0; z-index:1;
}
.table-premium tbody td { padding:.8rem 1rem; border-bottom:1px solid var(--eb-border); color: var(--eb-ink); vertical-align:middle; }
.table-premium tbody tr { transition: background .12s ease; }
.table-premium tbody tr:hover { background: var(--eb-surface-2); }
.table-premium tbody tr:last-child td { border-bottom:none; }
.table-wrap { border:1px solid var(--eb-border); border-radius:14px; overflow:auto; box-shadow: var(--eb-shadow-sm); background: var(--eb-surface); }

/* ── Skeleton loaders ────────────────────────────────────────────────────── */
.skeleton { position:relative; overflow:hidden; background: var(--eb-surface-3); border-radius:8px; }
.skeleton::after { content:''; position:absolute; inset:0; transform:translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: eb-shimmer 1.3s infinite; }
.skeleton-line { height:.85rem; border-radius:6px; }
.skeleton-tile { height:96px; border-radius:16px; }
@keyframes eb-shimmer { 100% { transform: translateX(100%); } }

/* ── Premium empty state ─────────────────────────────────────────────────── */
.empty-premium { text-align:center; padding:3rem 1.5rem; }
.empty-premium__icon { width:64px; height:64px; margin:0 auto 1rem; border-radius:18px; display:grid; place-items:center;
  background: var(--eb-surface-2); color: var(--primary-300); }
.empty-premium__title { font-weight:700; color: var(--primary-900); font-size:1.05rem; }
.empty-premium__text { color: var(--eb-ink-2); font-size:.9rem; margin-top:.35rem; max-width:26rem; margin-left:auto; margin-right:auto; }

/* ── Micro-interactions ──────────────────────────────────────────────────── */
.hover-lift { transition: transform .16s cubic-bezier(.22,1,.36,1), box-shadow .16s ease; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--eb-shadow); }
.tap-scale:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  .stat-tile, .hover-lift, .tap-scale, .skeleton::after, .card-premium { transition:none !important; animation:none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PWA — install banner, update toast, standalone polish
   ═══════════════════════════════════════════════════════════════════════════ */
.pwa-install-banner {
  position: fixed; left:12px; right:12px; bottom: calc(12px + env(safe-area-inset-bottom,0px)); z-index: 1000;
  display:flex; align-items:center; gap:.75rem; padding:.8rem .9rem;
  background: var(--eb-surface); border:1px solid var(--eb-border-2); border-radius:16px;
  box-shadow: var(--eb-shadow-lg); transform: translateY(140%); opacity:0; transition: transform .32s cubic-bezier(.22,1,.36,1), opacity .32s ease;
  max-width: 460px; margin:0 auto;
}
.pwa-install-banner.show { transform: translateY(0); opacity:1; }
.pwa-install-ic { flex:0 0 auto; width:40px; height:40px; border-radius:11px; display:grid; place-items:center; background: var(--primary-50); }
.pwa-install-txt { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; line-height:1.25; }
.pwa-install-txt strong { font-size:.9rem; color: var(--primary-900); }
.pwa-install-txt span { font-size:.75rem; color: var(--eb-ink-2); }
.pwa-install-go { flex:0 0 auto; border:none; cursor:pointer; font:inherit; font-weight:700; font-size:.82rem;
  background: var(--gold-500); color:#3F2D03; padding:.55rem .95rem; border-radius:10px; box-shadow: var(--eb-shadow-sm); }
.pwa-install-go:active { transform: scale(.96); }
.pwa-install-x { flex:0 0 auto; border:none; background:transparent; color: var(--eb-ink-faint); font-size:1.4rem; line-height:1; cursor:pointer; padding:0 .25rem; }

.pwa-update-toast {
  position: fixed; left:50%; bottom: calc(16px + env(safe-area-inset-bottom,0px)); transform: translate(-50%, 140%); z-index:1000;
  display:flex; align-items:center; gap:.85rem; background: var(--primary-900); color:#EAF3EE;
  padding:.7rem .8rem .7rem 1.1rem; border-radius:12px; box-shadow: var(--eb-shadow-lg); font-size:.85rem; opacity:0; transition: transform .3s ease, opacity .3s ease;
}
.pwa-update-toast.show { transform: translate(-50%, 0); opacity:1; }
.pwa-update-btn { border:none; cursor:pointer; font:inherit; font-weight:700; background: var(--gold-500); color:#3F2D03; padding:.4rem .8rem; border-radius:8px; }

@media (display-mode: standalone) {
  .topbar, .page-topbar { padding-top: env(safe-area-inset-top, 0px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION (.abn) — phones only (≤640px)
   ═══════════════════════════════════════════════════════════════════════════ */
.abn { display:none; }
.abn-sheet { display:none; }
.abn-sheet[hidden] { display:none; }
body.abn-sheet-open { position:fixed; left:0; right:0; width:100%; overflow:hidden; }

@media (max-width: 640px) {
  .abn {
    position: fixed; left:0; right:0; bottom:0; z-index:200;
    display:flex; align-items:stretch;
    background: rgba(255,255,255,0.94); border-top:1px solid var(--eb-border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    -webkit-backdrop-filter: saturate(1.6) blur(10px); backdrop-filter: saturate(1.6) blur(10px);
    box-shadow: 0 -2px 16px rgba(10,61,46,0.08);
  }
  .abn__tab {
    flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:3px; padding:8px 2px 6px; color: var(--eb-ink-faint); text-decoration:none;
    background:transparent; border:none; font:inherit; cursor:pointer; position:relative;
  }
  .abn__ic { display:grid; place-items:center; height:24px; position:relative; }
  .abn__ic svg { width:23px; height:23px; }
  .abn__lbl { font-size:10.5px; font-weight:600; letter-spacing:.01em; line-height:1; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .abn__tab.is-active { color: var(--primary-600); }
  .abn__tab.is-active .abn__ic::after {
    content:''; position:absolute; top:-8px; left:50%; transform:translateX(-50%);
    width:24px; height:3px; border-radius:0 0 3px 3px; background: var(--gold-500);
  }
  .abn__tab:active { background: var(--eb-surface-2); }

  .app-shell .page-content, .page-content { padding-bottom: calc(70px + env(safe-area-inset-bottom,0px)) !important; }

  .abn-sheet { display:block; position:fixed; inset:0; z-index:1100; }
  .abn-sheet[hidden] { display:none; }
  .abn-sheet__scrim { position:absolute; inset:0; background: rgba(5,28,20,.5); animation: abn-fade .2s ease; }
  .abn-sheet__panel {
    position:absolute; left:0; right:0; bottom:0;
    display:flex; flex-direction:column;
    max-height:86vh; max-height:86svh;
    background: var(--eb-surface); border-radius:20px 20px 0 0;
    padding:8px 16px calc(14px + env(safe-area-inset-bottom,0px));
    animation: abn-up .26s cubic-bezier(.22,1,.36,1); overscroll-behavior:contain;
    box-shadow: 0 -8px 40px rgba(5,28,20,.28);
  }
  @supports (max-height:100dvh) { .abn-sheet__panel { max-height:86dvh; } }
  .abn-sheet__grip { flex:0 0 auto; width:40px; height:4px; border-radius:3px; background: var(--eb-border-2); margin:4px auto 10px; }
  .abn-sheet__head { flex:0 0 auto; background: var(--eb-surface); display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 2px 12px; border-bottom:1px solid var(--eb-border); margin-bottom:4px; }
  .abn-sheet__who { display:flex; align-items:center; gap:11px; min-width:0; }
  .abn-sheet__avatar { flex:0 0 auto; width:40px; height:40px; border-radius:50%; display:grid; place-items:center; background: var(--primary-800); color:#fff; font-weight:800; font-size:15px; text-transform:uppercase; }
  .abn-sheet__idn { display:flex; flex-direction:column; min-width:0; }
  .abn-sheet__name { font-weight:700; font-size:15px; color: var(--eb-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .abn-sheet__role { font-size:12px; color: var(--eb-ink-faint); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .abn-sheet__x { flex:0 0 auto; width:34px; height:34px; border:none; background: var(--eb-surface-2); border-radius:50%; display:grid; place-items:center; color: var(--eb-ink-2); cursor:pointer; }
  .abn-sheet__body {
    flex:1 1 auto; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
    display:flex; flex-direction:column; gap:6px; padding-bottom:4px;
    -webkit-mask-image: linear-gradient(180deg, #000 88%, transparent 100%); mask-image: linear-gradient(180deg, #000 88%, transparent 100%);
  }
  .abn-sheet__body.is-scrollend { -webkit-mask-image:none; mask-image:none; }
  .abn-sheet__group-label { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color: var(--eb-ink-faint); padding:12px 6px 4px; }
  .abn-sheet__links { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
  .abn-sheet__link { display:flex; align-items:center; gap:8px; padding:11px 12px; border-radius:11px; background: var(--eb-surface-2); color: var(--eb-ink); text-decoration:none; font-size:13.5px; font-weight:600; }
  .abn-sheet__link:active { background: var(--eb-surface-3); }
  .abn-sheet__link.is-active { background: var(--primary-50); color: var(--primary-700); box-shadow: inset 0 0 0 1px var(--primary-200); }
  .abn-sheet__signout { flex:0 0 auto; border-top:1px solid var(--eb-border); margin-top:6px; padding-top:10px; }
  .abn-sheet__out { width:100%; display:flex; align-items:center; justify-content:center; gap:8px; padding:12px; border:none; border-radius:12px; background:#FEF2F2; color:#B91C1C; font:inherit; font-weight:700; font-size:14px; cursor:pointer; }

  .page-content > footer { display:none !important; }
}
@keyframes abn-fade { from { opacity:0; } to { opacity:1; } }
@keyframes abn-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .abn-sheet__scrim, .abn-sheet__panel, .pwa-install-banner, .pwa-update-toast { animation:none !important; transition:none !important; }
}

/* ============================================================
   WCAG 2.2 AA ACCESSIBILITY LAYER  (2026-07 — appended override layer)
   Centralises conformance fixes so they are auditable in one place.
   Each rule cites the Success Criterion it satisfies.
   ============================================================ */

/* Added token: an accessible dark warning for TEXT (warning-600 #D97706 = 3.07:1 fails 4.5:1). */
:root {
  --warning-700: #B45309;            /* on warning-50 ≈ 4.7:1  — 1.4.3 */
  --form-border:  #6B7280;           /* input/interactive boundary ≥ 3:1 — 1.4.11 */
  --ui-border:    #6B7280;           /* interactive component hairlines — gray-500, 4.83:1 ≥ 3:1 — 1.4.11 */
  --a11y-focus:   #0E3E24;           /* primary-800, high-contrast focus ring on light — 2.4.7 */
  --a11y-focus-dark: #E4BB5E;        /* gold-300, focus ring on the dark sidebar — 2.4.7 */
}

/* ---- 1.4.3 Contrast (Minimum): darken informational muted text to ≥ 4.5:1 ---- */
.form-input::placeholder,
.form-textarea::placeholder { color: var(--gray-500); }          /* was gray-400 2.54:1 */
.timeline-date { color: var(--gray-500) !important; }
.badge-amber, .badge-warning { color: var(--warning-700); }      /* 3.07:1 → 4.7:1 */
.alert-warning { color: var(--warning-700); }
.severity-medium { color: var(--warning-700); }
/* eb-ink-faint (#7d8b84 3.56:1) is used for real labels — darken globally. */
:root { --eb-ink-faint: #5C6B64; }                               /* ≈ 4.7:1 on white */
.stat-tile__label, .table-premium thead th { color: #46564E; }   /* eb-ink-2, 7.8:1 */
/* gold text (icons ok at 4.24:1, but text must be gold-700). */
.kpi-gold ~ * .kpi-value, .text-gold-strong { color: var(--gold-700); }

/* ---- 1.4.11 Non-text Contrast: raise interactive component boundaries to ≥ 3:1 ---- */
.form-input, .form-select, .form-textarea,
.form-addon-prefix, .form-addon-suffix { border-color: var(--form-border); }
.page-btn, .tabs, .kanban-card { border-color: var(--ui-border); }

/* ---- 2.4.7 Focus Visible + 2.4.13 Focus Appearance: a visible ring on EVERY interactive element ---- */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
.nav-item:focus-visible,
.tab-item:focus-visible,
.page-btn:focus-visible,
.dropdown-item:focus-visible,
.card:focus-visible,
.kpi-card:focus-visible,
.stat-tile:focus-visible {
  outline: 2px solid var(--a11y-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Inputs keep their soft ring AND gain a solid outline. */
.form-input:focus-visible, .form-select:focus-visible, .form-textarea:focus-visible {
  outline: 2px solid var(--a11y-focus);
  outline-offset: 1px;
}
/* On the dark green sidebar, use the gold ring so it is visible against #0A3D2E. */
.sidebar a:focus-visible,
.sidebar button:focus-visible,
.sidebar .nav-item:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--a11y-focus-dark);
  outline-offset: -2px;
}
/* Buttons: outline that contrasts with BOTH the (dark) button fill and the page. */
.btn:focus-visible {
  outline: 2px solid var(--a11y-focus-dark);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(10,61,46,.25);
}

/* ---- 2.5.8 Target Size (Minimum): interactive controls ≥ 24×24 CSS px ---- */
.alert-close, .toast-close { width: 24px; height: 24px; }
.btn-sm { min-height: 32px; }
.btn-icon-sm { width: 28px; height: 28px; }       /* already ≥24, made explicit */
.td-actions > a, .td-actions > button { min-width: 24px; min-height: 24px;
  display: inline-flex; align-items: center; justify-content: center; }

/* ---- 2.4.11 Focus Not Obscured: keep focused rows clear of sticky headers ---- */
.data-table tbody tr, .table-premium tbody tr,
:target { scroll-margin-top: calc(var(--topbar-height) + 12px); }

/* ---- Utilities: screen-reader-only text + skip link (2.4.1 Bypass Blocks, 1.3.1) ---- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: var(--z-toast, 600);
  background: var(--primary-900); color: #fff; padding: .625rem 1rem;
  border-radius: var(--radius-md); font-weight: 600; font-size: .875rem;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; outline: 2px solid var(--a11y-focus-dark); outline-offset: 2px; }

/* ---- 2.3.3 / 2.2 respect reduced motion globally (belt-and-braces) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   21. PUBLIC PORTAL — LAYOUT + DARK-SECTION HEADINGS
   Scoped to `.public-shell` (the wrapper on layouts/public.twig) so the
   authenticated dashboard is never affected.
   ============================================================ */

/* ---- (a) Structured page gutter --------------------------------------------
   `.max-w-content` is 1400px. With only `px-4` (16px) the content hugs the
   viewport edge on 1366–1440px laptops (≈7px each side) — it reads as "outside
   the page margin". Give every public content rail a comfortable, responsive
   gutter that grows with the viewport, and cap the readable width a touch below
   the hard 1400px so there is always breathing room at the sides. */
.public-shell .max-w-content {
  padding-left:  clamp(1rem, 4vw, 3rem);
  padding-right: clamp(1rem, 4vw, 3rem);
}
/* The Tailwind `px-4` utility on those same rails would otherwise override the
   above (equal specificity, later in cascade). Neutralise it inside the shell. */
.public-shell .max-w-content.px-4 { padding-left: clamp(1rem, 4vw, 3rem); padding-right: clamp(1rem, 4vw, 3rem); }

/* `.container-xl` is used by 5 public pages (report, verify, transparency, …) but
   was never defined anywhere — those rails had NO max-width and NO padding, so
   content ran fully edge-to-edge. Define it to match the content rail. */
.public-shell .container-xl,
.container-xl {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left:  clamp(1rem, 4vw, 3rem);
  padding-right: clamp(1rem, 4vw, 3rem);
}

/* Belt-and-braces: never let a public section scroll the page horizontally. */
.public-shell { overflow-x: hidden; }

/* ---- (b) Dark-section headings render light --------------------------------
   Global `h1..h4 { color: var(--gray-900|800) }` (element selector) beats bare
   utility classes AND inherited color, so headings placed on the dark hero/CTA
   bands come out dark-on-dark. Restore light text for any heading inside a
   section that opts in via `.eb-on-dark`, and — as a safety net — inside the
   dark-gradient hero/CTA bands the public pages already use. */
.public-shell .eb-on-dark h1,
.public-shell .eb-on-dark h2,
.public-shell .eb-on-dark h3,
.public-shell .eb-on-dark h4,
.public-shell .eb-on-dark p:not([style*="color"]),
.public-shell .eb-on-dark {
  color: #ffffff;
}
/* Utility escape hatches still win where a template sets them explicitly. */
.public-shell .text-white   { color: #ffffff !important; }
.public-shell .text-gray-900 { color: var(--gray-900) !important; }
.public-shell .text-primary-900 { color: var(--primary-900) !important; }
