:root {
    --primary-purple: #5d50c6;
    --light-purple: #7a6dec;
    --bg-light: #f8f9fa;
    --sidebar-width: 280px;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Helvetica', 'Arial', sans-serif;
    background-color: var(--bg-light);
}

/* --- 1. LAYOUT ESTRUCTURAL --- */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--primary-purple);
    color: white;
    z-index: 1000; /* Por debajo de los modales */
    position: relative;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex-grow: 1;
    z-index: 1; /* Capa base */
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Evita desbordes de tablas */
}

/* --- 2. HEADER Y TÍTULO CENTRADO --- */
.main-header {
    background: white;
    height: 75px;
    padding: 0 30px;
    border-bottom: 2px solid #eee;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.header-title-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: auto;
    pointer-events: none; /* CLAVE: Los clics atraviesan el espacio vacío */
    z-index: 5;
}

.workshop-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin: 0;
    pointer-events: auto; /* El nombre sí se puede clicar si tiene link */
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    z-index: 10;
}

/* --- 3. COMPONENTES (DASHBOARD) --- */
.dashboard-card {
    border: 1px solid #e0e0e0 !important;
    border-bottom: 5px solid var(--primary-purple) !important; /* Piso violeta */
    background: white !important;
    border-radius: 12px !important;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none !important;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.dashboard-card i {
    color: var(--primary-purple) !important;
}


/* Asegura que el contenido dentro de p-4 sea interactuable */
.p-4 {
    position: relative;
    z-index: 2;
}

/* --- 5. LOGO SIDEBAR --- */
.sidebar-logo {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.logo-container {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-container img {
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
}

/* --- 6. FIX IMPRESIÓN --- */
@media print {
    .sidebar, .main-header, .btn, .no-print, .modal-backdrop {
        display: none !important;
    }

    .content-wrapper, .p-4 {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        position: static !important;
    }
    
    body {
        background: white;
    }
}
/* 5. Eliminamos cualquier interferencia del content-wrapper */
.content-wrapper {
    z-index: 1;
}
/* --- FIX DEFINITIVO PARA CLICS EN MODALES --- */

/* 1. Forzamos que el modal esté siempre al frente de todo */
.modal {
    z-index: 10001 !important;
    pointer-events: none; /* El contenedor del modal no bloquea */
}

/* 2. El diálogo interno sí debe recibir clics */
.modal-dialog {
    z-index: 10002 !important;
    pointer-events: auto; /* El formulario vuelve a ser interactivo */
}

/* 3. El fondo oscuro debe estar detrás y no ser una pared */
.modal-backdrop {
    z-index: 10000 !important;
    pointer-events: none !important; /* Los clics atraviesan el fondo oscuro */
}

/* 4. Aseguramos que el Body no bloquee el scroll */
body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

/* --- 4. MODALES (ELIMINA BLOQUEO DE CLICS) --- */
.modal {
    z-index: 1050 !important;
}

.modal-backdrop {
   z-index: 1040 !important;
}

/*imprimir =============
/* Contenedor tipo papel para la vista web */
.hoja-papel-preview {
    background-color: white;
    width: 210mm; /* Ancho A4 */
    min-height: 297mm; /* Alto A4 */
    margin: 20px auto; /* Centra la hoja */
    padding: 15mm;
    box-shadow: 0 0 15px rgba(0,0,0,0.1); /* Sombra suave */
    border: 1px solid #ddd;
    overflow: hidden;
}

/* Ajuste para que la tabla no se rompa */
.hoja-papel-preview table {
    width: 100% !important;
}

/* Al imprimir, quitamos sombras y márgenes de pantalla */
@media print {
    .hoja-papel-preview {
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
    }
    .no-print { display: none !important; }
}