:root {
  --color-bg: #F0F2F5;
  --color-surface: #FFFFFF;
  --color-surface2: #F8F9FA;
  --color-primary: #5C6BC0;
  --color-primary-dark: #3949AB;
  --color-primary-light: #E8EAF6;
  --color-success: #43A047;
  --color-success-light: #E8F5E9;
  --color-warning: #FB8C00;
  --color-warning-light: #FFF3E0;
  --color-danger: #E53935;
  --color-danger-light: #FFEBEE;
  --color-text: #212121;
  --color-text-muted: #757575;
  --color-border: #E0E0E0;
  --color-shadow: rgba(0, 0, 0, 0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px var(--color-shadow);
  --shadow-md: 0 4px 16px var(--color-shadow);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
  --nav-height: 64px;
  --header-height: 56px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  padding-bottom: var(--nav-height);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1rem;
}

input, select, textarea {
  font-family: var(--font);
  font-size: 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
}

textarea { resize: vertical; min-height: 80px; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Layout ── */
#app {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 0 16px;
}

.page-header {
  background: var(--color-surface);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.page-content {
  padding: 16px;
}

/* ── Bottom Nav ── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 8px var(--color-shadow);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  transition: color var(--transition);
  padding: 8px 4px;
  min-height: 44px;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-item.active svg {
  stroke: var(--color-primary);
}

/* ── FAB ── */
#fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 99;
  transition: transform var(--transition), background var(--transition);
  border: none;
}

#fab:hover { background: var(--color-primary-dark); transform: scale(1.05); }
#fab:active { transform: scale(0.95); }

/* ── Section ── */
.section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  padding: 0 4px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.95rem;
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--color-text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollable horizontal strip ── */
.h-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }

/* ── Utilities ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: var(--color-text-muted); font-size: 0.875rem; }
.text-sm { font-size: 0.875rem; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
