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

    :root {
      --bg: #0f0f10;
      --surface: #18181b;
      --surface-2: #1e1e22;
      --surface-3: #27272a;
      --border: #2e2e33;
      --border-light: #3a3a40;
      --text: #e4e4e7;
      --text-muted: #a1a1aa;
      --text-faint: #71717a;
      --accent: #20b2aa;
      --accent-hover: #2dd4bf;

      --orange: #f59e0b;
      --purple-light: #c084fc;
      --purple: #8b5cf6;
      --green: #22c55e;
      --cyan: #22d3ee;
      --red: #ef4444;

      --radius: 8px;
      --radius-lg: 12px;
      --shadow: 0 4px 24px rgba(0,0,0,0.4);
      --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      --mono: 'JetBrains Mono', 'Fira Code', monospace;
    }

    html, body {
      height: 100%;
      font-family: var(--font);
      background: var(--bg);
      color: var(--text);
      -webkit-font-smoothing: antialiased;
    }

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

    .header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 58px;
      padding: 14px 24px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      z-index: 1000;
      flex-shrink: 0;
    }

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

    .header-icon {
      width: 38px;
      height: 38px;
      background: linear-gradient(135deg, var(--accent), var(--purple));
      border-radius: var(--radius);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .header-icon svg {
      width: 21px;
      height: 21px;
      fill: white;
    }

    .header h1 {
      font-size: 18px;
      font-weight: 600;
      letter-spacing: -0.01em;
    }

    .header .badge {
      display: inline-flex;
      align-items: center;
      background: var(--accent);
      color: #000;
      font-size: 13px;
      font-weight: 600;
      padding: 4px 12px;
      border-radius: 20px;
      margin-left: 4px;
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .icon-btn,
    .text-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--surface-2);
      color: var(--text-muted);
      cursor: pointer;
      font-family: var(--font);
      font-weight: 600;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
    }

    .icon-btn:hover,
    .text-btn:hover {
      background: var(--surface-3);
      color: var(--text);
      border-color: var(--border-light);
    }

    .icon-btn:focus-visible,
    .text-btn:focus-visible,
    .filter-btn:focus-visible,
    .toolbar select:focus-visible,
    .search-box input:focus-visible,
    .stats-toggle:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .icon-btn {
      width: 38px;
      height: 38px;
      flex-shrink: 0;
    }

    .icon-btn svg {
      width: 18px;
      height: 18px;
      stroke: currentColor;
    }

    .text-btn {
      min-height: 38px;
      padding: 0 14px;
      font-size: 13px;
      white-space: nowrap;
    }

    .mobile-filter-toggle {
      display: none;
    }

    .search-box {
      position: relative;
    }

    .search-box input {
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 10px 14px 10px 40px;
      font-size: 14px;
      color: var(--text);
      width: 300px;
      outline: none;
      font-family: var(--font);
      transition: border-color 0.2s, box-shadow 0.2s;
    }

    .search-box input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(32, 178, 170, 0.15);
    }

    .search-box input::placeholder {
      color: var(--text-faint);
    }

    .search-box svg {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 17px;
      height: 17px;
      stroke: var(--text-faint);
    }

    /* ===== TOOLBAR ===== */
    .toolbar {
      display: flex;
      align-items: center;
      gap: 18px;
      min-height: 46px;
      padding: 12px 24px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      flex-wrap: wrap;
    }

    .toolbar-actions {
      margin-left: auto;
    }

    .toolbar-group {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .toolbar-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-faint);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-right: 4px;
    }

    .filter-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 14px;
      font-size: 13px;
      font-weight: 500;
      border-radius: var(--radius);
      border: 1px solid var(--border);
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.15s;
      font-family: var(--font);
      white-space: nowrap;
    }

    .filter-btn:hover {
      background: var(--surface-3);
      color: var(--text);
      border-color: var(--border-light);
    }

    .filter-btn.active {
      background: var(--accent);
      color: #000;
      border-color: var(--accent);
      font-weight: 600;
    }

    .filter-btn .dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .filter-btn .dot.orange { background: var(--orange); }
    .filter-btn .dot.purple-light { background: var(--purple-light); }
    .filter-btn .dot.purple { background: var(--purple); }
    .filter-btn .dot.green { background: var(--green); }

    .toolbar select {
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      min-height: 32px;
      padding: 7px 30px 7px 12px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text);
      cursor: pointer;
      font-family: var(--font);
      outline: none;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
      transition: border-color 0.15s;
    }

    .toolbar select:hover {
      border-color: var(--border-light);
    }

    .toolbar select:focus {
      border-color: var(--accent);
    }

    /* ===== MAIN ===== */
    .main {
      flex: 1;
      position: relative;
      overflow: hidden;
    }

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

    /* ===== STATS PANEL ===== */
    .stats-panel {
      position: absolute;
      bottom: 24px;
      left: 24px;
      background: rgba(24, 24, 27, 0.92);
      backdrop-filter: blur(16px);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 16px 20px;
      min-width: 260px;
      z-index: 800;
      box-shadow: var(--shadow);
    }

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

    .stats-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 14px;
      font-weight: 600;
    }

    .stats-title svg {
      width: 16px;
      height: 16px;
      fill: var(--accent);
    }

    .stats-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--surface-2);
      color: var(--text-muted);
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
    }

    .stats-toggle:hover {
      background: var(--surface-3);
      color: var(--text);
      border-color: var(--border-light);
    }

    .stats-toggle svg {
      width: 14px;
      height: 14px;
      stroke: currentColor;
      transition: transform 0.15s;
    }

    .stats-panel.collapsed .stats-toggle svg {
      transform: rotate(180deg);
    }

    .stats-panel.collapsed .stats-body {
      display: none;
    }

    .stats-grid {
      display: grid;
      gap: 8px;
    }

    .stat-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 13px;
    }

    .stat-row .label {
      color: var(--text-muted);
    }

    .stat-row .value {
      font-weight: 600;
      font-variant-numeric: tabular-nums;
      color: var(--accent);
    }

    .stat-row.warning .value {
      color: var(--orange);
    }

    .stats-divider {
      border: none;
      border-top: 1px solid var(--border);
      margin: 10px 0;
    }

    .stats-section-title {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-faint);
      margin-bottom: 6px;
    }

    .region-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      margin-bottom: 4px;
    }

    .region-bar .name {
      flex: 1;
      color: var(--text-muted);
    }

    .region-bar .count {
      font-weight: 600;
      font-variant-numeric: tabular-nums;
      min-width: 24px;
      text-align: right;
    }

    .region-bar .bar-bg {
      width: 60px;
      height: 4px;
      background: var(--surface-3);
      border-radius: 2px;
      overflow: hidden;
    }

    .region-bar .bar-fill {
      height: 100%;
      background: var(--accent);
      border-radius: 2px;
      transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* ===== LEGEND ===== */
    .legend {
      position: absolute;
      bottom: 24px;
      right: 24px;
      background: rgba(24, 24, 27, 0.92);
      backdrop-filter: blur(16px);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 14px 18px;
      z-index: 800;
      box-shadow: var(--shadow);
    }

    .legend-title {
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 10px;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 5px;
    }

    .legend-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .legend-section {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px solid var(--border);
    }

    .legend-section .legend-title {
      font-size: 12px;
      margin-bottom: 6px;
    }

    .legend-size {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 11px;
      color: var(--text-faint);
      margin-bottom: 4px;
    }

    .legend-size .circle {
      border-radius: 50%;
      background: rgba(32, 178, 170, 0.3);
      border: 1px solid var(--accent);
      flex-shrink: 0;
    }

    /* ===== LEAFLET OVERRIDES ===== */
    .leaflet-control-zoom {
      border: 1px solid var(--border) !important;
      border-radius: var(--radius) !important;
      overflow: hidden;
      box-shadow: var(--shadow) !important;
    }

    .leaflet-control-zoom a {
      background: var(--surface) !important;
      color: var(--text) !important;
      border-color: var(--border) !important;
      width: 32px !important;
      height: 32px !important;
      line-height: 32px !important;
      font-size: 16px !important;
    }

    .leaflet-control-zoom a:hover {
      background: var(--surface-2) !important;
    }

    .leaflet-popup-content-wrapper {
      background: var(--surface) !important;
      color: var(--text) !important;
      border-radius: var(--radius-lg) !important;
      border: 1px solid var(--border) !important;
      box-shadow: var(--shadow) !important;
      padding: 0 !important;
    }

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

    .leaflet-popup-close-button {
      color: var(--text-muted) !important;
      font-size: 20px !important;
      right: 10px !important;
      top: 8px !important;
    }

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

    .leaflet-popup-content {
      margin: 0 !important;
      line-height: 1.5 !important;
    }

    /* ===== POPUP STYLES ===== */
    .popup-inner {
      padding: 16px;
      min-width: 280px;
      max-width: 340px;
    }

    .popup-company {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 4px;
    }

    .popup-company-name {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--accent);
    }

    .popup-status-badge {
      font-size: 10px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 20px;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .popup-status-badge.construction { background: rgba(245, 158, 11, 0.15); color: var(--orange); }
    .popup-status-badge.announced { background: rgba(192, 132, 252, 0.15); color: var(--purple-light); }
    .popup-status-badge.planned { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
    .popup-status-badge.operational { background: rgba(34, 197, 94, 0.15); color: var(--green); }

    .popup-name {
      font-size: 15px;
      font-weight: 600;
      margin-bottom: 2px;
      line-height: 1.3;
    }

    .popup-location {
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 10px;
    }

    .popup-stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      margin-bottom: 10px;
    }

    .popup-stat {
      background: var(--surface-2);
      border-radius: 6px;
      padding: 8px 10px;
    }

    .popup-stat-label {
      font-size: 10px;
      color: var(--text-faint);
      text-transform: uppercase;
      letter-spacing: 0.03em;
      margin-bottom: 2px;
    }

    .popup-stat-value {
      font-size: 13px;
      font-weight: 600;
    }

    .popup-desc {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.6;
      margin-bottom: 10px;
    }

    .popup-source {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      color: var(--accent);
      text-decoration: none;
      transition: color 0.15s;
    }

    .popup-source:hover {
      color: var(--accent-hover);
      text-decoration: underline;
    }

    .popup-source.is-missing {
      color: var(--orange);
      cursor: default;
    }

    .popup-source.is-missing:hover {
      color: var(--orange);
      text-decoration: none;
    }

    /* ===== TOOLTIP ===== */
    .leaflet-tooltip {
      background: var(--surface) !important;
      border: 1px solid var(--border) !important;
      color: var(--text) !important;
      border-radius: var(--radius) !important;
      padding: 8px 12px !important;
      font-family: var(--font) !important;
      font-size: 12px !important;
      box-shadow: var(--shadow) !important;
      white-space: nowrap !important;
    }

    .leaflet-tooltip::before {
      border-top-color: var(--surface) !important;
    }

    .tooltip-content {
      line-height: 1.5;
    }

    .tooltip-company {
      font-weight: 600;
      color: var(--accent);
    }

    .tooltip-name {
      font-weight: 500;
    }

    .tooltip-meta {
      color: var(--text-muted);
      font-size: 11px;
    }

    /* ===== FOOTER ===== */
    .footer {
      display: flex;
      align-items: center;
      gap: 14px;
      justify-content: flex-end;
      min-height: 36px;
      padding: 9px 24px;
      background: var(--surface);
      border-top: 1px solid var(--border);
      flex-shrink: 0;
    }

    .footer span,
    .footer a {
      color: var(--text-faint);
      text-decoration: none;
      font-size: 12px;
      transition: color 0.15s;
    }

    .footer a:hover {
      color: var(--text-muted);
    }

    /* ===== RESPONSIVE ===== */
    @media (max-width: 768px) {
      .header { min-height: 62px; padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
      .header-left { flex: 1; min-width: 0; }
      .header h1 { font-size: 16px; }
      .header .badge { font-size: 12px; padding: 3px 9px; }
      .header-right { flex: 1 0 100%; width: 100%; }
      .mobile-filter-toggle { display: inline-flex; }
      .search-box { flex: 1; }
      .search-box input { width: 100%; font-size: 13px; }
      .toolbar {
        display: none;
        align-items: flex-start;
        padding: 12px 14px;
        gap: 10px;
        max-height: 42vh;
        overflow: auto;
      }
      .toolbar.is-open { display: flex; }
      .toolbar-group { width: 100%; flex-wrap: wrap; }
      .toolbar-actions { margin-left: 0; }
      .toolbar select { min-width: 180px; }
      .stats-panel { left: 12px; bottom: 12px; min-width: 220px; max-width: calc(100% - 24px); padding: 12px 14px; }
      .legend { right: 12px; bottom: 12px; padding: 10px 14px; }
      .popup-inner { min-width: 240px; max-width: 280px; }
      .filter-btn { padding: 6px 10px; font-size: 12px; }
      .footer { justify-content: center; flex-wrap: wrap; text-align: center; padding: 9px 14px; }
    }

    @media (max-width: 480px) {
      .legend { display: none; }
      .header-icon { width: 34px; height: 34px; }
      .text-btn { padding-inline: 10px; }
    }

    /* ===== ANIMATIONS ===== */
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(8px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .stats-panel, .legend {
      animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Marker pulse */
    @keyframes pulse {
      0% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.5); opacity: 0; }
      100% { transform: scale(1); opacity: 0; }
    }

    .marker-circle {
      transition: transform 0.15s ease, filter 0.15s ease;
    }

    .marker-circle:hover {
      transform: scale(1.15);
      filter: brightness(1.3);
      cursor: pointer;
    }

    /* ===== NO RESULTS STATE ===== */
    .no-results {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      z-index: 600;
      display: none;
    }

    .no-results.visible {
      display: block;
    }

    .no-results svg {
      width: 48px;
      height: 48px;
      stroke: var(--text-faint);
      margin-bottom: 12px;
    }

    .no-results h3 {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .no-results p {
      font-size: 13px;
      color: var(--text-muted);
    }