/* ==========================================================================
   UG Solar Monitor — frosted glass theme on Bootstrap 5.3
   ========================================================================== */

:root {
  --brand-300: #fcd34d;
  --brand-400: #fbbf24;
  --brand-500: #f59e0b;
  --brand-600: #ea580c;
  --brand-grad: linear-gradient(135deg, #fbbf24 0%, #f59e0b 45%, #ea580c 100%);
  --brand-glow: 0 10px 30px -10px rgba(245, 158, 11, 0.55);

  --canvas: #f6f7fb;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --hairline: rgba(15, 23, 42, 0.07);

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.12);

  --sidebar-bg: linear-gradient(180deg, #0b1120 0%, #111a2e 100%);
  --sidebar-text: #94a3b8;
  --sidebar-hover: rgba(255, 255, 255, 0.05);

  --blob-1: rgba(251, 191, 36, 0.22);
  --blob-2: rgba(56, 189, 248, 0.16);
  --blob-3: rgba(244, 114, 182, 0.10);

  --radius-xl: 1.25rem;
  --radius-lg: 1rem;
  --radius-md: 0.75rem;

  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --bs-body-font-family: var(--font-sans);
  --bs-primary: #f59e0b;
  --bs-primary-rgb: 245, 158, 11;
  --bs-link-color: #d97706;
  --bs-link-color-rgb: 217, 119, 6;
  --bs-link-hover-color: #b45309;
}

[data-bs-theme="dark"] {
  --canvas: #060a14;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #8b9ab0;
  --hairline: rgba(148, 163, 184, 0.12);

  --glass-bg: rgba(15, 23, 42, 0.62);
  --glass-strong: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(148, 163, 184, 0.12);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);

  --sidebar-bg: linear-gradient(180deg, #050810 0%, #0a1020 100%);

  --blob-1: rgba(245, 158, 11, 0.14);
  --blob-2: rgba(56, 189, 248, 0.08);
  --blob-3: rgba(168, 85, 247, 0.07);

  --bs-body-bg: #060a14;
  --bs-link-color: #fbbf24;
  --bs-link-color-rgb: 251, 191, 36;
  --bs-link-hover-color: #fcd34d;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background-color: var(--canvas);
  background-image:
    radial-gradient(42rem 32rem at 8% -6%, var(--blob-1), transparent 60%),
    radial-gradient(38rem 30rem at 100% 8%, var(--blob-2), transparent 60%),
    radial-gradient(36rem 28rem at 60% 110%, var(--blob-3), transparent 60%);
  background-attachment: fixed;
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--text); letter-spacing: -0.015em; }
.text-muted { color: var(--muted) !important; }
.mono { font-family: var(--font-mono); }

.app-shell { display: flex; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */

.app-sidebar {
  width: 252px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1040;
  transition: transform 0.25s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.35rem 1.25rem 1.1rem;
  text-decoration: none;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.8rem;
  background: var(--brand-grad);
  box-shadow: var(--brand-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.brand-text { line-height: 1.1; }
.brand-text strong { display: block; color: #fff; font-weight: 800; font-size: 0.98rem; letter-spacing: -0.01em; }
.brand-text span { font-size: 0.68rem; color: #64748b; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

.sidebar-nav { padding: 0.5rem 0.8rem; display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }

.sidebar-section-label {
  text-transform: uppercase;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #475569;
  margin: 1.1rem 0.8rem 0.4rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link i { font-size: 1.02rem; width: 1.2rem; text-align: center; }
.sidebar-link:hover { background: var(--sidebar-hover); color: #e2e8f0; }

.sidebar-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.04));
}
.sidebar-link.active i { color: var(--brand-400); }
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -0.8rem;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-grad);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.8);
}

.badge-pill {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.12rem 0.48rem;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.sidebar-footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: #475569;
}
.sidebar-footer a { color: #64748b; text-decoration: none; }
.sidebar-footer a:hover { color: #cbd5e1; }

.sidebar-backdrop { display: none; }

/* ---------------- Topbar ---------------- */

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.75rem;
  background: color-mix(in srgb, var(--canvas) 72%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.app-page-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
}

.plant-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 300px;
  margin-left: 0.5rem;
  position: relative;
}
.plant-selector > i {
  position: absolute;
  left: 0.8rem;
  color: var(--brand-500);
  pointer-events: none;
  z-index: 1;
}
.plant-selector .form-select { padding-left: 2.1rem; }

.topbar-right { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }

.btn-icon {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: all 0.15s ease;
}
.btn-icon:hover { background: var(--glass-strong); border-color: var(--hairline); color: var(--text); }

.bell-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--canvas);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 2px rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 9px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 2px rgba(239, 68, 68, 0); }
}

.theme-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 0.8rem;
  background: var(--glass-bg);
  border: 1px solid var(--hairline);
}
.theme-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle button.active {
  background: var(--glass-strong);
  color: var(--brand-500);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--hairline);
  background: var(--glass-bg);
  padding: 0.22rem 0.75rem 0.22rem 0.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}
.user-chip:hover { background: var(--glass-strong); }

.avatar { width: 1.9rem; height: 1.9rem; border-radius: 999px; object-fit: cover; }
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-grad); color: #fff; font-weight: 800; text-transform: uppercase;
}

.dropdown-menu {
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  padding: 0.4rem;
}
.dropdown-item { border-radius: 0.6rem; font-weight: 600; font-size: 0.85rem; }

/* ---------------- Content & cards ---------------- */

.app-content { padding: 1.75rem; flex: 1; }

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: saturate(150%) blur(18px);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  padding: 1.35rem;
}

.glass-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.glass-card-header h3 {
  font-size: 0.98rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.glass-card-header h3 i { color: var(--brand-500); }
.glass-card-header p { font-size: 0.76rem; color: var(--muted); margin: 0.2rem 0 0; }

/* Hero banner */

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 1.6rem 1.75rem;
  color: #fff;
  background:
    radial-gradient(24rem 16rem at 92% -20%, rgba(255, 255, 255, 0.35), transparent 60%),
    linear-gradient(120deg, #f59e0b 0%, #f97316 55%, #e11d48 130%);
  box-shadow: 0 20px 45px -20px rgba(234, 88, 12, 0.65);
}
.hero-card h2 { color: #fff; font-weight: 800; font-size: 1.45rem; margin: 0 0 0.25rem; }
.hero-card .hero-sub { color: rgba(255, 255, 255, 0.85); font-size: 0.86rem; }
.hero-sun {
  position: absolute;
  right: -2.5rem;
  top: -2.5rem;
  width: 11rem;
  height: 11rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.hero-stats { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 1.25rem; position: relative; }
.hero-stat-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: rgba(255, 255, 255, 0.78); }
.hero-stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.hero-stat-value small { font-size: 0.85rem; font-weight: 700; opacity: 0.85; margin-left: 0.15rem; }

.live-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: live 1.8s infinite;
  margin-right: 0.35rem;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.btn-hero {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-weight: 700;
  border-radius: 0.75rem;
  backdrop-filter: blur(8px);
}
.btn-hero:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }

/* KPI tiles */

.kpi-card {
  padding: 1.15rem 1.2rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 40px -16px rgba(15, 23, 42, 0.22); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.kpi-label {
  text-transform: uppercase;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.025em; line-height: 1.15; }
.kpi-unit { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-left: 0.2rem; }
.kpi-foot { font-size: 0.74rem; color: var(--muted); margin-top: 0.3rem; }

.kpi-icon {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.kpi-amber .kpi-icon { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.kpi-sky .kpi-icon { background: rgba(14, 165, 233, 0.13); color: #0284c7; }
.kpi-violet .kpi-icon { background: rgba(139, 92, 246, 0.13); color: #7c3aed; }
.kpi-emerald .kpi-icon { background: rgba(16, 185, 129, 0.13); color: #059669; }
.kpi-rose .kpi-icon { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
[data-bs-theme="dark"] .kpi-amber .kpi-icon { color: #fbbf24; }
[data-bs-theme="dark"] .kpi-sky .kpi-icon { color: #38bdf8; }
[data-bs-theme="dark"] .kpi-violet .kpi-icon { color: #a78bfa; }
[data-bs-theme="dark"] .kpi-emerald .kpi-icon { color: #34d399; }
[data-bs-theme="dark"] .kpi-rose .kpi-icon { color: #fb7185; }

.kpi-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--accent, transparent);
  opacity: 0.85;
}
.kpi-amber { --accent: linear-gradient(90deg, #fbbf24, #f97316); }
.kpi-sky { --accent: linear-gradient(90deg, #38bdf8, #6366f1); }
.kpi-violet { --accent: linear-gradient(90deg, #a78bfa, #ec4899); }
.kpi-emerald { --accent: linear-gradient(90deg, #34d399, #14b8a6); }
.kpi-rose { --accent: linear-gradient(90deg, #fb7185, #f97316); }

/* Buttons & forms */

.btn { border-radius: 0.75rem; font-weight: 700; }
.btn-sm { border-radius: 0.65rem; padding: 0.35rem 0.8rem; font-size: 0.8rem; }

.btn-brand {
  background: var(--brand-grad);
  border: none;
  color: #fff;
  box-shadow: var(--brand-glow);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-brand:hover, .btn-brand:focus { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }
.btn-brand:active { transform: translateY(0) scale(0.98); }

.btn-outline-secondary {
  --bs-btn-color: var(--text-2);
  --bs-btn-border-color: var(--hairline);
  --bs-btn-bg: var(--glass-bg);
  --bs-btn-hover-bg: var(--glass-strong);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-border-color: rgba(245, 158, 11, 0.5);
  --bs-btn-active-bg: var(--glass-strong);
  --bs-btn-active-color: var(--text);
  --bs-btn-active-border-color: var(--brand-500);
}

.form-control, .form-select {
  border-radius: 0.75rem;
  border-color: var(--hairline);
  background-color: var(--glass-strong);
  color: var(--text);
  font-weight: 500;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 0.22rem rgba(245, 158, 11, 0.2);
}
.form-check-input:checked { background-color: var(--brand-500); border-color: var(--brand-500); }
.form-label { font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }

.nav-pills .nav-link { border-radius: 0.75rem; font-weight: 700; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }

/* Status pills */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.status-pill .dot { width: 0.42rem; height: 0.42rem; border-radius: 999px; }
.status-ok { background: rgba(16, 185, 129, 0.1); color: #059669; border-color: rgba(16, 185, 129, 0.22); }
.status-ok .dot { background: #10b981; }
.status-warning { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.25); }
.status-warning .dot { background: #f59e0b; }
.status-critical { background: rgba(239, 68, 68, 0.1); color: #dc2626; border-color: rgba(239, 68, 68, 0.22); }
.status-critical .dot { background: #ef4444; }
.status-muted { background: rgba(100, 116, 139, 0.1); color: #64748b; border-color: rgba(100, 116, 139, 0.2); }
.status-muted .dot { background: #94a3b8; }
[data-bs-theme="dark"] .status-ok { color: #34d399; }
[data-bs-theme="dark"] .status-warning { color: #fbbf24; }
[data-bs-theme="dark"] .status-critical { color: #f87171; }
[data-bs-theme="dark"] .status-muted { color: #94a3b8; }

/* Tables */

.table-glass {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-2);
  --bs-table-border-color: var(--hairline);
  --bs-table-hover-bg: rgba(245, 158, 11, 0.05);
  font-size: 0.85rem;
  margin-bottom: 0;
}
.table-glass thead th {
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 800;
  border-bottom: 1px solid var(--hairline);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  white-space: nowrap;
}
.table-glass td { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.table-glass tbody tr { transition: background 0.12s ease; }
.table-glass tbody tr:hover { background: rgba(245, 158, 11, 0.05); }
.table-glass tfoot td { border-top: 1px solid var(--hairline); color: var(--text); }
.site-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 999px; margin-right: 0.55rem; vertical-align: middle; }

.alert.glass-card { border: 1px solid rgba(16, 185, 129, 0.25); color: #047857; }
[data-bs-theme="dark"] .alert.glass-card { color: #6ee7b7; }

/* Charts */

.chart-box { position: relative; height: 290px; }
.chart-box-sm { position: relative; height: 210px; }

/* ---------------- Public pages (login, legal) ---------------- */

.public-body { min-height: 100vh; display: flex; flex-direction: column; }

.auth-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  gap: 2.5rem;
  align-items: center;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.75rem;
  padding: 2.5rem;
  color: #fff;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(30rem 20rem at 100% 0%, rgba(255, 255, 255, 0.35), transparent 60%),
    linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #e11d48 120%);
  box-shadow: 0 30px 60px -25px rgba(234, 88, 12, 0.65);
}
.auth-hero h1 { color: #fff; font-size: 2.1rem; font-weight: 800; line-height: 1.15; margin: 1.25rem 0 0.75rem; }
.auth-hero p { color: rgba(255, 255, 255, 0.88); font-size: 0.95rem; max-width: 26rem; }
.auth-hero .brand-mark { background: rgba(255, 255, 255, 0.22); box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.4); width: 2.75rem; height: 2.75rem; font-size: 1.35rem; }
.auth-sun {
  position: absolute; right: -5rem; bottom: -5rem; width: 18rem; height: 18rem; border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 68%);
}
.auth-features { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.7rem; position: relative; }
.auth-features li { display: flex; gap: 0.7rem; align-items: center; font-weight: 600; font-size: 0.9rem; }
.auth-features i {
  width: 2rem; height: 2rem; border-radius: 0.65rem; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-card { padding: 2.5rem 2.25rem; }
.auth-card h2 { font-weight: 800; font-size: 1.5rem; margin-bottom: 0.35rem; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--hairline);
  background: var(--glass-strong);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn-google:hover {
  color: var(--text);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 10px 24px -12px rgba(245, 158, 11, 0.55);
  transform: translateY(-1px);
}
.btn-google svg { width: 1.2rem; height: 1.2rem; }

.auth-divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.72rem; margin: 1.5rem 0; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

.public-footer {
  text-align: center;
  padding: 1.25rem 1rem 1.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.public-footer a { color: var(--muted); text-decoration: none; font-weight: 600; margin: 0 0.5rem; }
.public-footer a:hover { color: var(--brand-500); }

.public-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
}
.public-topbar .brand-text strong { color: var(--text); }

.legal-wrap { max-width: 880px; width: 100%; margin: 0 auto; padding: 1.5rem 1.5rem 0; flex: 1; }
.legal-card { padding: 2.5rem 2.75rem; }
.legal-card h1 { font-weight: 800; font-size: 2rem; margin-bottom: 0.35rem; }
.legal-meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 1.75rem; }
.legal-card h2 { font-size: 1.08rem; font-weight: 800; margin: 2rem 0 0.6rem; display: flex; gap: 0.55rem; align-items: center; }
.legal-card h2 .num {
  width: 1.7rem; height: 1.7rem; border-radius: 0.55rem; font-size: 0.78rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(245, 158, 11, 0.14); color: #d97706;
}
.legal-card p, .legal-card li { line-height: 1.7; font-size: 0.92rem; }
.legal-card ul { padding-left: 1.2rem; }
.legal-callout {
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.88rem;
  margin: 1rem 0;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.4); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.65); }

/* ---------------- Responsive ---------------- */

@media (max-width: 991.98px) {
  .app-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: 0 0 50px rgba(0, 0, 0, 0.35); }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, 0.45); z-index: 1035; backdrop-filter: blur(2px); }
  .app-topbar { padding: 0.7rem 1rem; gap: 0.5rem; }
  .app-content { padding: 1rem; }
  .plant-selector { max-width: none; margin-left: 0; }
  .app-page-title { display: none; }
  .user-chip .user-name { display: none; }
  .auth-wrap { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.25rem 1rem; }
  .auth-hero { min-height: 0; padding: 1.75rem; }
  .auth-hero h1 { font-size: 1.6rem; }
  .auth-card { padding: 1.75rem 1.5rem; }
  .legal-card { padding: 1.5rem 1.25rem; }
  .legal-wrap, .public-topbar { padding-left: 1rem; padding-right: 1rem; }
  .hero-stats { gap: 1.25rem; }
  .hero-stat-value { font-size: 1.5rem; }
}

@media (max-width: 575.98px) {
  .theme-toggle { display: none; }
}

/* ---------------- Print ---------------- */

@media print {
  .app-sidebar, .app-topbar, .no-print, .btn, form, .sidebar-backdrop { display: none !important; }
  .app-content { padding: 0; }
  body { background: #fff !important; }
  .glass-card, .hero-card {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    backdrop-filter: none !important;
  }
}
