/* ============================================================
   MMED SISO — Mobile-First Application CSS
   Mampong Municipal Education Directorate
   Designed for smartphones in the field.
   Full viewport. No empty space. No desktop leftovers.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #0f766e;
  --primary-dark: #134e4a;
  --primary-light: #ccfbf1;
  --primary-50: #f0fdfa;
  --primary-100: #99f6e4;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --bg: #f4f6f8;
  --border: #e8eaed;
  --border-light: #f1f3f5;

  --text: #1a1d21;
  --text-secondary: #5f6b7a;
  --text-muted: #98a2b3;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  --shadow-xl: 0 16px 40px rgba(0,0,0,0.12);

  --bottom-nav-h: 60px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }

/* ============================================================
   APP SHELL — Full viewport, single column flow
   On phones: 100% width, no max-width cap
   On desktop/tablet (>=768px): cap at 480px to simulate phone
   ============================================================ */
.app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   APP HEADER — Compact teal header with curved bottom
   Full viewport width on phone
   ============================================================ */
.app-header {
  position: relative;
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
  color: #fff;
  padding: 0;
  z-index: 50;
  flex-shrink: 0;
}
.app-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 20px;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  z-index: -1;
}
.app-header-content {
  position: relative;
  z-index: 1;
  padding: 10px 16px 24px;
  width: 100%;
}

/* Header top row: menu + brand + bell */
.app-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.app-menu-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
  flex-shrink: 0;
}
.app-menu-btn:active { background: rgba(255,255,255,0.25); }
.app-menu-btn svg { width: 20px; height: 20px; }

.app-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.app-bell-btn {
  position: relative;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
.app-bell-btn:active { background: rgba(255,255,255,0.25); }
.app-bell-btn svg { width: 18px; height: 18px; }
.app-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #0f766e;
}

/* Profile greeting row */
.app-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.app-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.app-avatar img { width: 100%; height: 100%; object-fit: cover; }
.app-greeting {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-greeting-hello {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
}
.app-greeting-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-greeting-role {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   APP BODY — Main scrollable content
   Full width on phone, no max-width cap
   ============================================================ */
.app-body {
  width: 100%;
  flex: 1;
  padding: 20px 16px 80px;
  position: relative;
  z-index: 1;
}
.app-body-wide { max-width: 100%; }

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 2px;
}
.section-link svg { width: 14px; height: 14px; }

/* ============================================================
   STATS GRID — 2-column cards
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-info { min-width: 0; flex: 1; }
.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* ============================================================
   VISIT CARDS — Full-width list cards
   ============================================================ */
.visit-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.visit-card:active { transform: scale(0.98); box-shadow: var(--shadow-xs); }
.visit-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.visit-card-icon svg { width: 20px; height: 20px; }
.visit-card-body { flex: 1; min-width: 0; }
.visit-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.visit-card-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.visit-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.visit-card-meta svg { width: 12px; height: 12px; }
.visit-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.visit-card-chevron svg { width: 18px; height: 18px; color: var(--text-muted); }

/* Status badges */
.status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.status-badge svg { width: 10px; height: 10px; }
.status-completed { background: var(--success-light); color: #065f46; }
.status-pending { background: var(--warning-light); color: #92400e; }
.status-draft { background: #f1f5f9; color: #475569; }

/* ============================================================
   BOTTOM NAVIGATION — Fixed, full viewport width
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  height: var(--bottom-nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  padding: 6px 0;
  min-height: 48px;
}
.nav-item svg { width: 22px; height: 22px; transition: all 0.2s; }
.nav-item.active { color: var(--primary); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}
.nav-item:active { background: var(--primary-50); }
.nav-label { font-size: 10px; }

/* ============================================================
   FLOATING ACTION BUTTON
   ============================================================ */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15,118,110,0.35);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.fab:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(15,118,110,0.4); }
.fab:active { transform: scale(0.94); }
.fab svg { width: 26px; height: 26px; }

/* ============================================================
   CARDS — Generic white card
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 12px;
}
.card-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
}
.card-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-header p { font-size: 12px; color: var(--text-muted); }
.card-body { padding: 16px; }
.card-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-icon-box svg { width: 18px; height: 18px; }

/* ============================================================
   BUTTONS — Large touch targets
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(15,118,110,0.25);
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--text-muted); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--primary);
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 12px; min-height: 36px; }
.btn-lg { padding: 14px 24px; font-size: 15px; min-height: 52px; }

/* ============================================================
   FORM CONTROLS — Mobile-friendly
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label .req { color: var(--danger); }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: all 0.2s;
  outline: none;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,0.08);
}
.form-input[readonly] { background: var(--surface-alt); color: var(--text-secondary); }
.form-textarea { min-height: 96px; resize: vertical; padding-top: 12px; }
.form-select {
  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='%2398a2b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-counter { font-size: 11px; color: var(--text-muted); text-align: right; margin-top: 2px; }

/* Info card (non-editable display) */
.info-card {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.info-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.info-card-icon svg { width: 16px; height: 16px; }
.info-card-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.info-card-value { font-size: 14px; font-weight: 600; color: var(--text); }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  position: relative;
  margin-bottom: 12px;
}
.search-bar svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  outline: none;
  min-height: 48px;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,0.08); }

/* ============================================================
   FILTER TABS / PILLS
   ============================================================ */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-pill {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.filter-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================================
   PROGRESS STEPS — 5-step wizard
   ============================================================ */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 16px 20px;
  background: var(--surface);
}
.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s;
}
.step-circle svg { width: 16px; height: 16px; }
.step-circle.pending {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 2px solid var(--border);
}
.step-circle.active {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(15,118,110,0.12);
}
.step-circle.done {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
}
.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  max-width: 32px;
}
.step-connector.done { background: var(--primary); }
.step-title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  padding: 0 20px 12px;
  background: var(--surface);
}

/* ============================================================
   ALERTS / NOTIFICATIONS
   ============================================================ */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: #065f46; }
.alert-error { background: var(--danger-light); color: #991b1b; }
.alert-info { background: var(--info-light); color: #1e40af; }
.alert-warning { background: var(--warning-light); color: #92400e; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.empty-state-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   LIST ITEMS
   ============================================================ */
.list-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-item-icon svg { width: 20px; height: 20px; }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: 14px; font-weight: 700; color: var(--text); }
.list-item-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.list-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   GALLERY GRID
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gallery-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gallery-item img { width: 100%; height: 120px; object-fit: cover; display: block; }
.gallery-item-info { padding: 10px 12px; }
.gallery-caption { font-size: 12px; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gallery-meta { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   EVIDENCE UPLOAD CARDS
   ============================================================ */
.evidence-card {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.evidence-card:active { border-color: var(--primary); background: var(--primary-50); }
.evidence-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.evidence-card-icon svg { width: 24px; height: 24px; }
.evidence-card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.evidence-card-sub { font-size: 12px; color: var(--text-muted); }

/* Attached file row */
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.file-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-row-icon svg { width: 18px; height: 18px; }
.file-row-info { flex: 1; min-width: 0; }
.file-row-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row-size { font-size: 11px; color: var(--text-muted); }
.file-row-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 6px;
  -webkit-tap-highlight-color: transparent;
}
.file-row-delete svg { width: 18px; height: 18px; }

/* Location section */
.location-box {
  background: var(--success-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.location-box-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.location-box-icon svg { width: 18px; height: 18px; }
.location-box-text { flex: 1; }
.location-box-title { font-size: 13px; font-weight: 700; color: #065f46; }
.location-box-coords { font-size: 11px; color: #047857; font-family: monospace; }

/* ============================================================
   MORE PAGE — Settings list
   ============================================================ */
.settings-list { margin-top: 8px; }
.settings-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.settings-item:active { transform: scale(0.98); }
.settings-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-item-icon svg { width: 20px; height: 20px; }
.settings-item-body { flex: 1; }
.settings-item-title { font-size: 14px; font-weight: 600; color: var(--text); }
.settings-item-sub { font-size: 12px; color: var(--text-muted); }
.settings-item-chevron svg { width: 18px; height: 18px; color: var(--text-muted); }

/* ============================================================
   SUMMARY CARD — Reports
   ============================================================ */
.summary-card {
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
  border-radius: var(--radius-xl);
  padding: 20px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(15,118,110,0.2);
}
.summary-card-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.summary-stat { }
.summary-stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.summary-stat-label { font-size: 11px; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.03em; }

/* ============================================================
   CONNECTION STATUS
   ============================================================ */
.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.conn-pill svg { width: 12px; height: 12px; }
.conn-online { background: rgba(16,185,129,0.15); color: #065f46; }
.conn-offline { background: rgba(239,68,68,0.15); color: #991b1b; }

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 72px);
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  opacity: 0;
  transition: all 0.3s;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; bottom: calc(var(--bottom-nav-h) + 80px); }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info { background: var(--info); color: #fff; }

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, #eef0f3 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card { height: 80px; margin-bottom: 8px; }

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }

/* ============================================================
   QUICK ACTIONS (kept for compatibility, not used on dashboard)
   ============================================================ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.qa-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qa-card:active { transform: scale(0.95); box-shadow: var(--shadow-xs); }
.qa-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qa-icon-box svg { width: 20px; height: 20px; }
.qa-icon-teal { background: var(--primary-light); color: var(--primary); }
.qa-icon-blue { background: var(--info-light); color: var(--info); }
.qa-icon-amber { background: var(--warning-light); color: var(--warning); }
.qa-icon-rose { background: #fce7f3; color: #be185d; }
.qa-icon-green { background: var(--success-light); color: var(--success); }
.qa-icon-purple { background: #ede9fe; color: #7c3aed; }
.qa-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
}
.qa-card-primary {
  background: var(--primary);
  color: #fff;
}
.qa-card-primary .qa-label { color: rgba(255,255,255,0.9); }
.qa-card-primary .qa-icon-box { background: rgba(255,255,255,0.2); color: #fff; }

/* ============================================================
   RESPONSIVE — Desktop/tablet simulation
   On >=768px, cap content to 480px and center it
   so it looks like a phone app on desktop
   ============================================================ */
@media (min-width: 768px) {
  .app-header-content { max-width: 480px; margin: 0 auto; }
  .app-body { max-width: 480px; margin: 0 auto; }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .fab { right: calc(50% - 240px + 20px); }
}

@media (max-width: 360px) {
  .app-body { padding: 16px 12px 80px; }
  .app-header-content { padding: 10px 14px 20px; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 20px; }
  .gallery-grid { gap: 8px; }
}

/* Print */
@media print {
  .app-header, .bottom-nav, .fab, .app-body > .controls { display: none !important; }
  .app-body { padding: 0; max-width: 100%; }
}
