:root {
    --primary: #ff6b00;
    --primary-glow: rgba(255, 107, 0, 0.4);
    --accent: #39ff14;
    --accent-secondary: #00f3ff;
    --bg-dark: #0a0a0a;
    --bg-card: rgba(20, 20, 20, 0.8);
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --glass-border: rgba(255, 255, 255, 0.1);
    --error: #ff0055;
    /* Accesibilidad */
    --touch-target: 56px;
    --neon-shadow: 0 0 15px rgba(255, 107, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 107, 0, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(57, 255, 20, 0.05) 0%, transparent 40%);
    min-height: 100vh;
    font-size: 16px;
    /* Base amigable para mayores */
}

body.modal-open {
    overflow: hidden !important;
}

/* Contenedores */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
    padding-top: 5vh;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.glass-card-wide {
    max-width: 1200px;
}

/* Tipografía */
h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 107, 0, 0.2);
}

p.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Formularios */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input,
select {
    width: 100%;
    height: var(--touch-target);
    padding: 0 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.3);
}

option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}


/* Botones Grandes */
button {
    width: 100%;
    height: var(--touch-target);
    background: linear-gradient(135deg, var(--primary), #ff4d00);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: var(--neon-shadow);
}

button:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

button:active {
    transform: scale(0.98);
}

button.secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    margin-top: 0.5rem;
    box-shadow: none;
}

/* Dashboard */
nav {
    display: flex;
    justify-content: flex-end;
    /* Alinear a la derecha botones técnicos */
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(5, 7, 10, 0.95);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem !important;
    height: 36px !important;
    padding: 0 0.75rem !important;
    white-space: nowrap;
}

.dashboard {
    padding: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    background: var(--glass);
    padding: 1.5rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 107, 0, 0.3);
}

/* Botones y Acciones */
.btn-whatsapp {
    background: #25d366 !important;
    box-shadow: 0 0 10px rgba(37, 211, 102, 0.3) !important;
    padding: 0.5rem !important;
    border-radius: 8px !important;
}

.btn-edit {
    background: var(--accent-secondary) !important;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3) !important;
    padding: 0.5rem !important;
    border-radius: 8px !important;
}

.btn-delete {
    background: var(--error) !important;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.3) !important;
    padding: 0.5rem !important;
    border-radius: 8px !important;
}

.btn-view {
    background: var(--accent) !important;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3) !important;
    padding: 0.5rem !important;
    border-radius: 8px !important;
}

.btn-small {
    width: auto !important;
    height: 40px !important;
    font-size: 0.9rem !important;
    padding: 0 1rem !important;
    margin-top: 0 !important;
}

/* Panel de Cumpleaños */
.birthday-panel {
    background: rgba(57, 255, 20, 0.03);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0 16px 16px 0;
}

.birthday-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.birthday-item:last-child {
    border-bottom: none;
}

/* Tablas Premium */
.table-responsive {
    overflow-x: auto;
    border-radius: 24px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    margin-top: 1rem;
}

#table-search {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

#table-search:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.2) !important;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    text-align: left;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 1rem;
}

tr:hover td {
    background: rgba(255, 107, 0, 0.03);
}

.row-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tarjetas de líderes */
.leaders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.leader-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.4) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.leader-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(255, 107, 0, 0.15);
}

.leader-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.leader-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.leader-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 107, 0, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.2);
}

.leader-info h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.2;
    text-shadow: none;
}

.leader-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.leader-stats {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.leader-count {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

.leader-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Modal Estilizado */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

#edit-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    width: 95%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

/* Grid para Móvil */
.grid-cols-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

/* Mapa */
#map {
    height: 400px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

/* Utilidades */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.icon-small {
    width: 24px;
    height: 24px;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}