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

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f1f5f9;
  opacity: 0;
  transition: opacity 0.18s ease;
  -webkit-font-smoothing: antialiased;
}
body.loaded { opacity: 1; }

/* ── Top Header ─────────────────────────────────── */
#topHeader {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 56px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}

/* ── Bottom Navigation ──────────────────────────── */
#bottomNav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  display: flex; align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(60px + env(safe-area-inset-bottom, 0px));
}
#bottomNav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 8px 4px;
  font-size: 10px; font-weight: 500; color: #94a3b8;
  text-decoration: none; transition: color 0.15s;
}
#bottomNav a svg { width: 22px; height: 22px; }
#bottomNav a.active { color: #2563eb; }
#bottomNav a.active svg { stroke-width: 2.5; }

/* ── Main content ───────────────────────────────── */
main {
  padding-top: 56px;
  padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 16px);
  min-height: 100vh;
}

/* ── FAB ────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 12px);
  right: 16px; z-index: 45;
  width: 52px; height: 52px; border-radius: 50%;
  background: #2563eb; color: white; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,99,235,0.38);
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab:active { transform: scale(0.93); box-shadow: 0 2px 10px rgba(37,99,235,0.3); }
.fab svg { width: 22px; height: 22px; }

/* ── Modal overlay ──────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  background: white; width: 100%; max-width: 600px;
  border-radius: 20px 20px 0 0;
  max-height: 92vh; overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: #e2e8f0; margin: 10px auto 0;
}

@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal-sheet {
    border-radius: 20px; margin: 16px;
    max-height: 85vh; width: calc(100% - 32px);
    transform: scale(0.95) translateY(0);
  }
  .modal-overlay.open .modal-sheet { transform: scale(1); }
  .sheet-handle { display: none; }
}

/* ── Cards ──────────────────────────────────────── */
.card {
  background: white; border-radius: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s, transform 0.12s;
}
.card:active { transform: scale(0.985); }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Form inputs ─────────────────────────────────── */
.input {
  width: 100%; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: 11px 14px; font-size: 14px; font-family: inherit;
  background: white; color: #1e293b; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.input::placeholder { color: #94a3b8; }

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
  width: 100%; background: #2563eb; color: white; border: none;
  border-radius: 12px; padding: 13px 20px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background 0.15s, transform 0.12s;
  -webkit-appearance: none;
}
.btn-primary:active { background: #1d4ed8; transform: scale(0.98); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }

.btn-secondary {
  width: 100%; background: #f1f5f9; color: #475569; border: none;
  border-radius: 12px; padding: 13px 20px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background 0.15s;
  -webkit-appearance: none;
}
.btn-secondary:active { background: #e2e8f0; }

/* ── Filter chips ───────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 20px; border: 1.5px solid #e2e8f0;
  font-size: 12px; font-weight: 500; color: #64748b;
  background: white; white-space: nowrap; cursor: pointer;
  transition: all 0.15s;
}
.chip.active { background: #2563eb; border-color: #2563eb; color: white; }
.chip:active { transform: scale(0.96); }

/* ── Section header ─────────────────────────────── */
.section-title {
  font-size: 13px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0 4px; margin-bottom: 8px;
}

/* ── Status dot ─────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  margin-top: 5px;
}

/* ── Empty state ────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px; text-align: center;
}
.empty-state svg { width: 48px; height: 48px; color: #cbd5e1; margin-bottom: 12px; }
.empty-state p { font-size: 14px; color: #94a3b8; }

/* ── Progress bar ───────────────────────────────── */
.progress-bar { height: 5px; border-radius: 3px; background: #f1f5f9; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }

/* ── Scrollbar thin ─────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* ── Desktop sidebar ─────────────────────────────── */
@media (min-width: 768px) {
  #bottomNav { display: none; }
  #desktopNav { display: flex !important; }
  main { padding-bottom: 32px; padding-left: 220px; }
  #topHeader { padding-left: 236px; }
}

#desktopNav {
  display: none;
  position: fixed; left: 0; top: 56px; bottom: 0; width: 204px; z-index: 40;
  background: white; border-right: 1px solid #e2e8f0;
  flex-direction: column; padding: 12px 8px; gap: 2px; overflow-y: auto;
}
#desktopNav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: #64748b;
  text-decoration: none; transition: all 0.15s;
}
#desktopNav a:hover { background: #f8fafc; color: #1e293b; }
#desktopNav a.active { background: #eff6ff; color: #2563eb; }
#desktopNav a svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Swipe hint ─────────────────────────────────── */
@media (hover: none) {
  .card:active { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
}
