/* ============================================
   LEAFY TALES — Mobile App Design System
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #4caf50;
  --primary-dark: #388e3c;
  --primary-light: #a5d6a7;
  --secondary: #8bc34a;
  --accent: #ffc107;
  --accent-dark: #f9a825;
  --danger: #f44336;
  --water: #2196f3;

  --bg: #f1f8e9;
  --bg-card: #ffffff;
  --bg-surface: #fafafa;
  --bg-nav: #ffffff;

  --text-primary: #1b2e1c;
  --text-secondary: #5a7a5b;
  --text-hint: #9e9e9e;
  --text-on-primary: #ffffff;

  --divider: rgba(0,0,0,0.08);
  --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 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.08);
  --shadow-fab: 0 6px 16px rgba(76,175,80,0.4);

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

  --app-bar-height: 56px;
  --bottom-nav-height: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: #2e7d32;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  max-height: 100vh;
  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);
  background: var(--primary);
  display: flex;
  align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.app-bar-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-on-primary);
  letter-spacing: 0.2px;
}

.app-bar-btn {
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-on-primary);
  transition: background var(--transition-fast);
}

.app-bar-btn:active {
  background: rgba(255,255,255,0.2);
}

/* ---------- Screens Container ---------- */
.screens-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  pointer-events: none;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar { display: none; }

.screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.screen.slide-out-left {
  opacity: 0;
  transform: translateX(-30px);
}

.screen-content {
  padding: 16px;
  min-height: 100%;
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: relative;
  z-index: 100;
  height: var(--bottom-nav-height);
  background: var(--bg-nav);
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--divider);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 8px 4px;
  transition: all var(--transition-fast);
  color: var(--text-hint);
}

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

.nav-icon {
  font-size: 22px;
  transition: transform var(--transition-fast);
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 14px);
  background: var(--accent);
  color: #333;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.nav-item:active { opacity: 0.7; }

/* ---------- Dashboard ---------- */
.greeting-section {
  padding: 8px 4px 16px;
}

.greeting-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.greeting-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon .material-icons-round { font-size: 20px; }

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
  line-height: 1.2;
}

/* ---------- Section Headers ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-action {
  font-size: 12px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  padding: 4px 8px;
}

/* ---------- Attention Cards ---------- */
.attention-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.attention-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border-left: 4px solid var(--accent);
}

.attention-card:active {
  transform: scale(0.98);
  box-shadow: none;
}

.attention-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.attention-info { flex: 1; min-width: 0; }

.attention-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attention-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.attention-chip {
  background: rgba(255,193,7,0.15);
  color: #e65100;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ---------- Activity List ---------- */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.activity-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.activity-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-dot .material-icons-round { font-size: 18px; }

.activity-info { flex: 1; min-width: 0; }

.activity-text {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.activity-time {
  font-size: 11px;
  color: var(--text-hint);
  margin-top: 2px;
}

/* ---------- Health Card ---------- */
.health-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.health-item { display: flex; flex-direction: column; gap: 6px; }

.health-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.health-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-bar-wrap {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Garden Log ---------- */
.log-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}
.log-filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--divider);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(76,175,80,0.3);
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.log-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.log-icon-wrap .material-icons-round { font-size: 18px; }

.log-content { flex: 1; min-width: 0; }

.log-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.log-plant {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.log-time {
  font-size: 11px;
  color: var(--text-hint);
  flex-shrink: 0;
  margin-top: 3px;
}

/* ---------- Plant Library ---------- */
.search-bar-wrap {
  position: relative;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-hint);
  font-size: 20px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  background: var(--bg-card);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-full);
  padding: 0 44px 0 42px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-hint);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.sort-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.sort-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--divider);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sort-chip.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(76,175,80,0.08);
}

.plant-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plant-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.plant-card:active {
  transform: scale(0.98);
  box-shadow: none;
}

.plant-card-header {
  display: flex;
  align-items: center;
  padding: 14px;
  gap: 14px;
}

.plant-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.plant-info { flex: 1; min-width: 0; }

.plant-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plant-species {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plant-chevron {
  color: var(--text-hint);
  font-size: 20px;
}

.plant-card-footer {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--divider);
  gap: 8px;
}

.plant-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 3px 8px;
  background: var(--bg);
  border-radius: var(--radius-full);
}

.plant-tag .material-icons-round { font-size: 12px; }

.plant-tag.overdue {
  background: rgba(244,67,54,0.1);
  color: var(--danger);
}

.plant-tag.due-today {
  background: rgba(255,193,7,0.15);
  color: #e65100;
}

.plant-tag.ok {
  background: rgba(76,175,80,0.1);
  color: var(--primary-dark);
}

.plant-card-actions {
  display: flex;
  margin-left: auto;
  gap: 4px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.icon-btn:active { background: rgba(0,0,0,0.08); }

.icon-btn.water { color: var(--water); }
.icon-btn.edit { color: var(--primary); }
.icon-btn.delete { color: var(--danger); }

/* ---------- FAB ---------- */
.fab {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  z-index: 50;
}

.fab:active {
  transform: scale(0.92);
  box-shadow: 0 3px 8px rgba(76,175,80,0.3);
}

.fab .material-icons-round { font-size: 28px; }

/* ---------- Reminders ---------- */
.reminder-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,193,7,0.1);
  border: 1px solid rgba(255,193,7,0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.reminder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.reminder-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.reminder-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.reminder-info { flex: 1; min-width: 0; }

.reminder-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.reminder-due {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.reminder-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.reminder-badge.today {
  background: rgba(244,67,54,0.1);
  color: var(--danger);
}

.reminder-badge.upcoming {
  background: rgba(255,193,7,0.15);
  color: #e65100;
}

.water-btn-small {
  background: var(--water);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.water-btn-small:active { opacity: 0.8; }

/* ---------- Plant Detail ---------- */
.detail-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: -16px -16px 0;
}

.detail-emoji {
  font-size: 56px;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-hero-info { flex: 1; min-width: 0; }

.detail-hero-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.detail-hero-species {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin-top: 4px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  padding: 16px 0;
  margin-bottom: 4px;
}

.detail-action-btn {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.detail-action-btn:active {
  opacity: 0.8;
  transform: scale(0.97);
}

.detail-action-btn.water-btn {
  background: var(--water);
  color: #fff;
}

.detail-action-btn.edit-btn {
  background: rgba(76,175,80,0.1);
  color: var(--primary-dark);
}

.detail-action-btn.delete-btn {
  background: rgba(244,67,54,0.1);
  color: var(--danger);
}

.detail-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.detail-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.detail-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
}

.detail-field + .detail-field {
  border-top: 1px solid var(--divider);
}

.detail-field-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-field-icon .material-icons-round { font-size: 16px; }

.detail-field-content { flex: 1; min-width: 0; }

.detail-field-label {
  font-size: 11px;
  color: var(--text-hint);
  font-weight: 500;
  margin-bottom: 2px;
}

.detail-field-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}

.detail-notes {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.notes-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Empty States ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  font-size: 56px !important;
  color: var(--primary-light);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 220px;
}

.empty-action {
  margin-top: 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(76,175,80,0.3);
  transition: transform var(--transition-fast);
}

.empty-action:active { transform: scale(0.96); }

/* ---------- Bottom Sheet ---------- */
.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-normal);
}

.sheet-overlay.visible {
  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(--bg-card);
  border-radius: 20px 20px 0 0;
  z-index: 201;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
}

.bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(0,0,0,0.12);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.sheet-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.sheet-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition-fast);
}

.sheet-close:active { background: rgba(0,0,0,0.12); }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sheet-body::-webkit-scrollbar { display: none; }

/* ---------- Form Fields ---------- */
.form-field {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 46px;
  background: var(--bg-surface);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
  background: #fff;
}

.form-input.error { border-color: var(--danger); }

.form-textarea {
  height: auto;
  min-height: 80px;
  padding: 12px 14px;
  resize: none;
  line-height: 1.5;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: block;
}

.form-hint {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 4px;
  display: block;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  height: 48px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 3px 10px rgba(76,175,80,0.3);
}

.btn-primary:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.btn-primary.full-width { width: 100%; }

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-md);
  height: 44px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-ghost:active { background: rgba(0,0,0,0.06); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.btn-danger:active { opacity: 0.85; }

.btn-water {
  background: var(--water);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.btn-water:active { opacity: 0.85; }

/* ---------- 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;
  padding: 24px;
  animation: fadeIn 200ms ease;
}

.dialog {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px 24px 20px;
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dialog-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.dialog-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 8px;
}

.dialog-body {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ---------- Snackbar ---------- */
.snackbar {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #323232;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 400;
  min-width: 200px;
  max-width: calc(100vw - 48px);
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.snackbar.visible {
  transform: translateX(-50%) translateY(0);
}

.snackbar-action {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  margin-left: auto;
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(90deg, #e8f5e9 25%, #c8e6c9 50%, #e8f5e9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes bounce-in {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.bounce-in { animation: bounce-in 0.3s ease; }

/* ---------- Utility ---------- */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--primary) !important; }
.text-warning { color: var(--accent-dark) !important; }

/* ---------- Responsive fallback ---------- */
@media (max-width: 380px) {
  .stats-row { gap: 8px; }
  .stat-card { padding: 12px 6px; }
  .stat-value { font-size: 20px; }
}
