/* ==========================================================================
   GENDIS ENTERPRISE DESIGN SYSTEM — "QUIET CONFIDENCE"
   Crafted for Industrial Agro-Manufacturing Intelligence (PT Sinergi Gula Nusantara)
   Clean, Minimalist, Precision-Engineered, Zero-Decoration Noise
   ========================================================================== */

:root {
  /* Surface Layers (Deep Obsidian & Charcoal Slates) */
  --bg-canvas: #090d14;
  --bg-surface: #0f1520;
  --bg-elevated: #151d2c;
  --bg-subtle: #0b1019;
  --bg-hover: rgba(255, 255, 255, 0.035);
  --bg-active: rgba(255, 255, 255, 0.06);

  /* Border & Divider Tokens */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);

  /* Primary Brand Accent (SGN Sugar Cane Emerald) */
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-active: #047857;
  --primary-text: #34d399;
  --primary-subtle: rgba(16, 185, 129, 0.09);
  --primary-border: rgba(16, 185, 129, 0.25);
  --primary-ring: rgba(16, 185, 129, 0.35);

  /* Semantic Status Colors (Restrained & High-Legibility) */
  --status-success: #10b981;
  --status-success-subtle: rgba(16, 185, 129, 0.1);
  --status-warning: #f59e0b;
  --status-warning-subtle: rgba(245, 158, 11, 0.1);
  --status-danger: #f43f5e;
  --status-danger-subtle: rgba(244, 63, 94, 0.1);
  --status-info: #0ea5e9;
  --status-info-subtle: rgba(14, 165, 233, 0.1);

  /* Typography Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-disabled: #475569;

  /* Spacing Scale (4px Base Grid) */
  --space-05: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Corner Radius (Moderate & Professional) */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Elevations (Subtle Crisp Layering) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-subtle);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-subtle);
  --shadow-drawer: 0 20px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-subtle);

  /* Typography & Numeric Layout */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Transition Timing */
  --transition-fast: 140ms ease;
  --transition-normal: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02' 1, 'cv03' 1, 'cv04' 1, 'cv11' 1;
  overflow: hidden;
}

body.scroll-locked {
  overflow: hidden !important;
}

/* Tabular figures for data tables and timestamps */
.tnum, table, .metric-value, .timestamp {
  font-feature-settings: 'tnum' 1;
}

/* ==========================================================================
   APPLICATION SHELL LAYOUT
   ========================================================================== */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-canvas);
}

/* ----------------- TOPBAR ----------------- */
.app-topbar {
  height: 48px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  flex-shrink: 0;
  z-index: 100;
  user-select: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.btn-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-sidebar-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.brand-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
}

.brand-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-text);
  letter-spacing: -0.01em;
}

.brand-separator {
  color: var(--border-strong);
  font-size: 13px;
  margin: 0 var(--space-1);
}

.topbar-context-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.system-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-text);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
  display: inline-block;
}

.btn-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  height: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-topbar-link:hover {
  background: var(--bg-hover);
  color: var(--primary-text);
  border-color: var(--primary-border);
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-left: var(--space-2);
  border-left: 1px solid var(--border-subtle);
}

.user-avatar-badge {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-text);
}

.user-meta-compact {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-meta-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta-role {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-logout-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-logout-compact:hover {
  color: var(--status-danger);
  background: var(--status-danger-subtle);
  border-color: rgba(244, 63, 94, 0.2);
}

/* ----------------- CONTAINER & BODY ----------------- */
.app-container {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
  height: calc(100vh - 48px);
}

/* Backdrop for overlay drawer & mobile */
.sidebar-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  z-index: 80;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ----------------- SIDEBAR (AUTO-HIDE & PINNED) ----------------- */
.app-sidebar {
  width: 250px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 90;
  user-select: none;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-normal), margin-left var(--transition-normal);
}

/* Mode: Unpinned (Desktop Overlay Default) */
body:not(.sidebar-pinned) .app-sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  box-shadow: var(--shadow-drawer);
}

body:not(.sidebar-pinned) .app-sidebar.sidebar-open {
  transform: translateX(0);
}

/* Mode: Pinned (Desktop Static Flow) */
@media (min-width: 1024px) {
  body.sidebar-pinned .app-sidebar {
    position: relative;
    transform: none;
    box-shadow: none;
  }
}

/* Mobile/Tablet (< 1024px): Always Overlay Drawer */
@media (max-width: 1023px) {
  .app-sidebar {
    position: absolute !important;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%) !important;
    box-shadow: var(--shadow-drawer) !important;
  }
  .app-sidebar.sidebar-open {
    transform: translateX(0) !important;
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-pin-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-pin-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-pin-toggle.pinned {
  color: var(--primary-text);
  background: var(--primary-subtle);
  border-color: var(--primary-border);
}

.sidebar-nav {
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-3) var(--space-3) var(--space-1) var(--space-3);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--primary-subtle);
  color: var(--primary-text);
  border-color: var(--primary-border);
  font-weight: 600;
}

.nav-btn.active svg {
  stroke: var(--primary);
  opacity: 1;
}

.sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-version-tag {
  font-size: 10px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ----------------- MAIN VIEWPORT ----------------- */
.main-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-5) var(--space-6);
  background-color: var(--bg-canvas);
  outline: none;
}

@media (max-width: 768px) {
  .main-viewport {
    padding: var(--space-4);
  }
}

.tab-pane {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.tab-pane.active {
  display: block;
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   DESIGN COMPONENTS: PANELS, HEADERS, GRIDS, TOOLBARS
   ========================================================================== */

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.page-header-left h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.page-header-left p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Metric KPI Strip (Clean & Non-Bloated) */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

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

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

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-1);
  letter-spacing: -0.02em;
}

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

/* Enterprise Panel (Replacement for noisy cards) */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.panel-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.panel-body {
  padding: var(--space-4);
}

/* Toolbar & Filter Bar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

/* ==========================================================================
   FORM CONTROLS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: var(--space-3);
}

.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 34px;
  padding: 0 var(--space-3);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea {
  height: auto;
  min-height: 72px;
  padding: var(--space-2) var(--space-3);
  resize: vertical;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-ring);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  cursor: pointer;
  padding-right: 24px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* ==========================================================================
   BUTTONS (PRECISE HIERARCHY)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-hover);
  border-color: var(--border-medium);
}

.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-destructive {
  background-color: var(--status-danger-subtle);
  border-color: rgba(244, 63, 94, 0.25);
  color: var(--status-danger);
}

.btn-destructive:hover:not(:disabled) {
  background-color: var(--status-danger);
  color: #ffffff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-success, .badge-active {
  background: var(--status-success-subtle);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning, .badge-superseded {
  background: var(--status-warning-subtle);
  color: var(--status-warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-danger {
  background: var(--status-danger-subtle);
  color: var(--status-danger);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.badge-info {
  background: var(--status-info-subtle);
  color: var(--status-info);
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.badge-neutral, .badge-dim {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.98);
  transition: transform var(--transition-fast);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast);
}

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

.modal-body {
  padding: var(--space-4);
  max-height: calc(85vh - 110px);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 360px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  box-shadow: var(--shadow-md);
  animation: toastSlideIn 0.2s ease forwards;
}

.toast-success {
  background-color: #064e3b;
  color: #d1fae5;
  border: 1px solid #059669;
}

.toast-error {
  background-color: #4c0519;
  color: #ffe4e6;
  border: 1px solid #e11d48;
}

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

/* ==========================================================================
   CUSTOM LUXURIOUS SCROLLBAR & ACTIVITY FEED STYLING
   ========================================================================== */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: rgba(6, 10, 18, 0.6);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.5), rgba(6, 182, 212, 0.6));
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
  transition: all var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.9), rgba(6, 182, 212, 0.95));
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.7);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.5) rgba(6, 10, 18, 0.6);
}

.custom-scrollbar {
  overflow-y: scroll !important;
  scrollbar-width: thin;
  scrollbar-color: #10b981 rgba(6, 10, 18, 0.7);
  scroll-behavior: smooth;
}

/* Dedicated High-Visibility Activity Feed Scrollbar */
#activity-feed-list {
  overflow-y: scroll !important;
  scrollbar-width: thin;
  scrollbar-color: #10b981 rgba(8, 14, 24, 0.85);
}

#activity-feed-list::-webkit-scrollbar {
  width: 8px !important;
  display: block !important;
}

#activity-feed-list::-webkit-scrollbar-track {
  background: rgba(8, 14, 24, 0.9) !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  margin: 4px 0 !important;
}

#activity-feed-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #10b981, #06b6d4) !important;
  border-radius: 8px !important;
  border: 2px solid rgba(8, 14, 24, 0.95) !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5) !important;
}

#activity-feed-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #34d399, #38bdf8) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.9) !important;
}

/* Activity Item Card Polish */
.activity-card-item {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  background: transparent;
}

.activity-card-item:hover {
  background: rgba(15, 23, 42, 0.85) !important;
  border-left: 3px solid #10b981;
  padding-left: 15px;
}

.activity-card-item:last-child {
  border-bottom: none;
}

/* ==========================================================================
   LEAFLET GIS MAP OVERLAYS
   ========================================================================== */
.leaflet-control-layers {
  background: rgba(15, 21, 32, 0.95) !important;
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
}

.leaflet-bar a {
  background-color: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

.leaflet-bar a:hover {
  background-color: var(--bg-elevated) !important;
  color: var(--primary) !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(8px);
  color: #f8fafc !important;
}

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

.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.leaflet-container a.leaflet-popup-close-button {
  color: #94a3b8 !important;
  padding: 6px !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  color: #f8fafc !important;
}

/* ==========================================================================
   PYTHON MCP STUDIO & CODEMIRROR THEME ENHANCEMENTS
   ========================================================================== */

.modal-box-studio {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(16, 185, 129, 0.1) !important;
  overflow: hidden;
}

.CodeMirror {
  height: 100% !important;
  width: 100% !important;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace !important;
  font-size: 12.5px !important;
  line-height: 1.5 !important;
  background: #090d16 !important;
  color: #e2e8f0 !important;
}

.CodeMirror-gutters {
  background: #0d131f !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.CodeMirror-linenumber {
  color: #475569 !important;
  padding: 0 8px 0 5px !important;
}

.CodeMirror-cursor {
  border-left: 2px solid #10b981 !important;
}

.CodeMirror-selected {
  background: rgba(16, 185, 129, 0.25) !important;
}

.CodeMirror-focused .CodeMirror-selected {
  background: rgba(16, 185, 129, 0.3) !important;
}

.CodeMirror-matchingbracket {
  color: #38bdf8 !important;
  border-bottom: 1px solid #38bdf8 !important;
  font-weight: 700;
}


