/* ==========================================================
   Peat Fire Risk Analytics - Apple Cupertino Design System
   Typography: Apple San Francisco / Plus Jakarta Sans / Inter
   Material: Frosted Glass with 180% Saturation & 24px Blur
   Aesthetics: Soft Bezier Curves, Ultra-Clean Layout, Zero Noise
   ========================================================== */

:root {
  /* Authentic Apple Typography Stack (Plus Jakarta Sans / Inter / San Francisco) */
  --apple-font: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  
  /* Luminous Silver & Glassmorphism Canvas */
  --apple-bg: #eaf0f7;
  --apple-canvas: 
    radial-gradient(1100px 650px at 5% 10%, rgba(205, 228, 255, 0.75) 0%, transparent 60%),
    radial-gradient(950px 550px at 95% 18%, rgba(220, 236, 255, 0.65) 0%, transparent 55%),
    radial-gradient(1150px 750px at 50% 90%, rgba(228, 224, 252, 0.55) 0%, transparent 60%),
    radial-gradient(850px 500px at 70% 55%, rgba(212, 242, 250, 0.45) 0%, transparent 50%),
    linear-gradient(150deg, #edf2f8 0%, #e1e8f2 50%, #d4dde9 100%);
  
  /* Pure Glassmorphism Material Tokens */
  --apple-glass: linear-gradient(145deg, rgba(255, 255, 255, 0.72) 0%, rgba(246, 249, 253, 0.58) 100%);
  --apple-glass-hover: linear-gradient(145deg, rgba(255, 255, 255, 0.84) 0%, rgba(248, 250, 254, 0.70) 100%);
  --apple-glass-border: rgba(255, 255, 255, 0.88);
  --apple-hairline: rgba(255, 255, 255, 0.75);
  --apple-blur: saturate(190%) blur(26px);
  
  /* Frosted White Glass Rail Material */
  --silver-rail-bg: rgba(255, 255, 255, 0.75);
  --silver-rail-border: 1px solid rgba(255, 255, 255, 0.95);
  --silver-rail-shadow: 
    0 12px 36px 0 rgba(31, 38, 135, 0.06),
    0 2px 8px 0 rgba(0, 0, 0, 0.02),
    inset 0 1.5px 2px 0 rgba(255, 255, 255, 1);

  /* Apple Titanium & Accents */
  --apple-titanium: linear-gradient(145deg, #1d1d1f 0%, #2c2c2e 100%);
  --apple-dark-solid: #1d1d1f;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  
  /* Subtle Risk Accents */
  --risk-low: #34c759;
  --risk-low-bg: rgba(52, 199, 89, 0.12);
  --risk-low-border: rgba(52, 199, 89, 0.25);
  
  --risk-mod: #ff9500;
  --risk-mod-bg: rgba(255, 149, 0, 0.12);
  --risk-mod-border: rgba(255, 149, 0, 0.25);
  
  --risk-high: #ff6b00;
  --risk-high-bg: rgba(255, 107, 0, 0.12);
  --risk-high-border: rgba(255, 107, 0, 0.25);
  
  --risk-extreme: #ff3b30;
  --risk-extreme-bg: rgba(255, 59, 48, 0.14);
  --risk-extreme-border: rgba(255, 59, 48, 0.28);

  /* Text Hierarchy */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  
  /* Premium Glassmorphic Shadows */
  --apple-shadow: 0 10px 32px 0 rgba(31, 38, 135, 0.06), 0 2px 6px 0 rgba(0, 0, 0, 0.02), inset 0 1.5px 2px 0 rgba(255, 255, 255, 0.95);
  --apple-shadow-hover: 0 16px 44px 0 rgba(31, 38, 135, 0.10), 0 4px 10px 0 rgba(0, 0, 0, 0.03), inset 0 1.5px 2px 0 #ffffff;
  --apple-hero-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

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

body {
  font-family: var(--apple-font);
  background: 
    radial-gradient(1200px 700px at 5% 5%, rgba(215, 235, 255, 0.85) 0%, transparent 60%),
    radial-gradient(1100px 650px at 95% 10%, rgba(255, 235, 225, 0.75) 0%, transparent 55%),
    radial-gradient(1300px 800px at 50% 95%, rgba(235, 225, 255, 0.75) 0%, transparent 60%),
    radial-gradient(900px 500px at 85% 70%, rgba(220, 245, 255, 0.6) 0%, transparent 50%),
    linear-gradient(145deg, #eef3f9 0%, #e2eaf4 50%, #d8e3f0 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding: 12px 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  letter-spacing: -0.015em;
  line-height: 1.5;
}

button, input, select, textarea, table, th, td {
  font-family: var(--apple-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: inherit;
}

/* Full Screen Clean Canvas (Full-width, Edge-to-Edge Responsive) */
.apple-shell {
  display: flex;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  margin: 0;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 
    0 16px 40px 0 rgba(15, 23, 42, 0.05),
    0 2px 8px 0 rgba(15, 23, 42, 0.02),
    inset 0 1.5px 2px 0 rgba(255, 255, 255, 1);
  padding: 14px 16px 18px 14px;
  min-height: calc(100vh - 24px);
}

/* ==========================================================
   FROSTED WHITE GLASSMORPHISM SIDEBAR RAIL
   ========================================================== */
.apple-sidebar-rail {
  width: 76px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px 8px 4px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  box-shadow: 
    0 12px 36px 0 rgba(31, 38, 135, 0.06),
    0 2px 8px 0 rgba(0, 0, 0, 0.02),
    inset 0 1.5px 2px 0 rgba(255, 255, 255, 1);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.apple-sidebar-rail::-webkit-scrollbar {
  display: none;
}

.rail-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 8px;
}

/* Frosted White Action Toggle */
.rail-menu-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.85);
  color: #334155;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03), inset 0 1px 1px #ffffff;
}

.rail-menu-btn:hover {
  background: #ffffff;
  color: #0f172a;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 3px;
}

/* Frosted White Rail Item */
.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 68px;
  padding: 4px 2px;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: #475569;
  font-family: var(--apple-font);
  font-size: 0.64rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: -0.01em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.rail-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: #334155;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02), inset 0 1px 1px #ffffff;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rail-item:hover {
  color: #0f172a;
}

.rail-item:hover .rail-icon-box {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07), inset 0 1px 1px #ffffff;
}

/* Active State: Clean Frosted White Glass Tile */
.rail-item.active {
  background: transparent;
  color: #0f172a;
  font-weight: 700;
  box-shadow: none;
}

.rail-item.active .rail-icon-box {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #ffffff;
  box-shadow: 
    0 6px 18px rgba(15, 23, 42, 0.12),
    0 1px 3px rgba(15, 23, 42, 0.04),
    inset 0 1px 1.5px #ffffff;
  transform: translateY(-1px);
}

/* Rail Bottom (Brand Anchor) */
.rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-top: 6px;
}

.rail-brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rail-brand-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35);
}

.rail-divider {
  width: 36px;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin-bottom: 8px;
}

/* ==========================================================
   MAIN WORKSPACE & TOP HEADER (Clean Full-Screen)
   ========================================================== */
.main-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.apple-top-header {
  position: sticky;
  top: 20px;
  z-index: 95;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82) 0%, rgba(245, 249, 254, 0.68) 100%);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 32px 0 rgba(31, 38, 135, 0.06), inset 0 1px 1.5px rgba(255, 255, 255, 0.95);
  transition: all 0.2s ease;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--apple-dark-solid);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--apple-font);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-subtag {
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
}

.brand-caption {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.apple-select {
  font-family: var(--apple-font);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 7px 14px;
  border-radius: 980px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03), inset 0 1px 1px #ffffff;
  transition: all 0.2s;
  max-width: 260px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.apple-select:hover {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.station-readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 6px 14px;
  border-radius: 980px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03), inset 0 1px 1px #ffffff;
  font-family: var(--apple-font);
  font-size: 0.78rem;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  transition: all 0.2s ease;
}

.system-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  border-radius: 980px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02), inset 0 1px 1px #ffffff;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--risk-low);
}

.digital-timestamp {
  font-family: -apple-system-monospaced, monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  border-radius: 980px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02), inset 0 1px 1px #ffffff;
}

/* Apple-style Segmented Language Switcher */
.lang-switch-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 3px;
  border-radius: 980px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03), inset 0 1px 1px #ffffff;
  gap: 2px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 980px;
  font-family: var(--apple-font);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  line-height: 1;
}

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

.lang-btn.active {
  background: #ffffff;
  color: #0071e3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.lang-flag {
  font-size: 0.85rem;
  line-height: 1;
}

.lang-flag-svg {
  width: 15px;
  height: 10px;
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  vertical-align: middle;
}

.lang-code {
  letter-spacing: 0.02em;
}

/* ==========================================================
   APPLE CARDS & GRIDS (Glassmorphism Core)
   ========================================================== */
.apple-card {
  background: var(--apple-glass);
  backdrop-filter: var(--apple-blur);
  -webkit-backdrop-filter: var(--apple-blur);
  border: 1px solid var(--apple-glass-border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--apple-shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.apple-card:hover {
  box-shadow: var(--apple-shadow-hover);
  border-color: rgba(255, 255, 255, 0.95);
}

.apple-card:hover {
  box-shadow: var(--apple-shadow-hover);
}

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

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

.overview-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.view-panel {
  display: none;
  animation: appleFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-panel.active {
  display: block;
}

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

.card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-btn-group {
  display: flex;
  gap: 4px;
}

.apple-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.apple-nav-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

/* Left Column Widgets */
.compact-card {
  padding: 20px;
}

.date-widget-body {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--apple-hairline);
}

.date-numeric {
  font-family: var(--apple-font);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

.date-meta .date-month-year {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.date-meta .date-sub {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* Apple Calendar */
.apple-calendar {
  margin-top: 4px;
}

.apple-cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.apple-cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}

.cal-cell {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.cal-cell:hover {
  background: rgba(0, 0, 0, 0.04);
}

.cal-cell.today {
  background: var(--apple-dark-solid);
  color: #ffffff;
  font-weight: 600;
}

.cal-cell.risk-marked {
  position: relative;
}

.cal-cell.risk-marked::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--risk-high);
}

/* Rainfall Tile */
.stat-tile {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
}

.tile-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.tile-content {
  flex: 1;
}

.tile-caption {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-tertiary);
  display: block;
  margin-bottom: 2px;
}

.tile-number {
  font-family: var(--apple-font);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.tile-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.apple-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
}

.apple-chip.neutral {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
}

.apple-chip.chip-warning {
  background: var(--risk-mod-bg);
  color: var(--risk-mod);
}

.apple-chip.chip-active {
  background: var(--risk-low-bg);
  color: var(--risk-low);
}

/* ==========================================================
   APPLE TITANIUM HERO CARD
   ========================================================== */
.apple-hero-card {
  background: var(--apple-titanium);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #f8fafc;
  padding: 24px 26px;
  box-shadow: var(--apple-hero-shadow);
  position: relative;
  overflow: hidden;
}

.hero-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.hero-id-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a1a1a6;
}

.hero-meta-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: #e5e5ea;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: 980px;
}

.hero-main-stat {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.hero-primary-val {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.hero-numeric {
  font-family: var(--apple-font);
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
}

.hero-risk-status {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 980px;
  letter-spacing: 0.02em;
  background: #ffffff;
  color: var(--risk-high);
}

.hero-formula-display {
  font-family: -apple-system-monospaced, monospace;
  font-size: 0.75rem;
  color: #a1a1a6;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 8px;
}

.hero-chart-wrapper {
  height: 85px;
  margin: 6px 0 16px 0;
}

.hero-parameters-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

.strip-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.strip-label {
  font-size: 0.68rem;
  color: #86868b;
  font-weight: 500;
}

.strip-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f5f5f7;
}

/* 3 Core Sensor Telemetry Cards (Reference: 3 Feature Cards Layout) */
.sensor-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.telemetry-card {
  padding: 22px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px 0 rgba(31, 38, 135, 0.04), inset 0 1px 1px #ffffff;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.telemetry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px 0 rgba(31, 38, 135, 0.08), inset 0 1px 1.5px #ffffff;
}

.telemetry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.telemetry-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.telemetry-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 980px;
}

.telemetry-badge.alert { background: var(--risk-high-bg); color: var(--risk-high); }
.telemetry-badge.warning { background: var(--risk-mod-bg); color: var(--risk-mod); }
.telemetry-badge.normal { background: rgba(0, 0, 0, 0.04); color: var(--text-secondary); }

.telemetry-val {
  font-family: var(--apple-font);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
}

.telemetry-val .unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.apple-meter-track {
  width: 100%;
  height: 5px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 980px;
  overflow: hidden;
  margin-bottom: 10px;
}

.apple-meter-bar {
  height: 100%;
  border-radius: 980px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-meter-bar.bar-danger { background: var(--risk-high); }
.apple-meter-bar.bar-warning { background: var(--risk-mod); }
.apple-meter-bar.bar-info { background: var(--apple-blue); }

.telemetry-info {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================
   APPLE SMOOTH BEZIER CHART PANEL
   ========================================================== */
.chart-panel-card {
  padding: 24px;
}

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

.panel-heading {
  font-family: var(--apple-font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.panel-subheading {
  font-size: 0.76rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.apple-button-group {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.04);
  padding: 3px;
  border-radius: 980px;
}

.chart-filter-btn {
  background: transparent;
  border: none;
  font-family: var(--apple-font);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 5px 14px;
  border-radius: 980px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-filter-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.chart-container-large {
  height: 330px;
  position: relative;
}

/* Right Column: Gauge & Actions */
.gauge-panel {
  padding: 20px;
  text-align: center;
}

.gauge-display-box {
  position: relative;
  width: 190px;
  margin: 0 auto;
}

.metallic-gauge-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.gauge-track-path {
  fill: none;
  stroke: rgba(0, 0, 0, 0.06);
  stroke-width: 16;
  stroke-linecap: round;
}

.gauge-active-path {
  fill: none;
  stroke: var(--apple-dark-solid);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s;
}

.gauge-readout {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-number {
  font-family: var(--apple-font);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.gauge-scale {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gauge-classification-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
  border-top: 1px solid var(--apple-hairline);
  padding-top: 14px;
}

.class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.class-color-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.class-color-pip.pip-low { background: var(--risk-low); }
.class-color-pip.pip-mod { background: var(--risk-mod); }
.class-color-pip.pip-high { background: var(--risk-high); }
.class-color-pip.pip-extreme { background: var(--risk-extreme); }

.class-range {
  font-family: -apple-system-monospaced, monospace;
  color: var(--text-tertiary);
}

/* Fast Action Panel */
.action-panel {
  padding: 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.action-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.action-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.action-caption {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin-bottom: 16px;
}

/* Apple Buttons */
.apple-btn-solid {
  background: var(--apple-blue);
  color: #ffffff;
  font-family: var(--apple-font);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-btn-solid:hover {
  background: var(--apple-blue-hover);
}

.apple-btn-subtle {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  font-family: var(--apple-font);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  white-space: nowrap;
  transition: background 0.15s;
}

.apple-btn-subtle:hover {
  background: rgba(0, 0, 0, 0.08);
}

.apple-btn-outline {
  background: #ffffff;
  color: var(--text-primary);
  font-family: var(--apple-font);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 980px;
  border: 1px solid var(--apple-hairline);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.apple-btn-outline:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

.alert-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.2);
}

.alert-indicator-box {
  color: var(--risk-mod);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--risk-mod);
  margin-bottom: 2px;
}

.alert-desc {
  font-size: 0.72rem;
  color: #7c4700;
  line-height: 1.35;
}

/* Subpage Containers */
.subpage-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.subpage-heading {
  font-family: var(--apple-font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.subpage-subheading {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 3px;
  font-weight: 400;
  line-height: 1.4;
}

.subpage-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-strip-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
}

.strip-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.strip-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.strip-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.strip-caption {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.strip-actions-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.strip-chips {
  display: flex;
  gap: 8px;
}

.strip-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--apple-hairline);
  background: rgba(255, 255, 255, 0.45);
}

.table-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-title-main {
  font-family: var(--apple-font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.table-top-bar .apple-btn-solid {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 980px;
  width: auto !important;
  max-width: max-content;
  flex-shrink: 0;
}

.table-scroll-container {
  width: 100%;
  overflow-x: auto;
}

.apple-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-family: var(--apple-font);
}

.apple-data-table thead tr {
  background: rgba(248, 250, 252, 0.9);
}

.apple-data-table th {
  padding: 13px 18px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
}

.apple-data-table th .th-unit {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 2px;
}

.apple-data-table tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.15s ease;
}

.apple-data-table tbody tr:hover {
  background: rgba(0, 113, 227, 0.03);
}

.apple-data-table td {
  padding: 12px 18px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.apple-data-table td .day-label {
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.apple-data-table td .unit-text {
  font-size: 0.76rem;
  color: var(--text-tertiary);
  margin-left: 2px;
  font-weight: 400;
}

.table-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 980px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.table-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.table-badge.complete {
  background: rgba(52, 199, 89, 0.12);
  color: #1b8738;
  border: 1px solid rgba(52, 199, 89, 0.25);
}

.table-badge.complete .badge-dot {
  background: #34c759;
  box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2);
}

.table-badge.missing {
  background: rgba(255, 59, 48, 0.1);
  color: #d70015;
  border: 1px solid rgba(255, 59, 48, 0.22);
}

.table-badge.missing .badge-dot {
  background: #ff3b30;
  box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.2);
}

.table-action-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.85);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.78rem;
}

.table-action-btn:hover {
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  border-color: rgba(255, 59, 48, 0.25);
  transform: scale(1.08);
}

/* Imputation Quad Grid */
.inline-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apple-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.imputation-quad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.chart-quad-card {
  padding: 20px;
}

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

.quad-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.apple-badge-pill {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 980px;
  font-size: 0.68rem;
  font-weight: 500;
}

.quad-chart-canvas {
  height: 220px;
  position: relative;
}

/* Forecasting Configurations (Clean Apple 4-Column Parameter Grid) */
.config-toolbar {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1.35fr;
  gap: 16px;
  padding: 16px 20px;
  align-items: start;
}

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

@media (max-width: 640px) {
  .config-toolbar {
    grid-template-columns: 1fr;
  }
}

/* Modern Horizon Field Card & Stepper Controls */
.horizon-field-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.horizon-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 980px;
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: -0.01em;
  border: 1px solid rgba(0, 113, 227, 0.2);
}

.horizon-control-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 7px 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.horizon-stepper-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.horizon-stepper-btn:hover {
  background: #0071e3;
  color: #ffffff;
  border-color: #0071e3;
  transform: translateY(-1px);
}

.horizon-stepper-btn:active {
  transform: scale(0.95);
}

.apple-range-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 980px;
  background: #e2e8f0;
  outline: none;
  transition: background 0.2s;
}

.apple-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0071e3;
  box-shadow: 0 1px 4px rgba(0, 113, 227, 0.4);
  cursor: pointer;
  border: 2px solid #ffffff;
  transition: transform 0.12s ease;
}

.apple-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.apple-range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0071e3;
  box-shadow: 0 1px 4px rgba(0, 113, 227, 0.4);
  cursor: pointer;
  border: 2px solid #ffffff;
}

.horizon-chips-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.horizon-chip {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  font-size: 0.67rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.horizon-chip:hover {
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  border-color: rgba(0, 113, 227, 0.2);
}

.horizon-chip.active {
  background: #0071e3;
  color: #ffffff;
  border-color: #0071e3;
  box-shadow: 0 1px 3px rgba(0, 113, 227, 0.25);
}

/* Forecast Chart Segmented Filter (Apple Glassmorphism) */
.forecast-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apple-segmented-filter {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 3px;
  border-radius: 980px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  gap: 2px;
}

.seg-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 980px;
  font-family: var(--apple-font);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  white-space: nowrap;
}

.seg-filter-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.6);
}

.seg-filter-btn.active {
  background: #ffffff;
  color: var(--apple-blue);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.12);
}

.seg-filter-btn i {
  font-size: 0.72rem;
}

.field-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}


.config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apple-input {
  font-family: var(--apple-font);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--apple-hairline);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  outline: none;
}

.apple-input:focus {
  border-color: var(--apple-blue);
}

.slider-with-readout {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apple-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 5px;
  background: #e5e5ea;
  border-radius: 980px;
  outline: none;
  transition: background 0.2s;
}

.apple-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  border: 0.5px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-slider::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

.apple-slider::-webkit-slider-thumb:active {
  transform: scale(0.96);
  background: #f8f8f8;
}

.apple-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  border: none;
}

.slider-readout-pill {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 980px;
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.table-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Mitigation SOP Grid */
.mitigation-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.sop-card {
  padding: 24px;
  border-radius: 18px;
  border-left-width: 4px;
}

.sop-card.border-extreme { border-left-color: var(--risk-extreme); }
.sop-card.border-high { border-left-color: var(--risk-high); }
.sop-card.border-mod { border-left-color: var(--risk-mod); }
.sop-card.border-low { border-left-color: var(--risk-low); }

.sop-status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 980px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.sop-status-pill.pill-extreme { background: var(--risk-extreme-bg); color: var(--risk-extreme); }
.sop-status-pill.pill-high { background: var(--risk-high-bg); color: var(--risk-high); }
.sop-status-pill.pill-mod { background: var(--risk-mod-bg); color: var(--risk-mod); }
.sop-status-pill.pill-low { background: var(--risk-low-bg); color: var(--risk-low); }

.sop-title {
  font-family: var(--apple-font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}

.sop-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sop-list li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.sop-list li i {
  color: var(--text-tertiary);
  margin-top: 3px;
  font-size: 0.75rem;
}

/* Modal Frame */
.modal-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.modal-layer.open,
.modal-layer.active {
  display: flex !important;
}

/* Apple Cupertino Chart Loading Overlay */
.chart-container-large,
.quad-chart-canvas {
  position: relative !important;
}

.chart-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.apple-spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid rgba(0, 113, 227, 0.18);
  border-top-color: #0071e3;
  border-radius: 50%;
  animation: appleSpin 0.75s linear infinite;
}

.apple-spinner-sm {
  width: 24px;
  height: 24px;
  border-width: 2.5px;
}

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

.chart-loading-text {
  font-family: var(--apple-font, -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-loading-subtext {
  font-size: 0.74rem;
  color: #86868b;
  margin-top: -4px;
}

.modal-frame {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.95);
  padding: 24px;
}

.apple-modal-card {
  max-width: 530px !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16), 0 0 1px rgba(0, 0, 0, 0.15) !important;
  padding: 24px 26px !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  animation: modalCardPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalCardPop {
  0% { transform: scale(0.94) translateY(8px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-head-title-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.modal-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.modal-icon-badge.header-weather-badge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.modal-subtitle {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.35;
}

.modal-dismiss-btn {
  width: 28px;
  height: 28px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  font-size: 1.05rem;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.modal-dismiss-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

/* Sensor Parameter Field Cards */
.form-field-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-field-card:focus-within {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.field-water:focus-within {
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.1) !important;
}

.field-moisture:focus-within {
  border-color: #34d399 !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.1) !important;
}

.field-rain:focus-within {
  border-color: #60a5fa !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1) !important;
}

.field-temp:focus-within {
  border-color: #fb923c !important;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.1) !important;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.field-label-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0;
  cursor: pointer;
}

/* Domain Themed Icon Pill Badges */
.sensor-icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.74rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.pill-time {
  background: #f5f3ff;
  color: #6366f1;
  border: 1px solid #ddd6fe;
}

.pill-water {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.pill-moisture {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.pill-rain {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.pill-temp {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

.unit-water { color: #0284c7 !important; }
.unit-moisture { color: #059669 !important; }
.unit-rain { color: #2563eb !important; }
.unit-temp { color: #ea580c !important; }

.modal-field-icon {
  font-size: 0.82rem;
  color: #475569;
  width: 15px;
  text-align: center;
}

.field-aux-hint {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 500;
}

.quick-na-btn {
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.quick-na-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.quick-na-btn.active {
  background: #334155;
  color: #ffffff;
  border-color: #334155;
}

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

.input-with-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.mini-stepper-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.input-time-styled {
  text-align: center;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.input-wrapper-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper-unit .apple-input {
  width: 100%;
  padding: 7px 32px 7px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  transition: all 0.15s ease;
}

.input-wrapper-unit .apple-input:focus {
  border-color: #475569;
  box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.12);
}

.input-wrapper-unit .apple-input.is-na {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #475569;
  font-weight: 700;
}

.input-unit-tag {
  position: absolute;
  right: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  pointer-events: none;
}

.field-live-feedback {
  font-size: 0.67rem;
  color: #64748b;
  margin-top: 5px;
  font-weight: 500;
  line-height: 1.25;
}

/* Technical Status Strip */
.modal-completeness-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-top: 4px;
  transition: all 0.2s ease;
}

.modal-completeness-banner.is-complete {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.modal-completeness-banner.has-missing {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.banner-status-icon {
  font-size: 1.15rem;
  color: #64748b;
  flex-shrink: 0;
}

.modal-completeness-banner.is-complete .banner-status-icon {
  color: #16a34a;
}

.modal-completeness-banner.has-missing .banner-status-icon {
  color: #475569;
}

.banner-status-info .banner-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
}

.banner-status-info .banner-desc {
  display: block;
  font-size: 0.70rem;
  color: #64748b;
  margin-top: 1px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.modal-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-weight: 600;
}

@media (max-width: 1200px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .col-left, .col-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================
   TONG SAMPAH / RECYCLE BIN STYLES (PER-STATION ISOLATION)
   ========================================================== */
.trash-badge-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 980px;
  line-height: 1.1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.trash-station-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0284c7;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 980px;
}

.btn-restore-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-restore-action:hover {
  background: #dcfce7;
  color: #14532d;
  transform: translateY(-1px);
}

.btn-perm-delete-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 4px;
}

.btn-perm-delete-action:hover {
  background: #fee2e2;
  color: #7f1d1d;
  transform: translateY(-1px);
}

.trash-empty-card {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.trash-empty-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.trash-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.trash-empty-desc {
  font-size: 0.82rem;
  color: #64748b;
  max-width: 440px;
  line-height: 1.45;
}

/* ==========================================================
   GIS MAP & SPATIAL RADAR PULSE STYLES
   ========================================================== */
.gis-hotspot-pulse {
  position: relative;
  width: 16px;
  height: 16px;
  background: #ff3b30;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.8);
}

.gis-hotspot-pulse::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ff3b30;
  opacity: 0.8;
  animation: pulseRadar 2s infinite ease-out;
}

.gis-station-marker {
  position: relative;
  width: 22px;
  height: 22px;
  background: #0071e3;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(0, 113, 227, 0.8);
}

.gis-station-marker::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #0071e3;
  opacity: 0.6;
  animation: pulseStation 2.4s infinite ease-out;
}

@keyframes pulseRadar {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.6); opacity: 0; }
}

@keyframes pulseStation {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.leaflet-popup-content-wrapper {
  border-radius: 14px !important;
  box-shadow: 0 12px 36px rgba(0,0,0,0.18) !important;
  padding: 4px !important;
  font-family: var(--apple-font) !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  line-height: 1.45 !important;
}

/* ==========================================================
   APPLE CUERTINO GUIDE & DOCUMENTATION SYSTEM (CARA PAKAI)
   ========================================================== */
.guide-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.apple-guide-stepper-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 20px 24px;
  box-shadow: var(--apple-shadow);
}

.stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.stepper-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-hint {
  font-size: 0.74rem;
  color: #86868b;
  font-weight: 500;
}

.stepper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.stepper-step {
  background: #fbfbfd;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
}

.stepper-step:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.step-num-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1d1d1f;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.step-details {
  flex: 1;
}

.step-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.step-desc {
  font-size: 0.76rem;
  color: #6e6e73;
  line-height: 1.45;
}

/* Modular Cards Grid */
.guide-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 18px;
}

.guide-modular-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--apple-shadow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-modular-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

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

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

.guide-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #1d1d1f;
  flex-shrink: 0;
}

.guide-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #86868b;
}

.guide-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.015em;
  margin-top: 1px;
}

.guide-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f5f5f7;
  color: #515154;
  border: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

.guide-card-desc {
  font-size: 0.82rem;
  color: #515154;
  line-height: 1.55;
  margin-bottom: 16px;
}

/* Apple Spec Rows */
.guide-spec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.guide-spec-row {
  background: #fbfbfd;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: #3a3a3c;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guide-spec-key {
  font-weight: 600;
  color: #1d1d1f;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.guide-spec-key::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #86868b;
  flex-shrink: 0;
}

.guide-spec-val {
  color: #515154;
  font-size: 0.77rem;
  line-height: 1.45;
  padding-left: 11px;
}

/* Status spectrum rows for card 6 */
.guide-status-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
}

.guide-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fbfbfd;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 9px;
  padding: 8px 12px;
  gap: 12px;
}

.guide-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
  flex-shrink: 0;
}

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

.guide-status-dot.low { background: #34c759; }
.guide-status-dot.mod { background: #ff9500; }
.guide-status-dot.high { background: #ff6b00; }
.guide-status-dot.ext { background: #ff3b30; }

.guide-status-range {
  font-family: var(--apple-font);
  font-size: 0.78rem;
  font-weight: 700;
  color: #1d1d1f;
}

.guide-status-level {
  font-size: 0.73rem;
  font-weight: 600;
  color: #515154;
}

.guide-status-desc {
  font-size: 0.75rem;
  color: #6e6e73;
  text-align: right;
  flex: 1;
}

/* ==========================================================
   CHART EXPAND (FULLSCREEN) & DAY RANGE FILTER
   ========================================================== */
.btn-chart-expand {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #515154;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.74rem;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.btn-chart-expand:hover {
  background: #1d1d1f;
  color: #ffffff;
  border-color: #1d1d1f;
  transform: scale(1.08);
}

.apple-chip-btn {
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #515154;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--apple-font);
}

.apple-chip-btn:hover {
  background: #e5e7eb;
  color: #1d1d1f;
}

.apple-chip-btn.active {
  background: #1d1d1f;
  color: #ffffff;
  border-color: #1d1d1f;
}

.day-filter-bar {
  transition: all 0.2s ease;
}

.day-filter-bar:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

/* ==========================================================
   7-DAY APPLE WEATHER FORECAST WIDGET (MODERN APPLE/iOS STYLE)
   ========================================================== */
.weather-forecast-card {
  padding: 16px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.weather-forecast-card:hover {
  box-shadow: 0 16px 32px -6px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
  border-color: rgba(186, 230, 253, 0.6);
}

.weather-forecast-card .card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.weather-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
}

.weather-title-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(0, 113, 227, 0.08);
  color: #0071e3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.weather-station-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.07);
  border: 1px solid rgba(2, 132, 199, 0.18);
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}

.weather-station-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
  display: inline-block;
}

/* Today Summary Banner */
.weather-today-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.85) 0%, rgba(248, 250, 252, 0.65) 100%);
  border: 1px solid rgba(219, 234, 254, 0.8);
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.weather-today-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weather-today-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 0 4px 10px rgba(0, 113, 227, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.weather-today-temp {
  font-family: var(--apple-font);
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.02em;
}

.weather-today-desc {
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
  margin-top: 3px;
  letter-spacing: -0.01em;
}

.weather-today-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.weather-stat-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0284c7;
  background: #ffffff;
  border: 1px solid rgba(186, 230, 253, 0.7);
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.05);
}

.weather-temp-range {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: -0.01em;
}

/* 7 Days List */
.weather-days-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weather-day-row {
  display: grid;
  grid-template-columns: 58px 24px 54px 1fr;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 0.76rem;
  transition: all 0.15s ease;
}

.weather-day-row:hover {
  background: rgba(241, 245, 249, 0.85);
}

.weather-day-row.is-today {
  background: rgba(239, 246, 255, 0.55);
}

.weather-day-row.is-today .weather-day-col-name {
  color: #0071e3;
  font-weight: 700;
}

.weather-day-col-name {
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  letter-spacing: -0.01em;
  font-size: 0.75rem;
}

.weather-day-col-icon {
  text-align: center;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-day-col-rain {
  text-align: right;
  font-size: 0.7rem;
}

.weather-rain-val {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  justify-content: flex-end;
}

.weather-rain-val.has-rain {
  color: #0284c7;
}

.weather-rain-val.no-rain {
  color: #94a3b8;
  font-weight: 500;
}

.weather-rain-val.no-rain i {
  color: #cbd5e1;
}

.weather-day-col-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.weather-day-min {
  color: #64748b;
  font-size: 0.71rem;
  font-weight: 500;
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.weather-bar-track {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: #e2e8f0;
  position: relative;
  overflow: visible;
  min-width: 28px;
}

.weather-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #60a5fa 0%, #f97316 100%);
}

.weather-current-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #0071e3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.weather-day-max {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.71rem;
  width: 20px;
  text-align: left;
  flex-shrink: 0;
}

.weather-card-footer {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #64748b;
}

.weather-api-source {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.weather-api-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  display: inline-block;
}

.btn-weather-refresh {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.btn-weather-refresh:hover {
  background: #0071e3;
  color: #ffffff;
  border-color: #0071e3;
  transform: rotate(180deg);
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.25);
}

/* Imputation Status Legend */
.impute-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
}

.legend-chip-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-chip-divider {
  width: 1px;
  height: 12px;
  background: #cbd5e1;
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-color-dot.dot-blue {
  background: #0071e3;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}

.legend-color-dot.dot-red {
  background: #ff3b30;
  box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.2);
}

/* ==========================================
   PDF EXPORT & PRINT STYLING
   ========================================== */
#btnPrintFullscreenPdf {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#btnPrintFullscreenPdf:hover {
  background: #f5f5f7 !important;
  border-color: rgba(0, 0, 0, 0.25) !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.apple-pdf-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(29, 29, 31, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 14px;
  font-family: var(--apple-font);
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 100000;
  animation: appleToastSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================
   CHART FULLSCREEN LIGHTBOX MODAL (Ultra-Clean Apple Lightbox)
   ========================================================== */
#chartFullscreenModal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  background: rgba(15, 23, 42, 0.72) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  z-index: 999999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

#chartFullscreenModal .modal-frame {
  width: 96vw !important;
  max-width: 1440px !important;
  height: 90vh !important;
  max-height: 90vh !important;
  background: #ffffff !important;
  border-radius: 20px !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.fs-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.fs-modal-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 20px 24px;
  position: relative;
  box-sizing: border-box;
}

#fullscreenCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  #chartFullscreenModal,
  #chartFullscreenModal * {
    visibility: visible !important;
  }
  #chartFullscreenModal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #ffffff !important;
    padding: 0 !important;
  }
  #chartFullscreenModal .modal-frame {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  #btnCloseFullscreenChart,
  #btnPrintFullscreenPdf {
    display: none !important;
  }
}

/* ==========================================================
   DEVELOPMENT LOCKED BLUR OVERLAY (APPLE FROSTED SILVER)
   ========================================================== */
.dev-locked-container {
  position: relative !important;
  min-height: 540px !important;
  border-radius: 20px !important;
  overflow: hidden !important;
}

.dev-blurred-content {
  filter: blur(10px) saturate(120%) !important;
  -webkit-filter: blur(10px) saturate(120%) !important;
  opacity: 0.42 !important;
  pointer-events: none !important;
  user-select: none !important;
  transition: all 0.3s ease;
}

.dev-locked-overlay {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(248, 250, 252, 0.4) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  z-index: 50 !important;
  padding: 24px !important;
}

.dev-silver-locked-card {
  max-width: 460px;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 26px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 
    0 24px 64px rgba(15, 23, 42, 0.10),
    0 4px 16px rgba(15, 23, 42, 0.04),
    inset 0 1.5px 2px #ffffff;
  animation: appleCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appleCardFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.silver-lock-badge {
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 30%, #e2e8f0 70%, #cbd5e1 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 16px 36px rgba(100, 116, 139, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 2.5px 3px #ffffff,
    inset 0 -2px 4px rgba(148, 163, 184, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.silver-lock-icon {
  font-size: 2.3rem;
  color: #64748b;
  filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.9));
  background: linear-gradient(145deg, #334155 0%, #64748b 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dev-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.95) 0%, rgba(226, 232, 240, 0.85) 100%);
  border: 1px solid rgba(203, 213, 225, 0.9);
  color: #475569;
  padding: 5px 16px;
  border-radius: 980px;
  font-family: var(--apple-font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02), inset 0 1px 1px #ffffff;
}

.dev-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 6px rgba(148, 163, 184, 0.9);
}

.dev-locked-title {
  font-family: var(--apple-font);
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
  line-height: 1.25;
}

.dev-locked-desc {
  font-family: var(--apple-font);
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0 auto;
}

/* ==========================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (iOS App Feel)
   ========================================================== */

/* Tablets & Small Laptops (max-width: 991px) */
@media (max-width: 991px) {
  .charts-duo-grid,
  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
  }
  
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mobile Devices & Tablets (max-width: 768px) */
@media (max-width: 768px) {
  /* Canvas Shell */
  body {
    overflow-x: hidden;
  }

  .apple-shell {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 6px 6px 85px 6px !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    min-height: 100vh !important;
  }

  /* iOS Bottom Navigation Bar */
  .apple-sidebar-rail {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: 66px !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 6px 12px 10px 12px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.95) !important;
    border-bottom: none !important;
    box-shadow: 0 -8px 26px rgba(15, 23, 42, 0.08) !important;
    z-index: 9999 !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .rail-top {
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: 100% !important;
    gap: 0 !important;
  }

  .rail-menu-btn,
  .rail-divider {
    display: none !important;
  }

  .rail-nav {
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: 100% !important;
    gap: 4px !important;
  }

  .rail-item {
    width: auto !important;
    flex: 1 !important;
    padding: 3px 0 !important;
    font-size: 0.60rem !important;
    gap: 2px !important;
  }

  .rail-icon-box {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.92rem !important;
    border-radius: 8px !important;
  }

  .rail-item span {
    white-space: nowrap;
    font-size: 0.58rem !important;
    letter-spacing: -0.02em;
  }

  /* Main Workspace */
  .main-workspace {
    width: 100% !important;
    max-width: 100% !important;
    gap: 10px !important;
  }

  /* Apple Top Header */
  .apple-top-header {
    position: sticky !important;
    top: 6px !important;
    padding: 8px 12px !important;
    border-radius: 14px !important;
    margin-bottom: 4px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .brand-caption {
    display: none !important;
  }

  .brand-title {
    font-size: 1rem !important;
  }

  .header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .custom-select-box {
    max-width: 140px !important;
  }

  #presetDatasetSelect {
    padding: 4px 6px !important;
    font-size: 0.70rem !important;
  }

  .station-readonly-badge {
    padding: 4px 8px !important;
    font-size: 0.70rem !important;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #btnRunForecast {
    padding: 4px 10px !important;
    font-size: 0.70rem !important;
  }

  .system-status-indicator {
    padding: 4px 8px !important;
    font-size: 0.68rem !important;
  }

  .lang-switch-pill {
    padding: 2px !important;
  }

  .lang-btn {
    padding: 3px 6px !important;
    font-size: 0.68rem !important;
  }

  /* Page Header and Headings */
  .subpage-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .subpage-heading {
    font-size: 1.25rem !important;
  }

  .subpage-subheading {
    font-size: 0.74rem !important;
  }

  .subpage-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .subpage-actions button {
    flex: 1 1 auto;
    font-size: 0.74rem !important;
    padding: 6px 10px !important;
    justify-content: center;
  }

  /* KPI Grid */
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .kpi-card {
    padding: 12px 10px !important;
    border-radius: 12px !important;
  }

  .kpi-val {
    font-size: 1.35rem !important;
  }

  .kpi-title {
    font-size: 0.68rem !important;
  }

  /* Horizontal Scrolling for Forecast 7-Day Strip */
  .forecast-strip,
  .forecast-cards-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 6px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .forecast-strip > *,
  .forecast-day-card {
    flex: 0 0 115px !important;
    min-width: 115px !important;
  }

  /* Peramalan Configuration Form */
  .config-grid,
  .peramalan-controls-grid,
  .config-fields-group {
    grid-template-columns: 1fr !important;
  }

  .ios-alarm-dial-wrapper {
    margin: 0 auto 10px !important;
  }

  /* Tables Scrollability */
  .table-scroll-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
  }

  .apple-data-table th,
  .apple-data-table td {
    padding: 7px 8px !important;
    font-size: 0.72rem !important;
    white-space: nowrap !important;
  }

  /* Modal Add Data */
  .apple-modal-card {
    width: 95% !important;
    max-width: 95% !important;
    margin: 12px auto !important;
    padding: 16px 14px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* GIS Map View */
  #leafletMapContainer {
    height: 380px !important;
  }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .sensor-inputs-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .system-status-indicator {
    display: none !important;
  }

  .brand-title {
    font-size: 0.95rem !important;
  }

  .brand-badge-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.85rem !important;
  }

  .kpi-cards-grid {
    grid-template-columns: 1fr !important;
  }

  .modal-actions {
    flex-direction: column !important;
    width: 100% !important;
  }

  .modal-actions button {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   Tong Sampah / Recycle Bin Styles (Isolated Per Station)
   ========================================================================== */
.trash-badge-count {
  position: absolute;
  top: -5px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 980px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
  border: 1.5px solid #ffffff;
  pointer-events: none;
}

.trash-station-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.2);
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 0.74rem;
  font-weight: 600;
}

.btn-restore-action {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(2, 132, 199, 0.2);
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.76rem;
}

.btn-restore-action:hover {
  background: #0284c7;
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.btn-perm-delete-action {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.76rem;
}

.btn-perm-delete-action:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.trash-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
  background: rgba(248, 250, 252, 0.6);
  border-radius: 16px;
  margin: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
}

.trash-empty-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.trash-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.trash-empty-desc {
  font-size: 0.8rem;
  color: #64748b;
  max-width: 440px;
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   Settings & Dynamic Station Management Styles
   ========================================================================== */
.settings-grid-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 1060px) {
  .settings-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* Left Card: Create Station Card */
.create-station-card {
  padding: 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--apple-shadow);
}

.create-station-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.create-station-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.create-station-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.015em;
}

.create-station-subtitle {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  display: block;
}

.station-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.station-form-group label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.create-station-card .apple-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1e293b;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.create-station-card .apple-input:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.create-station-card .apple-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.station-info-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 18px;
  font-size: 0.73rem;
  color: #1e40af;
  line-height: 1.45;
}

.station-info-box i {
  color: #3b82f6;
  font-size: 0.85rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.btn-submit-station {
  width: 100%;
  height: 38px;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 9px;
}

/* PFVI Scale Legend Strip */
.pfvi-legend-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 14px;
}

.pfvi-legend-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pfvi-legend-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pfvi-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.2;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.pill-green {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.dot-green {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.pill-yellow {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
}
.dot-yellow {
  background: #eab308;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2);
}

.pill-orange {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.dot-orange {
  background: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.pill-red {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.dot-red {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Station Table Rows & Cells */
.apple-data-table.station-table td {
  padding: 13px 16px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.apple-data-table.station-table tr:hover {
  background-color: rgba(241, 245, 249, 0.6) !important;
}

.station-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.station-icon-box.active {
  background: #eff6ff;
  color: #0071e3;
  border: 1px solid #bfdbfe;
}
.station-icon-box.inactive {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.station-active-tag {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.station-risk-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.station-risk-pill {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.station-risk-pill.pill-empty {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
  font-weight: 500;
}

.station-risk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.station-risk-dot.dot-gray {
  background: #94a3b8;
}

.station-pfvi-score {
  font-size: 0.68rem;
  color: #64748b;
  white-space: nowrap;
}

.station-pfvi-score.score-empty {
  color: #cbd5e1;
}

.station-count-pill {
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.76rem;
  border: 1px solid #e2e8f0;
  display: inline-block;
}

.station-count-empty {
  color: #94a3b8;
  font-size: 0.74rem;
  font-style: italic;
}

.btn-station-current {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  cursor: default;
}

.btn-station-open {
  padding: 5px 12px;
  border-radius: 8px;
  background: #0071e3;
  color: #ffffff;
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 113, 227, 0.2);
}

.btn-station-open:hover {
  background: #005bb5;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
}

.btn-station-delete {
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-station-delete:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}


/* Clear All Sensor Data Button Styling */
#btnClearAllSensorData {
  transition: all 0.15s ease;
}
#btnClearAllSensorData:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
  transform: translateY(-1px);
}
#btnHeaderClearAll {
  transition: all 0.15s ease;
}
#btnHeaderClearAll:hover {
  color: #ef4444 !important;
  transform: scale(1.15);
}
