/* ===== DISEÑO FUTURISTA PROFESIONAL - SISTEMA TRIBUNAL ===== */

/* Reset y Variables */
:root {
    --primary-blue: #4a90e2;
    --primary-slate: #5a6c7d;
    --primary-steel: #6b7f94;
    --secondary-blue: #3a6da3;
    --accent-teal: #5fbaa7;
    --accent-amber: #d4a574;
    --accent-coral: #c77a6a;
    --dark-bg: #0f1419;
    --darker-bg: #0a0d11;
    --card-bg: rgba(20, 28, 38, 0.95);
    --border-glow: rgba(74, 144, 226, 0.2);
    --text-light: #e8ecf1;
    --text-muted: #8997a8;
    --success: #5fbaa7;
    --warning: #d4a574;
    --danger: #c77a6a;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f1419 0%, #1a2028 50%, #0f1419 100%);
    color: var(--text-light);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(20, 30, 60, 0.95) 100%);
    padding: 40px;
    text-align: center;
    border: 2px solid var(--border-glow);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

header h1 {
    font-family: 'Inter', sans-serif;
    font-size: 3em;
    font-weight: 900;
    background: linear-gradient(135deg, #4a90e2, #5a6c7d, #6b7f94);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    color: var(--text-light);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

.header-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), var(--primary-slate), transparent);
    margin-top: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 40, 70, 0.95) 100%);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 30px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.stat-primary { border-color: var(--primary-blue); }
.stat-secondary { border-color: var(--primary-slate); }
.stat-tertiary { border-color: var(--accent-teal); }
.stat-gold { border-color: var(--accent-amber); }

.stat-icon {
    font-size: 3em;
    flex-shrink: 0;
}

.stat-primary .stat-icon { color: var(--primary-blue); }
.stat-secondary .stat-icon { color: var(--primary-slate); }
.stat-tertiary .stat-icon { color: var(--accent-teal); }
.stat-gold .stat-icon { color: var(--accent-amber); }

.stat-content {
    flex: 1;
    text-align: left;
}

.stat-number {
    display: block;
    font-family: 'Roboto Mono', monospace;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-light);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 0.95em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.search-panel {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 40, 70, 0.95) 100%);
    border: 2px solid var(--primary-blue);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.search-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(90, 108, 125, 0.1) 100%);
    padding: 20px 30px;
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 20px 20px 0 0;
}

.search-header h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.search-content {
    padding: 30px;
}

.search-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-field label {
    font-weight: 600;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85em;
}

.input-field {
    background: rgba(10, 14, 39, 0.7);
    border: 2px solid rgba(74, 144, 226, 0.25);
    border-radius: 12px;
    padding: 12px 18px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    font-weight: 500;
    outline: none;
}

.input-field:focus {
    border-color: var(--primary-blue);
    background: rgba(10, 14, 39, 0.9);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.search-actions {
    display: flex;
    gap: 10px;
}

.btn-filter, .btn-clear {
    padding: 12px 25px;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-filter {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
}

.btn-filter:hover { opacity: 0.9; }

.btn-clear {
    background: linear-gradient(135deg, var(--danger), var(--accent-coral));
    color: white;
}

.btn-clear:hover { opacity: 0.9; }

.filter-stats {
    text-align: center;
    padding: 12px;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 10px;
}

.filter-badge {
    font-size: 1em;
    font-weight: 600;
    color: var(--primary-blue);
}

.data-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.persona-group {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 40, 70, 0.95) 100%);
    border: 2px solid var(--border-glow);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.persona-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(90, 108, 125, 0.1) 100%);
    border-bottom: 2px solid var(--border-glow);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.persona-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.persona-dni {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--primary-blue);
    padding: 5px 15px;
}

.persona-nombre {
    font-size: 1.2em;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 1px;
}

.persona-stats {
    display: flex;
    gap: 12px;
}

.badge-count, .badge-total {
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95em;
}

.badge-count {
    background: rgba(74, 144, 226, 0.15);
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.badge-total {
    background: rgba(74, 144, 226, 0.25);
    border: 2px solid var(--primary-blue);
    color: var(--text-light);
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
}

.codigo-group {
    margin: 20px;
}

.codigo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(74, 144, 226, 0.06);
    border-left: 3px solid var(--primary-blue);
    border-radius: 8px;
    margin-bottom: 15px;
}

.codigo-label {
    font-size: 1.1em;
    color: var(--text-light);
    font-weight: 600;
}

.codigo-label strong {
    color: var(--primary-blue);
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1em;
}

.codigo-count {
    font-size: 0.9em;
    color: var(--text-light);
    padding: 6px 14px;
    background: rgba(74, 144, 226, 0.12);
    border: 1px solid var(--primary-blue);
    border-radius: 12px;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    margin: 0 10px 10px 10px;
    border-radius: 10px;
}

.cyber-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(10, 14, 39, 0.4);
}

.cyber-table thead {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.15) 0%, rgba(90, 108, 125, 0.15) 100%);
}

.cyber-table thead th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
    color: var(--primary-blue);
    border-bottom: 2px solid var(--border-glow);
    white-space: nowrap;
}

.cyber-table tbody tr {
    border-bottom: 1px solid rgba(74, 144, 226, 0.08);
}

.cyber-table tbody tr:hover {
    background: rgba(74, 144, 226, 0.06);
}

.cyber-table tbody td {
    padding: 15px;
    font-size: 0.95em;
    color: var(--text-light);
}

.uts-value {
    font-family: 'Roboto Mono', monospace;
    color: var(--primary-slate);
    font-weight: 600;
}

.importe-cyber {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text-light);
}

.fecha-cell {
    color: var(--accent-amber);
    font-weight: 600;
}

.badge-cuota {
    background: rgba(90, 108, 125, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    border: 2px solid var(--primary-slate);
    color: var(--primary-slate);
    display: inline-block;
}

.badge-dias {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    display: inline-block;
}

.badge-normal {
    background: rgba(95, 186, 167, 0.15);
    border: 2px solid var(--success);
    color: var(--success);
}

.badge-alerta {
    background: rgba(212, 165, 116, 0.15);
    border: 2px solid var(--warning);
    color: var(--warning);
}

.badge-critico {
    background: rgba(199, 122, 106, 0.15);
    border: 2px solid var(--danger);
    color: var(--danger);
}

.nivel-critico {
    background: rgba(199, 122, 106, 0.05);
    border-left: 3px solid var(--danger);
}

.nivel-alerta {
    background: rgba(212, 165, 116, 0.05);
    border-left: 3px solid var(--warning);
}

.detalle {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

.oficina {
    color: var(--text-muted);
    font-size: 0.9em;
}

.highlight-match {
    background: rgba(74, 144, 226, 0.12) !important;
    border-left: 3px solid var(--primary-blue);
}

.no-data {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 40, 70, 0.95) 100%);
    border: 2px solid var(--border-glow);
    border-radius: 20px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.no-data-icon {
    font-size: 5em;
    color: var(--success);
    margin-bottom: 20px;
}

.no-data p {
    font-size: 1.5em;
    color: var(--text-light);
    letter-spacing: 1px;
    font-weight: 600;
}

footer {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 40, 70, 0.95) 100%);
    border: 2px solid var(--border-glow);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.footer-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), var(--primary-slate), transparent);
    margin-bottom: 15px;
}

footer p {
    color: var(--text-light);
    font-size: 0.95em;
    letter-spacing: 1px;
    font-weight: 500;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-slate));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-slate), var(--primary-steel));
}

@media (max-width: 1200px) {
    .cyber-table {
        font-size: 0.9em;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 25px 20px;
    }
    
    header h1 {
        font-size: 2em;
        letter-spacing: 2px;
    }
    
    .subtitle {
        font-size: 1em;
        letter-spacing: 1px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        font-size: 2.5em;
    }
    
    .stat-number {
        font-size: 2em;
    }
    
    .search-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-filter, .btn-clear {
        width: 100%;
        justify-content: center;
    }
    
    .persona-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .persona-stats {
        flex-direction: column;
        width: 100%;
    }
    
    .badge-count, .badge-total {
        width: 100%;
        text-align: center;
    }
    
    .codigo-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .cyber-table thead th,
    .cyber-table tbody td {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }
    
    .persona-dni {
        font-size: 1.1em;
    }
    
    .persona-nombre {
        font-size: 1em;
    }
    
    .search-header h2 {
        font-size: 1.2em;
    }
}

/* Estilos para el botón de selección */
.btn-seleccionar {
    padding: 10px 20px;
    border: 2px solid var(--primary-blue);
    border-radius: 10px;
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-blue);
    font-family: 'Inter', sans-serif;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.btn-seleccionar:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: var(--primary-blue);
}

.btn-seleccionar.seleccionado {
    background: linear-gradient(135deg, var(--accent-teal), var(--success));
    border-color: var(--success);
    color: white;
}

.btn-seleccionar.seleccionado:hover {
    opacity: 0.9;
}

.btn-seleccionar .check-icon {
    font-size: 1.2em;
    font-weight: bold;
}

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

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95em;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, var(--accent-teal), var(--success));
    color: white;
    border: 2px solid var(--success);
}

.notification-error {
    background: linear-gradient(135deg, var(--danger), var(--accent-coral));
    color: white;
    border: 2px solid var(--danger);
}

/* Responsive para el botón de selección */
@media (max-width: 768px) {
    .btn-seleccionar,
    .btn-observacion-persona {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .persona-stats {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
}

/* Estilos para el botón de observación en persona */
.btn-observacion-persona {
    background: linear-gradient(135deg, var(--accent-amber), var(--warning));
    border: 2px solid var(--accent-amber);
    border-radius: 10px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.9em;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.btn-observacion-persona:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 165, 116, 0.4);
}

/* Estilos para el modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: linear-gradient(135deg, rgba(20, 28, 38, 0.98) 0%, rgba(30, 40, 70, 0.98) 100%);
    border: 2px solid var(--border-glow);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-glow);
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(90, 108, 125, 0.1) 100%);
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-light);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.modal-body {
    padding: 30px;
}

.modal-info {
    background: rgba(74, 144, 226, 0.05);
    border-left: 3px solid var(--primary-blue);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 8px;
}

.modal-info p {
    margin: 5px 0;
    color: var(--text-light);
    font-size: 0.95em;
}

.modal-info strong {
    color: var(--primary-blue);
    margin-right: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.modal-input {
    width: 100%;
    background: rgba(10, 14, 39, 0.7);
    border: 2px solid rgba(74, 144, 226, 0.25);
    border-radius: 10px;
    padding: 12px 18px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    outline: none;
    transition: all 0.2s ease;
}

.modal-input:focus {
    border-color: var(--primary-blue);
    background: rgba(10, 14, 39, 0.9);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.modal-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Inter', sans-serif;
}

.form-hint {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.85em;
    font-style: italic;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid var(--border-glow);
}

.btn-modal-cancel,
.btn-modal-save {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.btn-modal-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--text-muted);
    color: var(--text-light);
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-modal-save {
    background: linear-gradient(135deg, var(--accent-teal), var(--success));
    border: 2px solid var(--success);
    color: white;
}

.btn-modal-save:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(95, 186, 167, 0.3);
}

.btn-modal-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive para modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.2em;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-modal-cancel,
    .btn-modal-save {
        width: 100%;
    }
}
