/* ==========================================================================
   Indian Solar Load Scheduling & DSM Dispatch Simulator - Design System
   Aesthetic: Dark Executive Glassmorphism with Precision Telemetry
   Fully Adaptive & Responsive to all Screen Resolutions & Zoom Levels
   ========================================================================== */

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

:root {
  /* Color Palette & Surfaces */
  --bg-base: #080D1A;
  --bg-card: rgba(18, 26, 44, 0.78);
  --bg-card-hover: rgba(26, 38, 64, 0.88);
  --bg-surface: #0E1626;
  --bg-surface-dark: #0B1320;
  --bg-input: #141F33;
  --bg-input-focus: #1A253C;
  --bg-panel: rgba(14, 22, 38, 0.94);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-focus: rgba(56, 189, 248, 0.6);
  --border-glow: rgba(16, 185, 129, 0.3);

  /* Energy Semantics */
  --solar-gold: #FBBF24;
  --solar-gold-glow: rgba(251, 191, 36, 0.25);
  --solar-gold-light: #FCD34D;
  --btm-amber: #F97316;
  --oa-emerald: #10B981;
  --oa-emerald-glow: rgba(16, 185, 129, 0.25);
  --oa-emerald-light: #34D399;
  --oa-emerald-accent: #6EE7B7;
  --grid-sky: #38BDF8;
  --grid-sky-light: #93C5FD;
  --grid-sky-glow: rgba(56, 189, 248, 0.25);

  /* Status Semantics */
  --status-ok: #10B981;
  --status-ok-light: #34D399;
  --status-warning: #F59E0B;
  --status-danger: #EF4444;
  --status-danger-light: #F87171;
  --status-danger-glow: rgba(239, 68, 68, 0.35);

  /* Typography Colors */
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-accent: #38BDF8;
  --text-white: #FFFFFF;

  /* Typography Families */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing & Radii (Fluid & Scalable) */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 8px 24px -4px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-subtle);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);

  /* Transitions */
  --trans-fast: 0.15s ease;
  --trans-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Accessible Keyboard Focus Rings */
:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
}

/* User-Agent Reduced Motion Preference (WCAG 2.1 AA) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.45;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(251, 191, 36, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header & Top Navigation
   ========================================================================== */
.app-header {
  background: rgba(11, 17, 30, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.65rem clamp(1rem, 2vw, 2rem);
  width: 100%;
}

.header-container {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(251, 191, 36, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--solar-gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

.brand-title {
  min-width: 0;
}

.brand-title h1 {
  font-size: clamp(1.1rem, 1.25vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.brand-title p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.badge-tag.highlight {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--oa-emerald);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-header {
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all var(--trans-fast);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  white-space: nowrap;
}

.btn-header:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-accent);
}

.btn-header.primary {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--text-white);
}

.btn-header.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}

/* ==========================================================================
   Main Layout Container (Full-Width Responsive Workspace)
   ========================================================================== */
.main-wrapper {
  max-width: 1840px;
  width: 100%;
  margin: 1rem auto;
  padding: 0 clamp(0.75rem, 1.8vw, 1.75rem) 2.5rem;
  display: block;
}

/* ==========================================================================
   Primary Navigation Bar: Full-Width 2-Tab Switcher
   ========================================================================== */
.primary-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem clamp(0.75rem, 1.8vw, 1.75rem);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 56px;
  z-index: 90;
  gap: 1rem;
  flex-wrap: wrap;
}

.primary-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.primary-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.primary-tab-btn:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}

.primary-tab-btn.active {
  color: var(--text-white);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(16, 185, 129, 0.25));
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.35);
}

.primary-tab-btn svg {
  color: var(--grid-sky);
  flex-shrink: 0;
}

.primary-tab-btn.active svg {
  color: var(--grid-sky);
}

/* Main View Containers */
.main-view-container {
  display: none;
  width: 100%;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-view-container.active {
  display: block;
}

/* ==========================================================================
   Tab 1: Full-Width Plant Configuration Bento Grid
   ========================================================================== */
.config-bento-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

/* Tablet Viewports (768px - 1199px): Optimized 2-Column Balanced Bento Grid */
@media (max-width: 1199px) {
  .config-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* Mobile Viewports (< 768px): Single-Column Linear Flow */
@media (max-width: 767px) {
  .config-bento-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }
}

.config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.config-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.25rem;
}

.config-card-title {
  font-size: 0.90rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.config-cta-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
}

.btn-run-simulation {
  background: linear-gradient(135deg, #0284C7, #10B981);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem 2.25rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.45);
  transition: all var(--trans-fast);
}

.btn-run-simulation:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.55);
}

/* ==========================================================================
   Tab 2: Live Tuning Bar (Placed above graph in Results View)
   ========================================================================== */
.live-tuning-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.tuning-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 240px;
  flex: 1;
}

.tuning-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tuning-separator {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

.tuning-scenarios {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.tuning-scenarios .btn-scenario {
  padding: 0.38rem 0.7rem;
  font-size: 0.75rem;
}

/* Sidebar Master Header */
.sidebar-master-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.sidebar-master-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.sidebar-master-title svg {
  color: var(--grid-sky);
  flex-shrink: 0;
}

.btn-sidebar-collapse-master {
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--grid-sky);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.btn-sidebar-collapse-master:hover {
  background: rgba(56, 189, 248, 0.24);
  border-color: var(--grid-sky);
  color: var(--text-white);
  transform: translateX(-2px);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* Quick Uncollapse Sidebar Button (Workspace header) */
.btn-floating-expand-sidebar {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(18, 26, 44, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--grid-sky);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 10px rgba(56, 189, 248, 0.15);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-right: 0.5rem;
  flex-shrink: 0;
  transition: all var(--trans-fast);
}

.btn-floating-expand-sidebar:hover {
  background: var(--bg-card-hover);
  border-color: var(--grid-sky);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 14px rgba(56, 189, 248, 0.25);
}

.main-wrapper.sidebar-collapsed .btn-floating-expand-sidebar {
  display: inline-flex;
}

/* ==========================================================================
   Workspace Master Header - Project Name & OA Solar Captive Capacity Bar
   ========================================================================== */
.workspace-master-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.52rem 0.95rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  gap: 0.75rem;
  margin-bottom: 0.2rem;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.workspace-master-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--solar-gold) 0%, var(--oa-emerald) 100%);
  border-radius: 4px 0 0 4px;
}

.project-identity-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.project-identity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: var(--solar-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-identity-details {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.project-identity-label-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.2;
}

.project-identity-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.project-identity-caption {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.project-identity-content-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
  line-height: 1.25;
}

.project-name-display {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-identity-separator {
  color: var(--border-subtle);
  font-size: 0.8rem;
  user-select: none;
}

.project-capacity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--oa-emerald);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.project-capacity-badge svg {
  color: var(--solar-gold);
  flex-shrink: 0;
}

.project-capacity-badge strong {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--oa-emerald-light);
}

.project-capacity-unit-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.project-identity-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.project-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.project-meta-pill .meta-pill-label {
  color: var(--text-muted);
}

.project-meta-pill .meta-pill-val {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
}

.project-meta-pill.solar .meta-pill-val {
  color: var(--solar-gold);
}

.project-meta-pill.status {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--oa-emerald);
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--oa-emerald);
  box-shadow: 0 0 8px var(--oa-emerald);
  display: inline-block;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

@media (max-width: 1250px) {
  .project-identity-meta {
    display: none;
  }
}

@media (max-width: 600px) {
  .project-identity-caption {
    display: none;
  }
  .workspace-master-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Panel Accordion Collapsible Cards */
.panel-accordion-header {
  cursor: pointer;
  user-select: none;
}

.btn-panel-accordion {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color var(--trans-fast), background var(--trans-fast);
}

.btn-panel-accordion:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.glass-panel.panel-collapsed .btn-panel-accordion .chevron-icon {
  transform: rotate(-90deg);
}

.glass-panel.panel-collapsed .panel-accordion-content {
  display: none !important;
}

.glass-panel.panel-collapsed {
  padding-bottom: 0.75rem;
}

.glass-panel.panel-collapsed .panel-title-bar {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

/* Fluid breakpoints for standard resolution monitors & zoom */
@media (max-width: 960px) {
  .main-wrapper {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Ensure no child causes horizontal overflow clipping */
.main-wrapper > * {
  min-width: 0;
}

/* ==========================================================================
   Cards & Glass Panels
   ========================================================================== */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(1rem, 1.4vw, 1.35rem);
  transition: border-color var(--trans-fast);
  min-width: 0;
  width: 100%;
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.panel-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-title {
  font-size: clamp(0.88rem, 1.05vw, 0.98rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.panel-title svg {
  color: var(--text-accent);
  flex-shrink: 0;
}

/* ==========================================================================
   Configuration Console (Left Sidebar)
   ========================================================================== */
.config-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.form-group {
  margin-bottom: 0.9rem;
  min-width: 0;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.label-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.select-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-family: var(--font-main);
  transition: all var(--trans-fast);
  cursor: pointer;
}

.select-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* Flexible Unit Input Box (Prevents Number / Text Clipping on Any Screen) */
.input-with-unit {
  display: flex;
  align-items: stretch;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--trans-fast);
  width: 100%;
}

.input-with-unit:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.input-with-unit input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.52rem 0.65rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.95;
}

.input-with-unit .input-unit {
  flex-shrink: 0;
  padding: 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-family: var(--font-mono);
  user-select: none;
}

.input-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  align-items: stretch;
}

.input-grid-2 .form-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
}

.input-grid-2 .form-group .form-label {
  min-height: 1.35rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-grid-2 .form-group .input-with-unit,
.input-grid-2 .form-group .select-control {
  margin-top: auto;
}

@media (max-width: 360px) {
  .input-grid-2 {
    grid-template-columns: 1fr;
  }
}

.policy-callout {
  background: rgba(15, 23, 42, 0.65);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--oa-emerald);
  margin-top: 0.65rem;
}

.policy-callout-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--oa-emerald);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
}

.policy-callout-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.policy-meta-list {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.policy-meta-item {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  gap: 0.5rem;
}

.policy-meta-item span:last-child {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

/* ==========================================================================
   Real-Time Interactive Slider Control Center
   ========================================================================== */
.controls-card {
  background: linear-gradient(180deg, rgba(22, 33, 56, 0.88) 0%, rgba(14, 22, 38, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  position: relative;
  overflow: hidden;
}

.controls-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--solar-gold), var(--oa-emerald), var(--grid-sky));
}

.slider-container {
  margin-bottom: 1.25rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  gap: 0.5rem;
}

.slider-title {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.slider-val-badge {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--grid-sky);
  white-space: nowrap;
}

.slider-val-badge.gold {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--solar-gold);
}

.slider-val-badge.emerald {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--oa-emerald);
}

/* Custom Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 7px;
  background: var(--bg-input-focus);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  transition: background var(--trans-fast);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grid-sky);
  border: 2px solid var(--text-white);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
}

input[type="range"].slider-solar::-webkit-slider-thumb {
  background: var(--solar-gold);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

input[type="range"].slider-solar::-webkit-slider-thumb:hover {
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.9);
}

.slider-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ==========================================================================
   Quick Stress-Test Scenarios (Integrated inside Load Dispatch Profile)
   ========================================================================== */
.chart-scenarios-container {
  margin-bottom: 0.55rem;
  padding: 0.42rem 0.6rem;
  background: rgba(14, 22, 38, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  backdrop-filter: blur(8px);
}

.chart-scenarios-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.1;
  padding: 0 0.1rem;
}

.chart-scenarios-header .scenarios-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0;
}

.chart-scenarios-header .scenarios-title svg {
  color: var(--solar-gold);
}

.chart-scenarios-header .scenarios-subhint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-style: italic;
}

.chart-scenarios-container .scenario-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.btn-scenario {
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all var(--trans-fast);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.btn-scenario .scenario-btn-name {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.btn-scenario .label-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-scenario:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-accent);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-scenario.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.22);
}

.btn-scenario.active .scenario-btn-name {
  color: var(--grid-sky);
}

.btn-scenario.active .label-hint {
  color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 1450px) {
  .chart-scenarios-container .scenario-buttons-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .chart-scenarios-header .scenarios-subhint {
    display: none;
  }
  .chart-scenarios-container .scenario-buttons-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Center & Right Workspace
   ========================================================================== */
.workspace-content {
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 0.95vw, 0.85rem);
  min-width: 0;
  width: 100%;
}

/* KPI Metrics Grid (Fluid Auto-Filling Cards) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(0.45rem, 0.7vw, 0.65rem);
  width: 100%;
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: clamp(0.55rem, 0.75vw, 0.7rem) clamp(0.6rem, 0.8vw, 0.75rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform var(--trans-fast), border-color var(--trans-fast);
  min-width: 0;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  width: 100%;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  flex: 1;
  margin-left: 24px; /* Counterbalance the 24px icon pill on right for perfect optical centering */
}

.kpi-icon-pill {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
}

.kpi-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.25rem, 1.45vw, 1.45rem);
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  justify-content: center;
  text-align: center;
  gap: 0.25rem;
  white-space: nowrap;
  width: 100%;
}

.kpi-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-subtext {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.kpi-card.solar .kpi-icon-pill { color: var(--solar-gold); background: rgba(251, 191, 36, 0.15); }
.kpi-card.green .kpi-icon-pill { color: var(--oa-emerald); background: rgba(16, 185, 129, 0.15); }
.kpi-card.grid .kpi-icon-pill { color: var(--grid-sky); background: rgba(56, 189, 248, 0.15); }
.kpi-card.penalty .kpi-icon-pill { color: var(--status-danger); background: rgba(239, 68, 68, 0.15); }
.kpi-card.savings .kpi-icon-pill { color: var(--oa-emerald); background: rgba(16, 185, 129, 0.15); }

.kpi-card.penalty.has-penalty {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(18, 26, 44, 0.85) 100%);
}

.kpi-card.penalty.has-penalty .kpi-value {
  color: var(--status-danger-light);
}

/* ==========================================================================
   Side-by-Side Analytics Row (Graph: ~37% space [+25% width] | Table: ~63% space)
   ========================================================================== */
.analytics-split-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 2.15fr);
  gap: clamp(0.55rem, 0.85vw, 0.85rem);
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

@media (max-width: 1024px) {
  .analytics-split-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Chart Section (Reduced Size for Compact Side-by-Side View)
   ========================================================================== */
.chart-panel {
  position: relative;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(0.70rem, 0.9vw, 0.95rem);
}

.chart-panel .panel-title-bar {
  margin-bottom: 0.45rem;
  padding-bottom: 0.40rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chart-legend-custom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

.chart-canvas-wrapper {
  position: relative;
  height: clamp(230px, 30vh, 320px);
  width: 100%;
  min-width: 0;
  flex: 1;
}

/* External Live Hover Block Telemetry Bar (Shown ONLY when hovering over graph blocks) */
.chart-hover-telemetry-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.45rem;
  padding: 0.4rem 0.75rem;
  background: rgba(14, 22, 38, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 12px rgba(56, 189, 248, 0.15);
  gap: 0.5rem;
  flex-wrap: wrap;
  animation: telemetrySlideUp 0.12s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 40px;
}

.chart-hover-telemetry-bar.active {
  display: flex;
}

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

.cht-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.cht-block-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--grid-sky);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.cht-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.cht-metrics-grid {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.cht-metric {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.cht-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cht-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-primary);
}

.cht-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.cht-metric.load .cht-val {
  color: var(--text-white);
}

.cht-metric.btm .cht-val {
  color: var(--solar-gold);
}

.cht-metric.oa .cht-val {
  color: var(--oa-emerald);
}

.cht-metric.grid .cht-val {
  color: var(--grid-sky);
}

.cht-metric.dev .cht-val {
  color: var(--text-primary);
}

.cht-metric.penalty .cht-val {
  color: var(--text-muted);
}

/* ==========================================================================
   96-Block Dispatch Table (Expanded Horizontal Space ~60%)
   ========================================================================== */
.table-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  padding: clamp(0.75rem, 1vw, 1rem);
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

.table-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-surface);
  padding: 0.18rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.28rem 0.6rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--bg-input);
  color: var(--text-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.table-scroll-container {
  overflow-x: auto;
  height: clamp(230px, 30vh, 320px);
  max-height: clamp(230px, 30vh, 320px);
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(11, 17, 30, 0.65);
  width: 100%;
  min-width: 0;
  flex: 1;
}

.table-scroll-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
}

/* ==========================================================================
   24-Hour Time-Block Scrubber & Real-Time Power Flow Meter (Bottom Positioned)
   ========================================================================== */
.scrubber-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(0.6rem, 0.9vw, 0.8rem) clamp(0.8rem, 1.2vw, 1.1rem);
  min-width: 0;
  width: 100%;
}

.scrubber-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.scrubber-title-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.block-indicator-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.22rem 0.7rem;
  border-radius: 9999px;
  background: linear-gradient(90deg, #0284C7, #0EA5E9);
  color: var(--text-white);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.35);
  white-space: nowrap;
}

.scrubber-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-ctrl {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-ctrl:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-accent);
}

/* Instant Power Flow Diagram */
.power-flow-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
}

@media (max-width: 820px) {
  .power-flow-bar {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }
}

.flow-node {
  background: rgba(14, 22, 38, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.flow-node-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-node-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.flow-node.btm .flow-node-val { color: var(--solar-gold); }
.flow-node.oa .flow-node-val { color: var(--oa-emerald); }
.flow-node.grid .flow-node-val { color: var(--grid-sky); }
.flow-node.deviation .flow-node-val { color: var(--status-warning); }

.flow-node-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.flow-node.zero-export-alert {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.08);
}

.flow-node.overdrawl-alert {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

.dispatch-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: center;
}

.dispatch-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  line-height: 1.15;
}

.dispatch-table thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--bg-surface);
}

.dispatch-table thead tr:nth-child(2) th {
  position: sticky;
  top: 25px;
  z-index: 11;
  background: var(--bg-surface-dark);
}

/* Group Headers */
.dispatch-table th.th-group-header {
  padding: 0.32rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border-subtle);
}

.dispatch-table th.th-group-dispatch {
  background: rgba(16, 185, 129, 0.15);
  color: var(--oa-emerald-light);
  border-bottom: 2px solid var(--oa-emerald);
}

.dispatch-table th.th-group-dev {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-danger-light);
  border-bottom: 2px solid rgba(239, 68, 68, 0.55);
}

/* Sub-column Headers */
.dispatch-table th.th-subcol {
  padding: 0.28rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--bg-surface-dark);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.dispatch-table th.th-subcol.btm-col {
  color: var(--solar-gold);
}

.dispatch-table th.th-subcol.oa-col {
  color: var(--oa-emerald);
}

.dispatch-table th.th-subcol.grid-col {
  color: var(--grid-sky);
}

.dispatch-table th.th-subcol.dev-col {
  color: var(--status-danger-light);
}

.dispatch-table td {
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--text-primary);
  text-align: center;
  vertical-align: middle;
}

.dispatch-table tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

.dispatch-table tr.current-scrubbed-row {
  background: rgba(56, 189, 248, 0.16) !important;
  border-left: 3px solid var(--grid-sky);
}

.dispatch-table th:first-child,
.dispatch-table td:first-child,
.dispatch-table th:nth-child(2),
.dispatch-table td:nth-child(2) {
  text-align: center;
}

/* Status Badges in Table */
.badge-ok {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--status-ok-light);
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--solar-gold);
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--status-danger-light);
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

/* ==========================================================================
   Modal Dialogs & Reference Hub
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-smooth);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  transform: translateY(20px);
  transition: transform var(--trans-smooth);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  font-weight: 800;
  color: var(--text-primary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: 6px;
  transition: color var(--trans-fast);
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.modal-section {
  margin-bottom: 1.35rem;
}

.modal-section h3 {
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.modal-section p {
  margin-bottom: 0.65rem;
}

.modal-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-top: 0.65rem;
}

.modal-matrix-table th, .modal-matrix-table td {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.modal-matrix-table th {
  background: #141F33;
  color: var(--text-primary);
  font-weight: 700;
}

/* Policy Dossier Specific Modal Styles */
.policy-modal-card {
  max-width: 1040px;
  max-height: 92vh;
}

.policy-modal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.policy-modal-state-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 260px;
}

.policy-modal-state-select {
  flex: 1;
  background: #0B132B;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  outline: none;
}

.policy-kpi-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.policy-kpi-pill {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.policy-kpi-pill .pk-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.policy-kpi-pill .pk-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  font-family: var(--font-mono);
}

.policy-kpi-pill .pk-sub {
  font-size: 0.72rem;
  color: var(--solar-gold);
}

.settlement-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.settlement-model-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.settlement-model-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.settlement-model-card.model-net-metering::before {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}
.settlement-model-card.model-geoa::before {
  background: linear-gradient(90deg, #06B6D4, #3B82F6);
}
.settlement-model-card.model-group-captive::before {
  background: linear-gradient(90deg, #10B981, #34D399);
}
.settlement-model-card.model-third-party::before {
  background: linear-gradient(90deg, #8B5CF6, #A78BFA);
}

.sm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sm-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sm-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-exempt {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-payable {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-capped {
  background: rgba(6, 182, 212, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.badge-btm {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.sm-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sm-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.35rem;
}

.sm-detail-item .smd-label {
  color: var(--text-muted);
  flex: 1;
}

.sm-detail-item .smd-val {
  color: #FFFFFF;
  font-weight: 600;
  text-align: right;
  font-family: var(--font-mono);
}

.sm-summary-box {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 0.65rem;
  font-size: 0.775rem;
  line-height: 1.45;
  color: #CBD5E1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.losses-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.loss-chip {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.loss-chip .lc-volt {
  color: var(--text-muted);
  font-weight: 600;
}

.loss-chip .lc-val {
  color: #38BDF8;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Responsive Adaptations for Smaller Screens
   ========================================================================== */
@media (max-width: 900px) {
  .header-badges {
    display: none; /* Hide secondary decorative tags on compact viewports to prevent wrapping */
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 0.65rem 0.85rem;
  }
  .brand-title p {
    display: none;
  }
  .main-wrapper {
    padding: 0 0.65rem 2rem;
    gap: 1rem;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .scenario-buttons-grid {
    grid-template-columns: 1fr;
  }
  .power-flow-bar {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   SLDC Print Preview & Print Dossier Styles
   ========================================================================== */
.print-preview-modal-card {
  max-width: 960px;
  width: 95%;
  max-height: 92vh;
}

.print-modal-scroll {
  background: #090E18;
  padding: 1.5rem;
  overflow-y: auto;
}

/* Official SLDC Dossier Sheet (Screen Preview & Paper Output) */
.sldc-dossier-sheet {
  background: #FFFFFF;
  color: #111827;
  padding: 2.25rem 2.5rem;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  margin: 0 auto;
  max-width: 880px;
  box-sizing: border-box;
}

.sldc-dossier-header {
  border-bottom: 2px solid #0F172A;
  padding-bottom: 0.85rem;
  margin-bottom: 1.15rem;
  text-align: center;
}

.sldc-dossier-header .sldc-authority-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0F172A;
  margin-bottom: 0.2rem;
}

.sldc-dossier-header .sldc-form-title {
  font-size: 14px;
  font-weight: 800;
  color: #0284C7;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.sldc-dossier-header .sldc-form-subtitle {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}

.sldc-section-heading {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0F172A;
  background: #F1F5F9;
  padding: 4px 8px;
  border-left: 3px solid #0284C7;
  margin: 1rem 0 0.5rem;
}

.sldc-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.85rem;
  font-size: 12px;
}

.sldc-meta-table td {
  padding: 4px 8px;
  border: 1px solid #CBD5E1;
  vertical-align: top;
}

.sldc-meta-table td.meta-label {
  background: #F8FAFC;
  font-weight: 700;
  color: #334155;
  width: 25%;
}

.sldc-meta-table td.meta-val {
  color: #0F172A;
  font-weight: 600;
}

.sldc-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.sldc-summary-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  padding: 6px 10px;
}

.sldc-summary-box .sum-label {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  color: #475569;
}

.sldc-summary-box .sum-val {
  font-size: 14px;
  font-weight: 800;
  color: #0F172A;
  font-family: 'Fira Code', monospace;
  margin-top: 2px;
}

.sldc-dossier-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 12px;
  text-align: right;
  font-family: 'Fira Code', monospace;
}

.sldc-dossier-table th, .sldc-dossier-table td {
  border: 1px solid #CBD5E1;
  padding: 3.5px 5px;
}

.sldc-dossier-table th {
  background: #E2E8F0;
  color: #0F172A;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
}

.sldc-dossier-table th:first-child,
.sldc-dossier-table td:first-child,
.sldc-dossier-table th:nth-child(2),
.sldc-dossier-table td:nth-child(2) {
  text-align: left;
}

.sldc-dossier-table tr:nth-child(even) td {
  background: #F8FAFC;
}

.sldc-cert-block {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
}

.sldc-cert-block h4 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: #0F172A;
  margin-bottom: 0.35rem;
}

.sldc-sign-block {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #CBD5E1;
  font-size: 12px;
}

.sign-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sign-col .sign-line {
  margin-top: 2.5rem;
  border-top: 1px dashed #64748B;
  padding-top: 4px;
  font-weight: 700;
  color: #0F172A;
}

/* Screen Display Hiding: Ensure Print Dossier NEVER displays on screen or at the bottom of the app */
#sldcPrintDossier,
.sldc-print-dossier {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -99999px !important;
  top: -99999px !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Print Output Exclusivity via @media print */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 8mm 8mm 8mm;
  }
  
  html, body {
    background: #FFFFFF !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide entire interactive Web App */
  .app-header,
  .main-wrapper,
  .modal-overlay {
    display: none !important;
  }

  /* Show solely the Print Dossier Sheet */
  #sldcPrintDossier,
  .sldc-print-dossier {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    pointer-events: auto !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .sldc-dossier-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .sldc-dossier-table th {
    background: #E2E8F0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sldc-dossier-table tr:nth-child(even) td {
    background: #F8FAFC !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sldc-section-heading {
    background: #E2E8F0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sldc-cert-block {
    page-break-inside: avoid;
  }

  .sldc-sign-block {
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   Solar Site Coordinates & PVGIS Meteorological Simulation Styling
   ========================================================================== */
.input-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}

.site-met-subblock {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.4rem;
}

.site-met-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.site-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}

.rooftop-dot {
  background: var(--oa-emerald);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.oa-dot {
  background: var(--status-warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.btn-detect-gps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60A5FA;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-detect-gps:hover {
  background: rgba(59, 130, 246, 0.28);
  color: var(--grid-sky-light);
}

/* Google Maps Style Address Search Bar */
.address-search-group {
  position: relative;
}

.map-search-bar {
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(14, 22, 38, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
  transition: all var(--trans-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.map-search-bar:focus-within {
  border-color: var(--text-accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.map-pin-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 0.55rem;
  padding-right: 0.2rem;
  color: var(--status-danger-light);
  flex-shrink: 0;
}

.map-search-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.45rem 0.4rem !important;
  font-size: 0.8125rem !important;
  color: var(--text-primary) !important;
  flex: 1;
  min-width: 0;
}

.map-search-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.map-search-input::-webkit-calendar-picker-indicator {
  display: none !important;
  opacity: 0 !important;
}

.btn-map-search {
  background: rgba(56, 189, 248, 0.15);
  border: none;
  border-left: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--grid-sky);
  padding: 0.42rem 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
  flex-shrink: 0;
}

.btn-map-search:hover {
  background: rgba(56, 189, 248, 0.35);
  color: #FFFFFF;
}

.btn-map-search.searching svg {
  animation: pvgis-spin 1s linear infinite;
}

/* Dynamic Address Search Autocomplete Dropdown */
.geo-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(13, 20, 36, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75), 0 0 14px rgba(56, 189, 248, 0.2);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1200;
  padding: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}

#oaAddressSuggestions {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75), 0 0 14px rgba(16, 185, 129, 0.2);
  scrollbar-color: rgba(16, 185, 129, 0.4) transparent;
}

.geo-suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
}

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

.geo-suggestion-item:hover,
.geo-suggestion-item.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: transparent;
}

#oaAddressSuggestions .geo-suggestion-item:hover,
#oaAddressSuggestions .geo-suggestion-item.active {
  background: rgba(16, 185, 129, 0.18);
}

.geo-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.85rem;
}

.geo-item-body {
  flex: 1;
  min-width: 0;
}

.geo-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.geo-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #F8FAFC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo-item-sub {
  font-size: 0.72rem;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.geo-item-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: #64748B;
}

.geo-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.badge-industrial {
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-solarpark {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-district {
  background: rgba(168, 85, 247, 0.18);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-live {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-gps {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.geo-match-highlight {
  color: #38BDF8;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(56, 189, 248, 0.5);
}

#oaAddressSuggestions .geo-match-highlight {
  color: #FBBF24;
  text-decoration-color: rgba(245, 158, 11, 0.5);
}

.geo-dropdown-footer {
  padding: 0.3rem 0.5rem;
  font-size: 0.68rem;
  color: #64748B;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.2rem;
}

.geo-dropdown-empty {
  padding: 0.75rem;
  font-size: 0.75rem;
  color: #94A3B8;
  text-align: center;
}

.geo-dropdown-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem;
  font-size: 0.75rem;
  color: #38BDF8;
}

.badge-opt-tilt {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--oa-emerald);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.02em;
}

.highlight-updated {
  animation: pulse-tilt-border 1.4s ease-out;
}

@keyframes pulse-tilt-border {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.85);
    border-color: #10B981 !important;
  }
  60% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    border-color: #10B981 !important;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.pvgis-telemetry-box {
  margin-top: 0.75rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 8px;
  padding: 0.6rem;
}

.pvgis-telemetry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pvgis-telemetry-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--grid-sky-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-pvgis-sync {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--oa-emerald-light);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pvgis-sync:hover {
  background: rgba(16, 185, 129, 0.28);
  color: var(--oa-emerald-accent);
  border-color: rgba(16, 185, 129, 0.6);
}

.pvgis-chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.pvgis-chip {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  display: flex;
  flex-direction: column;
}

.pvgis-chip-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pvgis-chip-val {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1px;
}

.badge-mini-accent {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.18);
  color: var(--oa-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.35);
  text-transform: uppercase;
}

@keyframes pvgisSpin {
  100% {
    transform: rotate(360deg);
  }
}

.pvgis-spinning {
  animation: pvgisSpin 1s linear infinite;
}

/* ==========================================================================
   Auto-Save Status Indicator & Header Enhancements
   ========================================================================== */
.autosave-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--oa-emerald-light);
}

.autosave-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--oa-emerald);
  box-shadow: 0 0 8px var(--oa-emerald);
}

.btn-header.accent {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border-color: rgba(245, 158, 11, 0.5);
  color: var(--solar-gold-light);
  font-weight: 700;
}

.btn-header.accent:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(217, 119, 6, 0.55));
  border-color: rgba(245, 158, 11, 0.8);
  color: var(--text-white);
}

/* ==========================================================================
   Executive Workspace Navigation Tabs
   ========================================================================== */
.workspace-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.35rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.workspace-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.workspace-tab-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.workspace-tab-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(16, 185, 129, 0.2));
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--text-white);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.2);
}

.workspace-tab-content {
  display: none;
}

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

/* ==========================================================================
   Bankable Financial Dashboard & Tab Views
   ========================================================================== */
.bankable-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.bankable-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bankable-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.bankable-kpi-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
}

.bankable-kpi-box.highlight {
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(14, 165, 233, 0.12));
}

.bankable-kpi-box.success {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(16, 185, 129, 0.12));
}

.bkpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.bkpi-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-white);
  margin: 0.35rem 0 0.15rem 0;
}

.bkpi-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.financial-table-scroll {
  max-height: 480px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.financial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: right;
}

.financial-table th {
  background: rgba(15, 23, 42, 0.95);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.6rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.financial-table th:first-child,
.financial-table td:first-child {
  text-align: center;
}

.financial-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
}

.financial-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.dscr-tag-ok {
  color: var(--oa-emerald-light);
  font-weight: 700;
}

/* ==========================================================================
   Landed Cost Waterfall & Rule 3 Card
   ========================================================================== */
.landed-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 900px) {
  .landed-grid-2 {
    grid-template-columns: 1fr;
  }
}

.landed-waterfall-card, .rule3-audit-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.15rem;
}

.waterfall-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.waterfall-table td {
  padding: 0.45rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.waterfall-table td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.badge-pill-green {
  background: rgba(16, 185, 129, 0.2);
  color: var(--oa-emerald-light);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.rule3-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.rule3-badge.compliant {
  background: rgba(16, 185, 129, 0.2);
  color: var(--oa-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.rule3-badge.non-compliant {
  background: rgba(239, 68, 68, 0.2);
  color: var(--status-danger-light);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   BESS & Storage Arbitrage Panel
   ========================================================================== */
.bess-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Bankable DPR Dossier Modal & Print Styling
   ========================================================================== */
.dpr-modal-card {
  max-width: 980px;
  width: 95vw;
  max-height: 90vh;
}

.dpr-document {
  background: var(--bg-surface-dark);
  color: var(--text-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  font-family: var(--font-main);
  line-height: 1.5;
}

.dpr-cover-header {
  border-bottom: 2px solid rgba(245, 158, 11, 0.5);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.dpr-cover-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dpr-badge-confidential {
  background: rgba(239, 68, 68, 0.2);
  color: var(--status-danger-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.dpr-badge-statutory {
  background: rgba(16, 185, 129, 0.2);
  color: var(--oa-emerald-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.dpr-doc-ref {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dpr-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.dpr-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 0 1rem 0;
}

.dpr-project-meta-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.dpr-meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
}

.dpr-meta-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-white);
}

.dpr-section {
  margin-bottom: 2rem;
}

.dpr-section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--solar-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.4rem;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dpr-section-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.dpr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.dpr-kpi-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.dpr-kpi-box.highlight {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.05);
}

.dpr-kpi-box.success {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.dpr-kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.dpr-kpi-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-white);
  margin: 0.25rem 0 0.15rem 0;
}

.dpr-kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dpr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.dpr-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.dpr-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dpr-total-row td {
  font-weight: 700;
  color: var(--text-white);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
}

.dpr-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 850px) {
  .dpr-grid-2 {
    grid-template-columns: 1fr;
  }
}

.dpr-subheading {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 700;
  margin: 0 0 0.65rem 0;
}

.dpr-table-compact {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.dpr-table-compact td {
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dpr-table-compact td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.dpr-audit-card {
  border-radius: 8px;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dpr-audit-card.compliant {
  border-color: rgba(16, 185, 129, 0.4);
}

.audit-status-badge {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--oa-emerald-light);
  margin-bottom: 0.85rem;
}

.audit-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.audit-item {
  display: flex;
  gap: 0.6rem;
  font-size: 0.78rem;
}

.audit-bullet {
  color: var(--oa-emerald);
  font-weight: 800;
}

.audit-item p {
  margin: 0.15rem 0 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.audit-liability-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dpr-table-scroll {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.dpr-table-financial {
  font-size: 0.75rem;
  text-align: right;
}

.dpr-table-financial th {
  text-align: right;
  font-size: 0.75rem;
  font-weight: 700;
}

.dpr-table-financial th:first-child,
.dpr-table-financial td:first-child {
  text-align: center;
}

.dscr-ok {
  color: var(--oa-emerald-light);
}

.dpr-esg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.dpr-esg-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.esg-icon {
  font-size: 1.8rem;
  margin-bottom: 0.35rem;
}

.esg-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--oa-emerald-light);
}

.esg-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.esg-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dpr-sign-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.dpr-sign-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dpr-sign-line {
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  margin-bottom: 0.5rem;
  width: 80%;
}

/* ==========================================================================
   Responsive Adaptations (Tablet 768px-1199px & Mobile <768px)
   ========================================================================== */
@media (max-width: 1199px) {
  .analytics-split-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .live-tuning-bar {
    gap: 0.75rem;
  }

  .tuning-group {
    min-width: 200px;
  }
}

@media (max-width: 900px) {
  .input-grid-3 {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .dpr-esg-grid {
    grid-template-columns: 1fr;
  }

  .dpr-sign-block {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* ==========================================================================
   AI & SERC Optimal Capacity Sizing Advisor Widget
   ========================================================================== */
.sizing-advisor-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.sizing-advisor-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--solar-gold) 0%, var(--oa-emerald) 50%, var(--grid-sky) 100%);
}

.sizing-advisor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sizing-advisor-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.01em;
}

.sizing-advisor-title svg {
  color: var(--solar-gold);
}

.btn-apply-sizing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.4));
  border: 1px solid rgba(16, 185, 129, 0.6);
  color: var(--oa-emerald-light);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.btn-apply-sizing:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.45), rgba(5, 150, 105, 0.65));
  border-color: var(--oa-emerald-light);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

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

.btn-apply-sizing.applied {
  background: rgba(16, 185, 129, 0.6) !important;
  color: #FFFFFF !important;
  border-color: var(--oa-emerald) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6) !important;
}

.sizing-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.25rem;
}

.btn-sizing-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.btn-sizing-mode:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-sizing-mode.active {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--text-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 0 8px rgba(16, 185, 129, 0.1);
}

.btn-sizing-mode .mode-icon {
  font-size: 0.85rem;
}

.btn-sizing-mode .mode-text {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.btn-sizing-mode .mode-tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.btn-sizing-mode.active .mode-tag {
  background: rgba(16, 185, 129, 0.2);
  color: var(--oa-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.sizing-rec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

@media (max-width: 600px) {
  .sizing-rec-grid {
    grid-template-columns: 1fr;
  }
}

.sizing-rec-item {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.2s ease;
}

.sizing-rec-item.rooftop {
  border-left: 3px solid var(--solar-gold);
}

.sizing-rec-item.oa {
  border-left: 3px solid var(--oa-emerald);
}

.sizing-rec-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.sizing-rec-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
}

.sizing-rec-item.rooftop .sizing-rec-val {
  color: var(--solar-gold-light);
}

.sizing-rec-item.oa .sizing-rec-val {
  color: var(--oa-emerald-light);
}

.sizing-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sizing-rec-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.25;
}

.sizing-rec-details {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.45rem;
}

.sizing-rec-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.sizing-rec-meta strong {
  color: var(--text-white);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Solar Energy Banking & TOD Settlement Ledger Panel
   ========================================================================== */
.banking-ledger-panel {
  margin-top: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 1.1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.banking-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--oa-emerald-light);
}

.banking-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
  margin-bottom: 0.85rem;
}

.banking-metric-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.banking-metric-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.8);
}

.banking-metric-card.deduction {
  border-left: 3px solid #F87171;
  background: rgba(239, 68, 68, 0.05);
}

.banking-metric-card.highlight {
  border-left: 3px solid var(--grid-sky);
  background: rgba(56, 189, 248, 0.06);
}

.banking-metric-card.success {
  border-left: 3px solid var(--oa-emerald);
  background: rgba(16, 185, 129, 0.06);
}

.banking-metric-card.savings {
  border-left: 3px solid var(--solar-gold);
  background: rgba(245, 158, 11, 0.06);
}

.bm-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.bm-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
}

.banking-metric-card.deduction .bm-val {
  color: #F87171;
}

.banking-metric-card.highlight .bm-val {
  color: var(--grid-sky-light);
}

.banking-metric-card.success .bm-val {
  color: var(--oa-emerald-light);
}

.banking-metric-card.savings .bm-val {
  color: var(--solar-gold-light);
}

.bm-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.bm-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.25;
}

/* TOD Slot Banking Offset Breakdown */
.tod-banking-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.75rem;
}

.tod-slot-item {
  background: rgba(15, 23, 42, 0.55);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tod-slot-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.tod-slot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tod-slot-dot.night { background: #A78BFA; box-shadow: 0 0 6px rgba(167, 139, 250, 0.6); }
.tod-slot-dot.morning { background: var(--solar-gold); box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
.tod-slot-dot.evening { background: #F87171; box-shadow: 0 0 6px rgba(248, 113, 113, 0.6); }
.tod-slot-dot.day { background: var(--grid-sky); box-shadow: 0 0 6px rgba(56, 189, 248, 0.6); }

.tod-slot-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.tod-slot-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tod-slot-units {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-white);
}

.tod-slot-rate {
  font-size: 0.72rem;
  color: var(--oa-emerald-light);
  font-weight: 600;
}

/* Flash Animation when applying sizing */
@keyframes sizingFlash {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.35); border-color: var(--oa-emerald); }
  100% { box-shadow: none; }
}

.highlight-sizing-apply {
  animation: sizingFlash 1.2s ease-out;
}

/* ==========================================================================
   Touch Hit Target Optimization (WCAG 2.1 / 2.2 AAA >= 44x44px Touch Targets)
   ========================================================================== */
@media (pointer: coarse), (hover: none), (max-width: 1024px) {
  /* Buttons & Actionable Controls */
  .btn-header,
  .btn-scenario,
  .filter-btn,
  .workspace-tab-btn,
  .primary-tab-btn,
  .btn-run-simulation,
  .btn-pvgis-sync,
  .btn-detect-gps,
  .btn-tab-export,
  .btn-export-dpr {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
  }

  /* Compact Icon Action Buttons */
  .btn-ctrl,
  .btn-close-modal,
  .btn-panel-accordion,
  .btn-map-search {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Form Selects & Inputs */
  .select-control,
  .input-with-unit {
    min-height: 44px;
    box-sizing: border-box;
  }

  /* Range Slider Touch Targets */
  input[type="range"] {
    height: 10px;
    margin: 8px 0;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }

  .scrubber-slider {
    height: 12px;
  }
}



