
/* shared-theme.css - Versión Flexbox Definitiva */

:root {
    --primary: #0d6efd;
    --secondary: #6c757d;
    --dark: #2c3e50;
    --border-color: #dee2e6;
    --bg-light: #f8f9fa;
}

/* Regla de oro para que los paddings no rompan los tamaños */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    padding: 15px;
    background-color: #f4f7f6;
    margin: 0;
}

/* ==========================================
   TABULATOR - COMPACTO Y ALINEADO
   ========================================== */
.tabulator {
    background-color: white !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color) !important;
    margin: 0 !important; /* Eliminamos márgenes para que Flexbox controle el espacio */
}

/* Achicamos los HEADERS (Títulos y Filtros) */
.tabulator-header {
    background-color: var(--bg-light) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.tabulator-col-content {
    padding: 2px 8px !important;
}

.tabulator-col-title {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #495057;
}

.tabulator-header-filter input {
    height: 22px !important;
    font-size: 0.8rem !important;
    padding: 2px 4px !important;
    margin-bottom: 2px !important;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

/* Fijamos las FILAS a 34px */
.tabulator-row {
    min-height: 34px !important;
    height: 34px !important;
}

.tabulator-cell {
    padding: 0 10px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 0.9rem;
    border-right: 1px solid #f1f1f1 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
   SISTEMA DE MODALES (POPUPS)
   ========================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 650px; /* Tamaño máximo por defecto */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* CLAVE: Evita que el header cuadrado rompa los bordes redondos */
}

.modal-header {
    background-color: var(--dark);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h3 {
        margin: 0;
        font-size: 1.25rem;
        color: white !important;
    }

.modal-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

    .modal-close-btn:hover {
        color: #e74c3c;
    }

/* CLAVES RESTAURADAS PARA EL ESPACIADO INTERNO */
.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 75vh;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================
   FORMULARIOS Y BOTONES (UI Básico)
   ========================================== */
.form-group {
    margin-bottom: 15px;
}

    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
        color: var(--dark);
        font-size: 0.9rem;
    }

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.2s;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
    }

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .btn-primary:hover {
        background-color: #0b5ed7;
    }

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .btn-secondary:hover {
        background-color: #5c636a;
    }

.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
}

/* ==========================================
   LAYOUT MAESTRO PARA MÓDULOS (Flexbox)
   ========================================== */
.module-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.module-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.module-content {
    flex-grow: 1;
    min-height: 0;
    width: 100%;
}
