:root {
    /* --- PALETA NOCTURNA / NEÓN --- */
    --bg-color: #111827;
    /* Negro azulado profundo (Fondo) */
    --text-color: #f3f4f6;
    /* Blanco humo (Texto principal) */
    --text-muted: #9ca3af;
    /* Gris claro (Texto secundario) */

    --primary-color: #fbbf24;
    /* Ámbar Neón (Botones/Acentos) */
    --primary-hover: #f59e0b;
    /* Naranja intenso (Hover) */

    --card-bg: #1f2937;
    /* Gris Oscuro (Tarjetas/Sidebar) */
    --border-color: #374151;
    /* Gris medio (Bordes) */
    --input-bg: #111827;
    /* Fondo para inputs */

    --accent-color: #8b5cf6;
    /* Violeta Neón */
    --success-color: #10b981;
    /* Verde Esmeralda Neón */
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    /* Patrón de puntos sutil en modo oscuro */
    background-image: radial-gradient(#374151 1px, transparent 1px);
    background-size: 20px 20px;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    margin-top: 0;
    /* Sutil resplandor neón en los títulos */
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Dashboard Layout */
.dashboard-body {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h2 {
    font-size: 2.2rem;
    transform: rotate(-3deg);
    /* Efecto Neón fuerte para el logo */
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
}

.sidebar nav li {
    margin-bottom: 1rem;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.2s;
    background: transparent;
    border: 1px solid transparent;
}

.sidebar nav li.active a,
.sidebar nav a:hover {
    background: rgba(251, 191, 36, 0.1);
    /* Fondo amarillo transparente */
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.1);
    transform: translateX(5px);
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Auth Forms Visibility */
.auth-form {
    display: none;
    animation: fadeIn 0.5s;
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- HEADER & STATS --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 1.2rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
    gap: 20px;
}

.header-greeting h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-color);
}

.header-greeting p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

.hero-stats {
    display: flex;
    gap: 15px;
    margin-top: 0;
}

.hero-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-color);
    /* Fondo más oscuro para stats */
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.hero-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
}

.hero-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-color);
}

.hero-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.btn-primary {
    background: var(--primary-color);
    color: #000;
    /* Texto negro para contraste con amarillo neón */
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    /* Sombra brillante */
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.2);
}

/* View Toggle */
.view-toggle {
    margin-bottom: 1rem;
}

.toggle-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    margin-right: 0.5rem;
}

.toggle-btn:hover {
    background: rgba(251, 191, 36, 0.1);
}

.toggle-btn.active {
    background: var(--primary-color);
    color: #111827;
    /* Texto oscuro */
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.stat-label {
    color: var(--text-muted);
    font-weight: 600;
}

/* Bar Cards */
.bars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.bar-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.bar-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.1);
}

.bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bar-header h3 {
    color: var(--text-color);
    /* Blanco en lugar de negro */
    margin: 0;
}

.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* Ajuste de badges para modo oscuro */
.badge.visitado {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid #059669;
}

.badge.pendiente {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid #d97706;
}

.bar-comment {
    color: var(--text-muted);
    font-style: italic;
}

.bar-actions button {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
}

.bar-actions button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(251, 191, 36, 0.1);
}

.bar-actions .delete:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Map Fix */
#map {
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    filter: brightness(0.9);
    /* Oscurece un pelín el mapa si es la versión clara */
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    /* Fondo más oscuro */
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    z-index: 999;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    position: relative;
    border: 2px solid var(--primary-color);
    color: var(--text-color);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    /* Etiquetas en amarillo */
}

/* Inputs adaptados a modo oscuro */
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

/* Login Page (Conservando tu estilo elegante pero adaptado) */
.login-page {
    background: url('https://images.unsplash.com/photo-1514933651103-005eec06c04b?q=80&w=1974&auto=format&fit=crop') no-repeat center center/cover;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.85);
    /* Capa oscura más fuerte */
    z-index: -1;
}

.login-container {
    background: rgba(31, 41, 55, 0.9);
    /* Coincide con card-bg */
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--primary-color);
    backdrop-filter: blur(10px);
    color: white;
}

.login-header h1 {
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.login-header p {
    color: var(--text-muted);
    font-style: italic;
}

/* Tabs for Login */
.tab-btn {
    padding: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: none;
    cursor: pointer;
}

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

/* Login Inputs */
.login-container .input-group label {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.login-container input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #4b5563;
    color: white;
}

.login-container input:focus {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.5);
}

.login-container .btn-primary {
    /* Mantener estilo del dashboard */
    background: var(--primary-color);
    color: black;
    margin-top: 2rem;
    width: 100%;
}

/* FAB Button */
.fab-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-body {
        display: block;
        padding-bottom: 80px;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: flex;
        justify-content: center;
        background: var(--card-bg);
    }

    .sidebar .logo {
        display: none;
    }

    .sidebar nav {
        width: 100%;
    }

    .sidebar nav ul {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        margin: 0;
        padding: 5px 0;
        width: 100%;
    }

    .sidebar nav li {
        margin-bottom: 0;
        text-align: center;
    }

    .sidebar nav a {
        flex-direction: column;
        padding: 5px;
        font-size: 0.65rem;
        gap: 2px;
        background: transparent;
        justify-content: center;
        height: 100%;
        color: var(--text-muted);
        border: none;
    }

    .sidebar nav a i {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .sidebar nav li.active a,
    .sidebar nav a:hover {
        transform: none;
        background: transparent;
        color: var(--primary-color);
        box-shadow: none;
    }

    .sidebar nav li.active a i {
        background: rgba(251, 191, 36, 0.2);
        color: var(--primary-color);
        padding: 6px;
        border-radius: 50%;
    }

    /* Top Bar Mobile */
    .top-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem;
        gap: 1rem;
    }

    .top-bar h1 {
        font-size: 1.5rem;
    }

    .hero-stats {
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 8px;
    }

    .hero-stat-item {
        flex: 1;
        min-width: 0;
        padding: 8px 4px;
        flex-direction: column;
        text-align: center;
        gap: 2px;
    }

    /* FAB Mobile */
    .fab-btn {
        bottom: 90px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .main-content {
        padding: 1rem;
    }

    .btn-primary {
        width: 100%;
    }

    .view-toggle {
        display: flex;
        overflow-x: auto;
        padding-bottom: 5px;
        gap: 10px;
    }

    .toggle-btn {
        flex: 0 0 auto;
    }

    #map {
        height: 50vh !important;
    }

    .stats-container {
        grid-template-columns: 1fr 1fr;
    }

    .search-map-container {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin-bottom: 80px;
        padding: 1.5rem;
    }

    .sidebar nav ul li:last-child {
        display: none;
    }
}

/* =========================================
   FIX V3: PARCHES INICIO (MODO OSCURO + ESTRELLAS)
   ========================================= */

/* 1. Arreglar las Tablas (Top 10) - Cabecera Gris */
table {
    width: 100%;
    background-color: var(--card-bg) !important;
    color: var(--text-color);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 1rem;
}

/* LA SOLUCIÓN DEFINITIVA: Atacamos a todos los niveles */
table thead,
table thead tr,
table thead th {
    background-color: #374151 !important;
    /* Gris Pizarra (No es blanco, ni negro) */
    color: var(--primary-color) !important;
    /* Texto amarillo */
    border: none;
}

table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background-color: rgba(251, 191, 36, 0.05);
}

/* 2. Estilos base para tarjetas en Inicio */
.card,
.recommendation-card,
.white-box {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Títulos */
.card h3,
.recommendation-card h3,
.card h4,
.recommendation-card h4 {
    color: var(--text-color) !important;
}

/* --- CORRECCIONES DE COLOR --- */

/* A) Párrafos generales (comentarios): Blanco legible */
.card p,
.recommendation-card p,
.bar-comment {
    color: var(--text-color) !important;
    font-weight: 500;
    opacity: 0.9;
}

/* B) ¡NUEVO! Estrellas: Devolverles el color amarillo neón */
/* Busca iconos de estrellas dentro de las tarjetas */
.card .fa-star,
.recommendation-card .fa-star {
    color: var(--primary-color) !important;
}

/* C) Texto pequeño ("Recomendado por..."): Gris sutil */
.card small,
.recommendation-card small,
.text-muted {
    color: var(--text-muted) !important;
    opacity: 1;
}

/* 3. Arreglar inputs de búsqueda */
input[type="text"],
input[type="search"] {
    background-color: var(--input-bg) !important;
    color: white !important;
    border: 1px solid var(--border-color) !important;
}