/**
 * ============================================================================
 * WattWarung — AI Energy Assistant untuk UMKM Indonesia
 * File: css/style.css
 * Design System: EcoSync Modern Green SaaS Dashboard
 * ============================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* EcoSync Color Palette */
  --bg-outer: #E8EDE9;
  --bg-app: #F3F6F4;
  --bg-card: #FFFFFF;
  --bg-subtle: #F6F9F7;
  --bg-muted: #EDF2EE;

  /* Forest Green Primary Palette */
  --green-950: #092616;
  --green-900: #0D3820;
  --green-800: #134E2C;
  --green-700: #165B36;
  --green-600: #1B7042;
  --green-500: #228B53;
  --green-400: #48A874;
  --green-300: #93BFA6;
  --green-200: #C5E0D0;
  --green-100: #E5F1EA;
  --green-50: #F0F7F3;

  /* Semantic Colors */
  --color-primary: #165B36;
  --color-primary-dark: #0D3820;
  --color-secondary: #1B7042;
  --color-accent: #B9E77A;
  --color-text: #111827;
  --color-text-secondary: #4B5563;
  --color-text-muted: #84928A;
  --color-border: #E5EBE7;
  --color-danger: #DC2626;
  --color-warning: #D97706;
  --color-info: #2563EB;
  --color-success: #16A34A;

  /* Radii */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 2px 8px rgba(13, 56, 32, 0.03);
  --shadow-sm: 0 4px 20px rgba(13, 56, 32, 0.04);
  --shadow-md: 0 10px 30px rgba(13, 56, 32, 0.07);
  --shadow-lg: 0 20px 50px rgba(13, 56, 32, 0.12);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================================== */
/* 1. RESET & BASE                                                            */
/* ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Lucide SVG Sizing */
svg.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

/* ========================================================================== */
/* 2. APP SHELL LAYOUT (Floating Sidebar + Main Workspace)                    */
/* ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  padding: 18px;
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ========================================================================== */
/* 3. FLOATING WHITE SIDEBAR                                                  */
/* ========================================================================== */
.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 26px;
}

.brand-logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(22, 91, 54, 0.25);
  flex-shrink: 0;
}

.brand-logo-circle svg.lucide {
  width: 20px;
  height: 20px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.sidebar-close {
  display: none;
  margin-left: auto;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9CA3AF;
  padding: 0 14px;
  margin: 6px 0 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-full);
  color: #64748B;
  font-size: 13.5px;
  font-weight: 600;
  transition: all var(--transition);
}

.nav-item svg.lucide {
  width: 18px;
  height: 18px;
  color: #84928A;
  transition: color var(--transition);
}

.nav-item:hover {
  background: var(--green-50);
  color: var(--color-primary);
}

.nav-item:hover svg.lucide {
  color: var(--color-primary);
}

.nav-item.active {
  background: var(--green-100);
  color: var(--color-primary);
  font-weight: 700;
}

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

/* Sidebar Promo / Demo Card at Bottom */
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
}

.sidebar-promo-card {
  background: linear-gradient(145deg, #0D3820 0%, #165B36 100%);
  border-radius: 20px;
  padding: 18px;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.sidebar-promo-card::after {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 231, 122, 0.28) 0%, rgba(22, 91, 54, 0) 70%);
  bottom: -30px;
  right: -30px;
  pointer-events: none;
}

.promo-tag {
  font-size: 11px;
  font-weight: 600;
  color: #A7F3D0;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.promo-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 14px;
  color: #FFFFFF;
}

.btn-promo {
  width: 100%;
  background: #FFFFFF;
  color: var(--color-primary-dark);
  border: none;
  border-radius: var(--radius-full);
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-promo:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========================================================================== */
/* 4. MAIN CONTENT & TOP HEADER                                               */
/* ========================================================================== */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 440px;
}

.hamburger {
  display: none;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  padding: 11px 20px;
  width: 100%;
  box-shadow: var(--shadow-xs);
  border: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search:focus-within {
  border-color: var(--green-300);
  box-shadow: 0 4px 16px rgba(22, 91, 54, 0.08);
}

.header-search svg.lucide {
  color: #9CA3AF;
  width: 17px;
  height: 17px;
}

.header-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  color: var(--color-text);
  font-size: 13.5px;
}

.header-search input::placeholder {
  color: #9CA3AF;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.circle-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid transparent;
  box-shadow: var(--shadow-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}

.circle-icon-btn:hover {
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.notification-dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #EF4444;
  border: 1.5px solid #FFFFFF;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 8px;
  cursor: pointer;
}

.header-profile-info {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.header-business {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}

.header-category {
  font-size: 11.5px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
  color: var(--color-primary-dark);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
  box-shadow: var(--shadow-xs);
}

/* ========================================================================== */
/* 5. PAGE HERO & BUTTONS                                                     */
/* ========================================================================== */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-hero,
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero-title,
.page-header h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.hero-subtitle,
.page-header p {
  font-size: 13.5px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.hero-actions,
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn svg.lucide {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--color-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(22, 91, 54, 0.22);
}

.btn-primary:hover {
  background: var(--green-800);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(22, 91, 54, 0.28);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--green-50);
  border-color: var(--green-200);
  color: var(--color-primary);
}

.btn-danger {
  background: #FEE2E2;
  color: #B91C1C;
}

.btn-danger:hover {
  background: #FECACA;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

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

.btn-icon:hover {
  background: var(--bg-muted);
  color: var(--color-primary);
}

/* ========================================================================== */
/* 6. TOP 4 SUMMARY CARDS (EcoSync Style)                                     */
/* ========================================================================== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 158px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

/* Featured 1st Card: Forest Green */
.summary-card.featured {
  background: linear-gradient(145deg, #17633B 0%, #0F4327 100%);
  color: #FFFFFF;
}

.summary-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.summary-card.featured .summary-label {
  color: rgba(255, 255, 255, 0.88);
}

.summary-badge-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #F1F5F3;
  color: #4B5563;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-badge-icon svg.lucide {
  width: 16px;
  height: 16px;
}

.summary-card.featured .summary-badge-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.summary-main {
  margin: 14px 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.summary-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-text);
}

.summary-card.featured .summary-value {
  color: #FFFFFF;
}

.summary-unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.summary-card.featured .summary-unit {
  color: rgba(255, 255, 255, 0.78);
}

/* Status Pill inside 4th card */
.status-pill-large {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 700;
  background: var(--green-100);
  color: var(--color-primary);
}

.status-pill-large.badge-efficient {
  background: #E3F5EA;
  color: #156537;
}

.status-pill-large.badge-attention {
  background: #FEF3C7;
  color: #B45309;
}

.status-pill-large.badge-high {
  background: #FEE2E2;
  color: #B91C1C;
}

.summary-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.summary-footer svg.lucide {
  width: 14px;
  height: 14px;
}

.summary-card.featured .summary-footer {
  color: #A7F3D0;
}

.summary-footer.trend-warning {
  color: #D97706;
}

.summary-footer.trend-success {
  color: #16A34A;
}

/* ========================================================================== */
/* 7. MIDDLE ROW: SAVINGS/BREAKDOWN RING + REAL-TIME PILL BAR CHART           */
/* ========================================================================== */
.dashboard-middle-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(229, 235, 231, 0.6);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-header h3 {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.pill-select-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* Ring Chart Container & Legend */
.ring-chart-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ring-canvas-box {
  width: 210px;
  height: 210px;
  position: relative;
  margin: 4px auto 18px;
}

.ring-canvas-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.ring-legend-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.ring-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.ring-legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  font-weight: 500;
  min-width: 0;
}

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

.ring-legend-val {
  font-weight: 700;
  color: var(--color-text);
}

.chart-container {
  position: relative;
  width: 100%;
  height: 270px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ========================================================================== */
/* 8. BOTTOM ROW: SMART DEVICES GRID + DARK GREEN CARBON/AI TRACKER           */
/* ========================================================================== */
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
}

.link-action {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.link-action:hover {
  text-decoration: underline;
}

/* 2x2 Smart Devices Grid */
.smart-devices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.smart-device-item {
  background: var(--bg-subtle);
  border-radius: 16px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}

.smart-device-item:hover {
  background: #FFFFFF;
  border-color: var(--green-200);
  box-shadow: var(--shadow-xs);
}

.smart-device-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.smart-device-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #FFFFFF;
  color: #4B5563;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.smart-device-info {
  min-width: 0;
}

.smart-device-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-device-meta {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* Visual Toggle Switch (EcoSync style) */
.device-toggle-pill {
  width: 40px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}

.device-toggle-pill::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform var(--transition);
}

/* Dark Forest Green Impact / AI Card */
.impact-tracker-card {
  background: linear-gradient(140deg, #0D3820 0%, #14492B 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.impact-tracker-card::before {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(34, 139, 83, 0.22);
  right: -40px;
  bottom: -50px;
  pointer-events: none;
}

.impact-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.impact-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.impact-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
  margin-top: 2px;
}

.impact-badge {
  background: rgba(255, 255, 255, 0.16);
  color: #E2F8EC;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.impact-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0;
  position: relative;
  z-index: 1;
}

.impact-metric-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 4px;
}

.impact-metric-val {
  font-size: 24px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.impact-metric-val small {
  font-size: 13px;
  font-weight: 500;
  color: #A7F3D0;
}

.impact-insight-text {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.impact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.btn-impact {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-impact:hover {
  background: #FFFFFF;
  color: var(--color-primary-dark);
}

.btn-impact-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-impact-circle:hover {
  background: #FFFFFF;
  color: var(--color-primary-dark);
}

/* ========================================================================== */
/* 9. DEMO BANNER                                                             */
/* ========================================================================== */
.demo-banner {
  background: #FFFFFF;
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.demo-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.demo-banner-left strong {
  color: var(--color-primary);
}

/* ========================================================================== */
/* 10. INNER PAGES: TABLES, APPLIANCE CARDS, TABS, SIMULATOR                  */
/* ========================================================================== */
.audit-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.summary-card.compact {
  min-height: auto;
  padding: 18px 20px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--color-border);
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

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

.actions-cell {
  display: flex;
  gap: 6px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.badge-demo {
  background: #FEF3C7;
  color: #B45309;
}

.badge-category {
  background: var(--green-100);
  color: var(--color-primary);
}

.badge-info {
  background: var(--green-50);
  color: var(--color-primary);
}

.badge-high { background: #FEE2E2; color: #B91C1C; }
.badge-medium { background: #FEF3C7; color: #B45309; }
.badge-low { background: #DBEAFE; color: #1D4ED8; }

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-input-wrap svg.lucide {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
}

.search-input {
  width: 100%;
  padding: 11px 16px 11px 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--bg-card);
  outline: none;
}

.filter-select {
  padding: 11px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--bg-card);
  outline: none;
  min-width: 190px;
}

.appliance-summary {
  display: flex;
  gap: 24px;
  padding: 14px 22px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
  font-size: 13.5px;
}

/* Appliance Cards Grid */
.appliance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.appliance-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.appliance-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.appliance-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

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

.appliance-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-subtle);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 11px;
  color: var(--color-text-muted);
}

.spec-value {
  font-size: 13px;
  font-weight: 700;
}

.appliance-card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.energy-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.energy-kwh {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-primary);
}

.energy-cost {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-full);
  width: fit-content;
  box-shadow: var(--shadow-xs);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn.active {
  background: var(--color-primary);
  color: #FFFFFF;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Recommendations */
.recommendation-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  border-left: 4px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.recommendation-card.priority-high { border-left-color: #DC2626; }
.recommendation-card.priority-medium { border-left-color: #D97706; }
.recommendation-card.priority-low { border-left-color: #2563EB; }

.rec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.rec-issue {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.rec-action {
  background: var(--green-50);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-size: 13px;
}

.rec-impact {
  display: flex;
  gap: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
}

/* Simulator */
.simulator-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.simulator-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition);
}

.simulator-item:hover {
  border-color: var(--color-primary);
  background: var(--green-50);
}

.simulator-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.simulation-results-grid,
.report-summary-grid,
.discrepancy-grid,
.eval-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.sim-result-item,
.report-stat,
.discrepancy-item,
.eval-metric {
  background: var(--bg-subtle);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.sim-result-item.highlight {
  grid-column: 1 / -1;
  background: var(--green-100);
  color: var(--color-primary-dark);
}

.sim-result-label,
.report-stat-label,
.discrepancy-label,
.eval-label {
  display: block;
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.sim-result-value,
.report-stat-value,
.discrepancy-value,
.eval-value {
  font-size: 18px;
  font-weight: 800;
}

/* ========================================================================== */
/* 11. FORMS, MODALS, TOASTS & EMPTY STATES                                   */
/* ========================================================================== */
.form-group {
  margin-bottom: 16px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group input {
  border-radius: var(--radius-sm);
}

.input-prefix, .input-suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--color-border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.input-prefix {
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-suffix {
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-help {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 38, 22, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-sm {
  max-width: 420px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--color-text-muted);
}

.empty-state h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin: 10px 0 6px;
}

.empty-state p {
  font-size: 13px;
  margin-bottom: 16px;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 290px;
  animation: slideIn 0.25s ease;
}

.toast-error { border-left-color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--color-text-muted);
  cursor: pointer;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Calculation preview & Settings */
.calculation-preview {
  background: var(--green-50);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.preview-values {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}

.preview-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-primary);
  display: block;
}

.settings-data-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.data-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  gap: 12px;
  flex-wrap: wrap;
}

.collapsible.collapsed {
  display: none;
}

/* Utility */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--color-text-muted); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-sm { font-size: 12.5px; }

/* ========================================================================== */
/* 12. RESPONSIVE DESIGN                                                      */
/* ========================================================================== */
.sidebar-overlay {
  display: none;
}

@media (max-width: 1180px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-middle-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-layout {
    padding: 12px;
  }
  .sidebar {
    position: fixed;
    left: 12px;
    top: 12px;
    bottom: 12px;
    height: auto;
    transform: translateX(-120%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close,
  .hamburger {
    display: inline-flex;
  }
  .sidebar-overlay.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(9, 38, 22, 0.35);
    z-index: 90;
  }
}

@media (max-width: 640px) {
  .summary-cards,
  .smart-devices-grid,
  .audit-summary,
  .comparison-grid,
  .simulation-results-grid,
  .report-summary-grid,
  .discrepancy-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
  .header-profile-info {
    display: none;
  }
}

@media print {
  .sidebar, .main-header, .hero-actions, .btn, .toast-container {
    display: none !important;
  }
  .app-layout {
    display: block;
    padding: 0;
  }
}
