/* ==========================================================================
   BDIS - Bengkayang Distribution Intelligence System
   PLN ULP Bengkayang - Dark Industrial Technology Design System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-main: #07111f;
  --bg-surface: #0c182b;
  --bg-card: rgba(14, 28, 49, 0.85);
  --bg-card-hover: rgba(20, 38, 66, 0.95);
  --bg-glass: rgba(11, 23, 42, 0.7);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 168, 255, 0.35);
  --border-glow: rgba(0, 168, 255, 0.6);

  --primary: #00a8ff;
  --primary-glow: rgba(0, 168, 255, 0.4);
  --primary-dark: #0077b6;
  --accent-cyan: #00f2fe;
  
  /* Status Risk Colors (Strictly based on gardu.prd) */
  --risk-normal: #22c55e;      /* GREEN */
  --risk-normal-bg: rgba(34, 197, 94, 0.12);
  --risk-normal-border: rgba(34, 197, 94, 0.4);

  --risk-waspada: #eab308;     /* YELLOW */
  --risk-waspada-bg: rgba(234, 179, 8, 0.12);
  --risk-waspada-border: rgba(234, 179, 8, 0.4);

  --risk-warning: #f97316;     /* ORANGE */
  --risk-warning-bg: rgba(249, 115, 22, 0.12);
  --risk-warning-border: rgba(249, 115, 22, 0.4);

  --risk-critical: #ef4444;    /* RED */
  --risk-critical-bg: rgba(239, 68, 68, 0.15);
  --risk-critical-border: rgba(239, 68, 68, 0.5);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Fonts */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Elevation & Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 25px rgba(0, 168, 255, 0.25);
  --shadow-red-glow: 0 0 25px rgba(239, 68, 68, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-main);
  color: var(--text-main);
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  background: radial-gradient(circle at 50% 0%, #102444 0%, #07111f 55%, #040913 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle background grid pattern */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

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

a:hover {
  color: var(--accent-cyan);
}

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

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-glow {
  background: rgba(0, 168, 255, 0.12);
  border: 1px solid var(--border-accent);
  color: var(--primary);
  box-shadow: 0 0 14px rgba(0, 168, 255, 0.2);
}

.badge-demo {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid var(--risk-waspada-border);
  color: var(--risk-waspada);
}

.badge-pln {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
}

/* Pulsing Dots */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  position: relative;
}

.pulse-dot::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  animation: pulse-ring 1.8s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

.pulse-dot.dot-red {
  background: var(--risk-critical);
}
.pulse-dot.dot-red::after {
  border-color: var(--risk-critical);
}

.pulse-dot.dot-green {
  background: var(--risk-normal);
}
.pulse-dot.dot-green::after {
  border-color: var(--risk-normal);
}

.pulse-dot.dot-yellow {
  background: var(--risk-waspada);
}
.pulse-dot.dot-yellow::after {
  border-color: var(--risk-waspada);
}

@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(7, 17, 31, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: var(--transition);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #00a8ff 0%, #0066cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  box-shadow: 0 0 16px var(--primary-glow);
}

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

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(90deg, #ffffff 40%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(12, 24, 43, 0.8);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-item {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(0, 168, 255, 0.25) 0%, rgba(0, 119, 182, 0.4) 100%);
  border: 1px solid var(--border-accent);
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.25);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #00a8ff 0%, #0077b6 100%);
  color: white;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #22b8ff 0%, #0088cc 100%);
  box-shadow: 0 6px 24px rgba(0, 168, 255, 0.5);
  transform: translateY(-1px);
  color: white;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-accent);
  color: white;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   View Container & Router State
   ========================================================================== */
.view-section {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.view-section.active-view {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   LANDING PAGE STYLING (Strictly following gardu.prd specifications)
   ========================================================================== */
.landing-hero {
  padding: 70px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-glow-orb {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 168, 255, 0.18) 0%, rgba(0, 168, 255, 0.02) 60%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 auto;
}

.hero-tag-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 20px;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #ffffff 10%, #00a8ff 60%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--text-muted);
  font-weight: 400;
  max-width: 720px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

/* 3 Big Stats from gardu.prd:
   XX Total Trafo | XX% Healthy Assets | XX Active Alerts */
.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 820px;
  margin: 0 auto 60px;
}

.hero-stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.hero-stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.hero-stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.hero-stat-card.stat-healthy::after {
  background: linear-gradient(90deg, transparent, var(--risk-normal), transparent);
}

.hero-stat-card.stat-alert::after {
  background: linear-gradient(90deg, transparent, var(--risk-critical), transparent);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  color: #ffffff;
}

.stat-value.healthy-color {
  color: var(--risk-normal);
  text-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.stat-value.alert-color {
  color: var(--risk-critical);
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Bengkayang Visual Map Preview on Landing */
.hero-visual-preview {
  position: relative;
  border-radius: var(--radius-lg);
  background: rgba(11, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  max-width: 1080px;
  margin: 0 auto;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.preview-indicators {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.indicator-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-map-box {
  position: relative;
  height: 380px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #091322;
}

#landingMiniMap {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.landing-overlay-card {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(7, 17, 31, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 16px;
  max-width: 290px;
  z-index: 500;
  box-shadow: var(--shadow-md);
  text-align: left;
}

.overlay-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.overlay-body {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Features Grid on Landing */
.landing-features {
  padding: 80px 0;
  position: relative;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 50px;
}

.section-title {
  font-size: 2.1rem;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: rgba(0, 168, 255, 0.1);
  border: 1px solid rgba(0, 168, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.feature-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}

.feature-link {
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
}

/* Architecture Flow Section (from gardu.prd) */
.architecture-section {
  padding: 60px 0;
  background: rgba(12, 24, 43, 0.5);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.arch-flow-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 30px;
  margin-top: 30px;
  overflow-x: auto;
}

.arch-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 820px;
  gap: 16px;
}

.arch-step-box {
  flex: 1;
  background: rgba(11, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: var(--transition);
}

.arch-step-box:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 16px rgba(0, 168, 255, 0.2);
}

.step-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 6px;
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.step-detail {
  font-size: 0.78rem;
  color: var(--primary);
}

.arch-arrow {
  color: var(--text-dim);
  font-size: 1.2rem;
  font-weight: bold;
}

/* Footer */
.app-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ==========================================================================
   APP SHELL & MODULES (Executive, GIS, AI, Reliability, Priority, Data)
   ========================================================================== */
.app-layout {
  padding: 24px 0 60px;
}

.app-subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 20px;
}

.subnav-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.subnav-breadcrumbs .current {
  color: #ffffff;
  font-weight: 600;
}

.subnav-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
}

/* Metric Cards Grid (PRD: 186 TRAFOS | 91.4% HEALTHY | 12 ALERTS | 1.82 h MTTR) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
}

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

.kpi-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-icon {
  font-size: 1.1rem;
  color: var(--primary);
}

.kpi-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 4px;
}

.kpi-trend {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-good { color: var(--risk-normal); }
.trend-warning { color: var(--risk-warning); }
.trend-bad { color: var(--risk-critical); }

/* Overview Layout */
.overview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   GIS ASSET INTELLIGENCE MODULE (PROMPT 2 in gardu.prd)
   ========================================================================== */
.gis-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  height: calc(100vh - 170px);
  min-height: 650px;
}

.gis-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.search-input-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  background: rgba(7, 17, 31, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 36px;
  color: #ffffff;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 168, 255, 0.3);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.filter-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 8px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 168, 255, 0.4);
}

.gis-asset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
}

.asset-list-item {
  background: rgba(7, 17, 31, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.asset-list-item:hover {
  background: rgba(20, 38, 66, 0.8);
  border-color: var(--border-accent);
}

.asset-list-item.selected {
  background: rgba(0, 168, 255, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.2);
}

.asset-item-info {
  display: flex;
  flex-direction: column;
}

.asset-item-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
}

.asset-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.gis-map-viewport {
  position: relative;
  background: #091322;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 100%;
}

#gisMainMap {
  width: 100%;
  height: 100%;
}

/* Map Floating Legend (PRD colors) */
.gis-map-legend {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(7, 17, 31, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  z-index: 500;
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
}

.legend-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.legend-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-green { background: var(--risk-normal); box-shadow: 0 0 8px var(--risk-normal); }
.legend-yellow { background: var(--risk-waspada); box-shadow: 0 0 8px var(--risk-waspada); }
.legend-orange { background: var(--risk-warning); box-shadow: 0 0 8px var(--risk-warning); }
.legend-red { background: var(--risk-critical); box-shadow: 0 0 8px var(--risk-critical); }

/* Floating Detail Panel (Slide in from right when marker clicked) */
.gis-detail-drawer {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 360px;
  background: rgba(8, 19, 36, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.gis-detail-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.drawer-close:hover {
  color: #ffffff;
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.param-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.param-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.param-item-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.param-item-value {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

/* Condition Index Progress Bar */
.ci-bar-wrapper {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  height: 12px;
  overflow: hidden;
  position: relative;
  margin-top: 6px;
}

.ci-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

/* ==========================================================================
   AI TRANSFORMER ANALYSIS MODULE (ANFIS Model from PRD PROMPT 5)
   ========================================================================== */
.ai-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.ai-trafo-selector-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.score-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 17, 31, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.score-number-wrapper {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score-giant {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}

.score-scale {
  font-size: 1.3rem;
  color: var(--text-dim);
}

.ai-factors-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.factor-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.factor-bullet {
  color: var(--risk-critical);
  font-size: 1rem;
  line-height: 1.2;
}

/* Benchmark Comparison Table */
.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 10px;
}

.benchmark-table th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}

.benchmark-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.benchmark-table tr.highlight-row {
  background: rgba(0, 168, 255, 0.08);
}

.benchmark-table tr.highlight-row td {
  color: #ffffff;
  font-weight: 600;
}

/* ==========================================================================
   RELIABILITY & MAINTENANCE PRIORITY TABLES
   ========================================================================== */
.priority-table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  background: rgba(7, 17, 31, 0.9);
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
}

.badge-p1 {
  background: rgba(239, 68, 68, 0.2);
  color: var(--risk-critical);
  border: 1px solid var(--risk-critical-border);
}

.badge-p2 {
  background: rgba(249, 115, 22, 0.2);
  color: var(--risk-warning);
  border: 1px solid var(--risk-warning-border);
}

.badge-p3 {
  background: rgba(234, 179, 8, 0.2);
  color: var(--risk-waspada);
  border: 1px solid var(--risk-waspada-border);
}

.badge-p4 {
  background: rgba(34, 197, 94, 0.2);
  color: var(--risk-normal);
  border: 1px solid var(--risk-normal-border);
}

/* ==========================================================================
   MODAL & INTERACTION
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

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

.modal-body {
  padding: 24px;
}

/* Leaflet Custom Marker Styling */
.custom-bdis-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-inner-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  position: relative;
}

.marker-pulse {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  animation: pulse-ring 2s infinite ease-out;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .hero-stats-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .gis-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .gis-map-viewport {
    height: 480px;
  }
  .ai-layout {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none; /* Mobile menu handled via button */
  }
}

/* ==========================================================================
   SPASIAL JARINGAN GIS & ENGINE SWITCHER (MapLibre GL JS & Leaflet)
   ========================================================================== */

/* GIS Toolbar & Control Header */
.gis-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 16px;
}

.gis-toolbar-left, .gis-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Engine Switcher Pill Group */
.engine-switch-group {
  display: inline-flex;
  background: rgba(7, 17, 31, 0.85);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-accent);
  box-shadow: 0 0 14px rgba(0, 168, 255, 0.2);
}

.engine-btn {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.engine-btn:hover {
  color: #fff;
}

.engine-btn.active {
  background: linear-gradient(135deg, #00a8ff 0%, #0077b6 100%);
  color: #fff;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Basemap Switcher Buttons */
.basemap-switch-group {
  display: inline-flex;
  background: rgba(7, 17, 31, 0.7);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.basemap-btn {
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.basemap-btn:hover {
  color: #fff;
}

.basemap-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #00a8ff;
  border: 1px solid rgba(0, 168, 255, 0.3);
}

/* Layer Toggles Bar */
.layer-toggles-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.layer-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.layer-toggle-label input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
  width: 14px;
  height: 14px;
}

/* Substation Marker */
.substation-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  font-weight: 900;
  font-size: 14px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.7);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.substation-marker.gi-main {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  width: 34px;
  height: 34px;
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.9);
}

.substation-marker:hover {
  transform: scale(1.15);
}

/* Feeder Line Dash Animation */
@keyframes flowDash {
  to {
    stroke-dashoffset: -30;
  }
}

.sutm-flow-pulse {
  animation: flowDash 1.5s linear infinite;
}

/* Sidebar Tab Selector */
.gis-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.gis-sidebar-tab {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}

.gis-sidebar-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Feeder List Item in Sidebar */
.feeder-list-item {
  background: rgba(7, 17, 31, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}

.feeder-list-item:hover {
  background: rgba(20, 38, 66, 0.8);
  border-color: var(--border-accent);
}

.feeder-list-item.active {
  border-color: var(--primary);
  background: rgba(0, 168, 255, 0.12);
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.2);
}

.feeder-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.feeder-badge-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* Feeder Inspector Drawer (Floating bottom/left card) */
.feeder-inspector-card {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(8, 19, 36, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  max-width: 440px;
  z-index: 550;
  box-shadow: var(--shadow-md);
  display: none;
  animation: fadeIn 0.3s ease;
}

.feeder-inspector-card.open {
  display: block;
}

/* MapLibre specific adjustments */
.maplibregl-map {
  font-family: var(--font-body);
}

.maplibregl-popup-content {
  background: rgba(7, 17, 31, 0.95) !important;
  color: #fff !important;
  border: 1px solid var(--border-accent) !important;
  border-radius: var(--radius-sm) !important;
  padding: 12px 16px !important;
  box-shadow: var(--shadow-md) !important;
}

.maplibregl-popup-tip {
  border-top-color: rgba(7, 17, 31, 0.95) !important;
}

.maplibregl-ctrl-group {
  background: rgba(7, 17, 31, 0.85) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important;
}

.maplibregl-ctrl-group button {
  border-bottom: 1px solid var(--border-subtle) !important;
}

/* ==========================================================================
   COCKPIT GARDU ULP BENGKAYANG (HALAMAN BERANDA ACUAN)
   Layout: Control-room cockpit — 4-track grid (tren | ringkasan | hero | risiko)
   ========================================================================== */
#view-landing {
  --bg: #0a1330;
  --bg2: #0e1a3e;
  --panel: #111f48;
  --panel-2: #16285a;
  --line: #22356b;
  --grid: #1d2d5c;
  --ink: #eef3ff;
  --ink-2: #a9b7dc;
  --ink-3: #7385b3;
  --accent: #4cc3f0;
  --accent-2: #2a78d6;
  --amber: #f5b54a;
  --s-siang: #3987e5;
  --s-malam: #d95926;
  --s-r: #3987e5;
  --s-s: #d95926;
  --s-t: #199e70;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --neutral: #6b7aa6;
  --f-disp: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-num: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2b63 0%, var(--bg) 60%) var(--bg);
  min-height: calc(100vh - 70px);
  color: var(--ink);
  font-family: var(--f-body);
}

#view-landing .wrap {
  padding-inline: 16px;
  padding-block: 0 28px;
  max-width: 1680px;
  margin: 0 auto;
}

#view-landing .cockpit-quicknav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(14, 26, 62, 0.65);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  margin-bottom: 4px;
}

#view-landing .cockpit-quicknav .brand-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

#view-landing .cockpit-quicknav .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#view-landing header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 18px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

#view-landing header.top h1 {
  font-family: var(--f-disp);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: .01em;
  margin: 0;
  line-height: 1.05;
  text-wrap: balance;
  color: #fff;
}

#view-landing header.top .sub {
  color: var(--ink-2);
  margin-top: 4px;
  font-size: 13px;
}

#view-landing .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

#view-landing .date {
  font-family: var(--f-num);
  color: var(--ink-2);
  font-size: 13px;
}

#view-landing .seg {
  display: inline-flex;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

#view-landing .seg button {
  all: unset;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--f-disp);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--ink-2);
  transition: all 0.2s ease;
}

#view-landing .seg button[aria-pressed="true"] {
  background: var(--accent-2);
  color: #fff;
}

#view-landing .seg button:focus-visible,
#view-landing .tbl th button:focus-visible,
#view-landing input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#view-landing .grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr .62fr 1fr 1fr;
  grid-template-areas:
    "l1 t hero r1"
    "l2 t hero r2"
    "l3 dn dn r3";
}

#view-landing .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px 10px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#view-landing .panel h2 {
  font-family: var(--f-disp);
  font-weight: 600;
  font-size: 19px;
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
  color: #fff;
}

#view-landing .panel .note {
  color: var(--ink-3);
  font-size: 12px;
  margin-top: 2px;
}

#view-landing .chart {
  width: 100%;
  height: 270px;
  flex: none;
  margin-top: auto;
}

#view-landing .l1 { grid-area: l1; }
#view-landing .l2 { grid-area: l2; }
#view-landing .l3 { grid-area: l3; }
#view-landing .r1 { grid-area: r1; }
#view-landing .r2 { grid-area: r2; }
#view-landing .r3 { grid-area: r3; }

#view-landing .tiles {
  grid-area: t;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#view-landing .tiles .intro {
  padding: 4px 2px 6px;
}

#view-landing .tiles .intro h2 {
  font-family: var(--f-disp);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 700;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
  color: #fff;
}

#view-landing .tiles .intro p {
  color: var(--ink-2);
  font-size: 12.5px;
  margin: 6px 0 0;
  line-height: 1.45;
}

#view-landing .tile {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#view-landing .lbl {
  font-size: 12.5px;
  color: var(--ink-2);
  letter-spacing: .02em;
}

#view-landing .val {
  font-family: var(--f-disp);
  font-weight: 600;
  font-size: clamp(28px, 2.6vw, 38px);
  color: var(--accent);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

#view-landing .val small {
  font-size: .5em;
  color: var(--ink-2);
  font-weight: 500;
  margin-left: 4px;
}

#view-landing .hero {
  grid-area: hero;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1.1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  min-width: 0;
}

#view-landing .hero > div {
  padding: 18px 20px;
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#view-landing .h-main {
  grid-column: 1 / 3;
  background: linear-gradient(135deg, #1b2f6b, #14275c);
}

#view-landing .h-a { background: #183f66; }
#view-landing .h-b { background: #21386f; }

#view-landing .hero .big {
  font-family: var(--f-disp);
  font-weight: 700;
  font-size: clamp(48px, 5.4vw, 84px);
  line-height: 1;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}

#view-landing .hero .big small {
  font-size: .42em;
  color: var(--ink-2);
  margin-left: 6px;
  font-weight: 500;
}

#view-landing .hero .mid {
  font-family: var(--f-disp);
  font-weight: 700;
  font-size: clamp(40px, 4vw, 60px);
  line-height: 1;
  color: var(--amber);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

#view-landing .hero .mid small {
  font-size: .4em;
  color: var(--ink-2);
  margin-left: 6px;
  font-weight: 500;
}

#view-landing .hero .desc {
  color: var(--ink-2);
  font-size: 12.5px;
  margin-top: auto;
  padding-top: 10px;
  line-height: 1.45;
  max-width: 40ch;
}

#view-landing .hero .glyph {
  position: absolute;
  right: 16px;
  top: 16px;
  opacity: .2;
  width: 56px;
  height: 56px;
}

#view-landing .gauge {
  margin-top: 14px;
  max-width: 420px;
}

#view-landing .gauge .bar {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--neutral) 0 40%, var(--good) 40% 80%, var(--serious) 80% 100%);
  opacity: .9;
}

#view-landing .gauge .pin {
  position: absolute;
  top: -5px;
  width: 3px;
  height: 20px;
  background: var(--ink);
  border-radius: 2px;
  box-shadow: 0 0 0 2px var(--panel);
  transition: left 0.3s ease;
}

#view-landing .gauge .scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-num);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 5px;
}

#view-landing .donuts {
  grid-area: dn;
  padding: 0;
  overflow: hidden;
}

#view-landing .donuts .hd {
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

#view-landing .donuts .two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  flex: 1;
}

#view-landing .donuts .two > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#view-landing .donuts .cap {
  background: var(--bg2);
  text-align: center;
  padding: 7px;
  font-size: 13px;
  color: var(--ink);
}

#view-landing .donuts .chart {
  height: 250px;
}

#view-landing .lower {
  display: grid;
  grid-template-columns: 1fr 2.6fr;
  gap: 14px;
  margin-top: 14px;
}

#view-landing .tv .count {
  font-family: var(--f-disp);
  font-weight: 700;
  font-size: 52px;
  color: var(--accent);
  line-height: 1;
  margin: 10px 0 2px;
}

#view-landing .tv .count small {
  font-size: .36em;
  color: var(--ink-2);
  margin-left: 6px;
  font-weight: 500;
}

#view-landing .tv .chart {
  height: 150px;
  flex: none;
  margin-top: 8px;
}

#view-landing .tv ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
}

#view-landing .tv .warnbox {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}

#view-landing .tblhd {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

#view-landing .tblhd input {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 7px 10px;
  font: inherit;
  width: 220px;
  max-width: 100%;
}

#view-landing .tblwrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

#view-landing table.tbl {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  min-width: 980px;
}

#view-landing .tbl th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  text-align: left;
  font-weight: 500;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  padding: 0;
  white-space: nowrap;
  z-index: 2;
}

#view-landing .tbl th button {
  all: unset;
  cursor: pointer;
  display: block;
  padding: 8px 10px;
}

#view-landing .tbl th.num,
#view-landing .tbl td.num {
  text-align: right;
}

#view-landing .tbl th.num button {
  text-align: right;
  width: calc(100% - 20px);
}

#view-landing .tbl td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}

#view-landing .tbl tr:hover td {
  background: #152454;
}

#view-landing .mono {
  font-family: var(--f-num);
  font-size: 12px;
}

#view-landing .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid currentColor;
  line-height: 1.5;
}

#view-landing .pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

#view-landing .c-good { color: #3fcf3f; }
#view-landing .c-warn { color: var(--warn); }
#view-landing .c-serious { color: var(--serious); }
#view-landing .c-crit { color: #ff6b6b; }
#view-landing .c-neutral { color: #9aa7cf; }

#view-landing .legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 6px;
}

#view-landing .legend-row i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}

#view-landing footer {
  color: var(--ink-3);
  font-size: 12px;
  margin-top: 16px;
  line-height: 1.6;
}

#view-landing footer b {
  color: var(--ink-2);
  font-weight: 500;
}

@media (max-width: 1180px) {
  #view-landing .grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "t hero"
      "dn dn"
      "l1 r1"
      "l2 r2"
      "l3 r3";
  }
  #view-landing .lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #view-landing .grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "t"
      "hero"
      "dn"
      "l1"
      "r1"
      "l2"
      "r2"
      "l3"
      "r3";
  }
  #view-landing .tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  #view-landing .tiles .intro {
    grid-column: 1 / -1;
  }
  #view-landing .donuts .two {
    grid-template-columns: 1fr;
  }
  #view-landing .hero {
    grid-template-columns: 1fr;
  }
  #view-landing .h-main {
    grid-column: auto;
  }
}

/* ==========================================================================
   COCKPIT EXCEL / CSV UPLOAD & MEASUREMENT DATA ACTIONS
   ========================================================================== */
#view-landing .tbl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#view-landing .btn-cockpit-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg2, #0d1a38);
  border: 1px solid var(--line, #22356b);
  color: var(--ink, #eef3ff);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.4;
}

#view-landing .btn-cockpit-action:hover {
  background: var(--panel-2, #142454);
  border-color: var(--accent, #4cc3f0);
  color: #fff;
  box-shadow: 0 0 10px rgba(76, 195, 240, 0.25);
}

#view-landing .btn-cockpit-action.btn-upload {
  background: linear-gradient(135deg, rgba(42, 120, 214, 0.25), rgba(76, 195, 240, 0.3));
  border-color: var(--accent, #4cc3f0);
  color: var(--accent, #4cc3f0);
  font-weight: 600;
}

#view-landing .btn-cockpit-action.btn-upload:hover {
  background: var(--accent, #4cc3f0);
  color: #07111f;
  box-shadow: 0 0 16px rgba(76, 195, 240, 0.55);
}

#view-landing .btn-cockpit-action.btn-reset:hover {
  border-color: var(--warn, #fab219);
  color: var(--warn, #fab219);
}

.cockpit-dropzone {
  border: 2px dashed rgba(76, 195, 240, 0.5);
  background: rgba(13, 26, 56, 0.6);
  border-radius: 8px;
  padding: 28px 16px;
  text-align: center;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.cockpit-dropzone:hover,
.cockpit-dropzone.dragover {
  border-color: var(--accent, #4cc3f0);
  background: rgba(76, 195, 240, 0.12);
  box-shadow: 0 0 20px rgba(76, 195, 240, 0.25);
  transform: translateY(-1px);
}

#panel-measurements.drag-highlight {
  outline: 2px dashed var(--accent, #4cc3f0);
  outline-offset: -2px;
  box-shadow: 0 0 25px rgba(76, 195, 240, 0.3);
}

.cockpit-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0d1a38;
  border: 1px solid var(--accent, #4cc3f0);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(76, 195, 240, 0.3);
  z-index: 9999;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.cockpit-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

