/* =========================================================================
   CONTENEDOR GLOBAL
   ========================================================================= */

.reporte-container {
    padding: 15px 35px; 
    position: relative;
    z-index: 5;
}

/* =========================================================================
   CONTENEDOR Y GRID DE FILTROS (EL FORMULARIO)
   ========================================================================= */

.main-form-container {
    padding: 25px; 
    background-color: #ffffff;
    border-radius: 14px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    max-width: 1200px; 
    margin: 0 auto;
    font-size: 15px;
}

.filtros-grid {
    display: grid;
    /* PROPORCIÓN FINAL: 4fr (Departamentos) vs 3fr (Combinada) */
    grid-template-columns: 4fr 3fr; 
    width: 100%;
    gap: 30px; 
    margin-bottom: 30px; 
    align-items: flex-start; /* Alinea los ítems al inicio de la cuadrícula */
}

@media (max-width: 1000px) {
    .filtros-grid {
        grid-template-columns: 1fr;
    }
}

/* Contenedor que apila las Secciones 2 y 3 (Periodo y Estado) */
.combined-filters-column {
    display: flex;
    flex-direction: column;
    /* Espacio entre la caja de Periodo (Sección 2) y la caja de Estado (Sección 3) */
    gap: 30px; 
    width: 100%; 
}

.form-section {
    padding: 20px 15px;
    border: 1px solid #d5b690;
    border-radius: 10px; 
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
}

.titulo-seccion {
    font-family: 'Poppins', sans-serif;
    color: #861542;
    border-bottom: 2px solid #d5b690;
    display: block;
    margin-bottom: 18px; 
    font-size: 16px; 
    font-weight: 600;
    padding-bottom: 8px; 
}

/* =========================================================================
   SECCIÓN 1: ÁREAS / DEPARTAMENTOS
   ========================================================================= */

.area-selection-panel {
    grid-column: 1 / 2;
}

/* Botón Seleccionar Todo */
.btn-seleccionar-todo {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    background-color: #fce4ec; 
    border: 1px solid #861542;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 600;
    color: #861542;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-seleccionar-todo:hover {
    background-color: #861542;
    color: white;
}

.btn-seleccionar-todo.active {
    background-color: #861542;
    color: white;
    border-color: #861542;
}

.areas-list-scroll { 
    max-height: 400px;
    overflow-y: auto; 
    padding-right: 8px; 
}

/* Estilos de elementos en lista */
.area-header {
    padding: 10px 12px; 
    border-radius: 18px;
    font-size: 14px;
    margin-bottom: 8px; 
    display: flex; 
    align-items: center; 
    cursor: pointer; 
    font-weight: 600; 
    background-color: #f0f0f0; 
    border: 1px solid #ddd; 
    transition: all 0.2s; 
    line-height: 1.3em; 
    word-break: break-word;
}

.area-header:hover { 
  background-color: rgba(134, 21, 66, 0.1);
}

.area-header input[type="checkbox"] { 
    width: 16px; 
    height: 16px; 
    flex-shrink: 0; 
    margin-right: 8px; 
}
.area-nombre { 
    flex-grow: 1; 
    padding-left: 5px; 
    font-family: 'Poppins', sans-serif; 
}
.area-header .flecha-area { 
    flex-shrink: 0; 
    padding-left: 10px; 
    font-size: 1em; 
    color: #861542; 
} 

/* Sub-departamentos */
.area-departamentos-submenu { 
    padding-left: 20px; 
    border-left: 2px dotted #d5b690; 
    margin-top: 6px; 
}
.departamento-label {
    font-size: 14px;
    padding: 4px 0; 
    display: flex; 
    align-items: flex-start; 
    font-weight: 400; 
    cursor: pointer; 
    gap: 5px; 
    line-height: 1.3; 
    color: #000000; 
    font-family: 'Poppins', sans-serif;
}
.departamento-label input[type="checkbox"] { 
    width: 16px; 
    height: 16px; 
    margin: 0; 
    padding: 0;
    margin-top: 2px; 
    flex-shrink: 0; 
}
.departamento-label .departamento-texto-contenido { 
    flex-grow: 1; 
    display: block; 
    margin: 0; 
    padding: 0; 
    line-height: inherit; 
}


/* =========================================================================
   SECCIÓN 2: PERÍODO (Calendario)
   ========================================================================= */

.periodo-tipo-tabs { 
    display: flex; 
    justify-content: space-between; 
    width: 100%; 
    gap: 15px; 
    margin-bottom: 25px; 
    padding-bottom: 5px; 
}
.periodo-tab {
    padding: 10px 0; 
    flex-grow: 1; 
    border: 1px solid #d0d0d0; 
    background-color: #f0f0f0; 
    cursor: pointer;
    border-radius: 6px; 
    font-weight: 600; 
    font-family: 'Poppins', sans-serif; 
    text-align: center;
    font-size: 14px; color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.periodo-tab:hover { background-color: rgba(134, 21, 66, 0.1); }

.periodo-tab.active { 
    background-color: #861542; 
    color: #d5b690; 
    border-color: #861542; 
    box-shadow: 0 2px 5px rgba(134, 21, 66, 0.3); 
}

/* Estilos de inputs de fecha/año/mes */
.periodo-inputs select,
.periodo-inputs input[type="date"] {
    padding: 10px 12px; 
    border: 2px solid #861542;
    border-radius: 18px; 
    width: 100%;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #000;
    font-size: 14px;
    display: block;
    margin-top: 8px; 
}
.mes-inputs { 
    display: flex; 
    gap: 15px; 
}
.mes-inputs select {
    margin-top: 0; 
}

.rango-fechas-inputs { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 15px; 
}
.rango-fechas-inputs label, .input-group-field label { 
    font-weight: 600; 
    margin-top: 10px; 
    color: #861542; 
    display: block; 
    font-size: 14px; 
}

/* =========================================================================
   SECCIÓN 3: ESTADO (Radio Buttons Estilizados - Vertical)
   ========================================================================= */

/* Contenedor para los radio buttons */
.toggle-buttons-group {
    display: flex;
    flex-direction: column; 
    gap: 15px; 
    margin-bottom: 20px; 
}

/* Ocultar el input de radio nativo */
.hidden-radio {
    display: none;
}

/* Estilo del label que funciona como botón */
.radio-label {
    width: 100%; 
    cursor: pointer;
    text-align: center;
    padding: 12px 10px; 
    border: 2px solid #d5b690;
    background-color: #fff;
    border-radius: 18px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    font-weight: 600;
    font-size: 14px;
    color: #861542;
}

.radio-label:hover {
    background-color: #fce4ec; 
}

/* Estilo del label cuando el radio está seleccionado */
.radio-label.selected {
    background-color: #861542; 
    color: #d5b690; 
    border-color: #861542;
    box-shadow: 0 2px 5px rgba(134, 21, 66, 0.4);
}

/* Contenido interno del botón/label (para los íconos) */
.radio-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; 
}

.estado-actual-info {
    font-size: 0.95em; 
    color: #6c757d;
    text-align: center;
    padding: 8px 0;
    border-top: 1px solid #eee; 
    margin-top: 10px;
}

/* =========================================================================
   BOTÓN GENERAR REPORTE, ALERTA Y PROGRESO
   ========================================================================= */

.boton-generar-section {
    width: 100%;
    /* Dejamos el max-width amplio para que la barra se vea larga */
    max-width: 800px; 
    margin: 35px auto 0; 
    padding: 0;
    text-align: center;
    display: flex; 
    flex-direction: column;
    align-items: center;
}

/* Bar y Contenedor */
.progress-container {
    /* Mantenemos el contenedor amplio para la barra larga */
    width: 100%;
    max-width: 550px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
}

.progress-bar-wrapper {
    width: 100%;
    /* ❗ AJUSTE CLAVE: Altura reducida para hacerla más delgada */
    height: 15px; 
    background-color: #fce4ec; 
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-bar-label { font-weight: bold; color: #861542; margin-bottom: 5px; }

.progress-ba { 
    height: 100%; 
    background-color: #861542; 
    transition: width 0.15s linear; 
    border-radius: 12px 0 0 12px; 
}
.btn-cancelar { display: flex; align-items: center; padding: 8px 15px; font-size: 1em; font-weight: 600; border: 2px solid #861542; border-radius: 6px; background-color: white; color: #861542; cursor: pointer; transition: all 0.2s ease; }
.btn-cancelar:hover { background-color: #861542; color: white; }
.icon-cancelar { margin-right: 8px; }


/* Botón Generar (no está en el progress-container, solo para referencia) */
.btn-generar {
    width: 100%;
    max-width: 220px; 
    padding: 10px 20px;
    background-color: #861542; 
    color: white;
    border: none;
    border-radius: 8px; 
    font-size: 16px; 
    font-weight: 700;
    margin: 0 auto; 
    display: flex;
    justify-content: center; 
    align-items: center;
    transition: background-color 0.3s, transform 0.2s;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}
.btn-generar:hover:not(:disabled) { background-color: #6d1035; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); }
.btn-generar:disabled { background-color: #ccc; cursor: not-allowed; color: #a0a0a0; transform: none; box-shadow: none; }
.alerta-seleccion { margin-top: 10px; color: #ff9800; font-size: 0.9em; font-weight: 500; }

/* AJUSTES FINALES */
input[type="checkbox"] {
    accent-color: #861542;
}