/* ============================================
   GARDEN HARMONY - Material Design CSS
   ============================================ */

:root {
  --primary: #4CAF50;
  --primary-dark: #388E3C;
  --primary-light: #C8E6C9;
  --secondary: #8BC34A;
  --accent: #CDDC39;
  --accent-dark: #AFB42B;

  --surface: #FFFFFF;
  --surface-2: #F8FBF8;
  --surface-3: #F1F8E9;
  --background: #F4F7F4;
  --on-surface: #1B2E1C;
  --on-surface-medium: #4A6741;
  --on-surface-low: #8FA98D;
  --divider: #E2EDE2;

  --blue: #2196F3;
  --blue-light: #E3F2FD;
  --orange: #FF9800;
  --orange-light: #FFF3E0;
  --red: #F44336;
  --red-light: #FFEBEE;
  --green-light: #E8F5E9;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 100px;

  --shadow-1: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.12);
  --shadow-2: 0 3px 6px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.08);
  --shadow-3: 0 8px 24px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
  --shadow-fab: 0 6px 20px rgba(76,175,80,0.40);

  --top-bar: 56px;
  --bottom-nav: 60px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--background);
  color: var(--on-surface);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; }

/* ============================================
   TOP APP BAR
   ============================================ */
.top-app-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--top-bar);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 4px 0 4px;
  z-index: 100;
  border-bottom: 1px solid var(--divider);
  box-shadow: var(--shadow-1);
}
.app-bar-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--on-surface);
  letter-spacing: -0.3px;
}
.app-bar-actions { display: flex; align-items: center; }

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-medium);
  transition: background var(--transition);
  position: relative;
  overflow: hidden;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover, .icon-btn:active { background: var(--surface-3); }

.icon-btn-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-medium);
  transition: background var(--transition);
}
.icon-btn-small svg { width: 18px; height: 18px; }
.icon-btn-small:hover { background: var(--surface-3); }

.hamburger-btn { color: var(--on-surface); }

/* Search Bar */
.search-bar-container {
  position: fixed;
  top: var(--top-bar);
  left: 0; right: 0;
  background: var(--surface);
  padding: 8px 16px;
  z-index: 99;
  border-bottom: 1px solid var(--divider);
  transform: translateY(-100%);
  transition: transform var(--transition);
}
.search-bar-container.open { transform: translateY(0); }
.search-bar {
  display: flex;
  align-items: center;
  background: var(--background);
  border-radius: var(--radius-full);
  padding: 0 12px;
  gap: 8px;
  height: 40px;
}
.search-icon-small { width: 18px; height: 18px; color: var(--on-surface-low); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 15px;
  color: var(--on-surface);
}

/* ============================================
   SIDE DRAWER
   ============================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.side-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 300px;
  background: var(--surface);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.side-drawer.open { transform: translateX(0); }

.drawer-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 48px 20px 24px;
}
.drawer-logo { display: flex; align-items: center; gap: 14px; }
.drawer-logo-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.drawer-logo-icon svg { width: 28px; height: 28px; color: white; }
.drawer-app-name { font-size: 18px; font-weight: 700; color: white; }
.drawer-app-subtitle { font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 2px; }

.drawer-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--on-surface-low);
  padding: 20px 20px 8px;
}
.drawer-items { display: flex; flex-direction: column; }

.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: var(--on-surface);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  transition: background var(--transition);
  border-radius: 0;
}
.drawer-item:hover, .drawer-item.active { background: var(--green-light); color: var(--primary-dark); }
.drawer-item-icon { width: 22px; height: 22px; color: var(--on-surface-medium); flex-shrink: 0; }
.drawer-item-icon svg { width: 22px; height: 22px; }
.drawer-item.active .drawer-item-icon { color: var(--primary); }
.drawer-item-label { flex: 1; }
.drawer-item-chevron { width: 20px; height: 20px; color: var(--on-surface-low); }
.drawer-item-chevron svg { width: 20px; height: 20px; }
.drawer-footer { margin-top: auto; padding: 20px; border-top: 1px solid var(--divider); }
.drawer-version { font-size: 12px; color: var(--on-surface-low); }

/* ============================================
   MAIN CONTENT & SCREENS
   ============================================ */
.main-content {
  position: fixed;
  top: var(--top-bar);
  left: 0; right: 0;
  bottom: var(--bottom-nav);
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
.screen.active {
  display: flex;
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 0;
  -webkit-overflow-scrolling: touch;
}
.screen-scroll::-webkit-scrollbar { display: none; }

.drawer-screen .screen-scroll { padding-top: 0; }

.bottom-spacer { height: 80px; }

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav);
  background: var(--surface);
  display: flex;
  border-top: 1px solid var(--divider);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--on-surface-low);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 4px;
  transition: color var(--transition);
  position: relative;
}
.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::before { width: 40px; }
.nav-item.active { color: var(--primary); }
.nav-icon { width: 24px; height: 24px; }
.nav-label { line-height: 1; }

/* Hide bottom nav when drawer screen active */
.bottom-nav.hidden { display: none; }

/* ============================================
   FLOATING ACTION BUTTON
   ============================================ */
.fab {
  position: absolute;
  bottom: calc(var(--bottom-nav) + 16px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: var(--shadow-fab);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  cursor: pointer;
  outline: none;
}
.fab .material-icons-round {
  font-size: 26px;
  color: white;
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(76, 175, 80, 0.50);
}
.fab:active {
  transform: scale(0.95);
}
.fab.fab-hidden {
  transform: scale(0) !important;
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */
.ripple { position: relative; overflow: hidden; }
.ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.1);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
}
.ripple:active::after { opacity: 1; }

/* ============================================
   STATS ROW
   ============================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 4px 16px 16px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 10px 12px;
  text-align: center;
  box-shadow: var(--shadow-1);
}
.stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon--green { background: var(--green-light); color: var(--primary); }
.stat-icon--blue { background: var(--blue-light); color: var(--blue); }
.stat-icon--orange { background: var(--orange-light); color: var(--orange); }
.stat-value { font-size: 22px; font-weight: 700; color: var(--on-surface); line-height: 1; }
.stat-label { font-size: 11px; color: var(--on-surface-low); margin-top: 3px; }

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 8px;
}
.section-title { font-size: 16px; font-weight: 600; color: var(--on-surface); }
.btn-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* ============================================
   AI TIP CARD (DASHBOARD)
   ============================================ */
.ai-tip-card {
  margin: 0 16px 16px;
  background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid #C8E6C9;
  min-height: 90px;
}
.ai-tip-loading {
  display: flex; flex-direction: column; gap: 8px;
}
.ai-tip-content {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.ai-tip-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: white;
}
.ai-tip-icon svg { width: 20px; height: 20px; }
.ai-tip-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.55;
  color: var(--on-surface);
}
.ai-retry-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--primary-dark);
  font-weight: 600;
  margin-top: 8px;
  padding: 4px 0;
}
.ai-retry-btn svg { width: 14px; height: 14px; }
.ai-tip-error {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--on-surface-medium);
  font-size: 14px;
}

/* Shimmer */
.shimmer-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #d0e8d0 25%, #e8f5e9 50%, #d0e8d0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.shimmer-line--long { width: 90%; }
.shimmer-line--medium { width: 70%; }
.shimmer-line--short { width: 50%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 4px 16px 16px;
}
.quick-action-btn {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--on-surface-medium);
  box-shadow: var(--shadow-1);
  transition: transform var(--transition), box-shadow var(--transition);
}
.quick-action-btn:active { transform: scale(0.95); }
.quick-action-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.quick-action-icon svg { width: 20px; height: 20px; }

/* ============================================
   AI ACTION BAR
   ============================================ */
.ai-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  margin: 0 16px 12px;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-1);
  border-left: 3px solid var(--primary);
}
.ai-action-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
}
.ai-action-info svg { width: 20px; height: 20px; color: var(--primary); }

.btn-outlined-small {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition);
  white-space: nowrap;
}
.btn-outlined-small:hover { background: var(--primary-light); }
.btn-outlined-small:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* AI Result Card */
.ai-result-card {
  background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 0 16px 16px;
  border: 1px solid #C8E6C9;
}
.ai-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ai-result-card p { font-size: 14px; line-height: 1.6; color: var(--on-surface); }
.ai-result-card ul { padding-left: 18px; }
.ai-result-card li { font-size: 14px; line-height: 1.7; color: var(--on-surface); }

/* ============================================
   AI BADGE
   ============================================ */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}
.ai-badge svg { width: 12px; height: 12px; }

.ai-badge-small {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

/* ============================================
   LIST CARDS
   ============================================ */
.list-container { padding: 0 16px; }

.plant-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-1);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.plant-card:active { transform: scale(0.98); box-shadow: var(--shadow-2); }

.plant-card-avatar {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
  overflow: hidden;
}
.plant-card-avatar svg { width: 28px; height: 28px; color: var(--primary-dark); }

.plant-card-body { flex: 1; min-width: 0; }
.plant-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plant-card-species {
  font-size: 12px;
  color: var(--on-surface-low);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plant-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.plant-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--green-light);
  color: var(--primary-dark);
}
.plant-chip svg { width: 12px; height: 12px; }
.plant-chip--blue { background: var(--blue-light); color: var(--blue); }
.plant-chip--orange { background: var(--orange-light); color: var(--orange); }

.plant-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Task Cards */
.task-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.task-checkbox {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--divider);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all var(--transition);
}
.task-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.task-checkbox.checked svg { display: block; }
.task-checkbox svg { width: 14px; height: 14px; color: white; display: none; }

.task-body { flex: 1; min-width: 0; }
.task-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
}
.task-title.done {
  text-decoration: line-through;
  color: var(--on-surface-low);
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.task-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.task-type-badge--watering { background: var(--blue-light); color: var(--blue); }
.task-type-badge--pruning { background: var(--green-light); color: var(--primary-dark); }
.task-type-badge--fertilizing { background: var(--orange-light); color: var(--orange); }
.task-type-badge--repotting { background: #F3E5F5; color: #7B1FA2; }
.task-type-badge--harvesting { background: #FFF8E1; color: #F57F17; }
.task-type-badge--other { background: var(--surface-2); color: var(--on-surface-medium); }

.priority-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}
.priority-dot--high { background: var(--red); }
.priority-dot--medium { background: var(--orange); }
.priority-dot--low { background: var(--primary); }

.task-due {
  font-size: 12px;
  color: var(--on-surface-low);
}
.task-due--overdue { color: var(--red); font-weight: 600; }
.task-due--today { color: var(--orange); font-weight: 600; }

.task-card-actions { display: flex; gap: 4px; }

/* Journal Cards */
.journal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
  cursor: pointer;
}
.journal-card-image {
  width: 100%; height: 140px;
  object-fit: cover;
  display: block;
}
.journal-card-body { padding: 14px; }
.journal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.journal-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
  flex: 1;
}
.journal-card-date { font-size: 11px; color: var(--on-surface-low); margin-top: 3px; white-space: nowrap; }
.journal-card-preview {
  font-size: 13px;
  color: var(--on-surface-medium);
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.journal-card-tags {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.tag-chip {
  font-size: 11px;
  background: var(--green-light);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ============================================
   FILTER CHIPS
   ============================================ */
.filter-chips {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--divider);
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-medium);
  background: var(--surface);
  transition: all var(--transition);
}
.chip--active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  text-align: center;
}
.empty-state-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.empty-state-icon svg { width: 36px; height: 36px; color: var(--primary); }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--on-surface); margin-bottom: 8px; }
.empty-state-desc { font-size: 14px; color: var(--on-surface-low); margin-bottom: 24px; line-height: 1.5; }

.empty-state-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  color: var(--on-surface-low);
  font-size: 14px;
}
.empty-state-inline svg { width: 20px; height: 20px; color: var(--on-surface-low); flex-shrink: 0; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  color: white;
  border-radius: var(--radius-full);
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(76,175,80,0.30);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(76,175,80,0.40); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--surface-3);
  color: var(--on-surface-medium);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  transition: background var(--transition);
}
.btn-secondary:hover { background: var(--divider); }

.btn-danger {
  background: var(--red);
  color: white;
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  transition: transform var(--transition);
}
.btn-danger:active { transform: scale(0.97); }

/* ============================================
   MODALS & BOTTOM SHEETS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.bottom-sheet {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-sheet--tall { max-height: 92vh; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.bottom-sheet-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--divider);
  margin: 12px auto 0;
}
.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
}
.bottom-sheet-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--on-surface);
}
.bottom-sheet-content {
  padding: 8px 20px 20px;
  overflow-y: auto;
}

/* Confirm Dialog */
.confirm-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: calc(100% - 64px);
  padding: 24px;
  animation: fadeScaleIn 0.2s ease-out;
}
.modal-overlay.confirm-mode {
  align-items: center;
  justify-content: center;
}
@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
#confirmOverlay { align-items: center; justify-content: center; }

.confirm-title { font-size: 18px; font-weight: 700; color: var(--on-surface); margin-bottom: 8px; }
.confirm-message { font-size: 14px; color: var(--on-surface-medium); margin-bottom: 24px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ============================================
   FORMS
   ============================================ */
.form-field {
  position: relative;
  margin-bottom: 20px;
}
.form-row { display: flex; gap: 12px; }
.form-field--half { flex: 1; }

.form-input {
  width: 100%;
  padding: 16px 14px 8px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--on-surface);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--primary); }
.form-input:invalid:not(:placeholder-shown) { border-color: var(--red); }

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

.form-select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238FA98D'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  cursor: pointer;
}

.form-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--on-surface-low);
  transition: all var(--transition);
  pointer-events: none;
}
.form-label--active,
.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  top: 8px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}
.form-label--date {
  top: 8px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--on-surface-low);
  font-weight: 600;
}
.form-input:focus + .form-label--date { color: var(--primary); }
.form-label--select {
  top: 8px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* AI Suggestion in form */
.ai-suggestion-bar {
  background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid #C8E6C9;
}
.ai-suggestion-text {
  font-size: 13px;
  color: var(--on-surface-medium);
  margin-top: 6px;
  line-height: 1.5;
}

/* ============================================
   PLANT DETAIL SHEET
   ============================================ */
.plant-detail-hero {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.plant-detail-hero svg { width: 56px; height: 56px; color: var(--primary-dark); }

.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.detail-info-item {
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 12px;
}
.detail-info-label {
  font-size: 11px;
  color: var(--on-surface-low);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.detail-info-value { font-size: 14px; font-weight: 600; color: var(--on-surface); }

.detail-notes {
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
}
.detail-notes-label {
  font-size: 11px;
  color: var(--on-surface-low);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.detail-notes-text {
  font-size: 14px;
  color: var(--on-surface);
  line-height: 1.55;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.detail-actions .btn-primary,
.detail-actions .btn-secondary,
.detail-actions .btn-danger { flex: 1; text-align: center; padding: 12px 8px; }

.ai-plant-suggestions {
  margin-top: 16px;
}

/* ============================================
   ICON PICKER
   ============================================ */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  background: var(--background);
  border-radius: var(--radius-md);
}
.icon-picker-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 2px solid var(--divider);
  background: var(--surface);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}
.icon-picker-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.icon-picker-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* ============================================
   BACK BAR (DRAWER SCREENS)
   ============================================ */
.screen-back-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  margin-bottom: 16px;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.back-btn svg { width: 20px; height: 20px; }

.screen-back-bar .material-icons-round {
  display: inline-flex;
  vertical-align: middle;
}

/* ============================================
   CHARTS
   ============================================ */
.chart-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 16px 16px;
  box-shadow: var(--shadow-1);
}
.chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 16px;
}
.chart-container { min-height: 140px; }

/* Bar Chart */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.bar-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--secondary) 0%, var(--primary) 100%);
  min-height: 4px;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-chart-label { font-size: 10px; color: var(--on-surface-low); text-align: center; }
.bar-chart-value { font-size: 11px; font-weight: 600; color: var(--primary-dark); }

/* Horizontal Bar Chart */
.hbar-chart { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: flex; align-items: center; gap: 10px; }
.hbar-label { font-size: 12px; color: var(--on-surface-medium); width: 90px; text-align: right; flex-shrink: 0; }
.hbar-track {
  flex: 1;
  height: 14px;
  background: var(--background);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.hbar-value { font-size: 12px; font-weight: 600; color: var(--primary-dark); width: 24px; flex-shrink: 0; }

/* Donut / Pie SVG */
.donut-container { display: flex; align-items: center; gap: 16px; }
.donut-svg { flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-surface); }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Adherence Progress */
.adherence-list { display: flex; flex-direction: column; gap: 12px; }
.adherence-row { }
.adherence-header { display: flex; justify-content: space-between; margin-bottom: 5px; }
.adherence-name { font-size: 13px; font-weight: 600; color: var(--on-surface); }
.adherence-pct { font-size: 12px; color: var(--primary-dark); font-weight: 600; }
.adherence-track {
  height: 8px;
  background: var(--background);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.adherence-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
}

/* ============================================
   AI CHAT
   ============================================ */
.chat-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar { display: none; }

.chat-bubble {
  display: flex;
  gap: 8px;
  max-width: 88%;
}
.chat-bubble--user {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.chat-bubble--ai { align-self: flex-start; }

.chat-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
}
.chat-avatar svg { width: 18px; height: 18px; color: white; }

.chat-bubble-content {
  background: var(--surface);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 14px;
  box-shadow: var(--shadow-1);
}
.chat-bubble--user .chat-bubble-content {
  background: var(--primary);
  color: white;
  border-radius: 18px 18px 4px 18px;
}
.chat-bubble-content p { font-size: 14px; line-height: 1.55; }
.chat-bubble--user .chat-bubble-content p { color: white; }
.chat-time { font-size: 10px; color: var(--on-surface-low); margin-top: 4px; display: block; }
.chat-bubble--user .chat-time { color: rgba(255,255,255,0.7); text-align: right; }

.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}
.chat-typing span {
  width: 8px; height: 8px;
  background: var(--on-surface-low);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 16px 12px;
  background: var(--surface);
  border-top: 1px solid var(--divider);
}
.chat-input {
  flex: 1;
  border: 1.5px solid var(--divider);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 15px;
  outline: none;
  resize: none;
  max-height: 100px;
  overflow-y: auto;
  background: var(--background);
  color: var(--on-surface);
  line-height: 1.4;
}
.chat-input:focus { border-color: var(--primary); }
.chat-send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition), background var(--transition);
  box-shadow: 0 2px 8px rgba(76,175,80,0.35);
}
.chat-send-btn svg { width: 20px; height: 20px; }
.chat-send-btn:active { transform: scale(0.93); }
.chat-send-btn:disabled { background: var(--on-surface-low); box-shadow: none; }

/* ============================================
   SNACKBAR
   ============================================ */
.snackbar {
  position: fixed;
  bottom: calc(var(--bottom-nav) + 12px);
  left: 16px; right: 16px;
  background: #323232;
  color: white;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  z-index: 400;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  box-shadow: var(--shadow-3);
}
.snackbar.show { transform: translateY(0); opacity: 1; }
.snackbar-action {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  margin-left: 16px;
  flex-shrink: 0;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.ai-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
}
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-loading-text { font-size: 13px; color: var(--on-surface-medium); }

/* ============================================
   DASHBOARD MINI CARDS
   ============================================ */
.mini-plant-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
}
.mini-plant-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mini-plant-avatar svg { width: 22px; height: 22px; color: var(--primary); }
.mini-plant-name { font-size: 14px; font-weight: 600; color: var(--on-surface); flex: 1; }
.mini-plant-info { font-size: 12px; color: var(--on-surface-low); }

.mini-task-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-1);
}
