:root {
    --primary-color: #0f172a;
    --secondary-color: #3b82f6;
    --bg-color: #f1f5f9;
    --text-color: #334155;
    --white: #ffffff;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.layout-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 1px;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li a {
    display: block;
    padding: 15px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: 0.3s;
}

.sidebar nav ul li a:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--white);
}

.sidebar nav ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    background-color: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

#app-content {
    padding: 30px;
}

/* Utilidades UI */
.modulo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.badge.activo {
    background-color: #dcfce7;
    color: #166534;
}

/* ==========================================
   Estilos para Pestañas (Tabs)
========================================== */
.tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--secondary-color);
}

.tab-btn.active {
    color: var(--secondary-color);
    border-bottom: 3px solid var(--secondary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   Estilos de Modales y Formularios
========================================== */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6); /* Fondo oscuro semitransparente */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-in-out;
}

.modal.show {
    display: flex; /* Se muestra cuando tiene la clase 'show' */
}

.modal-content {
    background-color: var(--white);
    padding: 30px;
    border-radius: 10px;
    width: 450px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: 0.3s;
}

.close-btn:hover {
    color: #ef4444; /* Rojo al pasar el mouse */
}

/* Formularios */
.form-group {
    margin-bottom: 15px;
    margin-top: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    font-size: 15px;
}

.form-group input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--text-color);
}
.btn-secondary:hover { background-color: #cbd5e1; }