/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* ===== LAYOUT GENERAL ===== */
body {
    background: #F3F4F6;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 140px;
    background: #ffffff;
    padding-top: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    transition: width 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Menú arriba, logo abajo */
    height: 100vh;
    position: relative;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 14px 20px;
    font-size: 15px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

.sidebar li:hover {
    background: #F3F4F6;
}

.sidebar li.active {
    border-left: 4px solid #C62828;
    background: #F3F4F6;
    color: #C62828;
}

/* ===== SIDEBAR COLAPSADO ===== */
.sidebar.collapsed {
    width: 50px;
}

.sidebar.collapsed ul li {
    font-size: 0;
    padding-left: 10px;
}

.sidebar.collapsed ul li::before {
    content: "•";
    font-size: 18px;
    color: #C62828;
}

/* ===== LOGO ABAJO DEL SIDEBAR ===== */
.sidebar-logo {
    padding: 20px 0;
    text-align: center;
}

.sidebar-logo img {
    width: 120px;
    opacity: 0.85;
    transition: 0.3s;
}

.sidebar.collapsed .sidebar-logo img {
    width: 35px;
}

/* ===== BOTÓN PARA COLAPSAR SIDEBAR ===== */
.toggle-btn {
    position: absolute;
    left: 110px;
    top: 20px;
    background: #C62828;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
    z-index: 10;
}

.toggle-btn.collapsed {
    left: 50px;
}

/* ===== HEADER ===== */
.header {
    height: 70px;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header .logo {
    height: 45px;
}

.header .user {
    font-size: 15px;
    color: #374151;
}

.header .logout {
    padding: 8px 14px;
    background: #C62828;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

.header .logout:hover {
    background: #A91F1F;
}

/* ===== LINEA ROJA ===== */
.red-line {
    width: 100%;
    height: 3px;
    background: #C62828;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.iframe-container {
    flex: 1;
    background: white;
    margin: 0;
    overflow: auto;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block; /* evita espacios fantasmas */
}

/* ===== FOOTER TIPO MAR ===== */
.footer {
    text-align: center;
    background: white;
    position: fixed;
    bottom: 0;
    left: 110;
    width: calc(100% - 110px); /* si tu sidebar mide 180px */
    z-index: 10;
}

.footer .red-line {
    height: 3px;
    background: #C62828;
}

.footer .wave {
    width: 100%;
    height: 40px;
    background: white;
    border-bottom-left-radius: 50% 20px;
    border-bottom-right-radius: 50% 20px;
}

.footer p {
    padding: 10px 0;
    font-size: 13px;
    color: #6B7280;
}

/* ===== MÓDULOS INTERNOS ===== */
.module-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 90px);
    overflow: hidden;
    padding: 0;
}

.module-container h1 {
    color: #C62828;
    margin-bottom: 10px;
}

.module-container p {
    color: #374151;
    font-size: 15px;
}

/* ===== IFRAMES INTERNOS DE MÓDULOS ===== */
.mod-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.acciones {
    display: flex;
    gap: 8px;
}

.btn-accion {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: white;
}

.btn-accion.editar {
    background: #1976D2; /* Azul */
}

.btn-accion.editar:hover {
    background: #0F4FA8;
}

.btn-accion.borrar {
    background: #C62828; /* Rojo */
}

.btn-accion.borrar:hover {
    background: #A91F1F;
}