:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --danger-color: #f72525;
    --success-color: #2ba930;
    --warning-color: #f8961e;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #adb5bd;
    --border-radius: 0.8rem;
    --box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}



        body {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        main {
            flex: 1;
          
        }


body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--light-color);
    color: var(--dark-color);
    
}



.container {
    max-width: 100rem;
    margin: 0 auto;
    padding: 1.5rem;
}

a {
    text-decoration: none;
}


h1, h2, h3, h4 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
}

/* Navbar */
/* Navbar Styles */
.navbar {
    background-color: var(--primary-color);
    color: var(--light-color);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    padding: 0 2rem;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    height: 70px;
}

.nav-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--light-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.nav-brand:hover {
    transform: translateY(-2px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--light-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logout-link:hover {
    background-color: rgba(247, 37, 37, 0.2);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    z-index: 1001;
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--light-color);
    border-radius: 10px;
    transition: var(--transition);
}


/* Panel / Card */
.panel, .card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
   /* transform: translateY(-0.3rem);*/
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.card-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 0.1rem solid var(--light-color);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* Tablas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 0.1rem solid #ddd;
}

th {
    background-color: var(--primary-color);
    color: white;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Inputs y Forms */
input, select, .form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 0.1rem solid var(--gray-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus, .form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Botones */
button, .btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 1rem;
    display: inline-block;
}

button:hover, .btn:hover {
    background-color: var(--secondary-color);
  /*  transform: translateY(-0.2rem); */
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    opacity: 0.9;
}

#guardarAportes {
    margin-left: auto;
    display: block;
}


/* Estados */
.deuda, .text-danger {
    color: var(--danger-color);
    font-weight: bold;
}

.al-dia, .text-success {
    color: var(--success-color);
}

.text-primary {
    color: var(--primary-color);
}

/* Resumen / Stats */
.resumen, .stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.resumen-item, .stat-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
}

.resumen-valor, .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

/* Mes Selector */
.mes-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.mes-selector select {
    flex: 1;
    min-width: 10rem;
}

.total-deuda {
    font-size: 1.2rem;
    margin-top: 1rem;
    text-align: right;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* User Card */
.user-card {
    position: relative;
    overflow: hidden;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    text-align: center;
}

.user-avatar {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 auto 1rem;
}

.user-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.user-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.user-stat {
    text-align: center;
}

.user-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.user-stat-label, .stat-label,.ganancias-desglose {
    font-size: 0.8rem;
    color: var(--gray-color);
}

.total-ganancias {
     color: var(--success-color);
    /* Opcional: si quieres hacerlo más llamativo */
   /* font-weight: bold;*/
}


/* Login */
.login-container {
    max-width: 50rem;
    width: 90%;
    margin: 5rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}



        .auto-year-footer {
            background-color: var(--primary-color);
            color: var(--light-color);
            text-align: center;
            padding: 1.5rem;
            font-size: 0.9rem;
        }

        .highlight {
            color: var(--light-color);
            font-weight: bold;
        }


/* Responsive */
@media (max-width: 76.8rem) {


/* Mobile Styles */

    .navbar {
        padding: 0 1rem;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem;
        gap: 1rem;
        transition: var(--transition);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
        z-index: 1000;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem;
        border-radius: var(--border-radius);
    }
    
    /* Hamburger to X animation */
    .menu-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}


@media (max-width: 48rem) {


    .container {
      padding: 0.5rem;
    }

    .panel, .card {

      padding: 0.5rem;

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

    .resumen-item {
        min-width: 100%;
    }

    .mes-selector select {
        min-width: 100%;
    }
}





/* Estilos específicos para el panel de administración */
.admin-panel {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.admin-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
}

.admin-card:hover {
    transform: translateY(-0.3rem);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.admin-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.admin-card p {
    color: var(--gray-color);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Media Queries para responsividad */
@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .admin-card {
        padding: 1.5rem;
    }
    
    .card-icon {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .admin-card h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .panel-header {
        padding: 1rem;
    }
    
    .admin-card {
        padding: 1.2rem;
    }
    
    .card-icon {
        font-size: 1.8rem;
    }
    
    .admin-card h3 {
        font-size: 1.2rem;
    }
}