/* =========================
   RESET + BASE
========================= */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html, body{
    height:100%;
    font-family:'Segoe UI',sans-serif;
    background:#f8fafc;
    color:#1e293b;
    overflow:hidden;
}

/* =========================
   LAYOUT CORRECTO
========================= */
.layout{
    display:flex;
    height:100vh;
}

/* SIDEBAR */
.sidebar{
    width:250px;
    min-width:250px;
    background:#0f172a;
    padding:24px 14px;
    display:flex;
    flex-direction:column;
}

/* MAIN — AQUI ESTABA EL PROBLEMA */
.main{
    flex:1;
    padding:40px;
    overflow-y:auto;
    overflow-x:hidden;
}

/* =========================
   LOGO
========================= */
.logo{
    color:#fff;
    text-decoration:none;
    font-size:24px;
    font-weight:800;
    margin-bottom:30px;
    padding:10px 16px;
}

.logo span{
    color:#3b82f6;
}

/* =========================
   SIDEBAR LINKS
========================= */
.sidebar a{
    display:flex;
    align-items:center;
    gap:10px;
    color:#cbd5e1;
    text-decoration:none;
    padding:12px 16px;
    border-radius:10px;
    margin-bottom:6px;
    transition:.2s;
}

.sidebar a:hover{
    background:#1e293b;
    color:#fff;
}

.sidebar a.active{
    background:#2563eb;
    color:#fff;
    font-weight:600;
}

.sidebar hr{
    border:none;
    height:1px;
    background:#334155;
    margin:18px 0;
}

/* =========================
   TITULOS
========================= */
.page-title{
    font-size:34px;
    font-weight:800;
    margin-bottom:28px;
}

/* =========================
   BOTONES
========================= */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:11px 18px;
    border:none;
    border-radius:10px;
    cursor:pointer;
    text-decoration:none;
    font-weight:600;
    transition:.2s;
}

.btn:hover{
    transform:translateY(-1px);
}

.btn-primary{ background:#2563eb; color:#fff; }
.btn-danger{ background:#ef4444; color:#fff; }
.btn-success{ background:#16a34a; color:#fff; }
.btn-warning{ background:#f59e0b; color:#fff; }

/* =========================
   TABLAS
========================= */
.table-card{
    background:#fff;
    border-radius:16px;
    overflow:hidden;
    box-shadow:0 10px 25px rgba(0,0,0,.05);
}

table{
    width:100%;
    border-collapse:collapse;
}

thead{
    background:#0f172a;
    color:#fff;
}

th,td{
    padding:18px;
    text-align:left;
}

tbody tr{
    border-bottom:1px solid #e5e7eb;
}

tbody tr:hover{
    background:#f8fafc;
}

/* =========================
   FORMULARIOS
========================= */
.form-box{
    background:#fff;
    padding:40px;
    border-radius:16px;
    box-shadow:0 10px 25px rgba(0,0,0,.05);
}

.form-group{
    margin-bottom:18px;
}

.form-group label{
    display:block;
    margin-bottom:7px;
    font-weight:600;
}

.form-group input,
.form-group select,
.form-group textarea{
    width:100%;
    padding:13px;
    border:1px solid #cbd5e1;
    border-radius:10px;
    background:#f8fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus{
    outline:none;
    border-color:#2563eb;
    background:#fff;
}

/* =========================
   BOTONES GLOBALES
========================= */

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 16px;
}

.btn-primary,
.btn-success {
    background: #2563eb;
    color: white;
}

.btn-primary:hover,
.btn-success:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.btn-update{
    background:#2563eb;
    color:#fff;
    padding:8px 14px;
    border-radius:8px;
    text-decoration:none;
    font-size:14px;
}

.btn-update:hover{
    background:#1d4ed8;
}