/* ===================================================================
   TETES SMARTFARM OS - OFFICIAL DESIGN SYSTEM
   Berdasarkan Graphic Standard Manual (GSM) & Infografis Resmi TETES
   Warna Resmi:
   - Sky Water Blue: #1BAAF0
   - Deep Navy:      #0B355E
   - Leaf Green:     #45A94B
   - Fresh Lime:     #68C75E
   =================================================================== */

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

:root {
  /* Official TETES GSM Palette */
  --tetes-blue: #1BAAF0;
  --tetes-blue-light: #e0f2fe;
  --tetes-blue-border: #bae6fd;
  --tetes-navy: #0B355E;
  --tetes-navy-light: #164e87;
  --tetes-green: #45A94B;
  --tetes-green-light: #ecfdf5;
  --tetes-green-border: #a7f3d0;
  --tetes-lime: #68C75E;

  /* Fresh Agricultural & Clean Daylight Atmosphere */
  --bg-app: #f4faf6;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-card: #ffffff;
  --bg-card-hover: #f9fdfa;
  --bg-card-inner: #f3f8f5;
  --bg-table-row: #ffffff;
  --bg-table-stripe: #f8faf9;
  
  /* Primary & Accent Accents */
  --brand-primary: #45A94B;
  --brand-primary-hover: #35883a;
  --brand-primary-light: #e8f7ea;
  --brand-border: #bce4bf;

  --water-accent: #1BAAF0;
  --water-accent-light: #e0f2fe;
  --water-border: #bae6fd;
  
  --solar-accent: #f59e0b;
  --solar-accent-light: #fef3c7;
  --solar-border: #fde68a;

  --cyan-accent: #0284c7;
  --blue-accent: #1BAAF0;
  --indigo-accent: #0B355E;
  --rose-accent: #e11d48;
  --amber-accent: #d97706;

  /* Neutrals & Text (High Contrast & Clean) */
  --text-main: #0B355E; /* Official Navy */
  --text-body: #1e293b; /* Dark Slate */
  --text-muted: #475569;
  --text-dim: #64748b;
  --border-subtle: #e2ede5;
  --border-medium: #c8e0cf;
  --border-focus: #1BAAF0;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout Dimensions */
  --sidebar-width: 270px;
  --sidebar-collapsed: 76px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --shadow-panel: 0 10px 25px -5px rgba(11, 53, 94, 0.05), 0 4px 12px rgba(69, 169, 75, 0.04);
  --shadow-sm: 0 2px 8px rgba(11, 53, 94, 0.04);
  --shadow-card: 0 4px 18px rgba(11, 53, 94, 0.05);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  height: 100%;
  overflow-x: hidden;
  overflow-y: scroll; /* Stable single root scroll container */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: var(--font-sans);
  background-color: #e8f7fa;
  background-image: 
    radial-gradient(circle at 12px 12px, rgba(27, 170, 240, 0.22) 2px, transparent 2.5px),
    linear-gradient(180deg, rgba(224, 242, 254, 0.76) 0%, rgba(240, 253, 244, 0.88) 360px, rgba(244, 250, 246, 0.94) 100%),
    url('../icons/bg-farm-sky.jpg');
  background-size: 28px 28px, 100% 100%, cover;
  background-attachment: fixed, fixed, fixed;
  background-position: top left, top center, top center;
  color: var(--text-body);
  min-height: 100%;
  width: 100%;
  position: relative;
  overflow-x: hidden;
  overflow-y: visible; /* Prevents nested scroll trap */
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.mono-font {
  font-family: var(--font-mono);
}

/* ===================================================================
   SIGNATURE INFOGRAPHIC PILL BADGES & 3D TITLES (SESUAI PDF)
   =================================================================== */
.section-pill-green {
  background: linear-gradient(180deg, #5ec843 0%, #3ca82b 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.2px;
  padding: 6px 20px;
  border-radius: 9999px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(60, 168, 43, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.section-pill-blue {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.2px;
  padding: 6px 20px;
  border-radius: 9999px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.section-pill-navy {
  background: linear-gradient(180deg, #164e87 0%, #0B355E 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.2px;
  padding: 6px 20px;
  border-radius: 9999px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(11, 53, 94, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.badge-pill-pdf {
  background: linear-gradient(135deg, #68C75E 0%, #45A94B 100%);
  color: #ffffff;
  border-radius: 9999px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 4px 12px rgba(69, 169, 75, 0.25);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.badge-pill-blue {
  background: linear-gradient(135deg, #38bdf8 0%, #1BAAF0 100%);
  color: #ffffff;
  border-radius: 9999px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 4px 12px rgba(27, 170, 240, 0.25);
  letter-spacing: -0.01em;
}

/* 3D Bubble Title matching PDF typography */
.pdf-brand-title {
  font-size: 2.6rem;
  font-weight: 900;
  color: #48b73a;
  text-shadow: 
    0 1px 0 #3b9e2f,
    0 2px 0 #348e28,
    0 3px 0 #2c7a22,
    0 4px 8px rgba(11, 53, 94, 0.25);
  -webkit-text-stroke: 1.5px #ffffff;
  letter-spacing: 1px;
  line-height: 1;
  display: inline-block;
}

.pdf-brand-subtitle {
  font-size: 1.3rem;
  font-weight: 800;
  color: #2b7d23;
  margin-top: 4px;
  line-height: 1.25;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

/* ===================================================================
   APP LAYOUT (SIDEBAR + MAIN CONTENT)
   =================================================================== */
.enterprise-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* --- SIDEBAR --- */
.app-sidebar {
  width: var(--sidebar-width);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1.5px solid rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 4px 0 24px rgba(11, 53, 94, 0.05);
}

.sidebar-header {
  padding: 22px 20px 18px;
  border-bottom: 1.5px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.sidebar-brand-logo {
  max-height: 48px;
  max-width: 100%;
  object-fit: contain;
}

.sidebar-header-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 20px 20px 8px;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: visible; /* Prevents capturing wheel events away from main document */
}

/* Ensure chart canvases never trap vertical touch/wheel gestures */
canvas {
  touch-action: pan-y !important;
}

.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition);
  position: relative;
}

.nav-item-btn i {
  font-size: 16px;
  width: 22px;
  text-align: center;
  color: var(--text-dim);
  transition: var(--transition);
}

.nav-item-btn:hover {
  background-color: var(--tetes-green-light);
  color: var(--tetes-navy);
}

.nav-item-btn:hover i {
  color: var(--brand-primary);
}

.nav-item-btn.active {
  background: linear-gradient(135deg, rgba(69, 169, 75, 0.12) 0%, rgba(27, 170, 240, 0.08) 100%);
  color: var(--tetes-navy);
  font-weight: 700;
  border: 1.5px solid var(--brand-border);
}

.nav-item-btn.active i {
  color: var(--brand-primary);
}

.nav-item-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: linear-gradient(180deg, var(--tetes-lime), var(--tetes-green));
  border-radius: 0 4px 4px 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1.5px solid var(--border-subtle);
  background-color: var(--bg-card-inner);
}

.system-health-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tetes-lime);
  box-shadow: 0 0 10px var(--tetes-lime);
  animation: pulse-dot 2s infinite;
}

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

/* --- MAIN CONTENT AREA --- */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* Top App Bar */
.top-app-bar {
  min-height: 62px;
  height: auto;
  background-color: var(--bg-header);
  border-bottom: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(11, 53, 94, 0.03);
  gap: 14px;
  flex-wrap: wrap;
}

.location-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #ffffff;
  border: 1.5px solid var(--border-medium);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.location-badge i {
  color: var(--brand-primary);
}

.location-subtext {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  line-height: 1.35;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-telemetry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: 9999px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.3;
}

.quick-telemetry-chip span,
.quick-telemetry-chip strong {
  white-space: nowrap;
}

.quick-telemetry-chip strong {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 700;
}

.quick-telemetry-chip.chip-clickable {
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.quick-telemetry-chip.chip-clickable:hover {
  border-color: var(--brand-primary);
  background: #f0fdf4;
  transform: translateY(-1px);
}

.btn-enterprise {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  font-family: var(--font-sans);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-enterprise-primary {
  background: linear-gradient(135deg, var(--tetes-lime), var(--tetes-green));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(69, 169, 75, 0.25);
}

.btn-enterprise-primary:hover {
  background: linear-gradient(135deg, var(--tetes-green), #328237);
  box-shadow: 0 6px 16px rgba(69, 169, 75, 0.35);
  transform: translateY(-1px);
}

.btn-enterprise-secondary {
  background-color: #ffffff;
  border-color: var(--border-medium);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-enterprise-secondary:hover {
  background-color: var(--bg-card-inner);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-enterprise-solar {
  background-color: var(--solar-accent-light);
  border-color: var(--solar-border);
  color: var(--solar-accent);
  font-weight: 700;
}

.btn-enterprise-solar:hover {
  background-color: var(--solar-accent);
  color: #ffffff;
}

/* Page Content Viewport */
.page-viewport {
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ===================================================================
   HERO INFOGRAPHIC BANNER (SESUAI INFOGRAFIS PDF)
   =================================================================== */
.pdf-hero-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2.5px solid #ffffff;
  border-radius: 28px;
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  box-shadow: 0 16px 40px rgba(11, 53, 94, 0.1), 0 4px 12px rgba(69, 169, 75, 0.08);
  position: relative;
  overflow: hidden;
}

.pdf-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--tetes-blue), var(--tetes-green), var(--tetes-lime));
}

.pdf-hero-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1.4;
}

.pdf-hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pdf-chili-photo-frame {
  width: 145px;
  height: 190px;
  border-radius: 80px 80px 28px 28px;
  overflow: hidden;
  border: 4px solid #ffffff;
  box-shadow: 0 12px 28px rgba(11, 53, 94, 0.2), 0 0 0 3px var(--tetes-green);
  position: relative;
  background: #1e2e22;
  transition: var(--transition);
}

.pdf-chili-photo-frame:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 36px rgba(11, 53, 94, 0.25), 0 0 0 4px var(--tetes-blue);
}

.pdf-chili-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdf-chili-caption {
  font-size: 11px;
  font-weight: 700;
  color: var(--tetes-navy);
  background: #ffffff;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 5px;
}

.pdf-hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 0.9;
  min-width: 250px;
}

.hero-saving-badge {
  width: 100%;
  background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
  border: 2px solid var(--brand-border);
  border-radius: 22px;
  padding: 18px 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(69, 169, 75, 0.16);
  position: relative;
}

.hero-saving-val {
  font-size: 42px;
  font-weight: 900;
  color: #388e3c;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 4px rgba(56, 142, 60, 0.15);
}

.hero-saving-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--tetes-navy);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Benchmark Horizontal Comparison Bars */
.benchmark-bars-box {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.benchmark-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.benchmark-header-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

.benchmark-track {
  height: 12px;
  background: #e2ede5;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.benchmark-fill-conv {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7dd3fc, #38bdf8);
  border-radius: 9999px;
}

.benchmark-fill-tetes {
  height: 100%;
  width: 12.89%;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 9999px;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.badge-test-days {
  margin-top: 8px;
  background: #ffffff;
  border: 1.5px solid var(--brand-border);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tetes-green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

/* ===================================================================
   6-STEP WORKFLOW "CARA KERJA TETES" (SESUAI INFOGRAFIS PDF)
   =================================================================== */
.workflow-section-panel {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2.5px solid #ffffff;
  border-radius: 26px;
  padding: 22px 26px;
  box-shadow: 0 12px 32px rgba(11, 53, 94, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.workflow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  position: relative;
}

@media (max-width: 1100px) {
  .workflow-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

.workflow-node {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: 20px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.workflow-node:hover {
  transform: translateY(-4px);
  border-color: var(--tetes-blue);
  box-shadow: 0 10px 25px rgba(27, 170, 240, 0.18);
}

.workflow-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #12487e 0%, #0B355E 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(11, 53, 94, 0.28);
  position: relative;
}

.workflow-step-num {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, var(--tetes-lime), var(--tetes-green));
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.workflow-node-title {
  font-weight: 800;
  font-size: 13px;
  color: var(--tetes-navy);
  line-height: 1.25;
}

.workflow-node-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===================================================================
   4 IMPACT PILLARS (DAMPAK & POTENSI DARI PDF)
   =================================================================== */
.impact-pillars-panel {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2.5px solid #ffffff;
  border-radius: 26px;
  padding: 22px 26px;
  box-shadow: 0 12px 32px rgba(11, 53, 94, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

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

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

.impact-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.impact-card:hover {
  transform: translateY(-3px);
  border-color: var(--tetes-green);
  box-shadow: 0 8px 24px rgba(69, 169, 75, 0.15);
}

.impact-icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-card-inner);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1.5px solid var(--border-subtle);
}

/* ===================================================================
   SYSTEM STATUS BANNER (SCADA STYLE)
   =================================================================== */
.scada-status-strip {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid #ffffff;
  border-radius: 20px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 8px 24px rgba(11, 53, 94, 0.06);
}

.scada-status-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge-chip {
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge-chip.active-auto {
  background: var(--tetes-green-light);
  color: var(--tetes-green);
  border: 1.5px solid var(--brand-border);
}

.status-badge-chip.active-manual {
  background: var(--solar-accent-light);
  color: var(--solar-accent);
  border: 1.5px solid var(--solar-border);
}

.status-desc-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.status-desc-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

/* ===================================================================
   SMART DEVICE GUARDIAN (LIVE ONLINE/OFFLINE & POWER TRACKER)
   =================================================================== */
.device-guardian-strip {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid var(--border-subtle);
  border-radius: 20px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 8px 24px rgba(11, 53, 94, 0.06);
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.device-guardian-strip.is-online {
  border-color: #22c55e;
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.92) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.12);
}

.device-guardian-strip.is-offline {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.95) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.14);
}

.guardian-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.guardian-indicator-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.guardian-indicator-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 rgba(34, 197, 94, 0.7);
  animation: guardianPulseGreen 1.8s infinite;
}

.guardian-indicator-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 0 rgba(239, 68, 68, 0.7);
  animation: guardianPulseRed 1.5s infinite;
}

@keyframes guardianPulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.8); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes guardianPulseRed {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.guardian-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--tetes-navy);
}

.guardian-chip {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.guardian-chip.chip-online {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
}

.guardian-chip.chip-offline {
  background: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
}

.guardian-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.guardian-metrics-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.guardian-stat-item {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  min-width: 110px;
  box-shadow: var(--shadow-sm);
}

.guardian-stat-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.guardian-stat-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--tetes-navy);
  margin: 2px 0;
}

.guardian-stat-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Smart Actuator Timing Box */
.actuator-timing-box {
  margin-top: 14px;
  background: var(--bg-card-inner);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.timing-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timing-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.timing-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--tetes-navy);
}

@media (max-width: 900px) {
  .device-guardian-strip {
    flex-direction: column;
    align-items: flex-start;
  }
  .guardian-metrics-right {
    width: 100%;
    justify-content: flex-start;
  }
}

.sim-control-group {
  display: flex;
  align-items: center;
  background: var(--bg-card-inner);
  border: 1.5px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 3px;
}

.sim-btn-compact {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 9999px;
  transition: var(--transition);
}

.sim-btn-compact:hover {
  color: var(--text-main);
}

.sim-btn-compact.active {
  background: var(--brand-primary);
  color: #ffffff;
}

/* ===================================================================
   METRIC KPI SUMMARY CARDS
   =================================================================== */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid #ffffff;
  border-radius: 22px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 28px rgba(11, 53, 94, 0.07);
  transition: var(--transition);
  position: relative;
}

.kpi-card:hover {
  border-color: var(--tetes-green);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(69, 169, 75, 0.16);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-wrapper {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card-inner);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--brand-primary);
  border: 1px solid var(--border-subtle);
}

.kpi-main-val {
  font-size: 30px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0;
}

.kpi-unit {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
}

.kpi-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1.5px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: 8px;
}

.kpi-range-pill {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10.5px;
}

.kpi-range-pill.good { background: #dcfce7; color: #15803d; }
.kpi-range-pill.warn { background: #fef3c7; color: #b45309; }
.kpi-range-pill.alert { background: #fee2e2; color: #b91c1c; }

/* ===================================================================
   PANEL GRIDS & SCADA BLOCKS
   =================================================================== */
.layout-2col-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
}

@media (max-width: 1200px) {
  .layout-2col-grid {
    grid-template-columns: 1fr;
  }
}

.enterprise-panel {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2.5px solid #ffffff;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 14px 36px rgba(11, 53, 94, 0.08);
}

.panel-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1.5px solid var(--border-subtle);
  padding-bottom: 14px;
}

.panel-heading {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-heading i {
  color: var(--brand-primary);
  font-size: 16px;
}

.panel-tag-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
}

input[type="text"], input[type="number"], select {
  color: var(--tetes-navy) !important;
  background-color: #ffffff !important;
  border: 1.5px solid var(--border-medium);
  border-radius: 8px;
  font-weight: 700 !important;
}

/* ===================================================================
   TELEMETRY GAUGE & METRIC MATRIX
   =================================================================== */
.telemetry-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.scada-metric-box {
  background: var(--bg-card-inner);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
}

.scada-metric-box:hover {
  border-color: var(--brand-border);
  background: #ffffff;
}

.scada-metric-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.scada-metric-val {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin: 2px 0;
}

.scada-metric-sub {
  font-size: 10.5px;
  color: var(--text-dim);
}

/* ===================================================================
   SOLAR EBT & BATTERY SCADA BLOCK
   =================================================================== */
.ebt-scada-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--bg-card-inner);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.ebt-diagram-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pv-spec-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.pv-spec-val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.battery-scada-gauge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.battery-scada-meter {
  height: 22px;
  width: 100%;
  background: #e2e8f0;
  border: 1.5px solid var(--border-medium);
  border-radius: 9999px;
  padding: 2px;
  position: relative;
  overflow: hidden;
}

.battery-scada-fill {
  height: 100%;
  width: 88%;
  background: linear-gradient(90deg, var(--tetes-lime), var(--tetes-green));
  border-radius: 9999px;
  transition: width 0.6s ease;
}

/* ===================================================================
   ACTUATOR CONTROL CONSOLE (INDUSTRIAL STYLE)
   =================================================================== */
.control-rack-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mode-segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-card-inner);
  border: 1.5px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 3px;
  gap: 4px;
}

.mode-tab-btn {
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 700;
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.mode-tab-btn.active {
  background: #ffffff;
  color: var(--tetes-navy);
  box-shadow: var(--shadow-sm);
}

.actuator-switches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.actuator-card-unit {
  background: var(--bg-card-inner);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}

.actuator-card-unit.is-active {
  background: #ffffff;
  border-color: var(--tetes-blue-border);
  box-shadow: 0 4px 16px rgba(27, 170, 240, 0.12);
}

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

.actuator-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.actuator-status-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.actuator-status-tag.on { background: #dcfce7; color: #15803d; }
.actuator-status-tag.off { background: #f1f5f9; color: #64748b; }

/* Industrial Toggle Switch Styling */
.actuator-card {
  background: var(--bg-card-inner);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}

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

.actuator-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.actuator-state-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.actuator-state-badge.on {
  background: #dcfce7;
  color: #15803d;
}

.actuator-state-badge.off {
  background: #f1f5f9;
  color: #64748b;
}

.switch-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.industrial-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.industrial-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ind-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 9999px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ind-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.industrial-toggle input:checked + .ind-slider {
  background: linear-gradient(135deg, var(--tetes-lime), var(--tetes-green));
}

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

.industrial-toggle input:disabled + .ind-slider {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-toggle-actuator {
  width: 100%;
  padding: 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--border-medium);
  background: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
}

.btn-toggle-actuator:hover {
  background: var(--tetes-green-light);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-toggle-actuator.btn-active-state {
  background: linear-gradient(135deg, var(--rose-accent), #be123c);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

/* ===================================================================
   DECISION REASONING CALLOUT (AI EXPLAINABILITY)
   =================================================================== */
.ai-decision-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.ai-decision-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--tetes-green-light);
  border: 1.5px solid var(--brand-border);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ai-decision-body h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--tetes-navy);
  margin-bottom: 4px;
}

.ai-decision-body p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===================================================================
   DATA LOGS TABLE STYLING (RESPONSIVE & TOUCH OPTIMIZED)
   =================================================================== */
.table-scroll-hint {
  display: none;
  font-size: 11.5px;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .table-scroll-hint {
    display: flex;
  }
}

.enterprise-table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  background: #ffffff;
  position: relative;
}

.enterprise-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
  white-space: nowrap;
}

.enterprise-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--tetes-navy);
  border-bottom: 2px solid var(--border-medium);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.enterprise-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-body);
  vertical-align: middle;
}

.enterprise-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.enterprise-table tbody tr:hover {
  background-color: #f0fdf4;
}

/* ===================================================================
   CHAT ADVISOR (AI AGRONOMIST & IOT GENIUS CHATBOT)
   =================================================================== */
.chat-window-box {
  display: flex;
  flex-direction: column;
  height: 540px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chat-message-list {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 88%;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.6;
  box-sizing: border-box;
  animation: fadeInMsg 0.25s ease-out;
}

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

.chat-msg.bot {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  align-self: flex-start;
  color: #1e293b;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
  border-top-left-radius: 4px;
}

.chat-msg.user {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  color: #ffffff;
  align-self: flex-end;
  margin-left: auto;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
  border-top-right-radius: 4px;
  font-weight: 500;
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
}

.chat-sender-badge {
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand-primary);
  letter-spacing: 0.2px;
}

.chat-msg.user .chat-sender-badge {
  color: #ffffff;
}

.chat-time-stamp {
  font-size: 10px;
  color: var(--text-muted);
}

.chat-msg.user .chat-time-stamp {
  color: rgba(255, 255, 255, 0.8);
}

.chat-msg-content {
  word-break: break-word;
}

.chat-msg-content p {
  margin: 0 0 8px 0;
}

.chat-msg-content p:last-child {
  margin-bottom: 0;
}

.chat-msg-content ul, 
.chat-msg-content ol {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.chat-msg-content li {
  margin-bottom: 4px;
}

/* Scientific Math Formula Box in Chat */
.math-formula-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #166534;
  line-height: 1.5;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.math-formula-box.blue {
  background: #f0f9ff;
  border-color: #7dd3fc;
  color: #0369a1;
}

.math-formula-box strong {
  color: #0f172a;
}

/* AI Metric Pill */
.ai-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* Suggestion Quick Tags Row */
.chat-quick-tags-container {
  padding: 10px 14px;
  background: #ffffff;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  -webkit-overflow-scrolling: touch;
}

.chat-quick-tags-container::-webkit-scrollbar {
  height: 4px;
}

.chat-quick-tags-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.quick-ask-btn {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tetes-navy);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.quick-ask-btn:hover {
  background: #f0fdf4;
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-1px);
}

/* Chat Prompt Bar */
.chat-prompt-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: #ffffff;
}

.chat-prompt-input {
  flex: 1;
  padding: 11px 18px;
  border: 1.5px solid var(--border-medium);
  border-radius: 9999px;
  font-size: 13px;
  outline: none;
  font-family: var(--font-sans);
  color: var(--text-main);
  transition: border-color 0.2s;
}

.chat-prompt-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(69, 169, 75, 0.15);
}

/* Typing Indicator Animation */
.chat-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 4px 8px;
}

.chat-typing-indicator .typing-dot {
  width: 5px;
  height: 5px;
  background: var(--brand-primary);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.chat-typing-indicator .typing-dot:nth-child(1) { animation-delay: 0s; }
.chat-typing-indicator .typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-indicator .typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* ===================================================================
   TETES MODAL SYSTEM (LOCATION & CUSTOM FARM CONFIG)
   =================================================================== */
.tetes-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 53, 94, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: fadeInBackdrop 0.2s ease-out;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tetes-modal-card {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(11, 53, 94, 0.25);
  border: 1.5px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: zoomModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomModal {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.tetes-modal-header {
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.modal-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--tetes-navy);
  margin: 0;
}

.modal-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.btn-modal-close {
  background: none;
  border: none;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-modal-close:hover {
  color: #ef4444;
  background: #fee2e2;
}

.tetes-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  max-height: 75vh;
}

.form-group-item {
  margin-bottom: 12px;
}

.form-item-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--tetes-navy);
  margin-bottom: 6px;
}

.form-input-text {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border-medium);
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-main);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.form-input-text:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(69, 169, 75, 0.15);
}

.form-help-text {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
  line-height: 1.35;
}

.gps-autodetect-box {
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  margin: 12px 0;
}

.tetes-modal-footer {
  padding: 14px 20px;
  border-top: 1.5px solid var(--border-subtle);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===================================================================
   FLOATING SCROLL TO TOP BUTTON
   =================================================================== */
.btn-scroll-top {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tetes-lime), var(--tetes-green));
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 6px 20px rgba(60, 168, 43, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btn-scroll-top:hover {
  background: linear-gradient(135deg, var(--tetes-green), #2c7a22);
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 8px 24px rgba(60, 168, 43, 0.55);
}

/* ===================================================================
   MOBILE NAVIGATION DROPDOWN SYSTEM (INTERNATIONAL ENTERPRISE UX)
   =================================================================== */
.mobile-nav-wrapper {
  display: none; /* Hidden on desktop (> 992px) */
  position: relative;
}

.mobile-nav-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1.5px solid var(--border-medium);
  border-radius: 9999px;
  color: var(--tetes-navy);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  min-width: 160px;
  max-width: 200px;
}

.mobile-nav-trigger:active {
  transform: scale(0.97);
  background: var(--tetes-green-light);
}

.mobile-nav-trigger-left {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}

.mobile-nav-trigger-left i {
  color: var(--brand-primary);
  font-size: 13px;
  flex-shrink: 0;
}

.mobile-nav-trigger-left span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-chevron {
  font-size: 10.5px;
  color: var(--text-dim);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.mobile-nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, 90vw);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid var(--border-medium);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(11, 53, 94, 0.18), 0 4px 14px rgba(69, 169, 75, 0.08);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 9999;
  transform-origin: top right;
  animation: mobileMenuIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-dropdown-menu.is-open {
  display: flex;
}

@keyframes mobileMenuIn {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.18s ease;
  font-family: var(--font-sans);
}

.mobile-menu-item:hover, .mobile-menu-item:focus {
  background: var(--tetes-green-light);
  border-color: var(--tetes-green-border);
}

.mobile-menu-item.active {
  background: linear-gradient(135deg, rgba(69, 169, 75, 0.12) 0%, rgba(27, 170, 240, 0.08) 100%);
  border-color: var(--brand-border);
}

.mobile-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--brand-primary);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(11, 53, 94, 0.05);
}

.mobile-menu-item.active .mobile-item-icon {
  background: linear-gradient(135deg, var(--tetes-lime), var(--tetes-green));
  color: #ffffff;
  border-color: transparent;
}

.mobile-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-item-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--tetes-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-item-sub {
  font-size: 9.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-item-check {
  font-size: 14px;
  color: var(--brand-primary);
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mobile-menu-item.active .mobile-item-check {
  opacity: 1;
  transform: scale(1);
}

/* ===================================================================
   RESPONSIVE DESIGN (FOR SMARTPHONES, TABLETS & PWA MOBILE INSTALL)
   =================================================================== */

/* Tablet & Mobile Breakpoint (<= 992px) */
@media (max-width: 992px) {
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .enterprise-container {
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Fixed Desktop Sidebar becomes Top Mobile Sticky Header */
  .app-sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    border-right: none;
    border-bottom: 1.5px solid var(--border-subtle);
    z-index: 150;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 18px rgba(11, 53, 94, 0.08);
  }

  .sidebar-header {
    padding: 10px 14px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .sidebar-brand-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
  }

  .sidebar-brand-logo {
    max-height: 32px;
    max-width: 120px;
    object-fit: contain;
  }

  .sidebar-header-subtitle {
    display: none; /* Keep mobile topbar ultra clean */
  }

  .nav-section-title {
    display: none;
  }

  /* HIDE CLUMSY HORIZONTAL SCROLLBAR */
  .sidebar-nav {
    display: none !important;
  }

  /* SHOW SLEEK MOBILE DROPDOWN */
  .mobile-nav-wrapper {
    display: block !important;
  }

  .sidebar-footer {
    display: none;
  }

  /* Main Viewport Content */
  .app-main {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
  }

  .top-app-bar {
    position: relative;
    top: auto;
    height: auto;
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border-subtle);
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .location-selector {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .location-badge {
    font-size: 11.5px;
    padding: 3px 10px;
    white-space: normal;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .location-subtext {
    white-space: normal !important;
    word-break: break-word;
    font-size: 10px;
    line-height: 1.35;
    display: block;
    max-width: 100%;
    margin-top: 2px;
  }

  .header-tools {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    justify-content: flex-start;
  }

  .quick-telemetry-chip {
    font-size: 11px;
    padding: 5px 10px;
    width: auto;
    max-width: 100%;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
    flex: 0 1 auto;
  }

  .header-tools .btn-enterprise {
    font-size: 11px;
    padding: 5px 12px;
    width: auto;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
    flex: 0 1 auto;
  }

  .page-viewport {
    padding: 12px 10px 40px;
    gap: 14px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .layout-2col-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .pdf-hero-card {
    flex-direction: column;
    padding: 16px 14px;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .pdf-hero-left {
    width: 100%;
  }

  .pdf-hero-center {
    width: 100%;
    align-items: center;
  }

  .pdf-hero-right {
    width: 100%;
  }

  .ebt-scada-container {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .pv-spec-row {
    font-size: 12px;
    padding: 4px 0;
  }
}

/* Smartphone Specific Screens (<= 640px) */
@media (max-width: 640px) {
  .page-viewport {
    padding: 8px 8px 36px;
    gap: 12px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .pdf-brand-title {
    font-size: 1.85rem;
  }

  .pdf-brand-subtitle {
    font-size: 1rem;
  }

  /* 2-Column Telemetry KPI Cards */
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .kpi-card {
    padding: 12px 10px;
    border-radius: 16px;
    min-width: 0;
    box-sizing: border-box;
  }

  .kpi-title {
    font-size: 10px;
  }

  .kpi-icon-wrapper {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .kpi-main-val {
    font-size: 19px;
  }

  .kpi-unit {
    font-size: 11px;
  }

  .kpi-footer-meta {
    font-size: 9px;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding-top: 6px;
  }

  /* Telemetry Metric Boxes: Strict 2x2 Grid with zero overflow */
  .telemetry-row-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .scada-metric-box {
    padding: 10px 8px;
    border-radius: 12px;
    min-width: 0;
    box-sizing: border-box;
  }

  .scada-metric-title {
    font-size: 10.5px;
  }

  .scada-metric-val {
    font-size: 17px;
  }

  .scada-metric-sub {
    font-size: 9px;
  }

  /* Panels: No overflowing padding */
  .enterprise-panel {
    padding: 14px 10px;
    border-radius: 16px;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .panel-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .section-pill-green, .section-pill-blue, .section-pill-navy {
    font-size: 12px;
    padding: 5px 14px;
    max-width: 100%;
  }

  /* 2-Column 6-Step Workflow */
  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .workflow-node {
    padding: 10px 6px;
    border-radius: 14px;
  }

  .workflow-node-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .workflow-node-title {
    font-size: 11px;
  }

  .workflow-node-desc {
    font-size: 9.5px;
  }

  /* Solar SCADA Container */
  .ebt-scada-container {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .battery-scada-gauge {
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
  }

  /* Mode Segmented Controls */
  .mode-segmented-control {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 3px;
  }

  .mode-tab-btn {
    font-size: 10.5px;
    padding: 8px 4px;
  }

  /* Actuator Control Cards */
  .actuator-switches-grid,
  .actuator-rack-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .actuator-card-unit,
  .actuator-card {
    padding: 12px 10px;
  }

  .actuator-timing-box {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    padding: 10px 8px;
  }

  .actuator-timing-row {
    flex-direction: column;
    gap: 6px;
  }

  /* SCADA Status Strip */
  .scada-status-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 10px;
    box-sizing: border-box;
  }

  .scada-status-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Chart Canvases */
  .chart-card, .chart-container-box {
    padding: 10px 6px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  canvas {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Impact 4 Pillars Cards */
  .impact-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .impact-card {
    padding: 14px 10px;
  }

  /* PWA Banner */
  #pwaInstallBanner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 10px;
  }

  #pwaInstallBanner > div:last-child {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  #pwaInstallBanner .btn-enterprise {
    flex: 1;
    justify-content: center;
  }

  /* Chat Window */
  .chat-window-box {
    height: 360px;
  }

  .chat-bubble {
    max-width: 92%;
    font-size: 12px;
  }

  /* Floating Scroll Button */
  .btn-scroll-top {
    bottom: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 13px;
  }
}
