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

/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
  /* Colors */
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-tertiary: #242837;
  --bg-glass: rgba(26, 29, 39, 0.85);
  --bg-glass-light: rgba(36, 40, 55, 0.75);

  --text-primary: #f0f2f5;
  --text-secondary: #9ca3b4;
  --text-muted: #6b7280;

  --accent-primary: #6366f1;
  --accent-primary-hover: #818cf8;
  --accent-secondary: #22d3ee;
  --accent-danger: #ef4444;
  --accent-danger-hover: #f87171;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.15);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-header: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

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

html, body {
  height: 100%;
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  min-height: 60px;
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .logo-icon {
  font-size: 28px;
  line-height: 1;
}

.app-header .logo-text {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.app-header .logo-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

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

.app-main {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* ========================================
   Map Container
   ======================================== */
.map-container {
  flex: 1;
  position: relative;
}

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

/* Leaflet Overrides */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(12px) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 18px !important;
  transition: var(--transition-fast) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-tertiary) !important;
  border-color: var(--border-color-hover) !important;
}

.leaflet-control-zoom-in {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
}

.leaflet-control-zoom-out {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  border-top: none !important;
}

/* ========================================
   Stand Labels on Map
   ======================================== */
.stand-label {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.stand-label .stand-number {
  background: var(--gradient-primary);
  color: white;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.stand-label .stand-icons {
  display: flex;
  gap: 3px;
  font-size: 11px;
}

.stand-label .icon-water {
  color: #38bdf8;
}

.stand-label .icon-electricity {
  color: #facc15;
}

/* ========================================
   Stand Popup
   ======================================== */
.leaflet-popup-content-wrapper {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--text-primary) !important;
  min-width: 220px;
}

.leaflet-popup-tip {
  background: var(--bg-glass) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
}

.leaflet-popup-close-button {
  color: var(--text-secondary) !important;
  font-size: 20px !important;
  padding: 8px 10px 0 0 !important;
}

.leaflet-popup-close-button:hover {
  color: var(--text-primary) !important;
}

.popup-content {
  padding: 4px 0;
}

.popup-content .popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.popup-content .popup-number {
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.popup-content .popup-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.popup-content .popup-category {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.popup-content .popup-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popup-content .popup-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.popup-content .popup-detail-row .detail-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.popup-content .popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.popup-badge.badge-water {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.popup-badge.badge-electricity {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
}

.popup-badge.badge-none {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-muted);
}

.popup-content .popup-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.popup-content .popup-notes {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ========================================
   Legend
   ======================================== */
.map-legend {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  min-width: 180px;
}

.map-legend h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

.legend-icon-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ========================================
   Admin Sidebar
   ======================================== */
.admin-sidebar {
  width: 400px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  transition: width var(--transition-base);
}

.admin-sidebar.collapsed {
  width: 0;
  border-left: none;
}

.sidebar-header {
  padding: 16px 20px;
  background: var(--gradient-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h2 {
  font-size: 15px;
  font-weight: 700;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-family);
}

.sidebar-tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

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

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.tab-panel {
  display: none;
}

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

/* ========================================
   Form Styles
   ======================================== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  transition: var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  resize: vertical;
  min-height: 60px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10L6 8z' fill='%239ca3b4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

/* Checkbox/Toggle */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.toggle-group:hover {
  border-color: var(--border-color-hover);
}

.toggle-group input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--bg-primary);
  border-radius: 11px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-group input:checked + .toggle-switch {
  background: var(--accent-primary);
}

.toggle-group input:checked + .toggle-switch::after {
  left: 21px;
  background: white;
}

.toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========================================
   Stand List
   ======================================== */
.stand-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stand-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.stand-list-item:hover {
  border-color: var(--border-color-hover);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}

.stand-list-item.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.stand-list-number {
  background: var(--gradient-primary);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.stand-list-info {
  flex: 1;
  min-width: 0;
}

.stand-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stand-list-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.stand-list-icons {
  display: flex;
  gap: 4px;
  font-size: 14px;
  flex-shrink: 0;
}

.stand-list-actions {
  display: flex;
  gap: 4px;
}

.stand-list-actions .btn-icon {
  width: 28px;
  height: 28px;
  font-size: 14px;
  opacity: 0;
  transition: var(--transition-fast);
}

.stand-list-item:hover .stand-list-actions .btn-icon {
  opacity: 1;
}

/* ========================================
   Login Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.modal-content h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.modal-content .form-group {
  margin-bottom: 20px;
}

.modal-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ========================================
   Settings Panel
   ======================================== */
.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section h3 .section-icon {
  font-size: 16px;
}

.map-preview {
  width: 100%;
  height: 120px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
}

.map-preview-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: var(--bg-glass);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ========================================
   Info Stats Bar (Public View)
   ======================================== */
.stats-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  display: flex;
  gap: 8px;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.stat-chip .stat-icon {
  font-size: 16px;
}

/* ========================================
   Admin Toolbar
   ======================================== */
.admin-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  display: flex;
  gap: 8px;
}

.toolbar-group {
  display: flex;
  gap: 2px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: var(--shadow-md);
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.toolbar-btn.active {
  background: var(--accent-primary);
  color: white;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  animation: slideInRight 0.3s ease;
  min-width: 250px;
}

.toast.toast-success { border-left: 3px solid var(--accent-success); }
.toast.toast-error { border-left: 3px solid var(--accent-danger); }
.toast.toast-info { border-left: 3px solid var(--accent-primary); }

.toast-icon { font-size: 18px; }

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  line-height: 1.5;
}

/* ========================================
   Color Picker
   ======================================== */
.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.color-option:hover {
  transform: scale(1.15);
}

.color-option.selected {
  border-color: white;
  box-shadow: var(--shadow-glow);
}

.color-option.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ========================================
   Category Badge
   ======================================== */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 10px 16px;
  }

  .app-header .logo-text {
    font-size: 15px;
  }

  .app-header .logo-subtitle {
    display: none;
  }

  .admin-sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 360px;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform var(--transition-base);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-sidebar.collapsed {
    width: 100%;
    max-width: 360px;
  }

  .map-legend {
    bottom: 12px;
    left: 12px;
    max-width: 160px;
    padding: 12px;
  }

  .stats-bar {
    top: 8px;
    right: 8px;
    flex-wrap: wrap;
  }

  .stat-chip {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ========================================
   Leaflet Draw Overrides
   ======================================== */
.leaflet-draw-toolbar a {
  background-color: var(--bg-glass) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.leaflet-draw-toolbar a:hover {
  background-color: var(--bg-tertiary) !important;
}

.leaflet-draw-actions a {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  font-family: var(--font-family) !important;
  font-size: 12px !important;
}

.leaflet-draw-actions a:hover {
  background: var(--bg-tertiary) !important;
}

.leaflet-draw-tooltip {
  background: var(--bg-glass) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-family) !important;
  border-radius: var(--radius-sm) !important;
}

.leaflet-draw-tooltip-subtext {
  color: var(--text-muted) !important;
}

/* SR-only for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========================================
   Leaflet Layer Control (Map Switcher)
   ======================================== */
.leaflet-control-layers {
  border: none !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
}

.leaflet-control-layers-toggle {
  background-color: var(--bg-glass) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  width: 36px !important;
  height: 36px !important;
}

.leaflet-control-layers-expanded {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  padding: 8px 14px !important;
  font-family: var(--font-family) !important;
  font-size: 13px !important;
}

.leaflet-control-layers-separator {
  border-top-color: var(--border-color) !important;
}

.leaflet-control-layers label {
  color: var(--text-primary) !important;
  margin-bottom: 4px;
}

.leaflet-control-layers-base label {
  cursor: pointer;
  padding: 3px 0;
  transition: color 150ms ease;
}

.leaflet-control-layers-base label:hover {
  color: var(--accent-primary-hover) !important;
}
