/* ============================================================
   DEM Explorer — Dark Industrial GIS Theme
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-base: #080a10;
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1219;
  --bg-panel: #131720;
  --bg-panel-alt: #171c28;
  --bg-input: #0c0f17;
  --bg-hover: #1a2030;
  --bg-active: #1e2538;
  --border: #1c2233;
  --border-hover: #2a3450;
  --border-active: #00d4aa44;
  --text-primary: #e2e8f0;
  --text-secondary: #8892a8;
  --text-muted: #7a8599;
  --text-label: #b0bdd0;
  --accent: #00d4aa;
  --accent-light: #33ffd4;
  --accent-dim: rgba(0, 212, 170, 0.15);
  --accent-glow: rgba(0, 212, 170, 0.3);
  --accent2: #f59e0b;
  --accent2-dim: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --success: #10b981;
  --info: #3b82f6;
  --font-ui: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-width: 340px;
  --header-height: 52px;
  --radius: 8px;
  --radius-sm: 5px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* --- Layout --- */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* --- Header --- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  flex-shrink: 0;
}
.app-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}
.app-header .logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #007a63);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.app-header .logo span { color: var(--accent); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Main Content --- */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: min-width var(--transition), width var(--transition);
  z-index: 500;
}
.sidebar.collapsed {
  width: 0; min-width: 0;
  border-right: none;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
}

/* --- Sidebar Sections --- */
.sidebar-section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color var(--transition);
}
.sidebar-section:hover { border-color: var(--border-hover); }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.section-header:hover { background: var(--bg-hover); }
.section-header h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header h3 .icon { font-size: 14px; }
.section-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition);
}
.sidebar-section.collapsed .section-chevron { transform: rotate(-90deg); }
.section-content {
  padding: 0 14px 14px;
  max-height: 1060px;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.sidebar-section.collapsed .section-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* --- Form Controls --- */
.input-group {
  margin-bottom: 10px;
}
.input-group label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-label);
  margin-bottom: 4px;
}
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a5568'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* --- Range Slider --- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-panel);
  box-shadow: 0 0 6px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.range-row input[type="range"] { flex: 1; }
.range-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  min-width: 40px;
  text-align: right;
  font-weight: 500;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #009d7e);
  border-color: var(--accent);
  color: #0a0d14;
}
.btn-primary:hover {
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  background: var(--bg-panel-alt);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  background: var(--bg-panel);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}
.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--border-hover);
}
.btn-icon-clear {
  width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel-alt);
  color: var(--text-muted);
  flex-shrink: 0;
}
.btn-icon-clear:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}
.btn-icon-clear svg {
  width: 15px;
  height: 15px;
}
.btn-group {
  display: flex;
  gap: 6px;
}
.btn-full { width: 100%; }

/* --- DEM Source Cards --- */
.source-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.source-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.source-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}
.source-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.source-card .radio {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-hover);
  position: relative;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.source-card.selected .radio {
  border-color: var(--accent);
}
.source-card.selected .radio::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.source-info h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1px;
}
.source-info p {
  font-size: 10px;
  color: var(--text-muted);
}
.source-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.source-badge.key-required {
  background: var(--accent2-dim);
  color: var(--accent2);
}

/* --- Progress Bar --- */
.progress-container {
  display: none;
  margin-top: 10px;
}
.progress-container.visible { display: block; }
.progress-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.3s ease;
}
.progress-bar-fill.indeterminate {
  width: 30%;
  animation: indeterminate 1.5s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.progress-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* --- Viz Tabs (Map Overlay) --- */
.viz-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(15, 18, 25, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 800;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.viz-toolbar.visible { display: flex; }
.viz-tab {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
}
.viz-tab:hover { color: var(--text-secondary); background: var(--bg-hover); }
.viz-tab.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* --- Viz Controls Panel (in sidebar) --- */
.viz-controls { display: none; }
.viz-controls.visible { display: block; }
.viz-control-group { display: none; }
.viz-control-group.active { display: block; }

/* --- Checkbox --- */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border: 2px solid var(--border-hover);
  border-radius: 3px;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}
.checkbox-row input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-row input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: -1px; left: 2px;
  font-size: 11px;
  color: var(--bg-base);
  font-weight: 700;
}
.checkbox-row span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Stats Table --- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stat-card {
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.stat-card .stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.stat-card .stat-unit {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}
#histogram-canvas {
  width: 100%;
  height: 80px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
}

/* --- Export Buttons --- */
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.export-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
}
.export-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.export-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.export-btn .export-icon { font-size: 20px; }

/* --- Map Container --- */
.map-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
#map {
  flex: 1;
  background: var(--bg-base);
  z-index: 1;
}

/* --- Leaflet Dark Overrides --- */
.leaflet-control-zoom a {
  background: var(--bg-panel) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  font-size: 14px !important;
}
.leaflet-control-zoom a:hover {
  background: var(--bg-hover) !important;
  color: var(--accent) !important;
}
.leaflet-control-layers {
  background: rgba(15, 18, 25, 0.92) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
.leaflet-control-layers label {
  color: var(--text-secondary) !important;
  font-size: 12px;
}
.leaflet-control-layers-separator {
  border-top-color: var(--border) !important;
}
.leaflet-control-scale-line {
  background: rgba(15, 18, 25, 0.8) !important;
  border-color: var(--text-muted) !important;
  color: var(--text-secondary) !important;
  font-size: 10px;
  backdrop-filter: blur(4px);
}
.leaflet-draw-toolbar a {
  background-color: var(--bg-panel) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}
.leaflet-draw-toolbar a:hover {
  background-color: var(--bg-hover) !important;
}

/* --- Area Badge --- */
.area-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-top: 8px;
}

/* --- Tooltip --- */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  margin-left: 4px;
}
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 9999;
}
.info-tip:hover::after { opacity: 1; }

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}
.toast {
  padding: 10px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
  max-width: 360px;
  backdrop-filter: blur(10px);
}
.toast.error { border-left: 3px solid var(--danger); }
.toast.success { border-left: 3px solid var(--success); }
.toast.info { border-left: 3px solid var(--info); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 16, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 900;
  flex-direction: column;
  gap: 12px;
}
.loading-overlay.visible { display: flex; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* --- Color Ramp Preview --- */
.ramp-preview {
  height: 8px;
  border-radius: 4px;
  margin-top: 4px;
  border: 1px solid var(--border);
}
.ramp-viridis { background: linear-gradient(90deg, #440154, #31688e, #35b779, #fde725); }
.ramp-terrain { background: linear-gradient(90deg, #333399, #2d8f2d, #a6782b, #f5f5dc, #ffffff); }
.ramp-jet { background: linear-gradient(90deg, #000080, #0000ff, #00ffff, #ffff00, #ff0000, #800000); }
.ramp-grayscale { background: linear-gradient(90deg, #000000, #ffffff); }
.ramp-rainfall { background: linear-gradient(90deg, #bee6ff, #50b4ff, #1e64e6, #7828c8, #c81e64); }

/* --- Rainfall Trend Chart --- */
#rain-trend-canvas {
  width: 100%;
  height: 70px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
}

/* Date input styling */
input[type="date"] {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input[type="date"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

/* --- Legend Bar --- */
.legend-bar {
  display: none;
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  background: rgba(15, 18, 25, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.legend-bar.visible { display: block; }
.legend-gradient {
  width: 200px; height: 10px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.legend-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

/* --- Sidebar Toggle --- */
.sidebar-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 850;
}

/* --- API Key Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.modal p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}
.modal .btn-group { justify-content: flex-end; margin-top: 16px; }

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  gap: 6px;
}
.empty-state .empty-icon { font-size: 24px; opacity: 0.5; }

/* --- CN Table --- */
.cn-table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 11px; }
.cn-table th, .cn-table td { padding: 6px 8px; border: 1px solid var(--border); text-align: left; }
.cn-table th { background: var(--bg-hover); color: var(--text-label); font-weight: 600; text-transform: uppercase; }
.cn-table td { color: var(--text-primary); }
.cn-table tbody tr:hover { background: var(--bg-input); }

/* --- Sharp Grids (No interpolation) --- */
.pixelated-overlay {
  image-rendering: -moz-crisp-edges;
  image-rendering: -o-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    left: 0; top: var(--header-height); bottom: 0;
    z-index: 900;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }
  .sidebar.collapsed { transform: translateX(-100%); }
}
