/* ════════════════════════════════════════════════════════════
   ZEUS42 — Unified Design System & Styling
   Sleek Dark Cyber-Energy Aesthetic & Glassmorphism
   ════════════════════════════════════════════════════════════ */

:root {
  /* Colors */
  --bg-dark: #f3f6fa;
  --bg-darker: rgba(255, 255, 255, 0.7);
  --primary: #10b981;        /* Vibrant emerald green */
  --primary-glow: rgba(16, 185, 129, 0.08);
  --secondary: #3b82f6;      /* Vibrant electric blue */
  --secondary-glow: rgba(59, 130, 246, 0.08);
  --success: #059669;
  --success-glow: rgba(5, 150, 105, 0.04);
  --warning: #d97706;
  --danger: #dc2626;
  --danger-glow: rgba(220, 38, 38, 0.04);
  
  /* Surfaces */
  --surface-glass: rgba(255, 255, 255, 0.55);
  --surface-glass-hover: rgba(255, 255, 255, 0.85);
  --border-glass: rgba(255, 255, 255, 0.7);
  
  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  /* Radius & Shadows */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 10px 30px -10px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(15, 23, 42, 0.01);
}

body.dark-theme {
  --bg-dark: #070b13;
  --bg-darker: rgba(11, 19, 32, 0.8);
  --primary: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.15);
  --secondary: #3b82f6;
  --secondary-glow: rgba(59, 130, 246, 0.15);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --surface-glass: rgba(15, 23, 42, 0.6);
  --surface-glass-hover: rgba(21, 32, 54, 0.85);
  --border-glass: rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 12px 36px -15px rgba(0, 0, 0, 0.5);
}

/* Reset & Base Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Assistant', 'Plus Jakarta Sans', -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-text, .kpi-card-value, .amp-main, .wc-title, .wc-badge, .rsb-avatar, .kpi-card-desc, .kpi-card-label {
  font-family: 'Plus Jakarta Sans', 'Assistant', sans-serif;
}

/* Background glows */
.bg-glow-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-glow-orange {
  position: absolute;
  top: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  filter: blur(120px);
}

.bg-glow-blue {
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
  filter: blur(120px);
}

/* Base Elements */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #60a5fa;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}

.btn-secondary {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
  background: var(--surface-glass-hover);
  transform: translateY(-1px);
}

/* Glass Card */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wizard Screens */
.screen {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
  display: block;
}

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

/* Header & Container */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 15px 40px;
}

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

/* Brand styling */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.brand-icon svg {
  width: 16px;
  height: 16px;
  fill: white;
}

.brand-text {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.brand-text small {
  display: block;
  font-size: 8px;
  color: var(--primary);
  letter-spacing: 0.5px;
  font-weight: 600;
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.secure-dot {
  width: 6px;
  height: 6px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
}

/* Stepper */
.stepper {
  margin-bottom: 20px;
}

.stepper-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.3s;
}

.step-dot.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.step-dot.completed {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.step-line {
  flex-grow: 1;
  height: 2px;
  background: var(--border-glass);
  margin: 0 -2px;
  z-index: 1;
  transition: background 0.3s;
}

.step-line.active {
  background: var(--primary);
}

.stepper-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
}

/* Choices Grid */
.choices-grid {
  display: grid;
  gap: 12px;
  margin-top: 15px;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.choice-card {
  background: var(--surface-glass);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.choice-card:hover {
  background: var(--surface-glass-hover);
  border-color: var(--secondary);
}

.choice-card.selected {
  border-color: var(--primary);
  background: var(--primary-glow);
  box-shadow: 0 4px 15px -5px rgba(16, 185, 129, 0.1);
}

.choice-icon {
  font-size: 20px;
  color: var(--secondary);
  display: flex;
  align-items: center;
}

.choice-card.selected .choice-icon {
  color: var(--primary);
}

.choice-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.choice-content {
  flex-grow: 1;
}

.choice-title {
  font-size: 14px;
  font-weight: 700;
}

.choice-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.choice-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.choice-check svg {
  width: 10px;
  height: 10px;
  stroke: white;
  stroke-width: 3;
  fill: none;
  display: none;
}

.choice-card.selected .choice-check {
  background: var(--primary);
  border-color: var(--primary);
}

.choice-card.selected .choice-check svg {
  display: block;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: all 0.2s;
}

.upload-zone:hover {
  border-color: var(--secondary);
  background: rgba(59, 130, 246, 0.02);
}

.upload-zone.success {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.02);
}

.upload-zone.error {
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.02);
}

.upload-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2;
}

.upload-zone.success .upload-icon svg {
  stroke: var(--primary);
}

.upload-title {
  font-size: 14px;
  font-weight: 700;
  margin-top: 10px;
}

.upload-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.privacy-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

.or-divider {
  display: flex;
  align-items: center;
  text-align: align;
  color: var(--text-muted);
  font-size: 11px;
  margin: 15px 0;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-glass);
}

.or-divider:not(:empty)::before {
  margin-left: .5em;
}

.or-divider:not(:empty)::after {
  margin-right: .5em;
}

/* Manual Wrappers */
.manual-wrap {
  display: none;
}

.manual-wrap.show {
  display: block;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.field input:focus, .field select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 8px var(--secondary-glow);
}

/* Amps selector buttons */
.amps-row {
  display: flex;
  gap: 8px;
}

.amp-btn {
  flex: 1;
  background: var(--surface-glass);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.amp-btn:hover {
  border-color: var(--secondary);
}

.amp-btn.selected {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.amp-main {
  font-weight: 900;
  font-size: 13px;
}

.amp-sub {
  font-size: 9px;
  color: var(--text-secondary);
}

.reg-note {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(59, 130, 246, 0.04);
  border: 1px solid rgba(59, 130, 246, 0.1);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.reg-note.show {
  display: block;
}

.form-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

/* Welcome Card Landing Styles */
.wc-top {
  padding: 24px 24px 0;
}

.wc-badge {
  display: inline-block;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  margin-bottom: 12px;
}

.wc-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 12px;
}

.wc-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wc-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.wc-body {
  padding: 24px;
}

.steps-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.step-n {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: white;
}

.step-t {
  font-size: 12px;
  font-weight: 700;
}

.step-d {
  font-size: 10px;
  color: var(--text-secondary);
}

.cta-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), #059669);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
  transition: all 0.2s;
}

.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

/* ════════════════════════════════════
   REPORT DASHBOARD STYLES (UPGRADED)
   ════════════════════════════════════ */

.report-container {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.report-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}

/* Sidebar Profile */
.sidebar {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-self: start;
}

.rsb-user-card {
  text-align: center;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-glass);
}

.rsb-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: white;
  margin: 0 auto 10px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

#rsb-name {
  font-size: 14px;
  font-weight: 700;
}

.rsb-tier-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  margin-top: 4px;
}

.rsb-tier-badge.free {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

.rsb-tier-badge.premium {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.sidebar-item:hover {
  background: var(--border-glass);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--secondary-glow);
  color: var(--secondary);
  border-right: 3px solid var(--secondary);
}

.sidebar-item.premium-locked-item::after {
  content: '🔒';
  font-size: 10px;
  margin-right: auto;
}

/* Main Diagnostic Section */
.diagnostic-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-title {
  font-size: 22px;
  font-weight: 900;
}

.status-line {
  background: var(--secondary-glow);
  border: 1px solid rgba(59, 130, 246, 0.12);
  color: var(--secondary);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

body.dark-theme .status-line {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

.status-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--secondary);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* 3 KPIs Grid */
.kpis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.kpi-card {
  text-align: center;
  padding: 16px;
}

.kpi-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.kpi-card-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
}

.kpi-card-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "המהנדס מזהה" Bullets (Strictly 3) */
.engineer-box {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.section-h {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-h::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: var(--border-glass);
}

.insight-bullet-card {
  display: flex;
  gap: 12px;
  padding: 10px 0;
}

.insight-bullet-card + .insight-bullet-card {
  border-top: 1px solid rgba(15, 23, 42, 0.04);
}

body.dark-theme .insight-bullet-card + .insight-bullet-card {
  border-top-color: rgba(255, 255, 255, 0.03);
}

.insight-bullet-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.insight-bullet-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.insight-bullet-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--secondary);
}

.insight-bullet-line {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.next-action-badge {
  background: rgba(16, 185, 129, 0.06);
  border: 1.5px solid rgba(16, 185, 129, 0.15);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
}

body.dark-theme .next-action-badge {
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
}

/* "הפעולה הבאה" 3 Steps */
.action-steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.next-step-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.next-step-num {
  width: 24px;
  height: 24px;
  background: var(--secondary);
  color: white;
  font-size: 12px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.next-step-content {
  flex-grow: 1;
}

.next-step-title {
  font-size: 13px;
  font-weight: 800;
}

.next-step-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.next-step-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

/* Confidence level and what is missing */
.confidence-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.confidence-body {
  flex-grow: 1;
}

.confidence-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.confidence-badge.level-high { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.confidence-badge.level-medium { background: rgba(217, 119, 6, 0.15); color: var(--warning); }
.confidence-badge.level-low { background: rgba(220, 38, 38, 0.15); color: var(--danger); }

#confidence-text {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.missing-info-box {
  background: rgba(220, 38, 38, 0.02);
  border: 1px solid rgba(220, 38, 38, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.missing-title {
  font-size: 11px;
  color: var(--danger);
  font-weight: 800;
  margin-bottom: 4px;
}

.missing-list {
  padding-right: 15px;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Accordion advanced details */
.accordion-wrapper {
  margin-top: 10px;
}

.accordion-header {
  width: 100%;
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
  transition: all 0.2s;
}

.accordion-header:hover {
  background: var(--surface-glass-hover);
}

.accordion-arrow {
  font-size: 10px;
  transition: transform 0.3s;
}

.accordion-wrapper.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.accordion-wrapper.open .accordion-content {
  max-height: 2500px; /* high limit to enable normal content height */
  margin-top: 10px;
}

/* Advanced cards in accordion */
.advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.advanced-card-full {
  grid-column: 1 / -1;
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-glass);
}

.card-title-bar h3 {
  font-size: 14px;
  font-weight: 800;
}

/* Tables styling in dashboard */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.report-table tr {
  border-bottom: 1px solid rgba(15, 23, 42, 0.03);
}

body.dark-theme .report-table tr {
  border-bottom-color: rgba(255, 255, 255, 0.02);
}

.report-table tr:last-child {
  border-bottom: none;
}

.report-table td {
  padding: 8px 6px;
  vertical-align: middle;
}

.report-table td.lbl {
  font-weight: 700;
  color: var(--text-secondary);
  width: 50%;
}

.report-table td.val {
  font-weight: 700;
  text-align: left;
}

.report-table td.val-green { color: var(--success); }
.report-table td.val-red { color: var(--danger); }
.report-table td.val-blue { color: var(--secondary); }

/* Private suppliers specific */
.current-supplier-row {
  background: rgba(16, 185, 129, 0.03);
}

body.dark-theme .current-supplier-row {
  background: rgba(16, 185, 129, 0.05);
}

.supplier-link {
  font-weight: 800;
  color: var(--text-primary);
}

.curr-badge {
  font-size: 8px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 1px 4px;
  border-radius: 50px;
  font-weight: 700;
  margin-right: 4px;
}

.saving-cell {
  font-weight: 800;
  color: var(--success);
}

.note-cell {
  color: var(--text-secondary);
  font-size: 10px;
}

/* Quick Wins */
.quick-wins-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qw-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
}

.qw-action {
  font-size: 11px;
  font-weight: 700;
}

.qw-saving {
  font-size: 12px;
  font-weight: 800;
  color: var(--success);
}

.qw-cost {
  font-size: 10px;
  color: var(--text-muted);
}

/* Risks tracking */
.risk-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.risk-bar-label {
  font-size: 11px;
  width: 45%;
  font-weight: 700;
}

.risk-bar-track {
  flex-grow: 1;
  height: 5px;
  background: var(--border-glass);
  border-radius: 10px;
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
}

.risk-bar-fill.fill-green { background-color: var(--primary); }
.risk-bar-fill.fill-orange { background-color: var(--warning); }
.risk-bar-fill.fill-red { background-color: var(--danger); }

.risk-bar-value {
  font-size: 10px;
  font-weight: 800;
  width: 50px;
  text-align: left;
}

.risk-bar-value.val-green { color: var(--success); }
.risk-bar-value.val-orange { color: var(--warning); }
.risk-bar-value.val-red { color: var(--danger); }

/* BESS Sizing styling */
.bess-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.bess-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
}

.bess-item-label {
  font-size: 9px;
  color: var(--text-secondary);
}

.bess-item-val {
  font-size: 13px;
  font-weight: 900;
  margin-top: 2px;
}

.bess-item-val.val-blue { color: var(--secondary); }
.bess-item-val.val-green { color: var(--success); }
.bess-item-val.val-primary { color: var(--primary); }

.bess-advice-box {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.5;
  background: rgba(59, 130, 246, 0.03);
  border: 1px solid var(--border-glass);
  padding: 10px;
  border-radius: var(--radius-sm);
}

.loads-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--border-glass);
  padding-top: 10px;
}

.loads-title {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

.loads-title.title-supported { color: var(--success); }
.loads-title.title-restricted { color: var(--danger); }
.loads-title.title-inverters { color: var(--secondary); }

.loads-list {
  padding-right: 14px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.inverter-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.inv-tag {
  font-size: 9px;
  background: rgba(59, 130, 246, 0.06);
  color: var(--secondary);
  border: 1px solid rgba(59, 130, 246, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 160px;
  margin-top: 8px;
}

.shield-desc-box {
  font-size: 12px;
  line-height: 1.6;
}

.shield-heading {
  font-weight: 700;
  color: var(--secondary);
  margin: 10px 0 4px;
}

.shield-list {
  padding-right: 14px;
  margin-bottom: 10px;
}

.red-flag-box {
  background: rgba(220, 38, 38, 0.03);
  border: 1px solid rgba(220, 38, 38, 0.1);
  border-right: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
}

.red-flag-title {
  color: var(--danger);
  font-weight: 800;
  font-size: 11px;
  margin-bottom: 4px;
}

.red-flag-box ul {
  padding-right: 14px;
  font-size: 10px;
  color: var(--text-secondary);
}

.email-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 10px;
  line-height: 1.5;
  white-space: pre-line;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* Paywall / Locked Premium overlay */
.premium-locked {
  position: relative;
  overflow: hidden;
}

.premium-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 15, 30, 0.08) 0%, rgba(6, 15, 30, 0.6) 80%);
  z-index: 2;
  pointer-events: none;
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}

body.dark-theme .premium-locked::after {
  background: linear-gradient(180deg, rgba(7, 11, 19, 0.15) 0%, rgba(7, 11, 19, 0.8) 80%);
}

.paywall-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  text-align: center;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.paywall-box {
  background: #0b1424;
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  max-width: 340px;
  width: 100%;
}

body.dark-theme .paywall-box {
  background: #0a0f18;
}

.paywall-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
}

.paywall-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* Modal unlock */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 17, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #0b1424;
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.dark-theme .modal-content {
  background: #070d18;
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.modal-desc {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Mobile Sticky CTA */
.mobile-sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(7, 11, 19, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-glass);
  padding: 10px 20px;
  z-index: 90;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s ease-out;
}

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

.mobile-sticky-cta .btn {
  width: 100%;
}

/* Loading indicators */
.loading-screen {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(16, 185, 129, 0.15);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}

.loading-steps {
  max-width: 280px;
  width: 100%;
  margin-top: 16px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loading-step {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.01);
}

.loading-step.active {
  color: var(--secondary);
  border-color: var(--border-glass);
  background: rgba(59, 130, 246, 0.04);
}

.loading-step.done {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.12);
  background: rgba(16, 185, 129, 0.02);
}

/* Responsive Grid Adaptations */
@media (max-width: 992px) {
  .report-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .rsb-user-card {
    border-bottom: none;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
  }
  .rsb-avatar {
    margin: 0;
  }
  .sidebar-menu {
    display: none; /* Hide internal menu tabs on small screens */
  }
  .kpis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .kpis-grid {
    grid-template-columns: 1fr;
  }
  .kpi-card {
    padding: 12px;
  }
  .kpi-card-value {
    font-size: 20px;
  }
  .advanced-grid {
    grid-template-columns: 1fr;
  }
  .bess-grid {
    grid-template-columns: 1fr 1fr;
  }
  .loads-grid {
    grid-template-columns: 1fr;
  }
  .mobile-sticky-cta {
    display: block; /* Show sticky cta on mobile */
  }
  .report-container {
    padding-bottom: 70px; /* Space for sticky cta */
  }
  .amps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .sidebar {
    padding: 12px 16px;
  }
}

@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .sidebar, .btn, .mobile-sticky-cta, .paywall-overlay {
    display: none !important;
  }
  .accordion-content {
    max-height: none !important;
  }
}

/* Explanation Section Styles */
.explain-section {
  margin-top: 32px;
}

.explain-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.explain-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .explain-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.explain-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.explain-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: var(--shadow-md);
}

.explain-h {
  font-size: 15px;
  font-weight: 800;
  color: var(--secondary);
  margin-top: 0;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.explain-p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.explain-ul {
  padding-right: 18px;
  margin: 8px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.explain-ul li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .span-2 {
    grid-column: span 2;
  }
}
