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

html, body {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background: #f4f6f8;
}

/* ===== TOPBAR ===== */
.topbar {
    background: #2c3e50;
    color: #fff;
    padding: 7px 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-contenido {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: none;
    padding: 0;
}
.logo {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 15px;
}
.usuario-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.usuario-nombre { display: none; }
.btn-salir {
    color: #fff;
    text-decoration: none;
    background: #e74c3c;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 12px;
}

/* ===== MENÚ LATERAL ===== */
.menu-lateral {
    position: fixed;
    top: 0;
    left: -260px;
    width: 240px;
    height: 100vh;
    background: #34495e;
    padding-top: 45px;
    transition: left 0.3s;
    z-index: 99;
    overflow-y: auto;
    font-size: 13px;
}
.menu-lateral.activo { left: 0; }
.menu-lateral ul { list-style: none; }
.menu-lateral ul li { padding: 0; margin: 0; }

.menu-lateral ul li a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 7px 15px;
    border-bottom: 1px solid #2c3e50;
    font-size: 13px;
    line-height: 1.3;
}
.menu-lateral ul li a:hover { background: #2c3e50; }

/* Separadores de sección */
.menu-lateral ul li.menu-separador {
    display: block;
    font-size: 10px !important;
    color: #95a5a6 !important;
    padding: 8px 15px 4px 15px !important;
    margin: 4px 0 0 0 !important;
    border-top: 1px solid #2c3e50;
    border-bottom: none !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: bold;
    line-height: 1.2;
    background: transparent !important;
}

/* ===== CONTENIDO ===== */
.contenido {
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== BOTONES ===== */
.btn {
    display: inline-block;
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    background: #3498db;
    color: #fff;
}
.btn:hover { background: #2980b9; }
.btn-exito { background: #27ae60; }
.btn-exito:hover { background: #229954; }
.btn-peligro { background: #e74c3c; }
.btn-peligro:hover { background: #c0392b; }
.btn-gris { background: #95a5a6; }
.btn-gris:hover { background: #7f8c8d; }

/* ===== FORMULARIOS ===== */
.form-grupo {
    margin-bottom: 12px;
}
.form-grupo label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #555;
}
.form-grupo input,
.form-grupo select,
.form-grupo textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
}
.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* ===== TARJETAS ===== */
.card {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card h3 {
    margin-bottom: 10px;
    font-size: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* ===== TABLAS ===== */
.tabla-responsiva {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table th, table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}
table tr:hover { background: #f8f9fa; }

/* ===== LOGIN ===== */
.login-container {
    max-width: 360px;
    margin: 60px auto;
    padding: 20px;
}
.login-container h1 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 22px;
}
.alerta {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
}
.alerta-error { background: #f8d7da; color: #721c24; }
.alerta-exito { background: #d4edda; color: #155724; }

/* ===== RESPONSIVE ===== */

/* Celular */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .logo { font-size: 14px; }
}

/* Desktop */
@media (min-width: 769px) {
    .menu-lateral {
        left: 0;
        width: 220px;
        padding-top: 45px;
    }
    .contenido {
        margin-left: 220px;
        padding: 20px;
    }
    .menu-toggle { display: none; }
    .usuario-nombre { display: inline; }
}

/* ===== IMPRESIÓN DEL MANUAL ===== */
@media print {
    .topbar, .menu-lateral, .pie, button {
        display: none !important;
    }
    .contenido {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    body {
        background: #fff;
    }
    h3 {
        color: #2c3e50 !important;
    }
    a {
        color: #333 !important;
        text-decoration: none !important;
    }
}