/* FAA DER Audit System — Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  /* FAA/Federal color palette — authoritative navy + amber */
  --color-bg: #f0f2f5;
  --color-surface: #ffffff;
  --color-surface-2: #f8f9fb;
  --color-border: #e2e5ea;
  --color-border-2: #d1d5db;

  /* Brand */
  --color-navy: #1a2744;
  --color-navy-mid: #243560;
  --color-navy-light: #2e4480;
  --color-accent: #1e6eb5;
  --color-accent-hover: #1557a0;

  /* Status colors */
  --color-positive: #c0392b;       /* Red — violations/positives */
  --color-positive-bg: #fef2f2;
  --color-positive-border: #fca5a5;
  --color-warning: #d97706;        /* Amber — pending/expiring */
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fcd34d;
  --color-negative: #16a34a;       /* Green — negative/clear */
  --color-negative-bg: #f0fdf4;
  --color-negative-border: #86efac;
  --color-info: #0284c7;
  --color-info-bg: #f0f9ff;

  /* Text */
  --color-text: #111827;
  --color-text-2: #374151;
  --color-text-3: #6b7280;
  --color-text-4: #9ca3af;

  /* Fonts */
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, sans-serif;

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-bg: var(--color-navy);
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-text-active: #ffffff;
  --sidebar-accent: #3b82f6;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo .logo-text {
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.sidebar-logo .logo-sub {
  color: rgba(255,255,255,0.45);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 10px 0;
  flex: 1;
}
.nav-section {
  padding: 16px 12px 4px;
}
.nav-section-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 0 6px;
  margin-bottom: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--sidebar-text);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 1px;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active {
  background: rgba(59,130,246,0.2);
  color: #fff;
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--sidebar-accent);
  border-radius: 0 2px 2px 0;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--color-positive);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.nav-badge.warn { background: var(--color-warning); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 12px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 10px; color: rgba(255,255,255,0.45);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.btn-logout {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4);
  padding: 4px; border-radius: 4px;
  transition: color 0.15s;
}
.btn-logout:hover { color: #fff; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 8px 28px;
  min-height: 56px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header h1 {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}
.page-header .header-meta {
  font-size: 12px;
  color: var(--color-text-3);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.role-badge.der { background: #dbeafe; color: #1d4ed8; }
.role-badge.inspector { background: #f0fdf4; color: #15803d; }

.page-body {
  padding: 24px 28px;
  flex: 1;
}

/* ===== CARDS ===== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}
.card-subtitle {
  font-size: 12px;
  color: var(--color-text-3);
  margin-left: auto;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ===== KPI STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}
.stat-card.alert-card {
  border-color: var(--color-positive-border);
  background: var(--color-positive-bg);
}
.stat-card.warn-card {
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}
.stat-card.ok-card {
  border-color: var(--color-negative-border);
  background: var(--color-negative-bg);
}
.stat-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.stat-icon.red { background: var(--color-positive-bg); color: var(--color-positive); }
.stat-icon.amber { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-icon.green { background: var(--color-negative-bg); color: var(--color-negative); }
.stat-icon.blue { background: #eff6ff; color: var(--color-accent); }
.stat-icon svg { width: 16px; height: 16px; }
.stat-value {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--color-text-3);
  font-weight: 500;
}
.stat-change {
  font-size: 11px;
  color: var(--color-text-4);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-2);
  border-color: var(--color-border-2);
}
.btn-secondary:hover { background: var(--color-surface-2); border-color: #b0b7c3; }
.btn-danger { background: var(--color-positive); color: #fff; border-color: var(--color-positive); }
.btn-danger:hover { background: #a93226; }
.btn-ghost { background: none; color: var(--color-text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--color-surface-2); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
label {
  display: block;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-2);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}
label .req { color: var(--color-positive); margin-left: 2px; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(30,110,181,0.12);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--color-text-3); margin-top: 4px; }

/* ===== TABLE ===== */
.table-container { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  padding: 10px 14px;
  background: var(--color-surface-2);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-3);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--color-border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--color-surface-2); }
tbody td { padding: 11px 14px; color: var(--color-text-2); vertical-align: middle; }

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-positive { background: #fee2e2; color: #dc2626; }
.badge-negative { background: #dcfce7; color: #16a34a; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-rtd { background: #dbeafe; color: #1d4ed8; }
.badge-refusal { background: #fce7f3; color: #db2777; }
.badge-pre-emp { background: #ede9fe; color: #7c3aed; }

/* ===== ALERT BANNERS ===== */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-danger { background: var(--color-positive-bg); border: 1px solid var(--color-positive-border); color: #991b1b; }
.alert-warning { background: var(--color-warning-bg); border: 1px solid var(--color-warning-border); color: #92400e; }
.alert-info { background: var(--color-info-bg); border: 1px solid #bae6fd; color: #0c4a6e; }
.alert-success { background: var(--color-negative-bg); border: 1px solid var(--color-negative-border); color: #14532d; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--color-border); margin-bottom: 20px; }
.tab {
  padding: 9px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  display: none;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; gap: 10px;
}
.modal-title {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--color-text-3);
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--color-text); }
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-ui);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
  max-width: 340px;
}
.toast.success { background: #15803d; }
.toast.error { background: #dc2626; }
.toast.warn { background: #d97706; }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.progress-fill.green { background: var(--color-negative); }
.progress-fill.amber { background: var(--color-warning); }
.progress-fill.red { background: var(--color-positive); }

/* ===== SEARCH & FILTER BAR ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 0 1 320px;
  min-width: 200px;
  max-width: 320px;
}
/* Filters size to their text instead of stretching across the page */
.toolbar select { width: auto; min-width: 140px; max-width: 240px; flex: 0 0 auto; }
.search-box svg {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--color-text-4);
  pointer-events: none;
}
.search-box input {
  padding-left: 32px;
  width: 100%;
}

/* ===== SECTION GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.gap-sm { gap: 10px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-3);
}
.empty-state svg {
  width: 40px; height: 40px;
  margin: 0 auto 12px;
  opacity: 0.4;
}
.empty-state p { font-size: 14px; margin: 0 0 16px; }

/* ===== FILE UPLOAD ===== */
.drop-zone {
  border: 2px dashed var(--color-border-2);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover { border-color: var(--color-accent); background: #f0f7ff; }
.drop-zone.drag-over { border-color: var(--color-accent); background: #e0f0ff; }
.drop-zone-icon { margin: 0 auto 10px; color: var(--color-text-4); }
.drop-zone p { font-size: 13px; color: var(--color-text-3); margin: 0 0 6px; }
.drop-zone small { font-size: 11px; color: var(--color-text-4); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--color-text-3);
  margin-bottom: 20px;
}
.breadcrumb span { color: var(--color-text-3); }
.breadcrumb a { color: var(--color-accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
/* ===== MOBILE HAMBURGER ===== */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--color-navy);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.mobile-topbar .mobile-logo-text {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.2s;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 299;
}
.sidebar-overlay.open { display: block; }

@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 300;
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.25s;
    visibility: hidden;
  }
  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }
  .main-content { margin-left: 0 !important; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 16px; }
  .app-layout { display: block !important; }
}

/* ===== INSPECTOR READONLY MODE ===== */
body.inspector-mode .readonly-hidden { display: none !important; }
body.inspector-mode input:not([readonly]),
body.inspector-mode select:not([disabled]),
body.inspector-mode textarea:not([readonly]) {
  pointer-events: none;
  opacity: 0.75;
}

/* ===== Product wordmark and VIP partner logo (sidebar + mobile) ===== */
.sidebar-logo .brand-logo {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
}
.brand-wordmark {
  display: block;
  color: #0f1f3d;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: center;
}
.mobile-topbar .mobile-logo .brand-wordmark { font-size: 14px; padding: 2px 0; }
.shell-partner-logo { height: 30px; width: auto; display: block; }
.logo-sub[hidden] { display: none !important; }
.sidebar-brand-img { display: block; width: 100%; height: auto; }
.sidebar-brand-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.nav-pin-btn {
  background: none; border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.6);
  width: 26px; height: 26px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, color .15s;
}
.nav-pin-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-pin-btn[aria-pressed="true"] { color: #fff; background: var(--sidebar-accent); border-color: var(--sidebar-accent); }
.mobile-topbar .mobile-logo {
  display: inline-flex; background: #fff; border-radius: 6px; padding: 4px 8px;
}
.mobile-topbar .mobile-logo img { height: 30px; width: auto; display: block; }

/* ===== DESKTOP AUTO-HIDE MENU =====
   Menu hides to give pages (e.g. MIS reports) the full width.
   It slides out when the mouse reaches the left edge, or stays open
   when pinned. */
.nav-edge { display: none; }
@media (min-width: 769px) {
  body.nav-autohide .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease, box-shadow .22s ease;
    z-index: 400;
  }
  body.nav-autohide.nav-peek .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 28px rgba(4, 22, 59, 0.28);
  }
  body.nav-autohide .main-content { margin-left: 0 !important; }
  body.nav-autohide .nav-edge {
    display: block; position: fixed; top: 0; left: 0; bottom: 0;
    width: 14px; z-index: 390;
  }
}
@media print { .nav-edge { display: none !important; } }
@media (max-width: 768px) { .nav-pin-btn { display: none; } }

/* ===== EMPLOYEE FILE REMINDERS ===== */
.file-gap-badge {
  display: inline-block; margin-top: 3px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa;
  padding: 1px 7px; border-radius: 10px; text-decoration: none;
}
.file-gap-badge:hover { background: #ffedd5; }
.page-stat-btn { font: inherit; text-align: left; cursor: pointer; }
.page-stat-btn:hover { border-color: var(--color-border-2); }
.file-gap-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff7ed; border: 1px solid #fed7aa; border-left: 4px solid #ea580c;
  border-radius: var(--radius-md, 8px); padding: 12px 16px; margin-bottom: 16px;
  color: #7c2d12; font-size: 13px;
}
.file-gap-banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: #ea580c; }
.file-gap-banner ul { margin: 4px 0 0; padding-left: 18px; }
.file-gap-banner li { margin: 1px 0; }

/* Provider footer (all pages) */
.app-footer {
  margin-top: auto;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-3, #64748b);
}
@media print { .app-footer { display: none; } }

.app-footer .legal-links { display: block; margin-top: 4px; }
.app-footer .legal-links a { color: inherit; text-decoration: underline; }

/* ── Phone layout fixes ───────────────────────────────────── */
.stats-grid.stats-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats-grid.stats-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .page-stats { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px !important; align-items: stretch !important; }
  .page-stats > * { min-width: 0; }
  img, video, canvas { max-width: 100%; height: auto; }
  html, body { overflow-x: clip; }
  .page-header { height: auto; min-height: 56px; flex-wrap: wrap; padding: 10px 16px; gap: 8px 12px; }
  .page-header h1 { font-size: 16px; line-height: 1.25; }
  .page-header .header-meta { flex-wrap: wrap; gap: 8px; }
  .page-header .btn { padding: 7px 12px; font-size: 13px; }
  .modal-overlay { padding: 12px; align-items: flex-start; }
  .modal { max-height: calc(100dvh - 24px); }
  input, select, textarea { max-width: 100%; }
}
