/* ===== DESIGN SYSTEM VARIABLEs ===== */
:root {
    --primary: #0A1F44;
    --primary-light: #1A3A6A;
    --primary-dark: #061530;
    --secondary: #007D8F;
    --accent-gold: #D4AF37;
    --accent-green: #10B981;
    --accent-orange: #F97316;
    --accent-yellow: #FBBF24;
    --background: #F8F9FC;
    --surface: #FFFFFF;
    --surface-elevated: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-card: 0 4px 20px rgba(10, 31, 68, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== BASE RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===== HOME ANIMATIONS ===== */
.home-anim {
    animation: homeFadeUp 0.35s ease both;
}

.home-anim-delay-1 {
    animation-delay: 0.08s;
}

.home-anim-delay-2 {
    animation-delay: 0.16s;
}

@keyframes homeFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== WELCOME HEADER ===== */
.welcome-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.welcome-header::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.welcome-content {
    position: relative;
    z-index: 1;
    color: white;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.375rem 0;
    line-height: 1.2;
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.welcome-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    margin: 0;
    font-weight: 400;
    color: rgba(255,255,255,0.95);
}

.welcome-illustration {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.welcome-illustration svg {
    width: 100px;
    height: 100px;
}

@media (max-width: 600px) {
    .welcome-header {
        padding: 1.5rem;
        min-height: auto;
    }
    
    .welcome-title {
        font-size: 1.25rem;
    }
    
    .welcome-subtitle {
        font-size: 0.875rem;
    }
    
    .welcome-illustration {
        display: none;
    }
}

@media (min-width: 1024px) {
    .welcome-title {
        font-size: 1.75rem;
    }
    
    .welcome-subtitle {
        font-size: 1.0625rem;
    }
    
    .welcome-illustration svg {
        width: 110px;
        height: 110px;
    }
}

/* ===== CARD COMPONENTS ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: none;
}

.card-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
}

.card-primary::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.card-primary::after {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 40px;
    width: 80px;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='20' cy='20' r='3' fill='%2310B981'/%3E%3Ccircle cx='50' cy='30' r='2' fill='%23FBBF24'/%3E%3Cpath d='M60 50 L80 30 L85 35 L90 20' stroke='%23F97316' stroke-width='2' fill='none'/%3E%3Cpath d='M10 60 Q30 40 50 60' stroke='%2310B981' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat;
    background-size: contain;
    opacity: 0.6;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-amount {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.card-amount .decimals {
    font-size: 1.5rem;
    opacity: 0.8;
}

/* ===== USER PROFILE HEADER ===== */
.user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--surface);
    box-shadow: var(--shadow-md);
}

.user-info h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== MEMBER CARD ===== */
.member-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.member-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.member-info {
    flex: 1;
}

.member-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.member-info p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.member-arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.member-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var,--primary;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var,--text-primary;
}

.stat-label {
    font-size: 0.75rem;
    color: var,--text-secondary;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(30, 58, 95, 0.15);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(30, 58, 95, 0.25);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-glass {
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(10px);
    width: 100%;
}

.btn-glass:hover {
    background: rgba(255,255,255,0.3);
}

.btn-calc {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-calc:hover {
    background: linear-gradient(135deg, #4338CA, #6D28D9);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ===== PAGE CONTAINER ===== */
.page-container {
    padding: 0 1rem 5rem;
    min-height: 100vh;
}

@media (min-width: 768px) {
    .page-container {
        padding: 1.5rem 2rem 2rem;
    }
}

@media (min-width: 1024px) {
    .page-container {
        padding: 1.5rem 2.5rem 2rem;
    }
}

@media (min-width: 1440px) {
    .page-container {
        padding: 2rem 3rem 2rem;
    }
}

/* ===== TOP BAR ===== */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(248, 249, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.top-bar-brand {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-decoration: none;
    min-width: 0;
    overflow: hidden;
}

.top-bar-logo {
    width: 120px;
    height: auto;
    object-fit: contain;
    object-position: left;
}

.top-bar-tagline {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.top-bar-avatar {
    flex-shrink: 0;
}

.avatar-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: transparent;
}

.top-bar-title h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.top-bar-title p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* On desktop, hide top-bar brand (logo is in sidebar) and align avatar to right */
@media (min-width: 1280px) {
    .top-bar-brand {
        display: none;
    }

    .top-bar {
        justify-content: flex-end;
    }
}

@media (max-width: 767px) {
    .top-bar {
        padding: 0.75rem 1rem;
    }
}

/* ===== NAVIGATION BAR (BOTTOM on mobile / SIDEBAR on desktop) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    box-shadow: 0 -1px 10px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.25rem 0.5rem;
    padding-bottom: calc(0.25rem + env(safe-area-inset-bottom));
    z-index: 1000;
    height: auto;
    min-height: 40px;
}

.sidebar-brand {
    display: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.0625rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.5625rem;
    padding: 0.1875rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    flex: 1;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
}

.nav-item .nav-icon {
    font-size: 1.0625rem;
}

.nav-item .nav-label {
    /* visible on mobile bottom bar */
}

/* ===== SIDEBAR: tablet (icons only) ===== */
@media (min-width: 768px) {
    .bottom-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        width: 72px;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 0.5rem;
        padding-bottom: 0.5rem;
        box-shadow: 1px 0 10px rgba(0,0,0,0.04);
        border-right: 1px solid var(--border);
        gap: 0.25rem;
        min-height: unset;
        height: 100vh;
        overflow-y: auto;
    }

    .sidebar-brand {
        display: none;
    }

    .sidebar-logo {
        width: 36px;
        height: 36px;
        object-fit: contain;
    }

    .nav-item {
        flex: unset;
        width: 52px;
        height: 52px;
        border-radius: var(--radius-full);
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 0;
        font-size: 0;
    }

    .nav-item .nav-icon {
        font-size: 1.375rem;
    }

    .nav-item .nav-label {
        display: none;
    }

    .nav-item:hover {
        background: var(--background);
    }

    .nav-item.active {
        background: rgba(30, 58, 95, 0.1);
        color: var(--primary);
        font-weight: 700;
    }
}

/* ===== SIDEBAR: desktop (icons + labels) ===== */
@media (min-width: 1280px) {
    .bottom-nav {
        width: 240px;
        align-items: stretch;
        padding: 0.5rem 0.75rem;
    }

    .sidebar-brand {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 1rem 0.75rem 1.5rem;
        text-decoration: none;
    }

    .sidebar-logo {
        width: 130px;
        height: auto;
    }

    .nav-item {
        width: auto;
        height: auto;
        flex-direction: row;
        gap: 0.875rem;
        padding: 0.75rem 1rem;
        border-radius: var(--radius-full);
        font-size: 0.9375rem;
        justify-content: flex-start;
    }

    .nav-item .nav-icon {
        font-size: 1.375rem;
        flex-shrink: 0;
    }

    .nav-item .nav-label {
        display: inline;
        font-weight: 500;
    }

    .nav-item.active .nav-label {
        font-weight: 700;
    }
}

/* ===== AUTH PAGES ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.auth-form {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===== ICONS (SVG placeholders) ===== */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.icon-wallet::before { content: '\1F4B0'; }
.icon-card::before { content: '\1F4B3'; }
.icon-savings::before { content: '\1F4B5'; }
.icon-home::before { content: '\1F3E0'; }
.icon-chart::before { content: '\1F4CA'; }
.icon-settings::before { content: '\2699'; }
.icon-user::before { content: '\1F464'; }

/* ===== EXISTING STYLES (preserve) ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.input-error {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.input-error:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25) !important;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: var(--radius-md);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--primary);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ===== SETTINGS PAGE ===== */
.settings-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.settings-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-item:first-child {
    padding-top: 0;
}

.settings-item:hover {
    opacity: 0.7;
}

.settings-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: var(--radius-md);
}

.settings-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.settings-title {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.settings-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.settings-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.logout-btn {
    font-family: inherit;
}

.logout-btn .settings-icon {
    background: #FEE2E2;
}

.logout-btn:hover {
    opacity: 1;
    background: #FEF2F2;
    margin: 0 -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    width: calc(100% + 2.5rem);
    border-radius: var(--radius-md);
}

/* ===== AVATAR DROPDOWN MENU ===== */
.avatar-menu-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2);
}

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    padding: 0.5rem;
    z-index: 1000;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--background);
}

.dropdown-item.logout-item {
    color: #DC2626;
}

.dropdown-item.logout-item:hover {
    background: #FEE2E2;
}

.dropdown-divider {
    height: 1px;
    background: var(--border, #e5e7eb);
    margin: 0.25rem 0;
}

.dropdown-user-header {
    display: flex;
    flex-direction: column;
    padding: 0.625rem 0.75rem;
}

.dropdown-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.dropdown-user-email {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
}

.dropdown-contratos {
    padding: 0.5rem 0.75rem;
}

.dropdown-contratos-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-contratos-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.dropdown-contrato-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 0.375rem);
    background: var(--background, #f9fafb);
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
}

.dropdown-contrato-card:hover {
    border-color: rgba(30, 58, 95, 0.3);
    background: rgba(30, 58, 95, 0.03);
}

.dropdown-contrato-card.selected {
    border-color: #0A1F44;
    background: rgba(30, 58, 95, 0.06);
}

.contrato-radio {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border, #d1d5db);
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s ease;
}

.contrato-radio.active {
    border-color: #0A1F44;
}

.contrato-radio.active::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0A1F44;
}

.contrato-info {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
}

.contrato-numero {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.contrato-entorno {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
}

/* Settings page contract selector */
.settings-contrato-section {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.settings-contratos-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 0.25rem;
}

.settings-contrato-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--background, #f9fafb);
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
}

.settings-contrato-card:hover {
    border-color: rgba(30, 58, 95, 0.3);
    background: rgba(30, 58, 95, 0.03);
}

.settings-contrato-card.selected {
    border-color: #0A1F44;
    background: rgba(30, 58, 95, 0.06);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

.settings-contrato-card .contrato-numero {
    font-size: 0.875rem;
}

.settings-contrato-card .contrato-entorno {
    font-size: 0.75rem;
}

/* ===== LANDING PAGE STYLES ===== */
.landing-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #0D0D0D 0%, #1A1A2E 50%, #16213E 100%);
    color: white;
    overflow-x: hidden;
}

/* Landing Navbar */
.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.landing-logo-img {
    height: 80px;
    width: auto;
    background: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
}

.landing-nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.landing-nav-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.landing-nav-link:hover {
    color: white;
}

.landing-nav-cta {
    background: white;
    color: #0D0D0D;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255,255,255,0.2);
}

/* Hero Section */
.landing-hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.landing-hero-content {
    max-width: 600px;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.landing-badge-dot {
    width: 8px;
    height: 8px;
    background: #007D8F;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.landing-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 1.5rem 0;
    background: linear-gradient(135deg, #FFFFFF 0%, #B8C5D6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-title-highlight {
    background: linear-gradient(135deg, var(--primary) 0%, #007D8F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    margin: 0 0 2rem 0;
}

.landing-cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.landing-cta-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #007D8F 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.landing-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(30, 58, 95, 0.4);
}

.landing-cta-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.2);
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.landing-cta-secondary:hover {
    background: rgba(255,255,255,0.15);
}

/* Hero Visual */
.landing-hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.landing-hero-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.landing-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.landing-form-subtitle {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    margin: 0 0 1.5rem 0;
}

.landing-form-group {
    margin-bottom: 1rem;
}

.landing-form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    margin-bottom: 0.5rem;
}

.landing-form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.landing-form-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.landing-form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.12);
}

.landing-form-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #007D8F 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(30, 58, 95, 0.4);
}

.landing-form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
}

.landing-form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.landing-form-footer a:hover {
    text-decoration: underline;
}

.landing-form-error {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #FCA5A5;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Features Section */
.landing-features {
    background: rgba(255,255,255,0.02);
    padding: 5rem 2rem;
}

.landing-features-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.landing-section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: white;
}

.landing-section-subtitle {
    text-align: center;
    font-size: 1.125rem;
    color: rgba(255,255,255,0.6);
    margin: 0 0 3rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.landing-feature-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.landing-feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.landing-feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, #007D8F 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
}

.landing-feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: white;
}

.landing-feature-desc {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin: 0;
}

/* Stats Section */
.landing-stats {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.landing-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.landing-stat-item {
    text-align: center;
}

.landing-stat-value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, #007D8F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.landing-stat-label {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.6);
}

/* Insurers Section */
.landing-insurers {
    padding: 3rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.landing-insurers-inner {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.landing-insurers-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.5);
    margin: 0 0 2rem 0;
}

.landing-insurers-logos {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    align-items: center;
}

.landing-insurer-logo {
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

/* Landing Footer */
.landing-footer {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.landing-footer-text {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
}

.landing-footer-links {
    display: flex;
    gap: 2rem;
}

.landing-footer link {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.landing-footer-link:hover {
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .landing-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem 1.5rem 4rem;
    }
    
    .landing-hero-content {
        max-width: 100%;
    }
    
    .landing-title {
        font-size: 2.5rem;
    }
    
    .landing-cta-group {
        justify-content: center;
    }
    
    .landing-features-grid {
        grid-template-columns: 1fr;
    }
    
    .landing-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .landing-nav-links {
        display: none;
    }
}

@media (max-width: 640px) {
    .landing-title {
        font-size: 2rem;
    }
    
    .landing-hero-card {
        padding: 1.5rem;
    }
    
    .landing-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .landing-stat-value {
        font-size: 2rem;
    }
    
    .landing-footer {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* ===== CONNECTION ERROR POPUP ===== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.popup-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.popup-message {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}

.popup-details {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.popup-details summary {
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.popup-details p {
    margin: 0.75rem 0 0 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-word;
    font-family: monospace;
}

.popup-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.popup-actions .btn {
    flex: 1;
    max-width: 150px;
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
}

/* Slider de importe */
.slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.slider-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 55px;
}

.slider-label:first-of-type {
    text-align: right;
}

.slider-label:last-of-type {
    text-align: left;
}

/* Personalización del RadzenSlider */
.slider-container .rz-slider {
    flex: 1;
}

.slider-container .rz-slider .rz-slider-range {
    background: var(--primary);
}

.slider-container .rz-slider .rz-slider-handle {
    background: white;
    border: 3px solid var(--primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.slider-container .rz-slider .rz-slider-handle:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(30, 58, 95, 0.3);
}

/* Cálculo avanzado */
.btn-advanced-toggle {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-advanced-toggle:hover {
    color: var(--primary-dark, #4338CA);
    text-decoration: underline;
}

.advanced-calc-panel {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.75rem;
}

.advanced-calc-row {
    display: flex;
    gap: 1rem;
}

@media (max-width: 480px) {
    .advanced-calc-row {
        flex-direction: column;
        gap: 0;
    }
}

.form-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===== HISTORICO PAGE ===== */
.historico-loading,
.historico-empty,
.historico-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.historico-error p {
    margin: 0;
    color: #DC2626;
}

.historico-header {
    display: flex;
    align-items: center;
    padding: 0 0 0.75rem 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.historico-list {
    display: flex;
    flex-direction: column;
}

.historico-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    transition: background 0.15s ease;
}

.historico-row:last-child {
    border-bottom: none;
}

.historico-row:hover {
    background: var(--background);
    margin: 0 -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    border-radius: var(--radius-sm);
}

.historico-col-cliente {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.historico-cliente-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.08), rgba(30, 58, 95, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.historico-header .historico-col-cliente {
    gap: 0;
}

.historico-header .historico-col-cliente::before {
    content: none;
}

.historico-cliente-cif {
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.historico-col-fecha {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-align: center;
}

.historico-col-importe {
    flex: 1;
    text-align: right;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
}

.historico-col-clasif {
    flex: 0 0 60px;
    text-align: center;
}

.historico-importe-ok {
    color: #059669;
}

.historico-importe-parcial {
    color: #D97706;
}

.historico-importe-denegado {
    color: #DC2626;
}

.historico-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 700;
}

.badge-green {
    background: #DCFCE7;
    color: #059669;
}

.badge-yellow {
    background: #FEF3C7;
    color: #D97706;
}

.badge-red {
    background: #FEE2E2;
    color: #DC2626;
}

.badge-gray {
    background: #F3F4F6;
    color: var(--text-muted);
}

/* Responsive: en móvil apilar columnas */
@media (max-width: 600px) {
    .historico-header {
        display: none;
    }

    .historico-row {
        flex-wrap: wrap;
        gap: 0.25rem 0.75rem;
        padding: 0.75rem 0;
    }

    .historico-col-cliente {
        flex: 1 1 100%;
    }

    .historico-col-fecha {
        flex: 1;
        text-align: left;
        font-size: 0.75rem;
    }

    .historico-col-importe {
        flex: 0 0 auto;
        font-size: 0.8125rem;
    }

    .historico-col-clasif {
        flex: 0 0 auto;
    }
}

/* ===== HISTORICO SEARCH ===== */
.historico-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.historico-search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.historico-search-input {
    padding-left: 2.75rem !important;
    padding-right: 2.5rem !important;
}

.historico-search-clear {
    position: absolute;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--background);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.historico-search-clear:hover {
    background: #FEE2E2;
    color: #DC2626;
}

/* ===== HISTORICO EXPANDABLE ROWS ===== */
.historico-row-wrapper {
    border-bottom: 1px solid var(--border);
}

.historico-row-wrapper:last-child {
    border-bottom: none;
}

.historico-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.historico-row-clickable:hover {
    background: var(--background);
}

.historico-row-expanded {
    background: rgba(30, 58, 95, 0.04);
}

.historico-expand-icon {
    flex: 0 0 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.historico-detalle {
    padding: 1rem 1.25rem;
    background: linear-gradient(to bottom, rgba(30, 58, 95, 0.03), transparent);
    border-top: 1px dashed var(--border);
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

.historico-detalle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
}

.historico-detalle-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.historico-detalle-full {
    grid-column: 1 / -1;
}

.historico-detalle-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    font-weight: 500;
}

.historico-detalle-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.historico-detalle-mono {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 0.8125rem;
}

@media (max-width: 600px) {
    .historico-detalle-grid {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }

    .historico-detalle {
        padding: 0.75rem 1rem;
    }
}

/* ===== INPUT HIGHLIGHT PULSE (para importe calculado) ===== */
.input-highlight-pulse {
    animation: highlightPulse 1.2s ease;
}

@keyframes highlightPulse {
    0% {
        border-color: var(--primary);
        box-shadow: 0 0 0 0 rgba(30, 58, 95, 0.4);
        background-color: rgba(30, 58, 95, 0.03);
    }
    20% {
        border-color: #10B981;
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
        background-color: rgba(16, 185, 129, 0.08);
    }
    40% {
        border-color: var(--primary);
        box-shadow: 0 0 0 0 rgba(30, 58, 95, 0.2);
        background-color: rgba(30, 58, 95, 0.03);
    }
    60% {
        border-color: #10B981;
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
        background-color: rgba(16, 185, 129, 0.06);
    }
    80% {
        border-color: var(--primary);
        box-shadow: 0 0 0 0 rgba(30, 58, 95, 0.1);
        background-color: rgba(30, 58, 95, 0.02);
    }
    100% {
        border-color: var(--border);
        box-shadow: none;
        background-color: var(--surface);
    }
}

.input-highlight-pulse::placeholder {
    color: transparent;
}

/* ===== LOGIN PAGE - MOBILE FIRST ===== */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--background);
}

/* Mobile Login - Full screen focus on form */
.login-mobile {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem 1.5rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0));
    background: linear-gradient(180deg, #0A1F44 0%, #1A3A6A 40%, var(--background) 40%);
}

.login-mobile-header {
    text-align: center;
    padding-top: 1rem;
    margin-bottom: 2rem;
}

.login-mobile-logo {
    width: 140px;
    height: auto;
    margin-bottom: 1.5rem;
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
}

.login-mobile-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.5rem;
}

.login-mobile-subtitle {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.8);
    margin: 0;
    line-height: 1.5;
}

.login-mobile-form {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.login-form-group {
    margin-bottom: 1.25rem;
}

.login-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.1);
}

.login-form-input::placeholder {
    color: var(--text-muted);
}

.login-password-wrapper {
    position: relative;
}

.login-password-wrapper .login-form-input {
    padding-right: 3.5rem;
}

.login-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.login-password-toggle:hover {
    color: var(--text-primary);
}

.login-form-error {
    background: #FEE2E2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-form-error::before {
    content: '\26A0';
}

.login-submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: auto;
}

.login-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 95, 0.3);
}

.login-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.login-footer p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-mobile-trust {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: auto;
}

.login-mobile-trust p {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.login-trust-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Desktop Login - hidden on mobile */
.login-desktop {
    display: none;
}

/* Desktop: Show split layout */
@media (min-width: 768px) {
    .login-mobile {
        display: none;
    }

    .login-desktop {
        display: grid;
        grid-template-columns: 1fr 1fr;
        min-height: 100vh;
    }

    .login-desktop-left {
        background: linear-gradient(180deg, #0D0D0D 0%, #1A1A2E 50%, #16213E 100%);
        padding: 2rem 3rem;
        display: flex;
        flex-direction: column;
        color: white;
    }

    .login-desktop-logo {
        margin-bottom: 3rem;
    }

    .login-desktop-logo img {
        height: 50px;
        background: white;
        padding: 0.5rem 1.25rem;
        border-radius: 50px;
    }

    .login-desktop-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-width: 500px;
    }

    .login-desktop-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: rgba(255,255,255,0.1);
        padding: 0.5rem 1rem;
        border-radius: var(--radius-full);
        font-size: 0.8125rem;
        margin-bottom: 1.5rem;
        width: fit-content;
    }

    .login-badge-dot {
        width: 8px;
        height: 8px;
        background: #007D8F;
        border-radius: 50%;
        animation: pulse 2s infinite;
    }

    .login-desktop-title {
        font-size: 2.5rem;
        font-weight: 800;
        line-height: 1.15;
        margin: 0 0 1.25rem;
    }

    .login-title-highlight {
        background: linear-gradient(135deg, var(--secondary) 0%, #007D8F 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .login-desktop-subtitle {
        font-size: 1.125rem;
        color: rgba(255,255,255,0.7);
        line-height: 1.6;
        margin:  0 0 2rem;
    }

    .login-desktop-features {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .login-feature-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 0.9375rem;
        color: rgba(255,255,255,0.85);
    }

    .login-feature-icon {
        font-size: 1.25rem;
    }

    .login-desktop-stats {
        display: flex;
        gap: 2.5rem;
        padding-top: 2rem;
        margin-top: auto;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .login-stat {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .login-stat-value {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--secondary);
    }

    .login-stat-label {
        font-size: 0.8125rem;
        color: rgba(255,255,255,0.5);
    }

    .login-desktop-right {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        background: var(--background);
    }

    .login-desktop-card {
        width: 100%;
        max-width: 400px;
        background: var(--surface);
        border-radius: var(--radius-xl);
        padding: 2.5rem;
        box-shadow: var(--shadow-card);
    }

    .login-desktop-card h2 {
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0 0 0.5rem;
        color: var(--text-primary);
    }

    .login-desktop-card > p {
        font-size: 0.9375rem;
        color: var(--text-secondary);
        margin: 0 0 2rem;
    }
}

@media (min-width: 1280px) {
    .login-desktop-left {
        padding: 3rem 5rem;
    }

    .login-desktop-title {
        font-size: 3rem;
    }

    .login-desktop-card {
        padding: 3rem;
    }
}

/* Result card flash after update */
.result-flash {
    animation: resultFlash 0.5s ease-in-out 3;
}

@keyframes resultFlash {
    0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
    50% { box-shadow: 0 0 0 4px rgba(16,185,129,0.35), 0 0 20px rgba(16,185,129,0.15); }
}

/* Spinner small */
.spinner-small {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border, #e5e7eb);
    border-top-color: var(--primary, #0ea5e9);
    border-radius: 50%;
    animation: spin-small 0.6s linear infinite;
}

@keyframes spin-small {
    to { transform: rotate(360deg); }
}


