/* =========================
   RESET BÁSICO
========================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:Arial, sans-serif;
    background:#f5f5f5;
    color:#222;
}

/* =========================
   TOPBAR
========================= */

.topbar{
    background:#436c5a;
    color:white;
    padding:12px 15px;
    position:sticky;
    top:0;
    z-index:1000;
}

.topbar-inner{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.brand{
    display:flex;
    align-items:center;
    gap:10px;
}

.brand img{
    width:60px;
    height:60px;
    object-fit:contain;
}

.brand span{
    font-size:22px;
    font-weight:bold;
}

/* =========================
   MENÚ
========================= */

.menu{
    display:flex;
    gap:20px;
}

.menu a{
    color:white;
    text-decoration:none;
    font-weight:bold;
}

.menu a:hover{
    opacity:0.8;
}

/* BOTÓN MÓVIL */

.menu-toggle{
    display:none;
    background:none;
    border:none;
    color:white;
    font-size:30px;
    cursor:pointer;
}

/* =========================
   CONTENEDOR
========================= */

.container{
    padding:20px;
    max-width:700px;
    margin:auto;
}

/* =========================
   TÍTULOS
========================= */

h1{
    margin-bottom:20px;
    font-size:32px;
}

h2{
    margin-bottom:15px;
    font-size:24px;
}

/* =========================
   CARDS PANEL
========================= */

.cards{
    display:grid;
    gap:15px;
}

.card{
    background:white;
    padding:25px;
    border-radius:15px;
    text-align:center;
    text-decoration:none;
    color:#222;
    font-size:20px;
    font-weight:bold;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
    transition:0.2s;
}

.card:hover{
    transform:translateY(-2px);
}

/* =========================
   FORMULARIOS
========================= */

.form-card{
    background:white;
    padding:20px;
    border-radius:15px;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
}

.form-group{
    margin-bottom:18px;
}

.form-group label{
    display:block;
    margin-bottom:6px;
    font-weight:bold;
}

.form-group input,
.form-group select{
    width:100%;
    padding:14px;
    border:1px solid #ddd;
    border-radius:10px;
    font-size:16px;
    background:white;
}

.form-group input:focus,
.form-group select:focus{
    outline:none;
    border-color:#c62828;
}

/* =========================
   BOTONES
========================= */

.btn{
    width:100%;
    padding:14px;
    border:none;
    border-radius:10px;
    background:#c62828;
    color:white;
    font-size:16px;
    font-weight:bold;
    cursor:pointer;
    transition:0.2s;
}

.btn:hover{
    background:#a91f1f;
}

/* =========================
   TABLAS
========================= */

table{
    width:100%;
    border-collapse:collapse;
    background:white;
    border-radius:15px;
    overflow:hidden;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
}

th{
    background:#c62828;
    color:white;
    padding:14px;
    text-align:left;
}

td{
    padding:14px;
    border-bottom:1px solid #eee;
}

tr:last-child td{
    border-bottom:none;
}

/* =========================
   LOGIN
========================= */

.login-container{
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:100vh;
    padding:20px;
}

.login-box{
    width:100%;
    max-width:400px;
    background:white;
    padding:30px;
    border-radius:20px;
    box-shadow:0 2px 15px rgba(0,0,0,0.1);
    text-align:center;
}

.logo-login{
    width:150px;
    margin-bottom:15px;
}

.login-box h1{
    margin-bottom:10px;
}

.login-box p{
    margin-bottom:20px;
    color:#666;
}

.login-box input{
    width:100%;
    padding:14px;
    margin-bottom:15px;
    border:1px solid #ddd;
    border-radius:10px;
    font-size:16px;
}

.login-box button{
    width:100%;
    padding:14px;
    border:none;
    border-radius:10px;
    background:#c62828;
    color:white;
    font-size:16px;
    font-weight:bold;
    cursor:pointer;
}

.login-box button:hover{
    background:#a91f1f;
}

.error{
    background:#ffdada;
    color:#b00000;
    padding:12px;
    border-radius:10px;
    margin-bottom:15px;
}

.register-link{
    margin-top:15px;
}

.register-link a{
    color:#c62828;
    text-decoration:none;
    font-weight:bold;
}

/* =========================
   KPIs
========================= */

.kpis{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:15px;
    margin-bottom:20px;
}

.kpi{
    background:white;
    padding:20px;
    border-radius:15px;
    text-align:center;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
}

.kpi h3{
    margin-bottom:10px;
    font-size:16px;
    color:#666;
}

.kpi p{
    font-size:24px;
    font-weight:bold;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width:768px){

    /* menú móvil */

    .menu{
        display:none;
        flex-direction:column;
        position:absolute;
        top:65px;
        right:10px;
        background:#c62828;
        padding:15px;
        border-radius:15px;
        width:220px;
        box-shadow:0 2px 10px rgba(0,0,0,0.2);
    }

    .menu.show{
        display:flex;
    }

    .menu-toggle{
        display:block;
    }

    .menu a{
        padding:10px 0;
    }

    /* títulos */

    h1{
        font-size:28px;
    }

    h2{
        font-size:22px;
    }

    /* cards */

    .card{
        font-size:18px;
        padding:20px;
    }

    /* tablas responsive */

    table,
    thead,
    tbody,
    th,
    td,
    tr{
        display:block;
    }

    thead{
        display:none;
    }

    tr{
        background:white;
        margin-bottom:15px;
        border-radius:15px;
        padding:10px;
        box-shadow:0 2px 10px rgba(0,0,0,0.08);
    }

    td{
        display:flex;
        justify-content:space-between;
        padding:10px;
        border:none;
        border-bottom:1px solid #eee;
    }

    td:last-child{
        border-bottom:none;
    }

    td::before{
        content:attr(data-label);
        font-weight:bold;
        margin-right:15px;
    }

    /* KPIs */

    .kpis{
        grid-template-columns:1fr;
    }

}