/* ============================================================
   Survey & Sampling PWA — Main CSS
   Aesthetic: Industrial Precision — dark base, teal accent,
   monospace data feel, sharp edges with selective rounding
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Brand */
  --accent:        #00c896;
  --accent-dim:    #00a87e;
  --accent-glow:   rgba(0,200,150,.15);
  --accent-2:      #ff6b35;
  --warning:       #f5a623;
  --danger:        #e8445a;
  --info:          #4a9eff;

  /* Backgrounds */
  --bg-base:       #0f1923;
  --bg-surface:    #162030;
  --bg-card:       #1c2a3a;
  --bg-hover:      #223040;
  --bg-input:      #111e2b;
  --bg-overlay:    rgba(10,16,24,.92);

  /* Text */
  --text-primary:  #e8edf2;
  --text-secondary:#8fa3b5;
  --text-muted:    #4d6478;
  --text-accent:   #00c896;

  /* Borders */
  --border:        rgba(255,255,255,.07);
  --border-active: rgba(0,200,150,.4);
  --border-focus:  #00c896;

  /* Fonts */
  --font-ui:       'Space Grotesk', sans-serif;
  --font-data:     'JetBrains Mono', monospace;

  /* Spacing */
  --sidebar-w:     240px;
  --topbar-h:      60px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;

  /* Shadows */
  --shadow-card:   0 4px 24px rgba(0,0,0,.4);
  --shadow-modal:  0 20px 60px rgba(0,0,0,.6);
  --shadow-btn:    0 2px 12px rgba(0,200,150,.3);

  /* Transitions */
  --transition:    .18s ease;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background:  var(--bg-base);
  color:       var(--text-primary);
  line-height: 1.6;
  min-height:  100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); }

img { max-width: 100%; display: block; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--bg-base); }
::-webkit-scrollbar-thumb  { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── App Shell Layout ──────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-logo .logo-text span {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  color: var(--text-muted);
  font-family: var(--font-data);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  padding: 12px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 400;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-left-color: var(--border-active);
}
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
.nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
}
.nav-item.active .nav-icon { opacity: 1; }

.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--font-data);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--bg-hover); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 2px solid var(--border-active);
  object-fit: cover;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .85rem; color: var(--accent);
}

.user-info { flex: 1; min-width: 0; }
.user-info .name {
  font-size: .825rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-info .role {
  font-size: .7rem;
  color: var(--text-muted);
  font-family: var(--font-data);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

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

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.topbar-btn .notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--bg-surface);
}

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.page-header p {
  font-size: .85rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Stat Cards (Dashboard) ────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.stat-card.orange::before { background: var(--accent-2); }
.stat-card.blue::before   { background: var(--info); }
.stat-card.warning::before{ background: var(--warning); }

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
  font-family: var(--font-data);
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  font-family: var(--font-data);
}
.stat-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.stat-icon {
  position: absolute;
  bottom: 14px; right: 16px;
  font-size: 2rem;
  opacity: .08;
}

/* ── Data Tables ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-data);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

.td-mono {
  font-family: var(--font-data);
  font-size: .8rem;
  color: var(--text-secondary);
}

/* ── Badges / Status ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 500;
  font-family: var(--font-data);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-success { background: rgba(0,200,150,.12); color: var(--accent); }
.badge-danger  { background: rgba(232,68,90,.12);  color: var(--danger); }
.badge-warning { background: rgba(245,166,35,.12); color: var(--warning); }
.badge-info    { background: rgba(74,158,255,.12); color: var(--info); }
.badge-muted   { background: var(--bg-hover);      color: var(--text-muted); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: var(--font-ui);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #0a1018;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { background: var(--accent-dim); color: #0a1018; }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-active); }

.btn-danger {
  background: rgba(232,68,90,.15);
  color: var(--danger);
  border: 1px solid rgba(232,68,90,.3);
}
.btn-danger:hover { background: rgba(232,68,90,.25); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 10px;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-family: var(--font-data);
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: .9rem;
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-select option { background: var(--bg-card); }

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 5px;
}
.form-error {
  font-size: .75rem;
  color: var(--danger);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-input.error { border-color: var(--danger); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Search & Filters ──────────────────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: .875rem;
  padding: 9px 14px 9px 36px;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--border-focus); }
.search-input::placeholder { color: var(--text-muted); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  flex-wrap: wrap;
  gap: 10px;
}
.pagination-info {
  font-size: .8rem;
  color: var(--text-muted);
  font-family: var(--font-data);
}
.pagination-btns {
  display: flex;
  gap: 4px;
}
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  font-family: var(--font-data);
}
.page-btn:hover { border-color: var(--border-active); color: var(--accent); }
.page-btn.active {
  background: var(--accent);
  color: #0a1018;
  border-color: var(--accent);
  font-weight: 600;
}
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  transform: translateY(12px);
  transition: transform var(--transition);
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  font-size: 1.1rem;
}
.modal-close:hover { color: var(--text-primary); background: var(--danger); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-card);
  animation: slideInToast .25s ease;
  font-size: .875rem;
}
.toast.success { border-left: 3px solid var(--accent); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.toast-msg   { color: var(--text-secondary); font-size: .82rem; }

@keyframes slideInToast {
  from { opacity:0; transform: translateX(20px); }
  to   { opacity:1; transform: translateX(0); }
}

/* ── Loading States ────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; opacity: .3; margin: 0 auto 16px; }
.empty-state h3  { color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p   { font-size: .875rem; }

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .4s ease;
}
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger  { background: var(--danger); }

/* ── GPS / Map Preview ─────────────────────────────────────── */
.gps-display {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-data);
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.gps-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  animation: none;
}
.gps-dot.active {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  animation: pulse 1.5s ease-in-out infinite;
}
.gps-dot.invalid { background: var(--danger); }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 4px var(--accent-glow); }
  50%      { box-shadow: 0 0 0 8px rgba(0,200,150,.05); }
}

/* ── Photo Upload / Camera ─────────────────────────────────── */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
}
.photo-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.photo-upload-area.has-photo { padding: 0; border-style: solid; overflow: hidden; }
.photo-upload-area img { width: 100%; max-height: 260px; object-fit: cover; }
.photo-upload-area .upload-icon { font-size: 2rem; margin-bottom: 8px; opacity: .4; }
.photo-upload-area p { font-size: .82rem; color: var(--text-muted); }

/* ── Rating Stars ──────────────────────────────────────────── */
.star-rating { display: flex; gap: 4px; }
.star-btn {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--border);
  background: none;
  border: none;
  transition: color .1s, transform .1s;
  line-height: 1;
  padding: 2px;
}
.star-btn.active,
.star-btn:hover { color: var(--warning); transform: scale(1.1); }

/* ── Offline Banner ────────────────────────────────────────── */
.offline-banner {
  background: var(--warning);
  color: #0a1018;
  font-size: .825rem;
  font-weight: 600;
  padding: 8px 16px;
  text-align: center;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.offline-banner.show { display: flex; }

/* ── Chart Container ───────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 220px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-modal);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
  }
  .sidebar-overlay.show { display: block; }

  .main-content { margin-left: 0; }
  .topbar-menu-btn { display: flex; }
  .page-content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { max-width: 100%; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .page-header { flex-direction: column; }
  .page-header .btn { align-self: flex-start; }
}
