/* =========================================================
   Hospital Waiting Time Tracker — Global Stylesheet
   ALERT Branding Applied
   ========================================================= */

/* ---------- 1. RESET & VARIABLES ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  /* ALERT Brand Colors */
  --primary:        #006633; /* ALERT Dark Green */
  --primary-dark:   #004d26; 
  --primary-light:  #e6f2eb; 
  
  --secondary:      #008B8B; /* ALERT Teal */
  --secondary-light:#e0f2f1;

  --success:        #198754;
  --success-light:  #d1e7dd;
  --warning:        #ffc107;
  --warning-light:  #fff3cd;
  --danger:         #dc3545;
  --danger-light:   #f8d7da;
  --info:           #0dcaf0;
  --info-light:     #cff4fc;

  --bg:             #f4f7f6; /* Slight greenish tint */
  --surface:        #ffffff;
  --surface-2:      #f8f9fa;
  --border:         #dee2e6;
  --border-dark:    #ced4da;

  --text:           #212529;
  --text-muted:     #6c757d;
  --text-light:     #adb5bd;

  --radius:         8px;
  --radius-sm:      4px;
  --radius-lg:      12px;

  --shadow-sm:      0 1px 2px rgba(0,0,0,.05);
  --shadow:         0 2px 8px rgba(0,0,0,.08);
  --shadow-lg:      0 8px 24px rgba(0,0,0,.12);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5 { margin: 0 0 var(--space-3); font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 var(--space-3); }

/* ---------- 2. LOGIN PAGE ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6) var(--space-5);
  text-align: center;
}

.login-box h1 {
  font-size: 1.6rem;
  margin-bottom: var(--space-2);
  color: var(--primary-dark);
}

.login-box form {
  text-align: left;
  margin-top: var(--space-5);
}

.login-box label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  margin-bottom: var(--space-1);
  margin-top: var(--space-3);
  color: var(--text);
}

.login-box input {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}

.login-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 51, .15);
}

.login-box .btn { margin-top: var(--space-5); }

/* ---------- 3. TOP BAR / NAVIGATION ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.brand:hover { text-decoration: none; color: var(--primary); }

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  flex: 1 1 auto;
  justify-content: center;
}

.topbar-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.topbar-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.topbar-nav a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.user-badge small { color: var(--text-light); }

/* ---------- 4. CONTAINER & LAYOUT ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}

.grid {
  display: grid;
  gap: var(--space-4);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; gap: var(--space-3); }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; gap: var(--space-2); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ---------- 5. CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.card-header h2,
.card-header h3 { margin: 0; }

.card-body { padding: 0; }

/* Stat cards (dashboard) */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.stat-card .label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  font-weight: 600;
}
.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.stat-card .hint {
  font-size: .8rem;
  color: var(--text-light);
}
.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.danger  { border-left: 4px solid var(--danger);  }

/* ---------- 6. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: .9rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled,
.btn.disabled { opacity: .5; cursor: not-allowed; }

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); color: #fff; }

.btn.success { background: var(--success); color: #fff; }
.btn.success:hover { background: #146c43; color: #fff; }

.btn.warning { background: var(--warning); color: #212529; }
.btn.warning:hover { background: #e0a800; color: #212529; }

.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #b02a37; color: #fff; }

.btn.outline {
  background: transparent;
  border-color: var(--border-dark);
  color: var(--text);
}
.btn.outline:hover { background: var(--surface-2); }

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
}
.btn.ghost:hover { background: var(--primary-light); }

.btn.small { padding: 4px 10px; font-size: .8rem; }
.btn.large { padding: 12px 22px; font-size: 1rem; }
.btn.block { width: 100%; }

.btn-group { display: inline-flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------- 7. TABLES ---------- */
.table-wrap { overflow-x: auto; }

table.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: .9rem;
}
table.table th,
table.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.table th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  white-space: nowrap;
}
table.table tbody tr:hover { background: var(--surface-2); }
table.table tbody tr:last-child td { border-bottom: none; }

table.table.compact th,
table.table.compact td { padding: 6px 10px; }

table.table.striped tbody tr:nth-child(even) { background: var(--surface-2); }

/* ---------- 8. FORMS ---------- */
.form-group {
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group .req { color: var(--danger); }

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 51, .15);
}
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
  background: var(--surface-2);
  cursor: not-allowed;
}
.form-group textarea { resize: vertical; min-height: 80px; }

.form-group .inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: var(--space-4);
  font-weight: 400;
  cursor: pointer;
}
.form-group .inline input { width: auto; }

.form-group small.muted,
.form-group .help {
  display: block;
  margin-top: 4px;
  font-size: .8rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
fieldset legend {
  padding: 0 var(--space-2);
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- 9. ALERTS ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin-bottom: var(--space-4);
  font-size: .9rem;
}
.alert.info    { background: var(--info-light);    border-color: #b6effb; color: #055160; }
.alert.success { background: var(--success-light); border-color: #badbcc; color: #0f5132; }
.alert.warning { background: var(--warning-light); border-color: #ffecb5; color: #664d03; }
.alert.error,
.alert.danger  { background: var(--danger-light);  border-color: #f5c2c7; color: #842029; }

/* ---------- 10. BADGES & STATUS ---------- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  line-height: 1.2;
}
.badge.primary { background: var(--primary-light); color: var(--primary-dark); }
.badge.success { background: var(--success-light); color: #0f5132; }
.badge.warning { background: var(--warning-light); color: #664d03; }
.badge.danger  { background: var(--danger-light);  color: #842029; }
.badge.info    { background: var(--info-light);    color: #055160; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.in_progress { background: var(--warning); }
.status-dot.completed   { background: var(--success); }
.status-dot.cancelled   { background: var(--danger); }

/* ---------- 11. COLLECTOR TRACKING SCREEN ---------- */
.tracking-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4);
  /* Updated to ALERT gradient */
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
}
.tracking-header h1 { color: #fff; margin-bottom: var(--space-1); }
.tracking-header .meta { font-size: .9rem; opacity: .9; }
.tracking-header .meta b { font-weight: 600; }

.timestamp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.timestamp-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-sm);
}
.timestamp-box .label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.timestamp-box .value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}
.timestamp-box .value.empty { color: var(--text-light); font-weight: 400; font-style: italic; }
.timestamp-box.recorded { border-left: 4px solid var(--success); }
.timestamp-box.pending  { border-left: 4px solid var(--text-light); }

.running-timer {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--warning);
  text-align: center;
  padding: var(--space-3);
  background: var(--warning-light);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
}
.running-timer small {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font);
  margin-top: 4px;
}

.collector-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.collector-actions .btn {
  padding: 16px;
  font-size: 1rem;
  font-weight: 600;
  flex-direction: column;
  gap: 4px;
}
.collector-actions .btn i { font-size: 1.4rem; }

/* Journey timeline */
.journey-timeline {
  position: relative;
  padding-left: var(--space-5);
  margin: var(--space-4) 0;
}
.journey-timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding: var(--space-2) 0 var(--space-3) var(--space-3);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-dark);
}
.timeline-item.completed::before { background: var(--success); border-color: var(--success); }
.timeline-item.active::before    { background: var(--warning); border-color: var(--warning); box-shadow: 0 0 0 4px var(--warning-light); }
.timeline-item .title { font-weight: 600; }
.timeline-item .time  { font-size: .85rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ---------- 12. WORKFLOW BUILDER ---------- */
.workflow-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.workflow-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  cursor: grab;
  transition: box-shadow .15s, transform .15s;
}
.workflow-step:hover { box-shadow: var(--shadow); }
.workflow-step.dragging { opacity: .4; }
.workflow-step .handle {
  color: var(--text-light);
  font-size: 1.2rem;
  cursor: grab;
}
.workflow-step .order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: .85rem;
}
.workflow-step .dept { flex: 1; font-weight: 500; }
.workflow-step .actions { display: flex; gap: 4px; }

/* ---------- 13. REPORTS ---------- */
.report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 80px;
  align-items: center;
  gap: var(--space-3);
  font-size: .875rem;
}
.bar-track {
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  height: 20px;
}
.bar-fill {
  height: 100%;
  /* Updated to ALERT gradient */
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
  transition: width .4s ease;
}
.bar-value { text-align: right; font-weight: 600; font-family: var(--font-mono); }

/* ---------- 14. PAGINATION ---------- */
.pagination {
  display: flex;
  gap: var(--space-1);
  justify-content: center;
  margin-top: var(--space-4);
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.pagination a:hover { background: var(--surface-2); text-decoration: none; }
.pagination .current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ---------- 15. MODAL ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 1000;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
}
.modal-header,
.modal-footer {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.modal-footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
.modal-body { padding: var(--space-4); }

/* ---------- 16. FOOTER ---------- */
.site-footer {
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-muted);
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ---------- 17. UTILITIES ---------- */
.muted { color: var(--text-muted); }
.small { font-size: .8rem; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger);  }
.text-primary { color: var(--primary); }
.bold { font-weight: 600; }
.uppercase { text-transform: uppercase; letter-spacing: .04em; }
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}
.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; opacity: .4; margin-bottom: var(--space-3); }

/* ---------- 18. PRINT STYLES ---------- */
@media print {
  .topbar,
  .site-footer,
  .btn,
  .collector-actions,
  .report-filters,
  .pagination { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .container { max-width: 100%; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  table.table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 19. RESPONSIVE ---------- */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .topbar {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }
  .topbar-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .topbar-nav a { font-size: .8rem; padding: 5px 8px; }
  .brand span { display: none; }
  .user-badge { font-size: .75rem; padding: 3px 8px; }

  .container { padding: var(--space-4) var(--space-3); }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .tracking-header { padding: var(--space-3); }
  .tracking-header h1 { font-size: 1.3rem; }

  .running-timer { font-size: 1.5rem; }

  .collector-actions { grid-template-columns: repeat(2, 1fr); }
  .collector-actions .btn { padding: 12px; font-size: .9rem; }

  .timestamp-grid { grid-template-columns: repeat(2, 1fr); }

  .bar-row { grid-template-columns: 100px 1fr 60px; font-size: .8rem; }

  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }

  .footer-content { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .collector-actions { grid-template-columns: 1fr; }
  .timestamp-grid { grid-template-columns: 1fr; }
  .login-box { padding: var(--space-4); }
  .stat-card .value { font-size: 1.5rem; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }
}

/* ---------- 20. ACCESSIBILITY ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  z-index: 9999;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }