/* css/estilos.css */

:root {
    /* TUS COLORES EXACTOS */
    --color-primario: #8D0000;   /* Rojo RGB(141, 0, 0) */
    --color-secundario: #717170; /* Gris RGB(113, 113, 112) */
    --color-fondo: #f4f4f4;
    --color-blanco: #ffffff;
    --ancho-sidebar: 250px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: var(--color-fondo);
    display: flex; /* Esto es vital para que el menú quede al lado del contenido */
    min-height: 100vh;
}

/* --- ESTILOS DEL LOGIN --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--color-fondo);
}

.login-container {
    background-color: var(--color-blanco);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border-top: 5px solid var(--color-primario);
}

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; color: var(--color-secundario); margin-bottom: 5px; }
.form-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: var(--color-primario);
    color: var(--color-blanco);
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-login:hover { background-color: rgb(110, 0, 0); }

/* --- BARRA LATERAL (SIDEBAR) --- */
.sidebar {
    width: var(--ancho-sidebar);
    background-color: var(--color-primario); /* TU ROJO #8D0000 */
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed; /* Fija a la izquierda */
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(0,0,0,0.1);
}

.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: 0.3s;
    border-left: 4px solid transparent;
}
.sidebar-menu li a:hover {
    background-color: rgba(0,0,0,0.2);
    border-left-color: white;
}

.sidebar-footer {
    margin-top: auto; /* Empuja esto al fondo */
    padding: 20px;
    background-color: rgba(0,0,0,0.1);
}

.btn-logout {
    display: block;
    text-align: center;
    background: var(--color-blanco);
    color: var(--color-primario);
    padding: 10px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    margin-left: var(--ancho-sidebar); /* Deja espacio para la barra */
    padding: 40px;
    width: calc(100% - var(--ancho-sidebar));
}

h1, h2 { color: var(--color-secundario); }

/* --- PANELES Y TABLAS --- */
.panel {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border-top: 3px solid var(--color-secundario);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }

.btn-action { background: var(--color-primario); color: white; border: none; padding: 12px; width: 100%; border-radius: 4px; cursor: pointer; font-weight: bold; margin-top: 10px;}
.btn-cancel { display: block; text-align: center; background: var(--color-secundario); color: white; padding: 12px; border-radius: 4px; text-decoration: none; margin-top: 10px;}

table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th { background: var(--color-secundario); color: white; padding: 12px; text-align: left; }
td { padding: 12px; border-bottom: 1px solid #ddd; }

/* --- HEADER Y LOGOS --- */
.header-top {
    display: flex;
    justify-content: flex-end; /* Alinea a la derecha */
    margin-bottom: 20px;
}

.logo-derecha {
    width: 120px; /* Tamaño pequeño */
    height: auto;
}

/* --- NUEVO: BOTONES DE ACCIÓN CON ICONOS --- */

/* Estilo base para botones cuadrados/redondeados con iconos */
.btn-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    border-radius: 5px; 
    color: white;
    text-decoration: none;
    margin: 0 3px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Botón Editar (Lápiz) - Azul */
.btn-edit {
    background-color: #007bff; 
}
.btn-edit:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Botón Eliminar (Basura) - Rojo Corporativo */
.btn-delete {
    background-color: #8D0000; 
}
.btn-delete:hover {
    background-color: #b30000;
    transform: translateY(-2px);
}
/* --- ESTILOS ESPECÍFICOS DE ACTIVIDADES.PHP --- */

/* Contenedor Principal del Calendario */
.calendar-design-container { 
    max-width: 1300px; 
    margin: 0 auto; 
    padding: 0 10px; 
}

/* Header Personalizado (Barra Roja) */
.custom-header-bar { 
    background-color: var(--color-primario); /* #8D0000 */
    border-radius: 8px; 
    padding: 0 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: white; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
    margin-bottom: 10px; 
    height: 80px; 
    overflow: hidden; 
}

.header-logo { 
    height: 50px; 
    width: auto; 
    max-width: 180px; 
    background: white; 
    padding: 5px; 
    border-radius: 5px; 
    object-fit: contain; 
}

.header-center { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
}

.header-title { 
    font-size: 1.4rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    line-height: 1.1; 
    text-align: center; 
    color: white; 
    white-space: nowrap;
}

/* Switch */
.switch { position: relative; display: inline-block; width: 34px; height: 18px; margin-top: 3px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #f39c12; }
input:checked + .slider:before { transform: translateX(16px); }
.switch-label { font-size: 0.65rem; font-weight: bold; color: white; text-transform: uppercase; margin-left: 8px; vertical-align: middle; }

/* Controles del Mes */
.month-title-container { 
    text-align: center; 
    margin-bottom: 10px; 
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 15px; 
}
.month-title { font-size: 1.3rem; color: var(--color-primario); font-weight: 800; text-transform: uppercase; }
.nav-arrow { background: #eee; border: none; font-size: 1.2rem; color: var(--color-primario); cursor: pointer; padding: 4px 12px; border-radius: 4px; transition: 0.2s; }
.nav-arrow:hover { background: #ddd; }
.btn-hoy { background-color: #2c3e50; color: white; border: none; padding: 6px 12px; border-radius: 4px; font-weight: bold; font-size: 0.8rem; cursor: pointer; position: absolute; right: 0; }

/* Layout Calendario */
.calendar-layout { display: flex; align-items: flex-start; gap: 10px; }
.calendar-wrapper { flex: 1; background: white; border-radius: 8px; }
.worker-image-container { width: 200px; flex-shrink: 0; text-align: center; align-self: flex-end; display: none; }
@media (min-width: 1000px) { .worker-image-container { display: block; } }
.worker-image-container img { width: 100%; height: auto; max-height: 350px; object-fit: contain; }

/* FullCalendar Clean */
.fc-header-toolbar { display: none !important; }
.fc-col-header-cell { background-color: var(--color-primario) !important; color: white; padding: 8px 0; font-size: 0.9rem; }
.fc-daygrid-day-number { color: var(--color-primario); font-weight: bold; font-size: 1rem; padding: 4px; text-decoration: none; }
.fc-day-today { background-color: #fff8e1 !important; }
.fc-event { font-size: 0.75rem; border-radius: 3px; border: none; padding: 2px; }

/* Asignación (Modo Bolívar) */
.container-asignacion { display: grid; grid-template-columns: 1fr 1.5fr; gap: 20px; max-width: 1100px; margin: 10px auto; padding: 20px; }
.card-info { background: #f8f9fa; padding: 20px; border-radius: 8px; border-left: 5px solid var(--color-primario); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.card-form { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 1px solid #eee; }
.lbl-dato { font-size: 0.75rem; color: #777; font-weight: 700; text-transform: uppercase; margin-bottom: 2px; display: block; }
.val-dato { font-size: 0.95rem; color: #333; font-weight: 600; margin-bottom: 12px; display: block; border-bottom: 1px dotted #ccc; }
.val-destacado { color: var(--color-primario); font-size: 1.1rem; }
.badge-orden { background: #e8f5e9; color: #009c3b; padding: 4px 10px; border-radius: 15px; font-weight: bold; border: 1px solid #009c3b; display: inline-block; margin-bottom: 15px; font-size: 0.85rem;}
.form-grid-asign { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.input-asign { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; font-size: 0.95rem; }
.btn-guardar-asign { background: #009c3b; color: white; border: none; padding: 12px; width: 100%; font-weight: bold; font-size: 1rem; border-radius: 5px; cursor: pointer; margin-top: 15px; transition: 0.3s; }
.btn-guardar-asign:hover { background: #007a2e; }
.email-display { font-size: 0.8rem; color: #0033a0; font-weight: 600; margin-top: 3px; display: block; }
.btn-atras { display: inline-block; margin: 15px 20px; color: #666; text-decoration: none; font-weight: 600; font-size: 0.85rem; background: #eee; padding: 6px 15px; border-radius: 20px; }
.btn-atras:hover { color: var(--color-primario); background: #e0e0e0; }

/* Tabs */
.tabs { display: flex; gap: 5px; padding: 5px 20px 0 20px; max-width: 1250px; margin: 0 auto; }
.tab-btn { padding: 6px 15px; border: 1px solid #ccc; background: #f1f1f1; cursor: pointer; border-radius: 5px 5px 0 0; font-weight: bold; color: #555; font-size: 0.85rem; }
.tab-btn.active { background: var(--color-primario); color: white; border-color: var(--color-primario); }
.vista-seccion { display: none; }
.vista-seccion.active { display: block; }

/* Panel Depuración/Filtros */
.panel-depuracion { background: #fff3cd; border: 1px solid #ffeeba; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.depuracion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.depuracion-grid label { font-size: 0.85rem; font-weight: bold; color: #856404; display: block; margin-bottom: 3px; }
.depuracion-grid input, .depuracion-grid select { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; }
.btn-limpiar { background-color: #6c757d; color: white; border: none; padding: 8px; font-weight: bold; border-radius: 4px; cursor: pointer; width: 100%; transition:0.3s; font-size: 0.9rem;}

/* Modal Básico */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: white; margin: 5vh auto; padding: 20px; border-radius: 8px; width: 95%; max-width: 700px; max-height: 90vh; overflow-y: auto; }
.close-modal { float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
/* =========================================
   ESTILOS ESPECÍFICOS: ARL BOLÍVAR
   ========================================= */

/* Utilidad para quitar padding superior si es necesario */
.no-padding-top { padding-top: 0 !important; }

/* Botón Volver */
.btn-volver { 
    display: inline-block; 
    margin: 10px 0 5px 20px; 
    color: #666; 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 0.85rem; 
}
.btn-volver:hover { color: var(--color-primario); }

/* Encabezado Sección */
.header-bolivar { padding: 0 20px; margin-bottom: 5px; }
.header-bolivar h2 { 
    margin: 0; 
    font-size: 1.4rem; 
    color: var(--color-primario); 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

/* Barra de Filtros */
.barra-filtros { 
    background-color: white; 
    padding: 15px 20px; 
    margin: 10px 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    border-left: 4px solid var(--color-primario); 
}
.filtro-group select, .filtro-group input { 
    padding: 8px 12px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    font-size: 0.9rem; 
    outline: none; 
}
.btn-filtrar { 
    background-color: var(--color-primario); 
    color: white; 
    border: none; 
    padding: 8px 15px; 
    border-radius: 5px; 
    cursor: pointer; 
    font-weight: bold; 
}
.btn-limpiar { 
    background-color: #7f8c8d; 
    color: white; 
    border: none; 
    padding: 8px 15px; 
    border-radius: 5px; 
    cursor: pointer; 
    text-decoration: none; 
    font-size: 0.9rem; 
}

/* Tabla Scrollable */
.contenedor-tabla-scroll { 
    height: calc(100vh - 250px); 
    min-height: 400px; 
    overflow-y: auto; 
    overflow-x: auto; 
    background: white; 
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    margin: 0 20px 10px 20px; 
    border-top: 4px solid var(--color-primario); 
}
table.tabla-datos { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.tabla-datos th { 
    background-color: var(--color-primario); 
    color: white; 
    padding: 10px 15px; 
    text-align: left; 
    position: sticky; 
    top: 0; 
    z-index: 10; 
    font-weight: 700; 
    text-transform: uppercase; 
    white-space: nowrap; 
    box-shadow: 0 2px 2px rgba(0,0,0,0.1); 
}
table.tabla-datos td { 
    padding: 8px 15px; 
    border-bottom: 1px solid #eee; 
    color: #333; 
    vertical-align: middle; 
}
table.tabla-datos tr:hover { background-color: #f9f9f9; }
table.tabla-datos tr.fila-interactiva { cursor: pointer; transition: background 0.2s; }
table.tabla-datos tr.fila-interactiva:hover { background-color: #e8f5e9; }

/* Badges de Estado */
.badge-estado { 
    padding: 4px 8px; 
    border-radius: 12px; 
    font-weight: 700; 
    font-size: 0.7rem; 
    text-transform: uppercase; 
    display: inline-block; 
    min-width: 90px; 
    text-align: center; 
}
.st-pendiente { background-color: #ecf0f1; color: #7f8c8d; border: 1px solid #bdc3c7; }
.st-confirmada { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.st-reagendada { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.st-cancelada { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Paginación */
.paginacion-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 15px; 
    margin: 5px 0 10px 0; 
    padding-bottom: 10px; 
}
.btn-pag { 
    padding: 6px 14px; 
    background: white; 
    border: 1px solid #ddd; 
    color: var(--color-primario); 
    text-decoration: none; 
    border-radius: 5px; 
    font-weight: bold; 
    transition: 0.3s; 
    font-size: 0.85rem; 
}
.btn-pag:hover { background: var(--color-primario); color: white; }
.btn-pag.disabled { background: #eee; color: #aaa; pointer-events: none; }

/* Modal XL (Específico para gestión completa) */
.modal { display: none; position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.modal-content-xl { 
    background-color: white; 
    margin: 2vh auto; 
    width: 95%; 
    max-width: 1000px; 
    border-radius: 8px; 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    max-height: 95vh; 
    overflow-y: auto; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); 
}
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: #aaa; z-index: 10; }

/* Secciones del Modal */
.seccion-a { background-color: #f8f9fa; padding: 25px; border-bottom: 1px solid #ddd; }
.titulo-seccion { font-size: 0.9rem; font-weight: 800; color: var(--color-primario); text-transform: uppercase; margin-bottom: 15px; letter-spacing: 0.5px; }
.grid-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; row-gap: 20px; }
.info-item label { display: block; font-size: 0.75rem; color: #777; font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.info-item span { display: block; font-size: 0.95rem; color: #333; font-weight: 500; border-bottom: 1px dotted #ccc; padding-bottom: 2px; }

/* Historial */
.seccion-historial { padding: 20px 25px; background-color: #fffbf0; border-bottom: 1px solid #ddd; }
.tabla-historial { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 10px; background: white; border: 1px solid #eee; }
.tabla-historial th { background: #f39c12; color: white; padding: 8px; text-align: left; }
.tabla-historial td { padding: 8px; border-bottom: 1px solid #eee; color: #555; }
.historial-vacio { text-align: center; color: #999; font-style: italic; padding: 10px; }

/* Formulario Gestión */
.seccion-b { padding: 25px; background-color: white; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 700; color: #333; margin-bottom: 5px; }
.input-group input, .input-group select, .input-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 0.95rem; }
.radio-group { display: flex; gap: 20px; margin-top: 5px; }
.acciones-footer { text-align: right; margin-top: 20px; padding-top: 15px; border-top: 1px solid #eee; }
.btn-confirmar { background: var(--color-primario); color: white; border: none; padding: 12px 30px; border-radius: 5px; font-weight: bold; cursor: pointer; font-size: 1rem; }
.condicional-oculto { display: none; }
/* =========================================
   ESTILOS ESPECÍFICOS: BITÁCORA Y AUDITORÍA
   ========================================= */

/* Caja de notificaciones (Feedback visual) */
#notificacion-area { 
    display: none; 
    padding: 15px; 
    margin-bottom: 15px; 
    border-radius: 4px; 
    text-align: center; 
    font-weight: bold; 
}
.notif-success { 
    background: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb; 
}
.notif-error { 
    background: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb; 
}

/* Panel Depuración / Filtros (Ya existía uno similar, pero este refuerza estilos específicos de Bitácora) */
/* Nota: Si ya tienes .panel-depuracion en el CSS general, este bloque lo complementa */
.panel-depuracion { 
    background: #fff3cd; 
    border: 1px solid #ffeeba; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
}

/* Grid de Filtros */
.depuracion-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    gap: 10px; 
    align-items: end; 
}
.depuracion-grid label { 
    font-size: 0.85rem; 
    font-weight: bold; 
    color: #856404; 
    display: block; 
    margin-bottom: 3px; 
}
.depuracion-grid input, .depuracion-grid select { 
    width: 100%; 
    padding: 8px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
}

/* Botón Eliminar / Limpiar (Rojo Peligro) */
.btn-limpiar-danger { 
    background-color: #dc3545; 
    color: white; 
    border: none; 
    padding: 10px; 
    font-weight: bold; 
    border-radius: 4px; 
    cursor: pointer; 
    width: 100%; 
    transition: 0.3s;
}
.btn-limpiar-danger:hover { 
    background-color: #c82333; 
}