html,
    body,
    #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }
    
    .esri-attribution__sources, .esri-attribution__powered-by {
      display: none;
    }

    /* Panel de filtros */
    .filter-panel {
      position: absolute;
      top: 90px;
      left: 15px;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-radius: 12px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      padding: 20px;
      width: 320px;
      z-index: 1000;
      max-height: 80vh;
      overflow-y: hidden;
      transition: all 0.3s ease;
    }

    .filter-panel.collapsed {
      width: 60px;
      height: 60px;
      padding: 15px;
      overflow: hidden;
    }

    .filter-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      border-bottom: 2px solid #e1e5e9;
      padding-bottom: 15px;
    }

    .filter-title {
      font-size: 18px;
      font-weight: 600;
      color: #2c3e50;
      margin: 0;
    }

    .toggle-btn {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border: none;
      border-radius: 8px;
      color: white;
      cursor: pointer;
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      transition: all 0.3s ease;
    }

    .toggle-btn:hover {
      transform: scale(1.1);
    }

    .filter-group {
      margin-bottom: 25px;
    }

    .filter-label {
      display: block;
      font-weight: 600;
      color: #34495e;
      margin-bottom: 8px;
      font-size: 14px;
    }

    .filter-input {
      width: 100%;
      padding: 12px;
      border: 2px solid #e1e5e9;
      border-radius: 8px;
      font-size: 14px;
      background: white;
      transition: all 0.3s ease;
      box-sizing: border-box;
    }

    .filter-input:focus {
      outline: none;
      border-color: #667eea;
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .range-group {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .range-input {
      flex: 1;
    }

    .range-separator {
      color: #7f8c8d;
      font-weight: 600;
    }

    select.filter-input {
      cursor: pointer;
      background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
      background-position: right 12px center;
      background-repeat: no-repeat;
      background-size: 16px;
      padding-right: 40px;
      appearance: none;
    }

    .filter-actions {
      display: flex;
      gap: 10px;
      margin-top: 20px;
    }

    .btn {
      flex: 1;
      padding: 12px;
      border: none;
      border-radius: 8px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 14px;
    }

    .btn-primary {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

    .btn-secondary {
      background: #ecf0f1;
      color: #2c3e50;
      border: 2px solid #bdc3c7;
    }

    .btn-secondary:hover {
      background: #d5dbdb;
      transform: translateY(-1px);
    }

    .btn-export {
      width: 100%;
      background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.3s ease;
    }

    .btn-export:hover:not(:disabled) {
      background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    }

    .btn-export:disabled {
      background: #bdc3c7;
      color: #7f8c8d;
      cursor: not-allowed;
      transform: none;
    }

    .export-icon {
      font-size: 16px;
    }

    .export-info {
      text-align: center;
      font-size: 12px;
      color: #7f8c8d;
      margin-top: 8px;
      padding: 8px;
      background: rgba(189, 195, 199, 0.1);
      border-radius: 6px;
      transition: all 0.3s ease;
    }

    .export-info.success {
      color: #27ae60;
      background: rgba(46, 204, 113, 0.1);
    }

    .export-info.processing {
      color: #667eea;
      background: rgba(102, 126, 234, 0.1);
    }

    .results-counter {
      background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
      color: #2c3e50;
      padding: 10px 15px;
      border-radius: 8px;
      text-align: center;
      font-weight: 600;
      margin-bottom: 15px;
      font-size: 14px;
    }

    .loading {
      display: none;
      text-align: center;
      padding: 20px;
      color: #7f8c8d;
    }

    .spinner {
      border: 3px solid #f3f3f3;
      border-top: 3px solid #667eea;
      border-radius: 50%;
      width: 30px;
      height: 30px;
      animation: spin 1s linear infinite;
      margin: 0 auto 10px;
    }

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

    /* Control de basemap */
    .basemap-toggle {
      position: absolute;
      bottom: 20px;
      right: 20px;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-radius: 12px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      padding: 12px;
      z-index: 1000;
      display: flex;
      gap: 8px;
      transition: all 0.3s ease;
    }

    .basemap-btn {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border: none;
      border-radius: 8px;
      color: white;
      cursor: pointer;
      padding: 10px 15px;
      font-size: 12px;
      font-weight: 600;
      transition: all 0.3s ease;
      min-width: 80px;
    }

    .basemap-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

    .basemap-btn.active {
      background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
      transform: scale(0.95);
    }

    .basemap-btn.inactive {
      background: #ecf0f1;
      color: #2c3e50;
      border: 2px solid #bdc3c7;
    }

    .basemap-btn.inactive:hover {
      background: #d5dbdb;
    }

    /* Responsivo */
    @media (max-width: 768px) {
      .filter-panel {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: 60vh;
      }
      
      .filter-panel.collapsed {
        width: 50px;
        height: 50px;
        right: 10px;
        left: auto;
      }

      .basemap-toggle {
        bottom: 10px;
        right: 10px;
        padding: 8px;
        gap: 6px;
      }

      .basemap-btn {
        padding: 8px 12px;
        font-size: 11px;
        min-width: 70px;
      }
    }

    /* Efectos visuales adicionales */
    .filter-panel::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
      border-radius: 12px;
      pointer-events: none;
    }

     /* Control de capas */
    .layer-toggle {
      position: absolute;
      top: 15px;
      left: 60px;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-radius: 8px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.2);
      padding: 4px;
      z-index: 1000;
      min-width: 130px;
      transition: all 0.3s ease;
    }

    .layer-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 4px;
      padding: 4px 4px;
      border-radius: 6px;
      transition: all 0.3s ease;
      background: rgba(255, 255, 255, 0.3);
    }

    .layer-item:hover {
      background: rgba(102, 126, 234, 0.08);
    }

    .layer-label {
      font-size: 11px;
      font-weight: 500;
      color: #2c3e50;
      flex: 1;
    }

    .layer-switch {
      position: relative;
      width: 36px;
      height: 18px;
      background: #bdc3c7;
      border-radius: 9px;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .layer-switch.active {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .layer-switch::before {
      content: '';
      position: absolute;
      top: 2px;
      left: 2px;
      width: 14px;
      height: 14px;
      background: white;
      border-radius: 50%;
      transition: all 0.3s ease;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .layer-switch.active::before {
      transform: translateX(18px);
    }

    .layer-icon {
      width: 8px;
      height: 8px;
      margin-right: 6px;
      border-radius: 2px;
      display: inline-block;
    }

    .parcels-icon {
      background: #f5a856;
      border: 1px solid #FE9E18A6;
    }

    .basemap-icon {
      background: #f0f0f0;
      border: 1px solid #A6A6A652;
    }

    /* Responsivo */
    @media (max-width: 768px) {
      .layer-toggle {
        top: 80px;
        left: 10px;
        padding: 10px;
        min-width: 140px;
      }

      .layer-item {
        padding: 6px;
        margin-bottom: 8px;
      }

      .layer-label {
        font-size: 12px;
      }

      .layer-switch {
        width: 45px;
        height: 22px;
      }

      .layer-switch::before {
        width: 18px;
        height: 18px;
      }

      .layer-switch.active::before {
        transform: translateX(23px);
      }
    }

    #author {
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      background-color: rgba(255, 255, 255, 0.8);
      backdrop-filter: blur(4px);
      padding: 6px 10px;
      border-radius: 8px;
      font-size: 0.85rem;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      color: #333;
      box-shadow: 0 2px 6px rgba(0,0,0,0.15);
      z-index: 10;
    }

    #author a {
      text-decoration: none;
      color: #007acc;
      transition: color 0.3s ease;
    }

    #author a:hover {
      color: #005b99;
    }

    #author span {
      margin-right: 5px;
      color: #555;
    }