/* =====================
   RESET + VARIABLES
===================== */
:root {
    --bg-main: #0b0f1a;
    --bg-card: rgba(255,255,255,0.08);
    --bg-glass: rgba(255,255,255,0.12);
    --border-glass: rgba(255,255,255,0.18);

    --primary: #4fc3f7;
    --secondary: #7c4dff;
    --danger: #ff5252;
    --success: #00e676;

    --text-main: #eaeaf0;
    --text-muted: #a0a3bd;

    --blur: blur(14px);
    --radius: 16px;
    --shadow: 0 20px 40px rgba(0,0,0,.45);
}

/* Optimización para PCs viejas: reducir animaciones */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =====================
   BODY
===================== */
body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #12192c, #060913);
    color: var(--text-main);
    min-height: 100vh;
}

/* =====================
   HEADER
===================== */
.app-header {
    padding: 1.25rem 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header-left {
    flex: 1;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: .9rem;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-perfil {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-logout {
    padding: 0.5rem 1.25rem;
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
}

.btn-activar-audio {
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    animation: pulse-button 2s ease-in-out infinite;
}

.btn-activar-audio:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

@keyframes pulse-button {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.6);
    }
}

/* =====================
   LAYOUT
===================== */
.container {
    display: flex;
    gap: 1rem;
    max-width: 1800px;
    margin: auto;
    padding: 1.5rem;
}

/* =====================
   GLASS PANELS
===================== */
.data-panel {
    flex: 1;
    background: rgba(15, 20, 35, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.filters-panel {
    background: rgba(20, 25, 40, 0.95);
    width: 300px;
    align-self: flex-start;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
}

/* =====================
   TABLE
===================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
    border-spacing: 0;
}

.data-table thead {
    background: linear-gradient(90deg, #1a237e, #0d47a1);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: 1px;
    color: #cfd8ff;
    font-weight: 600;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: 0.9rem;
}

.data-table td:last-child {
    text-align: center;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,.06);
    transform: scale(1.002);
}

.data-table thead tr th:first-child {
    border-top-left-radius: 14px;
}

.data-table thead tr th:last-child {
    border-top-right-radius: 14px;
}

/* =====================
   DATA HIGHLIGHTS
===================== */
.money {
    font-weight: 600;
    color: var(--success);
}

.danger {
    font-weight: 700;
    color: var(--danger);
}

/* =====================
   PAGINACIÓN
===================== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-page {
    padding: 0.5rem 1rem;
    background: rgba(79, 195, 247, 0.15);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-page:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-number {
    padding: 0.5rem 1rem;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
}

/* =====================
   FILTERS
===================== */
.filters-container h2 {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    color: var(--primary);
}

.filter-group {
    margin-bottom: 1.2rem;
}

.filter-group label {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .4rem;
    display: block;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: .7rem;
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--border-glass);
    color: white;
    font-size: 0.9rem;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* =====================
   BUTTON
===================== */
.btn-apply {
    margin-top: 1rem;
    width: 100%;
    padding: .85rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    transition: transform .2s, box-shadow .2s;
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79,195,247,.4);
}

.btn-reporte {
    margin-top: 0.75rem;
    width: 100%;
    padding: .85rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    transition: transform .2s, box-shadow .2s;
    font-size: 0.95rem;
}

.btn-reporte:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16,185,129,.4);
}

/* =====================
   STATES
===================== */
.loading,
.no-data,
.error {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.error {
    color: var(--danger);
}

/* =====================
   CUOTAS ATRASADAS
===================== */
.cuotas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 30px;
    padding: .3rem .7rem;
    font-weight: 700;
    font-size: .85rem;
    border-radius: 8px;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

.cuota-ok {
    background: rgba(0, 230, 118, 0.18);
    color: #00e676;
}

.cuota-warn {
    background: rgba(255, 193, 7, 0.22);
    color: #ffc107;
}

.cuota-alert {
    background: rgba(255, 152, 0, 0.25);
    color: #ff9800;
}

.cuota-danger {
    background: rgba(244, 67, 54, 0.28);
    color: #f44336;
}

/* =====================
   MODAL
===================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(15, 20, 35, 0.98);
    margin: 2% auto;
    padding: 2rem;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: slideIn 0.2s ease;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scrollbar del modal */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 6px;
}

.modal-close,
.btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover,
.btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-content h2 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    font-size: 1.5rem;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detalle-item {
    display: flex;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detalle-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detalle-value {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Filas clickables */
.fila-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.fila-clickable:hover {
    background: rgba(79, 195, 247, 0.08) !important;
}

/* =====================
   OBSERVACIONES
===================== */
.observaciones-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-glass);
}

.observaciones-section h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 600;
}

.observaciones-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.observacion-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.875rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.observacion-box:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
}

.observacion-box h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.observacion-box .obs-text {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
}

/* Scrollbar personalizado para observaciones */
.obs-text::-webkit-scrollbar {
    width: 4px;
}

.obs-text::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.obs-text::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Zona de acciones en el modal */
.acciones-modal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-observacion {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    width: 100%;
}

.btn-observacion:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Zona para acciones personalizadas (WhatsApp, etc) */
.acciones-personalizadas {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zona-acciones-futuras {
    padding: 1rem;
    background: rgba(79, 195, 247, 0.05);
    border: 1px dashed var(--border-glass);
    border-radius: 8px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Botón de WhatsApp (ejemplo para futuro) */
.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* Modal de observación */
.modal-observacion .modal-content {
    max-width: 600px;
}

.modal-observacion textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    background: rgba(20, 25, 40, 0.95);
    color: var(--text-main);
    margin-bottom: 1rem;
}

.modal-observacion textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-guardar,
.btn-cancelar {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-guardar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-guardar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-cancelar {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.btn-cancelar:hover {
    background: rgba(255, 255, 255, 0.15);
}

.obs-info {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* =====================
   PANEL SOLICITADOS (RENTAS)
===================== */
.solicitados-panel {
    display: none; /* Oculto por defecto, se muestra solo para rentas/tribunal */
    background: rgba(15, 20, 35, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 320px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    position: sticky;
    top: 2rem;
}

.solicitados-container h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lista-solicitados {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.expediente-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s;
}

.expediente-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.exp-numero {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
}

.exp-deuda {
    font-weight: 600;
    color: var(--danger);
    font-size: 0.9rem;
}

.exp-info {
    margin-bottom: 0.75rem;
}

.exp-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.exp-nombre {
    color: var(--text-main);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.8rem !important;
}

/* =====================
   SELECCIÓN MÚLTIPLE
===================== */
.seleccion-multiple {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#contador-seleccionados {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
}

.btn-confirmar-seleccion {
    background: white;
    color: #f59e0b;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-confirmar-seleccion:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.checkbox-seleccion {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
    transform: scale(1.2);
}

.badge-seleccionado {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.action-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.botones-adicionales {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* =====================
   BOTONES DE ACCIÓN
===================== */
.btn-accion {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-solicitar {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
}

.btn-solicitar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4);
}

.btn-tomar {
    width: 100%;
    background: var(--success);
    color: white;
}

.btn-tomar:hover {
    background: #00c853;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 230, 118, 0.4);
}

.btn-finalizar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-finalizar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* =====================
   BADGES DE ESTADO
===================== */
.estado-badge {
    padding: 0.4rem 0.85rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.estado-solicitado {
    background: rgba(79, 195, 247, 0.15);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.estado-en-proceso {
    background: rgba(255, 193, 7, 0.15);
    color: #ffa000;
    border: 1px solid #ffa000;
}

.estado-en-tribunal {
    background: rgba(124, 77, 255, 0.15);
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.estado-finalizado {
    background: rgba(0, 230, 118, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

/* =====================
   NOTIFICACIONES
===================== */
.notificaciones-audio {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.btn-activar-audio {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-activar-audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-activar-audio:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 1200px) {
    .solicitados-panel {
        width: 280px;
    }
    
    .filters-panel {
        width: 280px;
    }
}

@media (max-width: 968px) {
    .container {
        flex-direction: column;
    }
    
    .solicitados-panel {
        width: 100%;
        max-height: 400px;
        order: -1;
        position: static;
    }
    
    .data-panel {
        width: 100%;
    }
    
    .filters-panel {
        width: 100%;
        position: static;
    }
    
    /* Ocultar botón de reporte en móviles */
    .btn-reporte {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .header-content {
        gap: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        background: rgba(255,255,255,.05);
        border-radius: 14px;
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: 0 10px 25px rgba(0,0,0,.3);
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .6rem 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
        font-size: .85rem;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: .7rem;
        letter-spacing: .8px;
    }

    .cuotas {
        margin-left: 0;
        margin-top: 0;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 1.5rem;
        max-height: 95vh;
    }
    
    .seleccion-multiple {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }
    
    .btn-confirmar-seleccion {
        width: 100%;
    }
    
    .action-cell {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .observaciones-section {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .observacion-box {
        padding: 0.75rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn-guardar,
    .btn-cancelar {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.3rem;
    }

    .data-table {
        font-size: .8rem;
    }
}
