/* ============================================================================
   VARIABLES CSS
   ============================================================================ */

:root {
    /* Colores principales - Esquema Yape */
    --primary-color: #722F8E;
    --primary-dark: #5A2470;
    --primary-light: #faf7fb;
    --primary-gradient: linear-gradient(135deg, #722F8E 0%, #5A2470 100%);
    --secondary-gradient: linear-gradient(135deg, #722F8E 0%, #5A2470 100%);
    
    /* Colores de texto */
    --text-dark: #0f172a;
    --text-medium: #475569;
    --text-light: #64748b;
    
    /* Colores de fondo */
    --background-color: #f8fafc;
    --background-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --card-background: #ffffff;
    --card-gradient: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    --border-color: #e2e8f0;
    
    /* Colores de estado */
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #7B1FA2;
    
    /* Sombras empresariales */
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 25px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.16);
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.4s ease;
}

/* ============================================================================
   RESET Y BASE
   ============================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Utilidad para ocultar elementos */
.hidden { 
    display: none !important; 
}

/* Clase para lectores de pantalla */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================================
   HEADER Y NAVEGACIÓN
   ============================================================================ */

.app-header {
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
    padding: 0;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(15, 23, 42, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(106, 27, 154, 0.1);
    backdrop-filter: blur(20px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.logo-container {
    width: 48px;
    height: 48px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.nav-logo { 
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.user-menu { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
}

/* ============================================================================
   BADGE DE DÍAS RESTANTES
   ============================================================================ */

.days-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #6A1B9A 0%, #8E24AA 100%);
    border: 2px solid rgba(106, 27, 154, 0.3);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    box-shadow: 
        0 8px 25px rgba(106, 27, 154, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.5s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.days-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.days-badge:hover::before {
    left: 100%;
}

.days-badge:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 35px rgba(106, 27, 154, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(106, 27, 154, 0.5);
}

.days-badge svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.days-badge.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 
        0 8px 25px rgba(245, 158, 11, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.days-badge.warning:hover {
    box-shadow: 
        0 12px 35px rgba(245, 158, 11, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(245, 158, 11, 0.5);
}

.days-badge.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 
        0 8px 25px rgba(16, 185, 129, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.days-badge.success:hover {
    box-shadow: 
        0 12px 35px rgba(16, 185, 129, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   MENÚ DROPDOWN
   ============================================================================ */

.dropdown { 
    position: relative; 
}

.menu-button {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    color: var(--text-medium);
    width: 44px;
    height: 44px;
}

.menu-button:hover,
.menu-button:focus-visible { 
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    outline: none;
}

.dropdown-content {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background-color: var(--card-background);
    min-width: 220px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 8px;
    border: 1px solid var(--border-color);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-email-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.user-email-info svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    font-weight: 500;
}

.dropdown-content a:hover,
.dropdown-content a:focus-visible { 
    background-color: var(--background-color);
    color: var(--primary-color);
    transform: translateX(4px);
    outline: none;
}

.dropdown-content a.logout-link:hover,
.dropdown-content a.logout-link:focus-visible {
    background-color: #fef2f2;
    color: var(--danger-color);
}

.dropdown-content a svg {
    flex-shrink: 0;
}

/* ============================================================================
   LAYOUT PRINCIPAL
   ============================================================================ */

.main-container {
    min-height: 100vh;
}

.app-view {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* ============================================================================
   PANTALLA DE LOGIN
   ============================================================================ */

.login-view {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(135deg, #6A1B9A 0%, #8E24AA 25%, #AB47BC 50%, #BA68C8 75%, #CE93D8 100%);
    position: relative;
    overflow: hidden;
}

.login-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(106, 27, 154, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(142, 36, 170, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(171, 71, 188, 0.2) 0%, transparent 50%);
}

.login-view::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 56px 48px;
    border-radius: 28px;
    box-shadow: 
        0 32px 80px rgba(106, 27, 154, 0.25),
        0 12px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-align: center;
    max-width: 480px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeInUp 0.8s ease;
    position: relative;
    z-index: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.login-logo-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.login-card:hover .login-logo-container::before {
    left: 100%;
}

.login-logo { 
    width: 80px;
    height: 80px;
    object-fit: contain;
    z-index: 1;
    position: relative;
}

.login-title { 
    font-weight: 800;
    font-size: 2.25rem;
    margin: 0 0 16px 0;
    color: var(--text-dark);
    font-family: 'Nunito', 'Poppins', sans-serif;
    letter-spacing: -0.02em;
}

.login-subtitle { 
    color: var(--text-medium);
    margin: 0 0 40px 0;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.6;
}

/* Botón de login con Google */
#login-button {
    width: 100%;
    padding: 18px 32px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
    background: linear-gradient(135deg, #6A1B9A 0%, #8E24AA 100%);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Nunito', 'Poppins', sans-serif;
    box-shadow: 
        0 8px 25px rgba(106, 27, 154, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

#login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#login-button:hover::before {
    left: 100%;
}

#login-button:hover,
#login-button:focus-visible {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(106, 27, 154, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    outline: none;
}

#login-button:active {
    transform: translateY(-1px);
    box-shadow: 
        0 8px 25px rgba(106, 27, 154, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#login-button svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ============================================================================
   TARJETAS DE ESTADO DEL SISTEMA
   ============================================================================ */

.system-status-container {
    margin-bottom: 8px;
}

.status-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 12px 0;
}

.status-cards-row {
    display: flex;
    gap: 12px;
}

.status-card-mini {
    flex: 1;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.status-card-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(106, 27, 154, 0.03), transparent);
    transition: left 0.8s ease;
}

.status-card-mini:hover::before {
    left: 100%;
}

.status-card-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(106, 27, 154, 0.02);
    transition: left 0.6s ease;
}

.status-card-mini:hover::before {
    left: 100%;
}

.status-card-mini:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #6A1B9A;
}

.status-card-clickable {
    cursor: pointer;
}

.status-card-clickable:hover {
    background-color: #F9F9F9;
}

.status-info-mini {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.status-label-mini {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value-mini {
    font-size: 13px;
    color: #6b7280;
    line-height: 1;
    font-weight: 500;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: relative;
}

.status-dot::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.2;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.15); opacity: 0.05; }
}

.status-dot-green {
    background: #10b981;
}

.status-dot-red {
    background: #ef4444;
}

.share-icon {
    color: #6E9C72;
    flex-shrink: 0;
}

.status-card-warning {
    border: 1px solid #fef3c7;
}

.status-card-warning:hover {
    background-color: #fffbeb;
    border-color: #fde68a;
}

.status-card-warning svg {
    color: #f59e0b;
    flex-shrink: 0;
}

/* ============================================================================
   HEADER DE TRANSACCIONES
   ============================================================================ */

.transactions-header { 
    margin-top: 32px;
    margin-bottom: 8px;
    padding: 0 0 0 0;
}

.transactions-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.transactions-header .subtitle {
    font-size: 14px;
    color: var(--text-medium);
    margin: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 24px;
}

#user-greeting {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-medium);
    margin: 0 0 4px 0;
}

.transactions-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

/* ============================================================================
   FILA DE BÚSQUEDA (NUEVA)
   ============================================================================ */

.search-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.filter-button {
    background: linear-gradient(135deg, #6A1B9A 0%, #8E24AA 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(106, 27, 154, 0.35);
}

.mobile-date-filter {
    width: 44px;
    height: 44px;
    background: #6A1B9A;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(106, 27, 154, 0.2);
    flex-shrink: 0;
}

.mobile-date-filter:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.3);
}

.date-filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(12px);
}

.date-filter-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

.date-filter-content::before {
    display: none;
}

.date-filter-content h3 {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.date-filter-content .filter-icon {
    width: 32px;
    height: 32px;
    background: #6A1B9A;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.date-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    background: white;
    color: #1a1a1a;
}

.date-input::-webkit-calendar-picker-indicator {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%236A1B9A" stroke-width="2.5"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat;
    background-size: 20px 20px;
    cursor: pointer;
    opacity: 1;
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 4px rgba(106, 27, 154, 0.2));
}

.date-input::-webkit-calendar-picker-indicator:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(106, 27, 154, 0.3));
    transition: all 0.2s ease;
}

/* Estilos para el calendario nativo */
.date-input {
    color-scheme: light;
}

.date-input::-webkit-datetime-edit {
    color: #1a1a1a;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 6px;
}

.date-input::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
    background: rgba(106, 27, 154, 0.03);
    border-radius: 8px;
    padding: 4px 8px;
}

.date-input::-webkit-datetime-edit-text {
    color: #6A1B9A;
    padding: 0 2px;
    font-weight: 500;
}

.date-input::-webkit-datetime-edit-month-field,
.date-input::-webkit-datetime-edit-day-field,
.date-input::-webkit-datetime-edit-year-field {
    background: rgba(106, 27, 154, 0.08);
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 1px;
    color: #6A1B9A;
    font-weight: 700;
    border: 1px solid rgba(106, 27, 154, 0.1);
    transition: all 0.2s ease;
}

.date-input::-webkit-datetime-edit-month-field:focus,
.date-input::-webkit-datetime-edit-day-field:focus,
.date-input::-webkit-datetime-edit-year-field:focus {
    background: rgba(106, 27, 154, 0.15);
    border-color: #6A1B9A;
    outline: none;
    box-shadow: 0 0 0 2px rgba(106, 27, 154, 0.1);
}

.date-input:focus {
    outline: none;
    border-color: #6A1B9A;
    box-shadow: 0 0 0 4px rgba(106, 27, 154, 0.1), 0 8px 25px rgba(106, 27, 154, 0.15);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.95);
}

.date-filter-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.date-filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.date-filter-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.date-filter-btn-cancel:hover {
    background: #e5e7eb;
}

.date-filter-btn-apply {
    background: #6A1B9A;
    color: white;
}

.date-filter-btn-apply:hover {
    background: #5A2470;
}

.date-separator {
    margin: 40px 0 24px 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    position: relative;
}

.date-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e5e7eb 20%, #e5e7eb 80%, transparent 100%);
    z-index: 1;
}

.date-separator h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.date-separator .date-label {
    background: #f8fafc;
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.date-separator .transaction-count {
    background: #6A1B9A;
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* ============================================================================
   BUSCADOR
   ============================================================================ */

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6A1B9A;
    pointer-events: none;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 56px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    background-color: #ffffff;
    color: var(--text-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.search-input:focus {
    outline: none;
    border-color: #6A1B9A;
    box-shadow: 0 0 0 4px rgba(106, 27, 154, 0.1), 0 8px 25px rgba(106, 27, 154, 0.15);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* ============================================================================
   INDICADOR DE TIEMPO REAL
   ============================================================================ */

.realtime-indicator-mini {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: #d1fae5;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--success-color);
    animation: fadeIn 0.5s ease;
    white-space: nowrap;
    margin-left: auto;
}

.realtime-dot-mini {
    width: 6px;
    height: 6px;
    background-color: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================================================
   LISTA DE TRANSACCIONES
   ============================================================================ */

.transactions-list-container {
    display: block;
    gap: 0;
    padding-bottom: 32px;
}

.date-group {
    margin-bottom: 40px;
}

.date-group:last-child {
    margin-bottom: 0;
}

.date-group .transactions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.transaction-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.02),
        0 8px 24px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.transaction-card::before {
    display: none;
}

.transaction-card.card-new {
    background: linear-gradient(135deg, #6A1B9A 0%, #8E24AA 100%);
    color: white;
    border: 2px solid #6A1B9A;
    box-shadow: 
        0 8px 32px rgba(106, 27, 154, 0.25),
        0 4px 16px rgba(106, 27, 154, 0.15);
    position: relative;
    overflow: hidden;
}

.transaction-card.card-new::after {
    content: 'NUEVO';
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FF6B35;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    animation: newBadgePulse 2s ease-in-out infinite;
}

@keyframes newBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.transaction-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.04),
        0 16px 32px rgba(0, 0, 0, 0.08);
    border-color: rgba(106, 27, 154, 0.15);
}

.transaction-card.card-new .card-name {
    color: white;
}

.transaction-card.card-new .card-amount {
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.transaction-card.card-new .label {
    color: rgba(255, 255, 255, 0.8);
}

.transaction-card.card-new .fecha-value {
    color: rgba(255, 255, 255, 0.9);
}

.transaction-card.card-new .card-code {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.transaction-card.card-new .yapeo-badge {
    color: #FFD700;
}

.transaction-card.card-new::before {
    display: none;
}

.transaction-card.card-new:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 16px 48px rgba(106, 27, 154, 0.35),
        0 8px 24px rgba(106, 27, 154, 0.25);
}

/* Nombre del Cliente */
.card-name { 
    font-weight: 700; 
    font-size: 22px; 
    color: #0a0a0a;
    margin-bottom: 28px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

/* Badge Yape */
.yapeo-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6A1B9A;
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 28px;
    letter-spacing: -0.05em;
    font-family: 'Nunito', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    text-align: center;
    width: 100%;
    text-transform: none;
}



/* Línea 2: Monto y Estado */
.card-row-monto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.monto-label-value {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.label {
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 400;
}

.card-amount { 
    font-weight: 900; 
    font-size: 24px; 
    color: #6A1B9A;
    font-variant-numeric: tabular-nums;
    font-family: 'Nunito', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.05em;
}

/* Línea 3: Fecha */
.card-row-fecha {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.fecha-value {
    font-size: 13px;
    color: var(--text-medium);
}

/* Línea 4: Código y NUEVA */
.card-row-codigo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-code { 
    flex: 1;
    font-size: 13px; 
    color: #6b7280;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.02);
    padding: 18px 22px;
    border-radius: 20px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-code:hover {
    background: rgba(106, 27, 154, 0.04);
    border-color: rgba(106, 27, 154, 0.2);
    transform: translateY(-1px);
}

/* Badge NUEVA */
.new-badge {
    background: #0a0a0a;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 100px;
    white-space: nowrap;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Estados de parseo */
.parse-status { font-size: 11px; font-weight: 700; padding: 8px 12px; border-radius: 20px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

.parse-parcial { background: linear-gradient(135deg, #FFF3CD 0%, #FFE69C 100%); color: #856404; border: 2px solid #FFE69C; box-shadow: 0 2px 8px rgba(133, 100, 4, 0.15); transition: all 0.3s ease; }

.parse-pendiente { background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%); color: #7B1FA2; border: 2px solid #E1BEE7; box-shadow: 0 2px 8px rgba(123, 31, 162, 0.15); transition: all 0.3s ease; }

.parse-alternativo { background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%); color: #1976D2; border: 2px solid #BBDEFB; box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15); transition: all 0.3s ease; }

/* Badges de formato */
.formato-badge { font-size: 10px; font-weight: 700; padding: 6px 10px; border-radius: 16px; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); transition: all 0.3s ease; }

.formato-completo {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.formato-parcial {
    background-color: #FFF3CD;
    color: #856404;
}

.formato-revisado {
    background-color: #E3F2FD;
    color: #1976D2;
}

.formato-auto {
    background-color: #F3E5F5;
    color: #7B1FA2;
}

/* Badges de IA */
.parse-ia-alta {
    background-color: #E8F5E9;
    color: #2E7D32;
    border: none;
}

.parse-ia-media {
    background-color: #FFF3CD;
    color: #856404;
    border: none;
}

.parse-ia-baja {
    background-color: #FFEBEE;
    color: #C62828;
    border: none;
}

.formato-ai {
    background-color: #E3F2FD;
    color: #1976D2;
    font-weight: 700;
}

/* Contenedor de badges */
.card-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* Sección de datos técnicos */
.technical-data-section {
    margin-top: 12px;
}

.tech-toggle { background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%); border: 2px solid #E1BEE7; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #7B1FA2; font-weight: 700; cursor: pointer; padding: 10px 16px; border-radius: 20px; transition: all 0.3s ease; width: 100%; justify-content: center; box-shadow: 0 2px 8px rgba(123, 31, 162, 0.15); }

.tech-toggle:hover {
    color: #6A1B9A;
}

.tech-content {
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    font-size: 11px;
}

.tech-item {
    margin-bottom: 6px;
    color: #374151;
}

.tech-subitem {
    margin-left: 12px;
    margin-bottom: 4px;
    color: #6b7280;
}

.tech-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-size: 10px;
}

.card-status { 
    font-size: 0.7rem; 
    font-weight: 700; 
    padding: 5px 10px; 
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Estados de transacciones */
.status-enviado { 
    background: #E8F5E9; 
    color: #2E7D32;
    border: none;
    font-weight: 600;
}

.status-pendiente { 
    background-color: #FFF3CD; 
    color: #856404;
    border: none;
}

.status-error { 
    background-color: #FFEBEE; 
    color: #C62828;
    border: none;
}

.status-enviando, 
.status-reenviando { 
    background-color: #F3E5F5; 
    color: #7B1FA2;
    border: none;
}

/* Mensajes de estado */
.transactions-list-container > p {
    text-align: center;
    color: var(--text-light);
    padding: 64px 24px;
    font-size: 1.125rem;
}



/* ============================================================================
   BOTÓN FLOTANTE DE WHATSAPP
   ============================================================================ */

.whatsapp-float {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    color: white;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 12px 35px rgba(37, 211, 102, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all var(--transition-base);
    z-index: 1000;
    text-decoration: none;
    animation: float 3s ease-in-out infinite;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.whatsapp-float:hover {
    transform: translateY(-6px) scale(1.1);
    box-shadow: 
        0 20px 50px rgba(37, 211, 102, 0.6),
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.whatsapp-float:active {
    transform: translateY(-2px) scale(1.05);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* ============================================================================
   SCROLLBAR PERSONALIZADO
   ============================================================================ */

::-webkit-scrollbar { 
    width: 10px; 
}

::-webkit-scrollbar-track { 
    background: var(--background-color); 
}

::-webkit-scrollbar-thumb { 
    background: var(--border-color); 
    border-radius: 5px; 
}

::-webkit-scrollbar-thumb:hover { 
    background: var(--text-light); 
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .status-cards-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .status-card-mini {
        padding: 12px;
        border-radius: 8px;
        gap: 10px;
    }
    
    .status-info-mini {
        gap: 3px;
    }
    
    .status-label-mini {
        font-size: 11px;
        letter-spacing: 0.3px;
    }
    
    .status-value-mini {
        font-size: 10px;
    }
    
    .status-dot {
        width: 8px;
        height: 8px;
    }
    
    .status-dot::before {
        top: -1px;
        left: -1px;
        right: -1px;
        bottom: -1px;
    }
    
    .navbar {
        height: 64px;
        padding: 0 16px;
    }
    
    .nav-brand {
        font-size: 1.25rem;
    }
    
    .logo-container {
        width: 40px;
        height: 40px;
    }
    
    .nav-logo {
        height: 32px;
        width: 32px;
    }

    .user-menu {
        gap: 8px;
    }

    .days-badge {
        padding: 6px 10px;
        font-size: 0.75rem;
        gap: 6px;
    }

    .days-badge svg {
        width: 14px;
        height: 14px;
    }
    
    .app-view {
        padding: 24px 16px;
    }
    
    .transactions-header h2 {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .realtime-indicator {
        justify-content: center;
    }
    
    .transaction-card {
        padding: 16px;
    }

    .transaction-card.latest::after {
        bottom: 16px;
        right: 16px;
        font-size: 0.6rem;
        padding: 3px 8px;
    }
    
    .card-name, 
    .card-amount {
        font-size: 1rem;
    }
    
    .login-card {
        padding: 40px 32px;
        border-radius: 24px;
    }
    
    .login-logo-container {
        width: 100px;
        height: 100px;
        margin: 0 auto 24px;
    }
    
    .login-logo {
        width: 64px;
        height: 64px;
    }
    
    .login-title {
        font-size: 1.875rem;
    }
    
    .login-subtitle {
        font-size: 1rem;
        margin-bottom: 32px;
    }
    
    #login-button {
        padding: 16px 28px;
        font-size: 15px;
    }
    
    .dropdown-content {
        min-width: 200px;
    }

    .whatsapp-float {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float svg {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 480px) {
    .status-cards-row {
        display: flex;
        flex-direction: row;
        gap: 6px;
    }
    
    .status-card-mini {
        padding: 6px 8px;
        border-radius: 6px;
        gap: 4px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-height: 50px;
        flex: 1;
    }
    
    .status-info-mini {
        gap: 1px;
        align-items: center;
    }
    
    .status-label-mini {
        font-size: 8px;
        letter-spacing: 0.1px;
    }
    
    .status-value-mini {
        font-size: 7px;
    }
    
    .status-dot {
        width: 5px;
        height: 5px;
        order: -1;
    }
    
    .status-dot::before {
        display: none;
    }
    
    .realtime-indicator-mini {
        display: none;
    }
    
    .search-row {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .filter-button {
        display: none;
    }
    
    .search-container {
        max-width: none;
        flex: 1;
    }
    
    .mobile-date-filter {
        display: flex !important;
    }
    
    .date-group .transactions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .transaction-card {
        padding: 12px;
        border-radius: 12px;
        margin-bottom: 8px;
    }
    
    .card-name {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .yapeo-badge {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .card-amount {
        font-size: 20px;
    }
    
    .card-code {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .label {
        font-size: 12px;
    }
    
    .fecha-value {
        font-size: 11px;
    }
    
    .login-view {
        padding: 16px;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: 20px;
        max-width: 100%;
    }
    
    .login-logo-container {
        width: 80px;
        height: 80px;
        margin: 0 auto 20px;
    }
    
    .login-logo {
        width: 48px;
        height: 48px;
    }
    
    .login-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .login-subtitle {
        font-size: 0.9rem;
        margin-bottom: 28px;
    }
    
    #login-button {
        padding: 14px 24px;
        font-size: 14px;
        border-radius: 12px;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .transactions-list-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .transactions-list-container {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

/* ============================================================================
   ACCESIBILIDAD - MODO REDUCCIÓN DE MOVIMIENTO
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   ALERTA FLOTANTE DE DISPOSITIVO OFFLINE
   ============================================================================ */

.offline-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(8px);
}

.offline-alert-content {
    background: linear-gradient(135deg, #6A1B9A 0%, #8E24AA 100%);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(106, 27, 154, 0.4);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-icon-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.alert-emoji {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.alert-icon-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.detail-emoji {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.offline-alert-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.alert-message {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 32px 0;
    line-height: 1.6;
    font-weight: 500;
}

.alert-details {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-detail-item {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 12px;
    text-align: center;
}

.alert-detail-item:last-child {
    margin-bottom: 0;
}



.alert-close-btn {
    padding: 14px 36px;
    background: #ffffff;
    color: #6A1B9A;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.alert-close-btn:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.4);
}

.alert-close-btn:active {
    transform: translateY(0);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================================
   MODALES PERSONALIZADOS
   ============================================================================ */

.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.custom-modal-content p {
    margin: 0 0 24px 0;
    font-size: 1rem;
    color: var(--text-medium);
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: 'Poppins', sans-serif;
}

.modal-btn-cancel {
    background: var(--background-color);
    color: var(--text-medium);
}

.modal-btn-cancel:hover {
    background: var(--border-color);
}

.modal-btn-confirm {
    background: var(--primary-color);
    color: white;
}

.modal-btn-confirm:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================================================
   DASHBOARD STYLES
   ============================================================================ */

.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 48px 32px;
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

.dashboard-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
}

.dashboard-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.95);
    margin: 0 0 24px 0;
    font-weight: 500;
}

.dashboard-nav {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

.nav-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.nav-btn.active:hover {
    background: rgba(255, 255, 255, 0.95);
}

.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.custom-modal-content p {
    margin: 0 0 24px 0;
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.modal-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.modal-btn-cancel:hover {
    background: #e5e7eb;
}

.modal-btn-confirm {
    background: #667eea;
    color: white;
}

.modal-btn-confirm:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.alert-modal-content {
    background: linear-gradient(135deg, #6A1B9A 0%, #8E24AA 100%);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(106, 27, 154, 0.4);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-modal-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Métricas Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.metric-card:nth-child(1) {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.metric-card:nth-child(2) {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.metric-card:nth-child(3) {
    background: linear-gradient(135deg, #45b7d1 0%, #3498db 100%);
    color: white;
}

.metric-card:nth-child(4) {
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%);
    color: white;
}

.metric-card:nth-child(5) {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: white;
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    flex-shrink: 0;
    align-self: flex-start;
}

.metric-icon svg {
    width: 24px;
    height: 24px;
}

.metric-info {
    flex: 1;
    min-width: 0;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    word-break: break-word;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

.chart-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.chart-card:nth-child(1)::before {
    background: linear-gradient(90deg, #ff6b6b, #ee5a52);
}

.chart-card:nth-child(2)::before {
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
}

.chart-card:nth-child(3)::before {
    background: linear-gradient(90deg, #45b7d1, #3498db);
}

.chart-card:nth-child(4)::before {
    background: linear-gradient(90deg, #f9ca24, #f0932b);
}

.chart-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.chart-header {
    margin-bottom: 28px;
}

.chart-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-card:nth-child(1) .chart-header h3 {
    color: #ff6b6b;
}

.chart-card:nth-child(2) .chart-header h3 {
    color: #4ecdc4;
}

.chart-card:nth-child(3) .chart-header h3 {
    color: #45b7d1;
}

.chart-card:nth-child(4) .chart-header h3 {
    color: #f9ca24;
}

.chart-header p {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 32px 20px;
        margin-bottom: 24px;
    }
    
    .dashboard-header h1 {
        font-size: 1.75rem;
    }
    
    .dashboard-subtitle {
        font-size: 0.95rem;
        margin-bottom: 16px;
    }
    
    .dashboard-nav {
        gap: 8px;
    }
    
    .nav-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }
    
    .metric-card {
        padding: 16px;
        gap: 12px;
    }
    
    .metric-icon {
        width: 40px;
        height: 40px;
    }
    
    .metric-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .metric-label {
        font-size: 0.75rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .chart-card {
        padding: 20px;
        border-radius: 16px;
    }
    
    .chart-header h3 {
        font-size: 1.1rem;
    }
    
    .chart-header p {
        font-size: 0.8rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .app-view {
        padding: 16px 12px;
    }
    
    .dashboard-header {
        padding: 24px 16px;
        border-radius: 12px;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-subtitle {
        font-size: 0.85rem;
    }
    
    .metric-card {
        padding: 14px;
        border-radius: 12px;
    }
    
    .metric-icon {
        width: 36px;
        height: 36px;
    }
    
    .metric-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .metric-value {
        font-size: 1.25rem;
    }
    
    .metric-label {
        font-size: 0.7rem;
    }
    
    .chart-card {
        padding: 16px;
    }
    
    .chart-header {
        margin-bottom: 16px;
    }
    
    .chart-header h3 {
        font-size: 1rem;
    }
    
    .chart-header p {
        font-size: 0.75rem;
    }
    
    .chart-container {
        height: 220px;
    }
}







/* Hover effects para badges */
.parse-status:hover, .formato-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tech-toggle:hover {
    background: linear-gradient(135deg, #E1BEE7 0%, #CE93D8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 31, 162, 0.25);
}

.tech-content {
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #FAFAFA 0%, #F5F5F5 100%);
    border-radius: 12px;
    border: 2px solid #E0E0E0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tech-item {
    padding: 8px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #6A1B9A;
    margin-bottom: 10px;
}

.tech-content code {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    padding: 4px 8px;
    border-radius: 6px;
    color: #1976D2;
    border: 1px solid #90CAF9;
    font-weight: 600;
}

@keyframes aiPulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(25, 118, 210, 0.2); }
    50% { box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4); }
}

.formato-ai {
    animation: aiPulse 2s ease-in-out infinite;
}


/* Botón de análisis con IA en tarjetas */
.ai-analyze-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.ai-analyze-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.5);
}

.card-row-codigo {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* Botón IA actualizado con icono */
.ai-analyze-btn {
    background: white !important;
    border: 2px solid #667eea !important;
    padding: 8px !important;
    border-radius: 50% !important;
    cursor: pointer;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2) !important;
}

.ai-analyze-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
    background: #f8f9ff !important;
}


/* ============================================================================
   PANTALLA DE CARGA
   ============================================================================ */

.loading-view {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(135deg, #E8EAF6 0%, #C5CAE9 50%, #9FA8DA 100%);
    position: relative;
    overflow: hidden;
}

.loading-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 48px 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(106, 27, 154, 0.15);
    text-align: center;
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: fadeInUp 0.6s ease;
}

.loading-logo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    animation: pulse 2s ease-in-out infinite;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #9FA8DA;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
    border-top-color: #7E57C2;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: #9575CD;
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: #B39DDB;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 0 12px 0;
    color: #5E35B1;
    font-family: 'Nunito', sans-serif;
}

.loading-subtitle {
    color: #7E57C2;
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

@media (max-width: 480px) {
    .loading-card {
        padding: 36px 28px;
    }
    
    .loading-logo-container {
        width: 60px;
        height: 60px;
    }
    
    .loading-logo {
        width: 48px;
        height: 48px;
    }
    
    .loading-spinner {
        width: 60px;
        height: 60px;
    }
    
    .loading-title {
        font-size: 1.25rem;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
    }
}


/* ============================================================================
   COLORES POR BANCO/BILLETERA DIGITAL
   ============================================================================ */

/* Yape - Morado */
.card-yape .yapeo-badge { color: #722F8E; }

/* Plin - Verde */
.card-plin .yapeo-badge { color: #00A651; }

/* Tunki - Naranja Interbank */
.card-tunki .yapeo-badge { color: #FF6B00; }

/* Lukita - Azul BCP */
.card-lukita .yapeo-badge { color: #0033A0; }

/* BCP - Azul */
.card-bcp .yapeo-badge { color: #0033A0; }

/* Interbank - Verde */
.card-interbank .yapeo-badge { color: #00A651; }

/* BBVA - Azul oscuro */
.card-bbva .yapeo-badge { color: #004481; }

/* Scotiabank - Rojo */
.card-scotiabank .yapeo-badge { color: #EC111A; }

/* BanBif - Rojo */
.card-banbif .yapeo-badge { color: #E31837; }

/* Pichincha - Amarillo */
.card-pichincha .yapeo-badge { color: #B8860B; }

/* Falabella - Verde lima */
.card-falabella .yapeo-badge { color: #7A9A1E; }

/* MiBanco - Azul claro */
.card-mibanco .yapeo-badge { color: #0072BC; }

/* Caja Arequipa - Rojo */
.card-caja-arequipa .yapeo-badge { color: #C8102E; }

/* Caja Huancayo - Azul */
.card-caja-huancayo .yapeo-badge { color: #1E3A8A; }

/* Caja Piura - Verde */
.card-caja-piura .yapeo-badge { color: #006633; }

/* Banco de la Nación - Azul marino */
.card-banco-nacion .yapeo-badge { color: #1B365D; }
.card-banco-de-la-nacion .yapeo-badge { color: #1B365D; }

/* CrediScotia - Rojo */
.card-crediscotia .yapeo-badge { color: #EC111A; }

/* Banco Ripley - Morado */
.card-banco-ripley .yapeo-badge { color: #6B2D7B; }

/* GNB - Naranja */
.card-gnb .yapeo-badge { color: #FF6600; }

/* Default/Otro - Gris */
.card-otro .yapeo-badge { color: #64748B; }
