/* =========================================================
   1. FILTROS: ESTRUCTURA GENERAL
   ========================================================= */

.filters-grid .field,
.filtros-grid .field {
    width: 100%;
    min-width: 0;
    margin: 0;
}

/* Etiquetas de filtros */
.filtros-grid .field label {
    display: block;
    width: 100%;
    margin-bottom: 7px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Inputs de filtros */
.filters-grid input,
.filtros-grid input[type="text"],
.filtros-grid input[type="date"] {
    display: block;
    width: 100% !important;
    height: 34px;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px 10px;
}

/* Estilos específicos de los filtros de bandejas */
.filtros-grid input[type="text"],
.filtros-grid input[type="date"] {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 14px;
}

/* Select nativo */
.filters-grid select {
    width: 100% !important;
}

/* Select2: estructura general */
.filters-grid .select2-container,
.filtros-grid .select2-container {
    display: block;
    width: 100% !important;
}

/* Select2: campo */
.filters-grid .select2-container .select2-selection--single {
    height: 34px;
    box-sizing: border-box;
}

.filtros-grid .select2-container .select2-selection--single {
    width: 100%;
    height: 40px !important;
    min-height: 40px !important;
    box-sizing: border-box;
    border: 1px solid #bbb !important;
    border-radius: 4px !important;
}

/* Select2: texto seleccionado */
.filters-grid
.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    line-height: 34px;
}

.filtros-grid
.select2-container
.select2-selection--single
.select2-selection__rendered {
    line-height: 38px !important;
    padding-right: 35px !important;
    padding-left: 12px !important;
    font-size: 14px;
}

/* Select2: flecha */
.filters-grid
.select2-container--default
.select2-selection--single
.select2-selection__arrow {
    height: 34px;
}

.filtros-grid
.select2-container
.select2-selection--single
.select2-selection__arrow {
    height: 38px !important;
}

/* Inputs del primer paso */
#paso1 .filters-grid .field input[type="text"],
#paso1 .filters-grid .field input[type="date"] {
    display: block !important;
    width: 100% !important;
    height: 34px !important;
    min-height: 34px !important;
    box-sizing: border-box !important;
    padding: 6px 10px !important;
    line-height: 20px !important;
}

/* =========================================================
   2. BOTONES DE CONSULTA Y EXPORTACIÓN
   ========================================================= */

#consultarMisTramite,
#excelMisTramite,
#consultar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    width: 120px;
    height: 32px;
    padding: 0;

    color: #fff;
    background-color: #299bd3;

    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 2px;

    appearance: none;
    -webkit-appearance: none;

    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

/* Iconos de los botones */
#consultarMisTramite i,
#excelMisTramite i {
    color: #fff !important;
    font-size: 13px;
    line-height: 1;
}

/* Hover */
#consultarMisTramite:hover,
#excelMisTramite:hover,
#consultar:hover {
    background-color: #2189bd;
}

/* Active */
#consultarMisTramite:active,
#excelMisTramite:active,
#consultar:active {
    background-color: #1d79a7;
}

/* Contenedor de botones de filtros */
.filters-grid .filter-button {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    height: 100%;
    margin: 0 !important;
}

/* Fila de botones del paso 1 */
#paso1 .btn-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    margin-top: 25px;
    margin-left: 2%;
    text-align: left !important;
}

/* Contenedor de botones del paso 1 */
#paso1 .btn-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px;

    width: auto !important;
    margin: 0 !important;

    float: none !important;
    text-align: left !important;
}

/* =========================================================
   3. INFORMACIÓN DEL TRÁMITE
   ========================================================= */

.tramite-contenedor {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tramite-nombre {
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
}

/* Información de pago */
.tramite-pago,
.tramite-pago-punto {
    color: #b45309;
}

.tramite-pago {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.tramite-pago-punto {
    margin-right: 3px;
}

/* Información de visita */
.tramite-visita,
.tramite-visita-punto {
    color: #6d4aa5;
}

.tramite-visita {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.tramite-visita-punto {
    margin-right: 3px;
}

/* =========================================================
   4. ESTADOS DEL TRÁMITE
   ========================================================= */

.estado-tramite {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 10px;

    border: 1px solid transparent;
    border-radius: 20px;

    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

/* Sin asignar */
.estado-sin-asignar {
    color: #475467;
    background-color: #f2f4f7;
    border-color: #d0d5dd;
}

/* Asignación */
.estado-asignacion {
    color: #3538cd;
    background-color: #eef4ff;
    border-color: #c7d7fe;
}

/* En revisión */
.estado-en-revision {
    color: #175cd3;
    background-color: #eff8ff;
    border-color: #b2ddff;
}

/* Devuelto */
.estado-devuelto {
    color: #b54708;
    background-color: #fff4ed;
    border-color: #ffd6ae;
}

/* Pendiente de pago */
.estado-pendiente-pago {
    color: #a15c07;
    background-color: #fffaeb;
    border-color: #fedf89;
}

/* Aprobado */
.estado-aprobado {
    color: #067647;
    background-color: #ecfdf3;
    border-color: #abefc6;
}

/* Pendiente de firma */
.estado-pendiente-firma {
    color: #6941c6;
    background-color: #f4f3ff;
    border-color: #d9d6fe;
}

/* Finalizado */
.estado-finalizado {
    color: #107569;
    background-color: #f0fdf9;
    border-color: #99f6e0;
}

/* Negado */
.estado-negado {
    color: #b42318;
    background-color: #fef3f2;
    border-color: #fecdca;
}

/* Estado desconocido */
.estado-desconocido {
    color: #344054;
    background-color: #f9fafb;
    border-color: #eaecf0;
}

/* =========================================================
   5. ESTADOS ACTIVO E INACTIVO
   ========================================================= */

.estado-activo,
.estado-inactivo {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 10px;
    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* Activo */
.estado-activo {
    color: #07883f;
    background-color: #e7f9ef;
}

/* Inactivo */
.estado-inactivo {
    color: #3f526e;
    background-color: #f0f3f7;
}

/* =========================================================
   6. TRAZABILIDAD: CONTENEDOR Y ENCABEZADO
   ========================================================= */

.trazabilidad-encabezado {
    margin: 0 0 18px;
    color: #12336b;
    font-size: 21px;
    font-weight: 700;
}

.trazabilidad-lista {
    position: relative;
    padding-left: 28px;
    border-left: none !important;
}

/* Línea vertical de la trazabilidad */
.trazabilidad-lista::before {
    position: absolute;
    top: 7px;
    bottom: 8px;
    left: 7px;
    width: 2px;

    background-color: #1ba4e8;
    content: "";
}

/* Elementos de trazabilidad */
.traza-item {
    position: relative;
    margin-bottom: 18px;
    border-left: none !important;
}

.traza-item:last-child {
    margin-bottom: 0;
}

.traza-contenido {
    min-width: 0;
    border-left: none !important;
}

/* Punto de la línea de tiempo */
.traza-punto {
    position: absolute;
    top: 2px;
    left: -27px;
    z-index: 2;

    width: 13px;
    height: 13px;
    box-sizing: border-box;

    background-color: #98a2b3;
    border: 2px solid #fff;
    border-radius: 50%;

    box-shadow: 0 0 0 1px #98a2b3;
}

/* Título */
.traza-titulo {
    margin: 0;
    color: #101828;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

/* Fecha, usuario y demás metadatos */
.traza-metadatos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;

    margin-top: 2px;

    color: #667085;
    font-size: 11px;
    line-height: 1.4;
}

.traza-separador {
    color: #98a2b3;
}

/* Descripción del evento */
.traza-detalle {
    margin: 4px 0 0;
    color: #101828;
    font-size: 14px;
    line-height: 1.4;
}

/* Sin registros */
.trazabilidad-vacia {
    color: #667085;
    font-size: 13px;
}

/* =========================================================
   7. COLORES DE LOS PUNTOS DE TRAZABILIDAD
   ========================================================= */

.traza-radicado {
    background-color: #98a2b3;
    box-shadow: 0 0 0 1px #98a2b3;
}

.traza-asignado {
    background-color: #3538cd;
    box-shadow: 0 0 0 1px #3538cd;
}

.traza-revision {
    background-color: #175cd3;
    box-shadow: 0 0 0 1px #175cd3;
}

.traza-devuelto {
    background-color: #b54708;
    box-shadow: 0 0 0 1px #b54708;
}

.traza-pendiente-pago {
    background-color: #a15c07;
    box-shadow: 0 0 0 1px #a15c07;
}

.traza-aprobado {
    background-color: #067647;
    box-shadow: 0 0 0 1px #067647;
}

.traza-pendiente-firma {
    background-color: #6941c6;
    box-shadow: 0 0 0 1px #6941c6;
}

.traza-finalizado {
    background-color: #107569;
    box-shadow: 0 0 0 1px #107569;
}

.traza-negado {
    background-color: #b42318;
    box-shadow: 0 0 0 1px #b42318;
}

.traza-desconocido {
    background-color: #667085;
    box-shadow: 0 0 0 1px #667085;
}

/* =========================================================
   8. ACCIÓN RUAFND
   ========================================================= */

.ruafnd-action {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;

    width: 100%;
    min-height: 50px;
}

/* Icono de la acción */
.ruafnd-action .ruafnd-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;
    min-width: 34px;
    box-sizing: border-box;

    color: #fff;
    background-color: #f0a52c;
    border-radius: 50%;

    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

/* Texto de la acción */
.ruafnd-action .ruafnd-copy {
    display: block;
    min-width: 0;
}

.ruafnd-action .ruafnd-copy strong {
    display: block;
    margin: 0;
    padding: 0;

    color: #855b0a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.ruafnd-action .ruafnd-copy span {
    display: block;
    margin: 2px 0 0;
    padding: 0;

    color: #627385;
    font-size: 11px;
    line-height: 1.3;
}

/* Botón de verificación */
.ruafnd-action #btnVerificarRuafnd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   9. AJUSTES RESPONSIVE
   ========================================================= */

@media (max-width: 576px) {
    .trazabilidad-encabezado {
        font-size: 18px;
    }

    .traza-titulo {
        font-size: 14px;
    }

    .traza-detalle {
        font-size: 13px;
    }

    #paso1 .btn-row {
        flex-wrap: wrap;
        margin-left: 0;
    }

    #paso1 .btn-container {
        flex-wrap: wrap;
    }

    .ruafnd-action {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .ruafnd-action #btnVerificarRuafnd {
        grid-column: 2;
        justify-self: start;
    }
}

.action-separator{
    border-top:1px solid #e0e6ec;
    margin:14px 0;
}

.btn-accion:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.traslado-review {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #eff8fc;
    border-radius: 10px;
    margin-bottom: 16px;
}

.review-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background-color: #168fc5 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}

.traslado-review strong {
    display: block;
    margin-bottom: 4px;
}

.traslado-review span {
    display: block;
    font-size: 13px;
    color: #555;
}

.review-list{
    margin-top:12px;
    border:1px solid #e0e7ed;
    border-radius:5px;
    background:#fff;
}

.review-list>div{
    display:flex;
    justify-content:space-between;
    padding:8px 10px;
    border-bottom:1px solid #edf1f4;
    font-size:11px;
}

.review-list>div:last-child{
    border-bottom:0;
}

.review-list span{
    color:#738396;
}

.review-list b{
    color:#172b42;
}

.permanencia-card {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 6px;
}

.permanencia-card.ok {
    background: #edf9f2;
    border: 1px solid #b9e4ca;
}

.permanencia-card.warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.permanencia-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #11a866;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}

.permanencia-card.warning .permanencia-icon {
    background: #c2410c;
    color: #fff;
}

.permanencia-card strong {
    display: block;
    color: #087a4b;
    font-size: 13px;
    margin: 1px 0 3px;
}

.permanencia-card.warning strong {
    color: #9a3412;
}

.permanencia-card span {
    display: block;
    color: #526b60;
    font-size: 11px;
    line-height: 1.4;
}

.permanencia-card.warning span {
    color: #9a3412;
}

.validation-detail{
    margin-top:12px;
    border:1px solid #e0e7ed;
    border-radius:5px;
    background:#fff;
}

.validation-detail>div{
    display:flex;
    justify-content:space-between;
    gap:12px;padding:8px 10px;
    border-bottom:1px solid #edf1f4;
    font-size:11px;
}

.validation-detail>div:last-child{
    border-bottom:0;
}

.validation-detail span{
    color:#738396;
}

.validation-detail b{
    color:#172b42;
    text-align:right;
}
