/* ═══════════════════════════════════════════════════════════════
 * Brett Smart Irrigation - Global Theme Styles
 * Centralized design system for consistency across all pages
 * ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ────────────────────────────────────────────── */
:root {
  /* Color Palette - Nature-inspired greens */
  --forest:   #1B4332;   /* deep forest — trust, stability  */
  --canopy:   #2D6A4F;   /* mid-canopy — growth, confidence */
  --leaf:     #40916C;   /* fresh leaf — action, health     */
  --sprout:   #52B788;   /* sprout — success, progress      */
  --dew:      #95D5B2;   /* morning dew — lightness         */
  --mist:     #D8F3DC;   /* mist — very light accent        */
  
  /* Accent colors */
  --soil:     #6B4226;   /* warm soil — earthiness          */
  --wheat:    #DDA15E;   /* harvest gold — warmth           */
  --wheat-bg: #FDF3E3;
  --sky:      #1A6091;   /* deep water — calm, reliable     */
  --sky-bg:   #EBF5FB;
  --stream:   #2986BB;   /* flowing water — agility         */
  --rust:     #B05C1E;
  --rust-bg:  #FEF0E7;
  --plum:     #6B3FA0;
  --plum-bg:  #F5EEF8;
  
  /* Neutrals & backgrounds */
  --cream:    #F7F3EC;   /* natural bg — breathable         */
  --sand:     #EDE4D3;   /* soft sand — secondary bg        */
  --bark:     #2C1A0E;   /* dark text                       */
  --dark:     #1A1A1A;
  --muted:    #6B7280;   /* secondary text                  */
  --border:   rgba(27,67,50,.1);
  --white:    #FFFFFF;
  
  /* Status colors */
  --danger:   #C0392B;
  --danger-bg:#FDECEC;
  --warning:  #D97706;
  --success:  #059669;
  
  /* Border radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  
  /* Layout */
  --sidebar-w: 240px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 6px 24px rgba(0,0,0,.09);
  --shadow-lg: 0 24px 64px rgba(27,67,50,.2);
}

/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--bark);
  min-height: 100vh;
  display: flex;
}

/* ─── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--forest);
  display: flex; 
  flex-direction: column;
  position: fixed; 
  top: 0; 
  left: 0; 
  bottom: 0; 
  z-index: 200;
  overflow-y: auto;
  transition: transform .3s ease;
}

.sidebar-brand {
  display: flex; 
  align-items: center; 
  gap: .75rem;
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-brand-icon {
  width: 36px; 
  height: 36px; 
  border-radius: 9px;
  background: linear-gradient(135deg, var(--canopy), var(--sprout));
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1rem; 
  color: var(--white); 
  flex-shrink: 0;
}

.sidebar-brand-name { 
  font-weight: 700; 
  font-size: .88rem; 
  color: var(--white); 
  line-height: 1.3; 
}

.sidebar-brand-sub  { 
  font-size: .68rem; 
  color: rgba(255,255,255,.4); 
}

.sidebar-section-label {
  font-size: .65rem; 
  font-weight: 700; 
  letter-spacing: 1px;
  text-transform: uppercase; 
  color: rgba(255,255,255,.3);
  padding: 1.25rem 1.25rem .4rem;
}

.sidebar-nav { 
  padding: .25rem .75rem; 
  flex: 1; 
}

.nav-item {
  display: flex; 
  align-items: center; 
  gap: .75rem;
  padding: .7rem .75rem; 
  border-radius: var(--radius-sm);
  text-decoration: none; 
  color: rgba(255,255,255,.6);
  font-size: .85rem; 
  font-weight: 500;
  margin-bottom: .1rem;
  transition: background .2s, color .2s;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.1); 
  color: var(--white);
}

.nav-item.active { 
  background: rgba(82,183,136,.22); 
  color: var(--white); 
}

.nav-item i { 
  width: 18px; 
  text-align: center; 
  font-size: .9rem; 
  flex-shrink: 0; 
}

.nav-item .nav-badge {
  margin-left: auto; 
  background: var(--leaf); 
  color: var(--white);
  font-size: .65rem; 
  font-weight: 700;
  padding: .15rem .45rem; 
  border-radius: 100px;
}

.sidebar-user {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; 
  align-items: center; 
  gap: .75rem;
}

.sidebar-avatar {
  width: 36px; 
  height: 36px; 
  border-radius: 50%;
  background: linear-gradient(135deg, var(--leaf), var(--sprout));
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: var(--white); 
  font-size: .9rem; 
  flex-shrink: 0;
  font-weight: 600;
}

.sidebar-user-name  { 
  font-size: .82rem; 
  font-weight: 600; 
  color: var(--white); 
  line-height: 1.3; 
}

.sidebar-user-role  { 
  font-size: .7rem; 
  color: rgba(255,255,255,.4); 
}

.sidebar-logout {
  margin-left: auto; 
  color: rgba(255,255,255,.3);
  cursor: pointer; 
  font-size: .85rem;
  transition: color .2s;
  background: none;
  border: none;
}

.sidebar-logout:hover { 
  color: #F87171; 
}

/* ─── Main area ────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; 
  min-width: 0;
  display: flex; 
  flex-direction: column;
}

/* ─── Top bar ──────────────────────────────────────────────────── */
.topbar {
  background: rgba(247,243,236,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .9rem 2rem;
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 1rem;
  position: sticky; 
  top: 0; 
  z-index: 100;
}

.topbar-left h2 {
  font-family: 'Lora', serif;
  font-size: 1.2rem; 
  font-weight: 600; 
  color: var(--forest);
  letter-spacing: -.2px;
}

.topbar-left p { 
  font-size: .78rem; 
  color: var(--muted); 
  margin-top: .1rem; 
}

.topbar-right { 
  display: flex; 
  align-items: center; 
  gap: .75rem; 
}

.live-pill {
  display: flex; 
  align-items: center; 
  gap: .4rem;
  background: var(--mist); 
  border: 1px solid rgba(64,145,108,.2);
  color: var(--canopy); 
  font-size: .75rem; 
  font-weight: 600;
  padding: .3rem .75rem; 
  border-radius: 100px;
}

.live-dot {
  width: 7px; 
  height: 7px; 
  border-radius: 50%; 
  background: var(--leaf);
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink { 
  0%, 100% { opacity: 1; } 
  50% { opacity: .25; } 
}

.topbar-icon-btn {
  width: 36px; 
  height: 36px; 
  border-radius: 9px;
  background: var(--sand); 
  border: 1px solid var(--border);
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: .9rem; 
  color: var(--muted); 
  cursor: pointer;
  transition: background .2s, color .2s;
  text-decoration: none; 
  position: relative;
}

.topbar-icon-btn:hover { 
  background: var(--white); 
  color: var(--forest); 
}

.topbar-icon-btn .notif-dot {
  position: absolute; 
  top: 5px; 
  right: 5px;
  width: 7px; 
  height: 7px; 
  border-radius: 50%;
  background: var(--danger); 
  border: 1.5px solid var(--cream);
}

/* ─── Content ──────────────────────────────────────────────────── */
.content { 
  padding: 2rem; 
  flex: 1; 
}

/* ─── Quick-nav cards ───────────────────────────────────────────── */
.quicknav { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
  gap: 1rem; 
  margin-bottom: 2rem; 
}

.quicknav-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex; 
  align-items: center; 
  gap: 1rem;
  text-decoration: none; 
  color: var(--bark);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.quicknav-card:hover { 
  border-color: var(--leaf); 
  box-shadow: var(--shadow-md); 
  transform: translateY(-2px); 
}

.quicknav-icon {
  width: 40px; 
  height: 40px; 
  border-radius: 10px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1.1rem; 
  flex-shrink: 0;
}

.quicknav-icon.blue  { background: var(--sky-bg);   color: var(--sky); }
.quicknav-icon.green { background: var(--mist);     color: var(--canopy); }
.quicknav-icon.amber { background: var(--wheat-bg); color: var(--rust); }
.quicknav-icon.plum  { background: var(--plum-bg);  color: var(--plum); }

.quicknav-label { 
  font-size: .8rem; 
  font-weight: 600; 
  color: var(--forest); 
  line-height: 1.3; 
}

.quicknav-sub   { 
  font-size: .7rem; 
  color: var(--muted); 
}

/* ─── Section titles ────────────────────────────────────────────── */
.section-head {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  margin-bottom: 1rem; 
  flex-wrap: wrap; 
  gap: .5rem;
}

.section-head h3 {
  font-size: .95rem; 
  font-weight: 700; 
  color: var(--forest);
  display: flex; 
  align-items: center; 
  gap: .5rem;
}

.section-head h3 i { 
  color: var(--leaf); 
}

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn-sm-outline {
  display: inline-flex; 
  align-items: center; 
  gap: .35rem;
  border: 1.5px solid var(--border); 
  color: var(--muted);
  background: var(--white); 
  border-radius: var(--radius-sm);
  font-size: .78rem; 
  font-weight: 600; 
  padding: .35rem .8rem;
  text-decoration: none; 
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.btn-sm-outline:hover { 
  border-color: var(--leaf); 
  color: var(--forest); 
}

.btn-primary {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: .6rem;
  padding: .95rem 1.5rem;
  background: linear-gradient(135deg, var(--leaf) 0%, var(--sprout) 100%);
  color: var(--white); 
  border: none; 
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: .95rem; 
  font-weight: 700; 
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(64,145,108,.35);
  transition: opacity .2s, transform .15s, box-shadow .2s;
  text-decoration: none;
  margin-top: 1em;
  margin-bottom: 1em;
}

.btn-primary:hover { 
  opacity: .92; 
  transform: translateY(-1px); 
  box-shadow: 0 6px 24px rgba(64,145,108,.45); 
  color: var(--white);
}

.btn-primary:active { 
  transform: translateY(0); 
}

.btn-danger {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  background: var(--danger);
  color: var(--white); 
  border: none; 
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: .85rem; 
  font-weight: 600; 
  cursor: pointer;
  transition: background .2s, transform .15s;
  text-decoration: none;
}

.btn-danger:hover { 
  background: #A93226;
  transform: translateY(-1px);
  color: var(--white);
}

/* ─── Stat Cards ────────────────────────────────────────────────── */
.stat-row { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
  gap: 1rem; 
  margin-bottom: 1.5rem; 
}

.stat-card {
  background: var(--white); 
  border: 1px solid var(--border);
  border-radius: var(--radius-md); 
  padding: 1.1rem 1.25rem;
  display: flex; 
  align-items: center; 
  gap: 1rem;
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 42px; 
  height: 42px; 
  border-radius: 10px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1.1rem; 
  flex-shrink: 0;
}

.stat-icon.green { 
  background: var(--mist); 
  color: var(--canopy); 
}

.stat-icon.red { 
  background: var(--danger-bg); 
  color: var(--danger); 
}

.stat-icon.amber { 
  background: var(--warning-bg); 
  color: var(--warning); 
}

.stat-icon.blue { 
  background: var(--sky-bg); 
  color: var(--sky); 
}

.stat-value { 
  font-size: 1.5rem; 
  font-weight: 800; 
  color: var(--forest); 
  letter-spacing: -1px; 
  line-height: 1;
}

.stat-label { 
  font-size: .72rem; 
  color: var(--muted); 
  font-weight: 500; 
  margin-top: .2rem;
}

/* ─── Sensor Group Section ─────────────────────────────────────── */
.group-block { 
  margin-bottom: 2.25rem; 
}

.group-title-row {
  display: flex; 
  align-items: center; 
  gap: .75rem; 
  margin-bottom: 1rem;
}

.group-title {
  font-size: .9rem; 
  font-weight: 700; 
  color: var(--forest);
}

.group-badge {
  font-size: .7rem; 
  font-weight: 600;
  background: var(--mist); 
  color: var(--canopy);
  padding: .2rem .6rem; 
  border-radius: 100px;
}

.group-divider { 
  flex: 1; 
  height: 1px; 
  background: var(--border); 
}

/* ─── Metric cards ─────────────────────────────────────────────── */
.metric-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 1rem; 
}

.metric-card {
  border-radius: var(--radius-md); 
  padding: 1.5rem 1.5rem 1.2rem;
  position: relative; 
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  cursor: default;
}

.metric-card:hover { 
  transform: translateY(-3px); 
  box-shadow: var(--shadow-md); 
}

.metric-card.moisture { background: linear-gradient(145deg, #1A3F6E 0%, #2986BB 100%); }
.metric-card.temp     { background: linear-gradient(145deg, #7D3000 0%, #E07020 100%); }
.metric-card.humidity { background: linear-gradient(145deg, #1B4332 0%, #40916C 100%); }
.metric-card.battery  { background: linear-gradient(145deg, #4A1E78 0%, #9B59B6 100%); }
.metric-card.flow     { background: linear-gradient(145deg, #1A6091 0%, #48BDED 100%); }

/* watermark icon */
.metric-card::after {
  content: attr(data-icon);
  font-family: 'Font Awesome 6 Free'; 
  font-weight: 900;
  position: absolute; 
  right: 1.25rem; 
  top: 1rem;
  font-size: 3rem; 
  color: rgba(255,255,255,.12);
  pointer-events: none;
}

.metric-tag { 
  font-size: .72rem; 
  font-weight: 600; 
  color: rgba(255,255,255,.6); 
  margin-bottom: .4rem; 
  text-transform: uppercase; 
  letter-spacing: .5px; 
}

.metric-value { 
  font-size: 2.2rem; 
  font-weight: 800; 
  color: var(--white); 
  letter-spacing: -1.5px; 
  line-height: 1; 
  margin-bottom: .35rem; 
}

.metric-range { 
  font-size: .72rem; 
  color: rgba(255,255,255,.55); 
  margin-bottom: .75rem; 
}

.metric-status-badge {
  display: inline-flex; 
  align-items: center; 
  gap: .35rem;
  font-size: .72rem; 
  font-weight: 700; 
  padding: .25rem .65rem; 
  border-radius: 100px;
}

.metric-status-badge.ok       { background: rgba(255,255,255,.2); color: var(--white); }
.metric-status-badge.warning  { background: rgba(253,186,85,.3);  color: #FDE68A; }
.metric-status-badge.critical { background: rgba(248,113,113,.3); color: #FCA5A5; }

.metric-sensor { 
  font-size: .7rem; 
  color: rgba(255,255,255,.4); 
  margin-top: .65rem; 
}

/* progress bar */
.metric-bar {
  height: 4px; 
  background: rgba(255,255,255,.15); 
  border-radius: 2px;
  margin-top: .8rem; 
  overflow: hidden;
}

.metric-bar-fill { 
  height: 100%; 
  background: rgba(255,255,255,.55); 
  border-radius: 2px; 
  transition: width .5s ease; 
}

/* ─── Controls Panel ────────────────────────────────────────────── */
.controls-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
  gap: 1rem; 
}

.control-card {
  background: var(--white); 
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  padding: 1.25rem;
  display: flex; 
  align-items: center; 
  gap: 1rem;
  transition: border-color .2s, box-shadow .2s;
}

.control-card:hover { 
  border-color: rgba(64,145,108,.3); 
  box-shadow: var(--shadow-sm); 
}

.control-icon {
  width: 44px; 
  height: 44px; 
  border-radius: 11px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1.1rem; 
  flex-shrink: 0;
}

.control-icon.blue  { background: var(--sky-bg);   color: var(--sky); }
.control-icon.green { background: var(--mist);     color: var(--canopy); }
.control-icon.amber { background: var(--wheat-bg); color: var(--rust); }
.control-icon.teal  { background: #E8F8F5; color: #148A7A; }

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

.control-name { 
  font-size: .85rem; 
  font-weight: 600; 
  color: var(--forest); 
}

.control-sub  { 
  font-size: .72rem; 
  color: var(--muted); 
}

.control-stat { 
  font-size: .7rem; 
  color: var(--leaf); 
  font-weight: 600; 
  margin-top: .2rem; 
}

/* toggle switch */
.toggle { 
  position: relative; 
  display: inline-block; 
  width: 40px; 
  height: 22px; 
  flex-shrink: 0; 
}

.toggle input { 
  opacity: 0; 
  width: 0; 
  height: 0; 
}

.toggle-slider {
  position: absolute; 
  inset: 0;
  background: #CBD5E1; 
  border-radius: 100px;
  cursor: pointer; 
  transition: background .2s;
}

.toggle-slider::before {
  content: ''; 
  position: absolute;
  width: 16px; 
  height: 16px; 
  border-radius: 50%;
  background: var(--white); 
  left: 3px; 
  top: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle input:checked + .toggle-slider { 
  background: var(--leaf); 
}

.toggle input:checked + .toggle-slider::before { 
  transform: translateX(18px); 
}

/* ─── Alerts ────────────────────────────────────────────────────── */
.alerts-list { 
  display: flex; 
  flex-direction: column; 
  gap: .65rem; 
}

.alert-item {
  display: flex; 
  align-items: flex-start; 
  gap: .85rem;
  background: var(--white); 
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); 
  padding: .9rem 1rem;
  border-left: 3px solid transparent;
  transition: box-shadow .2s;
}

.alert-item:hover { 
  box-shadow: var(--shadow-sm); 
}

.alert-item.critical { border-left-color: var(--danger); }
.alert-item.warning  { border-left-color: var(--warning); }
.alert-item.info     { border-left-color: var(--leaf); }

.alert-dot {
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  flex-shrink: 0; 
  margin-top: 4px;
}

.alert-dot.critical { background: var(--danger); }
.alert-dot.warning  { background: var(--warning); }
.alert-dot.info     { background: var(--leaf); }

.alert-text { 
  flex: 1; 
}

.alert-title { 
  font-size: .82rem; 
  font-weight: 600; 
  color: var(--dark); 
}

.alert-sub   { 
  font-size: .72rem; 
  color: var(--muted); 
  margin-top: .1rem; 
}

.alert-time  { 
  font-size: .7rem; 
  color: var(--muted); 
  flex-shrink: 0; 
  white-space: nowrap; 
}

/* ─── Two-column layout ─────────────────────────────────────────── */
.two-col { 
  display: grid; 
  grid-template-columns: 1fr 320px; 
  gap: 1.5rem; 
  margin-top: 1.5rem; 
}

@media (max-width: 1100px) { 
  .two-col { 
    grid-template-columns: 1fr; 
  } 
}

/* ─── Widget cards ─────────────────────────────────────────────── */
.widget-card {
  background: var(--white); 
  border: 1px solid var(--border);
  border-radius: var(--radius-md); 
  padding: 1.25rem;
}

.widget-card + .widget-card { 
  margin-top: 1rem; 
}

.widget-title {
  font-size: .82rem; 
  font-weight: 700; 
  color: var(--forest);
  display: flex; 
  align-items: center; 
  gap: .5rem; 
  margin-bottom: 1rem;
}

.widget-title i { 
  color: var(--leaf); 
}

/* system health bars */
.health-item { 
  margin-bottom: .85rem; 
}

.health-label-row { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: .35rem; 
}

.health-label { 
  font-size: .78rem; 
  font-weight: 500; 
  color: var(--dark); 
}

.health-pct   { 
  font-size: .75rem; 
  font-weight: 700; 
  color: var(--forest); 
}

.health-bar { 
  height: 6px; 
  background: var(--sand); 
  border-radius: 3px; 
  overflow: hidden; 
}

.health-bar-fill { 
  height: 100%; 
  border-radius: 3px; 
  transition: width .5s; 
}

.health-bar-fill.green { background: linear-gradient(90deg, var(--leaf), var(--sprout)); }
.health-bar-fill.amber { background: linear-gradient(90deg, #D97706, #F59E0B); }
.health-bar-fill.red   { background: linear-gradient(90deg, var(--danger), #EF4444); }

/* sensor summary list */
.sensor-summary-list { 
  display: flex; 
  flex-direction: column; 
  gap: .5rem; 
}

.sensor-summary-item {
  display: flex; 
  align-items: center; 
  gap: .75rem;
  padding: .5rem .65rem; 
  border-radius: 8px;
  background: var(--cream);
}

.sensor-state-dot { 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  flex-shrink: 0; 
}

.sensor-state-dot.active   { background: var(--success); }
.sensor-state-dot.warning  { background: var(--warning); }
.sensor-state-dot.inactive { background: var(--muted); }

.sensor-id   { 
  font-size: .78rem; 
  font-weight: 600; 
  color: var(--forest); 
  flex: 1; 
}

.sensor-last { 
  font-size: .7rem; 
  color: var(--muted); 
}

/* ─── Hamburger (mobile) ───────────────────────────────────────── */
.hamburger {
  display: none; 
  align-items: center; 
  justify-content: center;
  width: 36px; 
  height: 36px; 
  border-radius: 9px;
  background: var(--sand); 
  border: 1px solid var(--border);
  cursor: pointer; 
  color: var(--muted); 
  font-size: 1rem;
}

.hamburger:hover { 
  background: var(--white); 
  color: var(--forest); 
}

.sidebar-overlay {
  display: none; 
  position: fixed; 
  inset: 0;
  background: rgba(0,0,0,.4); 
  z-index: 199;
}

.sidebar-overlay.open { 
  display: block; 
}

/* ─── Login/Auth Pages ─────────────────────────────────────────── */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.left-panel {
  background: var(--forest);
  display: flex; 
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  position: relative; 
  overflow: hidden;
}

/* organic leaf pattern */
.left-panel::before {
  content: '';
  position: absolute; 
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 110% 20%, rgba(82,183,136,.2) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at -10% 80%, rgba(64,145,108,.15) 0%, transparent 60%);
  pointer-events: none;
}

.left-blob {
  position: absolute; 
  border-radius: 50%; 
  pointer-events: none;
}

.left-blob-1 {
  width: 320px; 
  height: 320px;
  bottom: -80px; 
  right: -80px;
  background: radial-gradient(circle, rgba(82,183,136,.18), transparent 70%);
}

.left-blob-2 {
  width: 180px; 
  height: 180px;
  top: 4rem; 
  right: 2rem;
  background: radial-gradient(circle, rgba(149,213,178,.1), transparent 70%);
}

.left-brand {
  display: flex; 
  align-items: center; 
  gap: .75rem;
  position: relative; 
  z-index: 2;
}

.brand-icon {
  width: 44px; 
  height: 44px; 
  border-radius: 12px;
  background: linear-gradient(135deg, var(--canopy), var(--sprout));
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1.25rem; 
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.brand-name { 
  font-weight: 700; 
  color: var(--white); 
  font-size: 1rem; 
}

.brand-sub  { 
  font-size: .7rem; 
  color: rgba(255,255,255,.5); 
  display: block; 
}

.left-middle { 
  position: relative; 
  z-index: 2; 
}

.left-quote {
  font-family: 'Lora', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500; 
  color: var(--white);
  line-height: 1.35; 
  letter-spacing: -.2px;
  margin-bottom: 1.5rem;
}

.left-quote span { 
  color: var(--sprout); 
}

.left-quote-sub {
  color: rgba(255,255,255,.5); 
  font-size: .9rem; 
  line-height: 1.6;
  max-width: 380px;
}

/* live sensor preview pills */
.sensor-pills {
  display: flex; 
  flex-direction: column; 
  gap: .75rem;
  margin-top: 2rem;
}

.sensor-pill {
  display: flex; 
  align-items: center; 
  gap: 1rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 100px; 
  padding: .65rem 1.25rem;
  color: var(--white);
}

.pill-dot {
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  flex-shrink: 0;
  animation: blink 2s ease-in-out infinite;
}

.pill-dot.green  { background: var(--sprout); }
.pill-dot.amber  { background: var(--wheat); }
.pill-dot.blue   { background: #5BB8F5; }

.pill-label { 
  font-size: .8rem; 
  flex: 1; 
  color: rgba(255,255,255,.7); 
}

.pill-value { 
  font-weight: 700; 
  font-size: .85rem; 
  color: var(--white); 
}

.left-footer {
  position: relative; 
  z-index: 2;
  font-size: .75rem; 
  color: rgba(255,255,255,.3);
}

/* ─── Right Panel (Login Form) ──────────────────────────────────── */
.right-panel {
  display: flex; 
  align-items: center; 
  justify-content: center;
  padding: 3rem 2rem;
  background: var(--cream);
}

.login-card {
  width: 100%; 
  max-width: 420px;
}

.login-header { 
  margin-bottom: 2.25rem; 
}

.login-header h1 {
  font-family: 'Lora', serif;
  font-size: 1.85rem; 
  font-weight: 600;
  color: var(--forest); 
  letter-spacing: -.3px;
  margin-bottom: .4rem;
}

.login-header p { 
  color: var(--muted); 
  font-size: .9rem; 
  line-height: 1.55; 
}

/* form elements */
.form-group { 
  margin-bottom: 1.25rem; 
}

.form-label {
  display: block; 
  font-size: .82rem; 
  font-weight: 600;
  color: var(--bark); 
  margin-bottom: .5rem; 
  letter-spacing: .1px;
}

.form-input-wrap { 
  position: relative; 
}

.form-input-icon {
  position: absolute; 
  left: 1rem; 
  top: 50%; 
  transform: translateY(-50%);
  color: var(--muted); 
  font-size: .9rem; 
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: .825rem 1rem .825rem 2.75rem;
  background: var(--white);
  border: 1.5px solid rgba(27,67,50,.12);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: .9rem; 
  color: var(--bark);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form-input::placeholder { 
  color: rgba(107,114,128,.55); 
}

.form-input:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(64,145,108,.12);
}

/* Form Validation Styles */
.form-input.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
}

.form-input.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220,53,69,.12);
}

.error-message {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #dc3545;
}

/* password toggle */
.pw-toggle {
  position: absolute; 
  right: 1rem; 
  top: 50%; 
  transform: translateY(-50%);
  background: none; 
  border: none; 
  cursor: pointer;
  color: var(--muted); 
  font-size: .9rem; 
  padding: .2rem;
  transition: color .2s;
}

.pw-toggle:hover { 
  color: var(--forest); 
}

/* remember + forgot row */
.form-meta {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.form-check {
  display: flex; 
  align-items: center; 
  gap: .5rem;
  font-size: .82rem; 
  color: var(--muted); 
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 15px; 
  height: 15px; 
  accent-color: var(--leaf); 
  cursor: pointer;
}

.form-forgot {
  font-size: .82rem; 
  color: var(--leaf); 
  text-decoration: none; 
  font-weight: 500;
}

.form-forgot:hover { 
  color: var(--forest); 
  text-decoration: underline; 
}

/* submit button */
.btn-submit {
  width: 100%; 
  padding: .95rem;
  background: linear-gradient(135deg, var(--leaf) 0%, var(--sprout) 100%);
  color: var(--white); 
  border: none; 
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: .95rem; 
  font-weight: 700; 
  letter-spacing: .2px;
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: .6rem;
  box-shadow: 0 4px 16px rgba(64,145,108,.35);
  transition: opacity .2s, transform .15s, box-shadow .2s;
}

.btn-submit:hover { 
  opacity: .92; 
  transform: translateY(-1px); 
  box-shadow: 0 6px 24px rgba(64,145,108,.45); 
}

.btn-submit:active { 
  transform: translateY(0); 
}

/* divider */
.divider {
  display: flex; 
  align-items: center; 
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--muted); 
  font-size: .78rem;
}

.divider::before, .divider::after {
  content: ''; 
  flex: 1; 
  height: 1px; 
  background: rgba(27,67,50,.1);
}

/* back link */
.back-link {
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: .4rem;
  color: var(--muted); 
  font-size: .82rem; 
  text-decoration: none; 
  margin-top: 1.5rem;
}

.back-link:hover { 
  color: var(--forest); 
}

/* error / info messages */
.msg {
  border-radius: var(--radius-sm);
  padding: .85rem 1rem; 
  font-size: .82rem; 
  line-height: 1.5;
  display: flex; 
  align-items: flex-start; 
  gap: .65rem;
  margin-bottom: 1.25rem;
}

.msg.info {
  background: var(--mist);
  border: 1px solid rgba(64,145,108,.2);
  color: var(--canopy);
}

.msg.error {
  background: var(--danger-bg);
  border: 1px solid rgba(192,57,43,.2);
  color: var(--danger);
}

.msg.success {
  background: var(--mist);
  border: 1px solid rgba(64,145,108,.2);
  color: var(--canopy);
}

.msg i {
  flex-shrink: 0; 
  margin-top: 2px;
}

/* ─── Tables ───────────────────────────────────────────────────── */
.table-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.data-table thead {
  background: var(--sand);
  border-bottom: 2px solid var(--border);
}

.data-table th {
  padding: .85rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: .78rem;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.data-table tbody tr:hover {
  background: var(--cream);
}

.data-table td {
  padding: .9rem 1rem;
  color: var(--bark);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 100px;
}

.status-badge.active   { background: var(--mist); color: var(--canopy); }
.status-badge.warning  { background: var(--wheat-bg); color: var(--rust); }
.status-badge.inactive { background: var(--sand); color: var(--muted); }
.status-badge.critical { background: var(--danger-bg); color: var(--danger); }

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main { 
    margin-left: 0; 
  }
  
  .sidebar { 
    transform: translateX(-100%); 
  }
  
  .sidebar.open { 
    transform: none; 
  }
  
  .hamburger { 
    display: flex; 
  }
  
  .two-col { 
    grid-template-columns: 1fr; 
  }
  
  .auth-layout {
    grid-template-columns: 1fr;
  }
  
  .left-panel {
    min-height: 40vh;
    padding: 2rem;
  }
  
  .left-quote {
    font-size: 1.4rem;
  }
  
  .sensor-pills {
    display: none;
  }
}

@media (max-width: 640px) {
  .content { 
    padding: 1rem; 
  }
  
  .topbar { 
    padding: .8rem 1rem; 
  }
  
  .metric-grid { 
    grid-template-columns: 1fr 1fr; 
  }
  
  .controls-grid { 
    grid-template-columns: 1fr; 
  }
  
  .right-panel {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 380px) {
  .metric-grid { 
    grid-template-columns: 1fr; 
  }
}

/* ─── Utilities ────────────────────────────────────────────────── */
.text-forest { color: var(--forest); }
.text-leaf { color: var(--leaf); }
.text-muted { color: var(--muted); }
.bg-cream { background: var(--cream); }
.bg-white { background: var(--white); }

/* ─── Filter Bar ──────────────────────────────────────────────── */
.filter-bar {
  background: var(--white); 
  border: 1px solid var(--border);
  border-radius: var(--radius-md); 
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex; 
  align-items: flex-end; 
  gap: .75rem; 
  flex-wrap: wrap;
}
.filter-group { 
  display: flex; 
  flex-direction: column; 
  gap: .35rem; 
  flex: 1; 
  min-width: 140px; 
}
.filter-label { 
  font-size: .72rem; 
  font-weight: 600; 
  color: var(--bark); 
  letter-spacing: .1px; 
}
.filter-input, .filter-select {
  padding: .6rem .9rem; 
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); 
  font-family: 'Inter', sans-serif;
  font-size: .85rem; 
  color: var(--bark); 
  background: var(--cream);
  outline: none; 
  transition: border-color .2s, box-shadow .2s;
}
.filter-input:focus, .filter-select:focus {
  border-color: var(--leaf); 
  box-shadow: 0 0 0 3px rgba(64,145,108,.1);
  background: var(--white);
}
.filter-input::placeholder { color: rgba(107,114,128,.5); }
.filter-actions { 
  display: flex; 
  gap: .5rem; 
  align-items: flex-end; 
}
.btn-filter {
  display: inline-flex; 
  align-items: center; 
  gap: .4rem;
  padding: .6rem 1.1rem; 
  border-radius: var(--radius-sm);
  font-size: .82rem; 
  font-weight: 600; 
  cursor: pointer; 
  border: none;
  transition: background .2s, color .2s;
}
.btn-filter.apply { 
  background: var(--leaf); 
  color: var(--white); 
}
.btn-filter.apply:hover { 
  background: var(--canopy); 
}
.btn-filter.reset { 
  background: var(--sand); 
  color: var(--muted); 
  border: 1px solid var(--border); 
}
.btn-filter.reset:hover { 
  background: var(--white); 
  color: var(--forest); 
}

/* ─── Table Card ──────────────────────────────────────────────── */
.table-card {
  background: var(--white); 
  border: 1px solid var(--border);
  border-radius: var(--radius-md); 
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-card-header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--forest); 
  color: var(--white);
  flex-wrap: wrap; 
  gap: .5rem;
}
.table-card-header h2 {
  font-size: .9rem; 
  font-weight: 700;
  display: flex; 
  align-items: center; 
  gap: .5rem;
  margin: 0;
}
.table-card-header .record-count {
  font-size: .75rem; 
  background: rgba(255,255,255,.15);
  padding: .25rem .7rem; 
  border-radius: 100px;
  color: rgba(255,255,255,.85);
}

/* ─── Table ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--cream); 
  font-size: .75rem; 
  font-weight: 700;
  color: var(--muted); 
  text-transform: uppercase; 
  letter-spacing: .7px;
  padding: .75rem 1.1rem; 
  border-bottom: 1px solid var(--border);
  white-space: nowrap; 
  text-align: left;
}
thead th.sortable { 
  cursor: pointer; 
  user-select: none; 
}
thead th.sortable:hover { 
  color: var(--forest); 
}
thead th .sort-icon { 
  margin-left: .3rem; 
  opacity: .4; 
  font-size: .65rem; 
}
thead th.sorted .sort-icon { 
  opacity: 1; 
  color: var(--leaf); 
}

tbody tr { 
  border-bottom: 1px solid rgba(27,67,50,.05); 
  transition: background .15s; 
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(27,67,50,.025); }

tbody td {
  padding: .85rem 1.1rem; 
  font-size: .85rem; 
  color: var(--dark);
  vertical-align: middle;
}
td.mono { 
  font-family: 'SF Mono', 'Fira Code', monospace; 
  font-size: .8rem; 
  color: var(--canopy); 
  font-weight: 600; 
}

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; 
  align-items: center; 
  gap: .25rem;
  font-size: .72rem; 
  font-weight: 700; 
  padding: .25rem .65rem;
  border-radius: 100px;
}
.badge::before { 
  content: ''; 
  width: 6px; 
  height: 6px; 
  border-radius: 50%; 
}
.badge.active   { 
  background: var(--success-bg); 
  color: var(--success); 
}
.badge.active::before { background: var(--success); }
.badge.inactive { 
  background: var(--sand); 
  color: var(--muted); 
}
.badge.inactive::before { background: var(--muted); }
.badge.warning  { 
  background: var(--warning-bg); 
  color: var(--warning); 
}
.badge.warning::before { background: var(--warning); }
.badge.danger { 
  background: var(--danger-bg); 
  color: var(--danger); 
}
.badge.danger::before { background: var(--danger); }

/* ─── Group Pill ──────────────────────────────────────────────── */
.group-pill {
  display: inline-flex; 
  align-items: center; 
  gap: .3rem;
  background: var(--mist); 
  color: var(--canopy);
  font-size: .75rem; 
  font-weight: 600; 
  padding: .2rem .65rem;
  border-radius: 100px;
}
.group-pill i { font-size: .6rem; }

/* ─── Action Buttons ──────────────────────────────────────────── */
.action-btn {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  width: 30px; 
  height: 30px; 
  border-radius: 7px;
  border: 1.5px solid var(--border); 
  background: var(--white);
  font-size: .8rem; 
  color: var(--muted); 
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  text-decoration: none;
}
.action-btn:hover.edit   { 
  background: var(--sky-bg);   
  color: var(--sky);    
  border-color: rgba(26,96,145,.25); 
}
.action-btn:hover.delete { 
  background: var(--danger-bg); 
  color: var(--danger); 
  border-color: rgba(192,57,43,.25); 
}
.action-btn.edit:hover   { 
  background: var(--sky-bg);   
  color: var(--sky);    
  border-color: rgba(26,96,145,.25); 
}
.action-btn.delete:hover { 
  background: var(--danger-bg); 
  color: var(--danger); 
  border-color: rgba(192,57,43,.25); 
}

/* ─── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; 
  padding: 3.5rem 1rem; 
  color: var(--muted);
}
.empty-state i { 
  font-size: 2.5rem; 
  color: var(--dew); 
  margin-bottom: 1rem; 
  display: block; 
}
.empty-state p { font-size: .9rem; }

/* ─── Notification Items ──────────────────────────────────────── */
.notification-item {
  display: flex;
  align-items: start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item.unread {
  background: var(--mist);
}

.notification-item:hover {
  background: rgba(149,213,178,.08);
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

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

.notification-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: .35rem;
}

.notification-sensor {
  font-weight: 400;
  color: var(--muted);
  font-size: .85rem;
  font-family: 'Monaco', 'Courier New', monospace;
}

.notification-details {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .25rem;
}

.notification-details strong {
  color: var(--forest);
  font-weight: 700;
}

.notification-time {
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.notification-time i {
  font-size: .7rem;
}

.notification-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
  flex-shrink: 0;
}

.notification-age {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ─── Pagination ──────────────────────────────────────────────── */
.pagination-row {
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  flex-wrap: wrap; 
  gap: 1rem;
  padding: .9rem 1.25rem; 
  border-top: 1px solid var(--border);
  font-size: .8rem; 
  color: var(--muted);
}
.pagination { 
  display: flex; 
  gap: .35rem; 
  flex-wrap: wrap; 
}
.page-btn {
  display: flex; 
  align-items: center; 
  justify-content: center;
  min-width: 32px; 
  height: 32px; 
  padding: 0 .5rem;
  border-radius: 7px; 
  border: 1.5px solid var(--border);
  background: var(--white); 
  color: var(--muted);
  font-size: .8rem; 
  font-weight: 600; 
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  text-decoration: none;
}
.page-btn:hover      { 
  background: var(--mist); 
  border-color: rgba(64,145,108,.3); 
  color: var(--forest); 
}
.page-btn.active     { 
  background: var(--forest); 
  border-color: var(--forest); 
  color: var(--white); 
}
.page-btn.disabled   { 
  opacity: .4; 
  pointer-events: none; 
}

/* Per-page select */
.per-page-wrap { 
  display: flex; 
  align-items: center; 
  gap: .5rem; 
}
.per-page-select {
  padding: .3rem .6rem; 
  border: 1.5px solid var(--border);
  border-radius: 6px; 
  font-size: .78rem; 
  color: var(--bark);
  background: var(--white); 
  outline: none; 
  cursor: pointer;
}
.per-page-select:focus { border-color: var(--leaf); }

/* ─── Settings Hub ────────────────────────────────────────────── */
.settings-hub { 
  max-width: 900px; 
  margin: 0 auto; 
}
.settings-narrow { 
  max-width: 680px; 
}
.settings-stack { 
  display: flex; 
  flex-direction: column; 
  gap: 1rem; 
}
.settings-card {
  display: flex; 
  align-items: center; 
  gap: 1.25rem;
  background: var(--white); 
  border: 1px solid var(--border);
  border-radius: var(--radius-md); 
  padding: 1.5rem;
  text-decoration: none; 
  color: var(--bark);
  transition: all .2s;
  box-shadow: var(--shadow-sm);
}
.settings-card:hover { 
  transform: translateY(-2px); 
  box-shadow: var(--shadow-md);
  border-color: var(--leaf);
}
.settings-icon {
  width: 52px; 
  height: 52px; 
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--leaf), var(--sprout));
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1.3rem; 
  color: var(--white);
  flex-shrink: 0;
}
.settings-body { flex: 1; }
.settings-title { 
  font-size: 1rem; 
  font-weight: 700; 
  color: var(--forest); 
  margin-bottom: .3rem; 
}
.settings-desc { 
  font-size: .82rem; 
  color: var(--muted); 
  line-height: 1.5; 
}

.settings-form-body {
  padding: 1.25rem;
  background: var(--white);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: .5rem;
}

/* ─── Forms ───────────────────────────────────────────────────── */
.form-group { 
  margin-bottom: 1.25rem; 
}
.form-label { 
  display: block; 
  font-size: .82rem; 
  font-weight: 600; 
  color: var(--bark); 
  margin-bottom: .4rem; 
}
.form-input, .form-select, .form-textarea {
  width: 100%; 
  padding: .7rem .9rem; 
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); 
  font-family: 'Inter', sans-serif;
  font-size: .85rem; 
  color: var(--bark); 
  background: var(--cream);
  outline: none; 
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-textarea { 
  resize: vertical; 
  min-height: 100px; 
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--leaf); 
  box-shadow: 0 0 0 3px rgba(64,145,108,.1);
  background: var(--white);
}
.form-input::placeholder, .form-textarea::placeholder { 
  color: rgba(107,114,128,.5); 
}
.form-help { 
  font-size: .75rem; 
  color: var(--muted); 
  margin-top: .3rem; 
}
.form-switch {
  display: flex; 
  align-items: center; 
  gap: .75rem;
  cursor: pointer;
}
.form-switch input[type="checkbox"] {
  width: 44px; 
  height: 24px; 
  appearance: none;
  background: var(--sand); 
  border: 1.5px solid var(--border);
  border-radius: 100px; 
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.form-switch input[type="checkbox"]::before {
  content: ''; 
  position: absolute; 
  width: 18px; 
  height: 18px;
  background: var(--white); 
  border-radius: 50%; 
  top: 2px; 
  left: 2px;
  transition: transform .2s, background .2s;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.form-switch input[type="checkbox"]:checked {
  background: var(--leaf);
  border-color: var(--leaf);
}
.form-switch input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}
.form-switch-label { 
  font-size: .85rem; 
  color: var(--bark); 
  font-weight: 500; 
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.toggle-switch input[type="checkbox"] {
  width: 48px;
  height: 26px;
  appearance: none;
  background: var(--sand);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.toggle-switch input[type="checkbox"]:checked {
  background: var(--leaf);
  border-color: var(--leaf);
}

.toggle-switch .toggle-slider {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform .2s;
  box-shadow: 0 2px 4px rgba(0,0,0,.12);
  pointer-events: none;
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-slider {
  transform: translateX(22px);
}

.btn-submit {
  display: inline-flex; 
  align-items: center; 
  gap: .5rem;
  background: var(--forest); 
  color: var(--white);
  padding: .75rem 1.75rem; 
  border-radius: var(--radius-sm);
  font-size: .9rem; 
  font-weight: 600; 
  border: none; 
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .2s, transform .15s;
}
.btn-submit:hover { 
  background: var(--canopy); 
  transform: translateY(-1px); 
}

.btn-secondary {
  display: inline-flex; 
  align-items: center; 
  gap: .5rem;
  background: var(--sand); 
  color: var(--forest);
  padding: .75rem 1.75rem; 
  border-radius: var(--radius-sm);
  font-size: .9rem; 
  font-weight: 600; 
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
  margin-top: 1em;
  margin-bottom: 1em;
}
.btn-secondary:hover { 
  background: var(--white); 
  color: var(--forest);
}

/* ─── Profile Page ────────────────────────────────────────────── */
.profile-container {
  max-width: 900px; 
  margin: 0 auto;
}
.profile-card {
  background: var(--white); 
  border: 1px solid var(--border);
  border-radius: var(--radius-md); 
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.profile-header {
  background: linear-gradient(135deg, var(--forest), var(--canopy));
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--white);
}
.profile-avatar-large {
  width: 100px; 
  height: 100px; 
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 2.5rem; 
  color: var(--white);
  margin: 0 auto 1rem;
  border: 4px solid rgba(255,255,255,.2);
  font-weight: 700;
}
.profile-name { 
  font-size: 1.5rem; 
  font-weight: 700; 
  margin-bottom: .3rem; 
}
.profile-email { 
  font-size: .85rem; 
  opacity: .7; 
}
.profile-body {
  padding: 2rem 1.5rem;
}
.profile-section {
  margin-bottom: 2rem;
}
.profile-section:last-child {
  margin-bottom: 0;
}
.profile-section-title {
  font-size: 1rem; 
  font-weight: 700; 
  color: var(--forest); 
  margin-bottom: 1rem;
  display: flex; 
  align-items: center; 
  gap: .5rem;
}
.profile-section-title i {
  color: var(--leaf);
}
