/* ========================================
   GARDEN GLIMPSE – Design System
   ======================================== */

:root {
  --primary: #8BC34A;
  --primary-dark: #558B2F;
  --primary-light: #DCEDC8;
  --secondary: #558B2F;
  --accent: #FFEB3B;
  --accent-dark: #F9A825;

  --bg: #F1F8E9;
  --surface: #FFFFFF;
  --surface-2: #F9FBF5;
  --border: #E0E0E0;

  --text-primary: #1B1B1B;
  --text-secondary: #5A5A5A;
  --text-hint: #9E9E9E;

  --danger: #E53935;
  --success: #43A047;
  --warning: #FB8C00;
  --info: #039BE5;

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

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
  --shadow-fab: 0 6px 20px rgba(139,195,74,0.45);

  --app-bar-height: 56px;
  --bottom-nav-height: 64px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);

  font-size: 16px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #2E7D32;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
a { text-decoration: none; color: inherit; }

/* ── App Shell ── */
#app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.3);
}

/* ── App Bar ── */
.app-bar {
  position: relative;
  z-index: 100;
  height: var(--app-bar-height);
  min-height: var(--app-bar-height);
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  padding: 0 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.app-bar__back-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: #fff;
  flex-shrink: 0;
  transition: background var(--transition);
}
.app-bar__back-btn:active { background: rgba(255,255,255,0.15); }
.app-bar__title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-bar__actions {
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.app-bar__action-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: #fff;
  transition: background var(--transition);
}
.app-bar__action-btn:active { background: rgba(255,255,255,0.15); }

/* ── Screens ── */
.screens {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity var(--transition), transform var(--transition);
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}
.screen--sub {
  transform: translateX(100%);
}
.screen--sub.active {
  transform: translateX(0);
}
.screen-content {
  padding: 12px 16px;
  min-height: 100%;
}
.bottom-spacer { height: 80px; }

/* ── Bottom Navigation ── */
.bottom-nav {
  height: var(--bottom-nav-height);
  min-height: var(--bottom-nav-height);
  background: var(--surface);
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-hint);
  position: relative;
  transition: color var(--transition);
  border-radius: 0;
  padding: 6px 4px;
}
.nav-item::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
  transition: width var(--transition);
}
.nav-item.active { color: var(--primary-dark); }
.nav-item.active::before { width: 36px; }
.nav-icon { font-size: 22px; }
.nav-label { font-size: 10px; font-weight: 500; letter-spacing: 0.3px; }
.nav-item:active { background: rgba(139,195,74,0.08); }

/* ── FAB ── */
.fab {
  position: absolute;
  bottom: 24px;
  right: 20px;
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 50;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.fab:active {
  transform: scale(0.92);
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(139,195,74,0.3);
}
.fab .material-icons { font-size: 26px; }

/* ── Dashboard ── */
.dashboard-greeting {
  padding: 8px 0 16px;
}
.greeting-sub {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}
.greeting-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.stat-icon { font-size: 22px; color: var(--primary); }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; }

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.section-action {
  font-size: 13px;
  color: var(--primary-dark);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.section-action:active { background: var(--primary-light); }

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.quick-action-btn {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: transform var(--transition), box-shadow var(--transition);
}
.quick-action-btn .material-icons { font-size: 26px; color: var(--primary); }
.quick-action-btn:active { transform: scale(0.96); box-shadow: none; }

/* Dashboard mini list */
.dashboard-plant-list, .dashboard-task-list { display: flex; flex-direction: column; gap: 8px; }
.dash-plant-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.dash-plant-avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.dash-plant-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dash-plant-avatar .material-icons { color: var(--primary); font-size: 22px; }
.dash-plant-info { flex: 1; min-width: 0; }
.dash-plant-name { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-plant-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.dash-plant-badge {
  font-size: 10px; font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary-dark);
  text-transform: capitalize;
}

.dash-task-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.dash-task-icon { width: 36px; height: 36px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-task-icon.priority-high { background: #FFEBEE; }
.dash-task-icon.priority-high .material-icons { color: var(--danger); }
.dash-task-icon.priority-medium { background: #FFF3E0; }
.dash-task-icon.priority-medium .material-icons { color: var(--warning); }
.dash-task-icon.priority-low { background: var(--primary-light); }
.dash-task-icon.priority-low .material-icons { color: var(--primary-dark); }
.dash-task-info { flex: 1; min-width: 0; }
.dash-task-title { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-task-due { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── Search Bar ── */
.search-bar-wrap { padding: 8px 0 4px; }
.search-bar {
  background: var(--surface);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 44px;
  box-shadow: var(--shadow-sm);
  gap: 8px;
}
.search-icon { color: var(--text-hint); font-size: 20px; }
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
}
.search-input::placeholder { color: var(--text-hint); }
.search-clear { color: var(--text-hint); display: flex; align-items: center; }
.search-clear .material-icons { font-size: 18px; }

/* ── Filter Chips ── */
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 12px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
}
.chip--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.chip:active { transform: scale(0.95); }

/* ── Plant List ── */
.plant-list { display: flex; flex-direction: column; gap: 10px; }
.plant-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: stretch;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}
.plant-card:active { transform: scale(0.98); box-shadow: none; }
.plant-card__image {
  width: 80px;
  min-height: 80px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.plant-card__image img { width: 100%; height: 100%; object-fit: cover; }
.plant-card__image .material-icons { font-size: 32px; color: var(--primary); }
.plant-card__body {
  flex: 1;
  padding: 12px 12px 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.plant-card__name { font-size: 15px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plant-card__meta { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.plant-card__meta .material-icons { font-size: 13px; }
.plant-card__chips { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.plant-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}
.plant-chip--type { background: var(--primary-light); color: var(--primary-dark); }
.plant-chip--water { background: #E3F2FD; color: #1565C0; }
.plant-card__chevron {
  display: flex;
  align-items: center;
  padding-right: 10px;
  color: var(--text-hint);
}

/* ── Plant Detail Screen ── */
.detail-hero {
  width: 100%;
  height: 200px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero .material-icons { font-size: 72px; color: var(--primary); }

.detail-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.detail-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.detail-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; text-transform: capitalize; }
.detail-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.detail-chip {
  font-size: 12px; font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.detail-chip--type { background: var(--primary-light); color: var(--primary-dark); }
.detail-chip--water { background: #E3F2FD; color: #1565C0; }

.detail-info-list { display: flex; flex-direction: column; gap: 0; }
.detail-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-icon { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--primary-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.detail-info-icon .material-icons { font-size: 18px; color: var(--primary-dark); }
.detail-info-content { flex: 1; }
.detail-info-label { font-size: 11px; color: var(--text-hint); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-info-value { font-size: 14px; color: var(--text-primary); font-weight: 500; margin-top: 2px; }

.detail-notes {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.detail-notes-title { font-size: 13px; color: var(--text-hint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.detail-notes-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.detail-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

/* Growth Notes */
.growth-notes-section { margin-bottom: 16px; }
.growth-note-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}
.growth-note-date { font-size: 11px; color: var(--text-hint); font-weight: 500; margin-bottom: 4px; }
.growth-note-text { font-size: 14px; color: var(--text-primary); line-height: 1.5; }
.add-note-btn {
  width: 100%;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  color: var(--text-hint);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition);
}
.add-note-btn:active { border-color: var(--primary); color: var(--primary); }

/* ── Task List ── */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: transform var(--transition);
}
.task-card.done { opacity: 0.55; }
.task-card:active { transform: scale(0.98); }
.task-checkbox {
  width: 22px; height: 22px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  transition: all var(--transition);
}
.task-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.task-checkbox.checked .material-icons { font-size: 14px; color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-title {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  text-decoration: none;
}
.task-card.done .task-title { text-decoration: line-through; color: var(--text-hint); }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.task-due { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 3px; }
.task-due .material-icons { font-size: 13px; }
.task-due.overdue { color: var(--danger); }
.priority-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.priority-badge.high { background: #FFEBEE; color: var(--danger); }
.priority-badge.medium { background: #FFF3E0; color: var(--warning); }
.priority-badge.low { background: var(--primary-light); color: var(--primary-dark); }
.task-plant-tag {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.task-actions { display: flex; gap: 4px; align-self: center; }
.task-action-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-hint);
  transition: background var(--transition);
}
.task-action-btn:active { background: var(--border); }
.task-action-btn .material-icons { font-size: 18px; }

/* ── Pest & Remedies ── */
.pest-list { display: flex; flex-direction: column; gap: 10px; }
.pest-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.pest-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.pest-card__header:active { background: var(--bg); }
.pest-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: #FFF3E0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
}
.pest-info { flex: 1; }
.pest-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.pest-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.pest-expand { color: var(--text-hint); transition: transform var(--transition); }
.pest-expand.open { transform: rotate(180deg); }
.pest-card__body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.pest-card__body.open { display: block; }
.pest-remedy-section { margin-top: 12px; }
.pest-remedy-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-hint); margin-bottom: 6px; }
.pest-remedy-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.pest-symptoms { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-top: 8px; }

.remedy-list { display: flex; flex-direction: column; gap: 8px; }
.remedy-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.remedy-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: #E8F5E9;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.remedy-icon .material-icons { font-size: 20px; color: var(--primary-dark); }
.remedy-body { flex: 1; min-width: 0; }
.remedy-pest { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.remedy-plant-tag { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.remedy-solution { font-size: 13px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }
.remedy-del {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  color: var(--text-hint);
  display: flex; align-items: center; justify-content: center;
  align-self: center;
  transition: background var(--transition);
}
.remedy-del:active { background: #FFEBEE; color: var(--danger); }
.remedy-del .material-icons { font-size: 18px; }

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state__icon { font-size: 64px; color: var(--primary-light); }
.empty-state__title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.empty-state__text { font-size: 14px; color: var(--text-secondary); line-height: 1.5; max-width: 240px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(139,195,74,0.4); }
.btn--primary:active { background: var(--primary-dark); transform: scale(0.97); }
.btn--outline { background: transparent; color: var(--primary-dark); border: 2px solid var(--primary); }
.btn--outline:active { background: var(--primary-light); transform: scale(0.97); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:active { background: #C62828; transform: scale(0.97); }
.btn--text { background: transparent; color: var(--text-secondary); padding: 0 12px; }
.btn--text:active { background: var(--border); }
.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* ── Bottom Sheets ── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  backdrop-filter: blur(2px);
}
.sheet-overlay.open { opacity: 1; pointer-events: all; }

.bottom-sheet {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 201;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.bottom-sheet.open { transform: translateX(-50%) translateY(0); }

.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: 12px auto 4px;
  flex-shrink: 0;
}
.sheet-header {
  display: flex;
  align-items: center;
  padding: 8px 16px 12px;
  flex-shrink: 0;
}
.sheet-title { flex: 1; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.sheet-close {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-hint);
  transition: background var(--transition);
}
.sheet-close:active { background: var(--border); }
.sheet-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 16px;
  -webkit-overflow-scrolling: touch;
}

/* ── Forms ── */
.form-field {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.required { color: var(--danger); }
.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,195,74,0.15);
  background: var(--surface);
}
.form-textarea {
  height: auto;
  padding: 12px 14px;
  resize: none;
  line-height: 1.5;
}
.select-wrap { position: relative; }
.form-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 40px;
}
.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-hint);
  pointer-events: none;
  font-size: 20px;
}
.field-error { display: block; font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-input.error { border-color: var(--danger); }

.sheet-actions {
  display: flex;
  gap: 10px;
  padding: 16px 0 24px;
}
.sheet-actions .btn { flex: 1; }

/* ── Dialog ── */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.dialog {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  width: calc(100% - 64px);
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: dialogIn 0.2s ease;
}
@keyframes dialogIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.dialog-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.dialog-body { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 20px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Snackbar ── */
.snackbar {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #323232;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  max-width: calc(100% - 40px);
}
.snackbar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #f5f5f5 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 80px;
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
}

/* ── Note Sheet ── */
#noteSheetOverlay, #noteSheet { z-index: 202; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 0; }
