
/* ==========================================================================
   1. ESTILOS BASE Y GENERALES
   ========================================================================== */
body {
    font-family: "Source Sans 3", sans-serif;
    margin: 0;
    background: #fafafa;
}

.ca-contenedor {
    font-family: "Source Sans 3", sans-serif;
    margin: 20px 0;
}

h2 {
    color: #2c3e50;
}

/* ==========================================================================
   2. FORMULARIO DE CONSULTA
   ========================================================================== */
.ca-form-container {
    background: #fff;
    padding: 30px 20px 20px 20px; /* Padding top 30px como solicitaste */
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ca-form-linea {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.ca-form-linea-2 {
    margin-bottom: 0;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.ca-form-linea label {
    font-weight: bold;
    color: #34495e;
    white-space: nowrap;
    font-size: 17px !important; /* Tu ajuste específico */
}

.ca-form-linea-1 input[type="text"] {
    padding: 2px 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 18px; /* Tu ajuste específico */
}

#ca-fechaDesde, 
#ca-fechaHasta {
    width: 150px;
}

#ca-caratula {
    width: 250px;
    flex: 1;
    min-width: 200px;
}

/* Selector de elementos por página */
.ca-form-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ca-form-selector select#ca-elementosPorPagina {
    padding: 2px 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 17px; /* Tu ajuste específico */
    background: white;
    cursor: pointer;
    min-width: 60px;
}

.ca-form-selector select#ca-elementosPorPagina:hover {
    border-color: #999;
}

.ca-form-selector select#ca-elementosPorPagina:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.15);
}

.ca-label-ayuda {
    font-size: 13px;
    color: #666;
}

/* Botones del formulario */
.ca-form-botones {
    display: flex;
    gap: 8px;
}

.ca-form-botones button {
    padding: 8px 20px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.ca-form-botones button:hover {
    background: #34495e;
}

.ca-form-botones button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.ca-form-botones button.btn-limpiar {
    background: #7f8c8d;
}

.ca-form-botones button.btn-limpiar:hover {
    background: #95a5a6;
}

/* ==========================================================================
   3. MENSAJES Y SPINNER
   ========================================================================== */
.ca-mensaje {
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
}

.ca-mensaje.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.ca-mensaje.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    /* display: none;  <-- Nota: Si esto está activo, los errores no se verán. Quítalo si quieres verlos. */
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   4. REGISTROS (FORMATO DIVS RESPONSIVO)
   ========================================================================== */
.ca-registros-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #ddd;
    border-top: none;
    background: white;
}

.ca-registros-header {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1.5fr/* 3fr*/;
    background: #2c3e50;
    color: white;
    font-weight: bold;
    font-size: 18px;
    border: 1px solid #2c3e50;
    border-bottom: none;
}

.ca-header-cell {
    padding: 12px 10px;
    border-right: 1px solid rgba(255,255,255,0.2);
    min-width: 250px;
}

.ca-header-cell:last-child {
    border-right: none;
}

.ca-header-providencia {
    min-width: 30vw;
}

.ca-registro, .ca-registrog {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1.5fr/* 3fr*/;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
border: solid 1px #ddd;
}

.ca-registro:last-child {
    border-bottom: none;
}

.ca-registro:hover, .ca-registrog:hover {
    background:  #ffe;
}

.ca-campo {
    padding: 12px 10px;
    border-right: 1px solid #e0e0e0;
    font-size: 18px;
    vertical-align: top;
    display: flex;
    flex-direction: column;
    min-width: 250px;
}

.ca-campo:last-child {
    border-right: none;
}

.ca-campo-label {
    display: none; /* Se muestra solo en móvil */
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 12px;
}

.ca-campo-valor {
    color: #333;
    line-height: 1.4;
}

.ca-campo-providencia {
    min-width: 30vw;
}

/* ==========================================================================
   5. ESTILOS DE LA PROVIDENCIA (TEXTO)
   ========================================================================== */
.texto-providencia,
.texto-providencia * {
    font-family: 'Source Sans 3', Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333333 !important;
    text-align: justify !important;
    text-justify: inter-word !important;
    -webkit-hyphens: auto !important;
    -moz-hyphens: auto !important;
    -ms-hyphens: auto !important;
    hyphens: auto !important;
}

.texto-providencia a,
.texto-providencia a * {
    color: #0073aa !important;
    text-decoration: underline !important;
}

.texto-providencia p,
.texto-providencia ul,
.texto-providencia ol {
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
}

/* Truncado y expansión */
.texto-providencia {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Ajustado a 2 según tu código original */
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
}

.texto-providencia.expandido {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.btn-toggle-texto {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    font-size: 11px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-toggle-texto:hover {
    background: #2980b9;
}

/* ==========================================================================
   6. PAGINACIÓN
   ========================================================================== */
.ca-paginacion-info {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px 4px 0 0;
    border: 1px solid #ddd;
    border-bottom: none;
    font-size: 13px;
    color: #555;
}

.ca-paginador {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 0 0 4px 4px;
    border: 1px solid #ddd;
    flex-wrap: wrap;
}

.ca-paginador-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.2s ease;
    min-width: 36px;
}

.ca-paginador-btn:hover:not(:disabled):not(.activa) {
    background: #e9ecef;
    border-color: #999;
}

.ca-paginador-btn.activa {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
    font-weight: bold;
    cursor: default;
}

.ca-paginador-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ca-paginador-ellipsis {
    padding: 6px 8px;
    color: #999;
    user-select: none;
}

.ca-registrog{background: #eee;}




/* ==========================================================================
   7. RESPONSIVE (MÓVILES - Max 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Formulario */
    .ca-form-linea {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ca-form-linea-1 label,
    .ca-form-linea-1 input[type="text"],
    .ca-form-selector,
    .ca-form-botones {
        width: 100%;
    }
    
    #ca-fechaDesde, 
    #ca-fechaHasta, 
    #ca-caratula {
        width: 100%;
    }
    
    .ca-form-linea-2 {
        align-items: flex-start;
    }
    
    .ca-form-botones {
        justify-content: flex-end;
    }

    .ca-form-container select#ca-elementosPorPagina {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .ca-label-ayuda {
        display: block;
        margin-bottom: 8px;
    }

    /* Registros (Tarjetas) */
    .ca-registros-header {
        display: none; /* Ocultar encabezados de tabla */
    }

    .ca-registros-container {  
        border: 0;
        background: none;
    }

    .ca-registro, .ca-registrog {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        border: 1px solid #ddd!important;
        border-radius: 8px;
        margin-bottom: 10px;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .ca-registro:hover, .ca-registrog:hover {
        background:  #ffe;
    }

    .ca-campo {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 8px 0;
    }

    .ca-campo:last-child {
        border-bottom: none;
    }

    .ca-campo-label {
        display: block; /* Mostrar etiquetas en móvil */
    }

    .ca-campo-providencia {
        min-width: auto;
    }

    /* Paginación */
    .ca-paginador {
        gap: 3px;
    }
    .ca-paginador-btn {
        padding: 5px 8px;
        font-size: 12px;
        min-width: 30px;
    }
    .ca-paginacion-info {
        font-size: 12px;
        text-align: center;
    }
}

