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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bruto-color: #3b82f6;
    --liquido-color: #10b981;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(99, 102, 241, 0.2);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Tema oscuro */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #273245;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.9);
    --glass-border: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] body {
    background: #0f172a;
    color: var(--text-primary);
}

[data-theme="dark"] .calculator {
    background: #273245 !important;
    background: rgba(39, 50, 69, 0.4) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

body {
    font-family: 'Monoid', 'JetBrains Mono', 'Courier New', Courier, monospace;
    background: #f2f2f2;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-top: 70px; /* Espacio para navbar fijo */
    display: block; /* Forzar flujo vertical */
    width: 100%;
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.75rem 0;
}

[data-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.95);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    flex-shrink: 0;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ============================================
   SECCIONES DE PÁGINA
   ============================================ */
.page-section {
    width: 100%;
    max-width: 100%;
    display: block !important; /* Asegurar flujo vertical */
    position: relative;
    clear: both;
    float: none !important;
    margin: 0;
    padding: 0;
}

.calculator-section {
    min-height: 100vh;
    background: transparent;
    width: 100%;
    display: block !important;
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

/* Header */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    width: 100%;
}

.app-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    animation: gradientRotate 20s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

@keyframes gradientRotate {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

.app-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Calculator */
.calculator {
    background: #e9e9e9;
    background: rgba(233, 233, 233, 0.4);
    border: none;
    border-radius: 2rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.8s ease-out 0.2s both;
    position: relative;
    transition: padding-bottom 0.4s ease;
    backdrop-filter: blur(32.5x);
    -webkit-backdrop-filter: blur(2.5px);
}

/* Date Selector */
.date-selector-container {
    position: absolute;
    top: 1rem;
    right: 0;
    left: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    padding-right: 2.5rem;
    pointer-events: none;
}

.date-selector-container > * {
    pointer-events: auto;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    color: var(--text-primary);
}

.date-display:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

[data-theme="dark"] .date-display {
    background: rgba(39, 50, 69, 0.9);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

[data-theme="dark"] .date-display:hover {
    background: rgba(39, 50, 69, 1);
    color: var(--text-primary);
}

.date-icon {
    width: 1.3rem;
    height: 1.3rem;
    flex-shrink: 0;
    color: var(--primary-color);
}

.btn-icon {
    width: 1.3rem;
    height: 1.3rem;
    flex-shrink: 0;
}

#selected-date-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* Date Modal */
.date-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
    padding: 1rem;
    box-sizing: border-box;
}

.date-modal-content {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    animation: slideUp 0.3s ease-out;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

[data-theme="dark"] .date-modal-content {
    background: #1e293b;
}

.date-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.date-modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.date-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.date-selectors {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.date-select-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-select-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.date-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--glass-border);
    border-radius: 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 600;
}

.date-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .date-select {
    background: #1e293b;
    color: #f1f5f9;
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .date-select:focus {
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.date-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.date-cancel-btn,
.date-confirm-btn,
.date-today-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-today-btn {
    background: var(--accent-color);
    color: white;
    margin-right: auto;
}

.date-today-btn:hover {
    background: #f59f00;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.date-cancel-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.date-cancel-btn:hover {
    background: var(--glass-border);
}

[data-theme="dark"] .date-cancel-btn {
    background: #1e293b;
    color: #cbd5e1;
}

[data-theme="dark"] .date-cancel-btn:hover {
    background: #334155;
    color: #f1f5f9;
}

.date-confirm-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.date-confirm-btn:hover {
    background: #5855eb;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Section */
.input-section {
    margin-bottom: 2.5rem;
    width: 100%;
    overflow: visible;
}

.input-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefixes {
    position: absolute;
    left: 0.75rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.currency-symbol {
    font-size: 2rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
}

.amount-input {
    width: 100%;
    padding: 1.5rem 1.5rem 1.5rem 1.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--bg-secondary);
    border: none;
    border-radius: 1rem;
    color: transparent;
    caret-color: var(--primary-color);
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: var(--shadow-sm);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    position: relative;
}

[data-theme="dark"] .amount-input:not(:focus) {
    background: #2b3648;
}

.amount-input::placeholder {
    color: transparent;
}

.amount-input-wrapper {
    position: relative;
}

/* Animación de borde estilo Apple Intelligence - Solo en los bordes */
.amount-input-wrapper::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
        #6366f1 0%,
        #8b5cf6 25%,
        #ec4899 50%,
        #f59e0b 75%,
        #6366f1 100%);
    background-size: 300% 300%;
    border-radius: 1rem;
    opacity: 0.1;
    z-index: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gradientFlow 5s ease infinite;
    pointer-events: none;
}

/* Pseudo-elemento que cubre el centro para mostrar solo los bordes */
.amount-input-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    border-radius: 1rem;
    z-index: 1;
    pointer-events: none;
    transition: background 0.3s ease;
}

[data-theme="dark"] .amount-input-wrapper::after {
    background: #2b3648;
}

.amount-input-wrapper.focused::after {
    background: var(--bg-card);
}

[data-theme="dark"] .amount-input-wrapper.focused::after {
    background: #1e293b;
}

.amount-input-wrapper:hover::before {
    opacity: 0.25;
}

.amount-input-wrapper.focused::before {
    opacity: 0.4;
}

/* Animación del gradiente que fluye */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Animación del emoji cayendo */
.falling-emoji {
    position: fixed;
    font-size: 2rem;
    z-index: 10000;
    pointer-events: none;
    animation: fallAndFade 1.5s ease-out forwards;
    will-change: transform, opacity;
}

@keyframes fallAndFade {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(100px) rotate(180deg) scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: translateY(200px) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

/* Asegurar que el input y display tengan z-index correcto por encima del borde animado */
.amount-input {
    position: relative;
    z-index: 3;
    background: transparent !important;
}

.amount-input:focus {
    background: transparent !important;
}

.amount-display {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    padding: 1.5rem 1.5rem 1.5rem 1.5rem;
    z-index: 2;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: visible;
}

.amount-display span {
    display: inline-block;
}

.amount-display .digit {
    animation: digitEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center bottom;
}

.amount-display .digit-exit {
    animation: digitExit 0.1s cubic-bezier(0.4, 0, 1, 1) forwards;
    transform-origin: center bottom;
}

@keyframes digitEnter {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    60% {
        transform: translateY(-4px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes digitExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-15px) scale(0.8);
    }
}

.amount-input:focus {
    outline: none;
    /* El background ahora lo proporciona .amount-input-wrapper::after */
}

.input-hint {
    margin-top: 0.5rem;
    text-align: center;
    min-height: 1.5rem;
}

.type-indicator {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Results Section */
.results-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    min-width: 0;
}

.result-card {
    background: var(--bg-card);
    border: none;
    border-radius: 1.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out both;
    box-shadow: var(--shadow-md);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    word-wrap: break-word;
}

.result-label strong {
    color: #000000;
}

[data-theme="dark"] .result-label strong {
    color: #ffffff;
}

.result-value-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s ease;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    min-width: 0;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Tamaños dinámicos según cantidad de dígitos */
.result-value.size-6 {
    font-size: 1.75rem;
}

.result-value.size-7 {
    font-size: 1.60rem;
}

.result-value.size-8 {
    font-size: 1.4rem;
}

.result-value.size-9 {
    font-size: 1.35rem;
}

.result-value.size-10 {
    font-size: 1.2rem;
}

.result-value.size-11 {
    font-size: 1.1rem;
}

.result-value.size-12 {
    font-size: 1rem;
}

.result-bruto .result-value {
    color: var(--bruto-color);
}

.result-liquido .result-value {
    color: var(--liquido-color);
}

.result-value.updated {
    animation: numberPulse 0.5s ease;
}

.result-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.result-opposite {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.result-retention,
.result-to-receive,
.result-amount-receive {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-amount-receive {
    color: var(--text-primary);
    font-weight: 600;
}

.result-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    width: 100%;
    min-width: 0;
}

.value-copy-btn {
    padding: 0.4rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.value-copy-btn:hover {
    opacity: 1;
    background: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.value-copy-btn .btn-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.action-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--bg-secondary);
    color: var(--primary-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@keyframes numberPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Botón SII Link */
.sii-link-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0 1.5rem 0;
    padding-top: 2px;
    animation: siiLinkFadeIn 0.6s ease-out;
    transition: margin 0.4s ease, opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease;
    overflow: visible;
    max-height: 100px;
    opacity: 1;
}

.sii-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.sii-link-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.2) 100%);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.2);
}

.sii-link-btn:active {
    transform: translateY(0);
}

.sii-link-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.sii-link-container.hiding {
    animation: siiLinkFadeOut 0.4s ease-in forwards;
    margin-top: 0;
    margin-bottom: 0;
    max-height: 0;
}

@keyframes siiLinkFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes siiLinkFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

[data-theme="dark"] .sii-link-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.2) 100%);
    border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .sii-link-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.25) 100%);
    border-color: var(--primary-color);
}

@media (max-width: 767px) {
    .sii-link-btn {
        font-size: 0.875rem;
        padding: 0.75rem 1.25rem;
    }
}

/* Retention Info */
.retention-info {
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.retention-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Evitar que retention-display-inline herede el wrap */
.retention-display.retention-display-inline {
    flex-wrap: nowrap !important;
}

/* Retención inline justo debajo del input */
.retention-display-inline {
    display: flex;
    margin-top: 0.75rem;
    margin-bottom: 0;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: visible;
}


.retention-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.retention-display-inline .retention-label {
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.retention-value {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.retention-value-clickable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

.retention-value-clickable:hover {
    background: rgba(99, 102, 241, 0.1);
}

.year-selector-dropdown {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    overflow: hidden;
    animation: slideDownFade 0.25s ease-out forwards;
    padding: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

[data-theme="dark"] .year-selector-dropdown {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(99, 102, 241, 0.3);
}

.year-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: var(--text-primary);
    border-radius: 0.5rem;
}

[data-theme="dark"] .year-option {
    color: #f1f5f9;
}

.year-option:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

[data-theme="dark"] .year-option:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
}

.year-option:active {
    background: rgba(99, 102, 241, 0.2);
}

.year-option-active {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--primary-color) !important;
    font-weight: 600;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.retention-status {
    text-align: center;
    margin-top: 0.75rem;
}

#last-update-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Advanced Options */
.advanced-toggle {
    text-align: center;
    margin-top: 1.5rem;
}

.toggle-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.advanced-options {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    animation: slideDown 0.3s ease-out;
}

.advanced-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mode-select {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.mode-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Error Message */
.error-message {
    margin-top: 1.5rem;
    margin-bottom: 0;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    color: var(--error-color);
    text-align: center;
    font-size: 0.9rem;
    display: none;
    animation: shake 0.5s ease;
}

.error-message.show {
    display: block;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Footer */
footer {
    margin-top: 3rem;
    text-align: center;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* AdSense */
.adsense-mobile {
    display: block;
    margin: 2rem auto 0;
    max-width: 100%;
    padding: 1rem;
    text-align: center;
}

.adsense-desktop-left {
    display: none;
}

.adsense-desktop {
    display: none;
}

.adsense-desktop-bottom {
    display: none;
}

.ad-placeholder {
    background: var(--bg-secondary);
    border: 1px dashed var(--glass-border);
    border-radius: 0.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-height: 50px;
}

/* Modal de Cotización */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border-radius: 1.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.quote-info {
    margin-bottom: 1.5rem;
}

.quote-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
}

.quote-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quote-item.highlight {
    padding-top: 0.75rem;
    border-top: 2px solid var(--glass-border);
    font-weight: 600;
}

.quote-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.quote-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.quote-item.highlight .quote-value {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.quote-description {
    margin-bottom: 1.5rem;
}

.quote-description label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.quote-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.quote-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
}

/* Vista previa del documento (similar al PDF) */
.quote-preview-document {
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* Forzar modo claro en el preview incluso en darkmode para que sea fiel al PDF */
[data-theme="dark"] .quote-preview-document {
    background: white !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    color: #1e293b !important;
}

[data-theme="dark"] .quote-preview-header h3 {
    color: #6366f1 !important;
}

[data-theme="dark"] .quote-preview-date {
    color: #64748b !important;
}

[data-theme="dark"] .quote-preview-description {
    color: #1e293b !important;
}

[data-theme="dark"] .quote-preview-description.editable {
    background: transparent !important;
}

[data-theme="dark"] .quote-preview-description.editable:focus {
    background: #f1f5f9 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

[data-theme="dark"] .quote-preview-table {
    background: #f1f5f9 !important;
}

[data-theme="dark"] .quote-table-row {
    color: #1e293b !important;
}

[data-theme="dark"] .quote-table-row.highlight {
    color: #6366f1 !important;
    border-top-color: rgba(99, 102, 241, 0.2) !important;
}

[data-theme="dark"] .quote-table-divider {
    background: rgba(99, 102, 241, 0.2) !important;
}

[data-theme="dark"] .quote-preview-footer {
    border-top-color: rgba(99, 102, 241, 0.2) !important;
}

[data-theme="dark"] .quote-preview-footer p {
    color: #94a3b8 !important;
}

.quote-preview-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.quote-logo-container {
    position: relative;
    flex-shrink: 0;
}

.quote-logo-initials {
    width: 100px;
    height: 65px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 1px;
}

.quote-logo-preview {
    max-width: 100px;
    max-height: 65px;
    object-fit: contain;
    display: block;
}

.remove-logo-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.remove-logo-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.quote-preview-title {
    flex: 1;
}

.quote-preview-title h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.quote-preview-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.quote-preview-content {
    flex: 1;
}

.quote-description-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

/* Animación de borde estilo Apple Intelligence para descripción */
.quote-description-wrapper::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
        #6366f1 0%,
        #8b5cf6 25%,
        #ec4899 50%,
        #f59e0b 75%,
        #6366f1 100%);
    background-size: 300% 300%;
    border-radius: 0.5rem;
    opacity: 0.1;
    z-index: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gradientFlow 5s ease infinite;
    pointer-events: none;
}

/* Pseudo-elemento que cubre el centro para mostrar solo los bordes */
.quote-description-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
    z-index: 1;
    pointer-events: none;
    transition: background 0.3s ease;
}

.quote-description-wrapper.focused::after {
    background: rgba(241, 245, 249, 0.8);
}

.quote-description-wrapper:hover::before {
    opacity: 0.25;
}

.quote-description-wrapper.focused::before {
    opacity: 0.4;
}

.quote-preview-description {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 60px;
    white-space: pre-wrap;
    position: relative;
    z-index: 2;
    background: transparent !important;
}

.quote-preview-description.editable {
    cursor: text;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.quote-preview-description.editable:focus {
    outline: none;
    background: transparent !important;
    /* El background ahora lo proporciona .quote-description-wrapper::after */
}

.quote-preview-table {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.quote-table-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.quote-table-row.highlight {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary-color);
    padding-top: 1rem;
    border-top: 2px solid var(--glass-border);
    margin-top: 0.5rem;
}

.quote-table-label {
    flex: 1;
}

.quote-table-amount {
    text-align: right;
    font-weight: 600;
    min-width: 120px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.quote-table-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
}

.quote-preview-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.quote-preview-footer p {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
}

/* Controles de edición */
.quote-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quote-logo-upload {
    margin-bottom: 0.5rem;
}

.logo-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px dashed var(--glass-border);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.logo-upload-label:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 1.2rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.btn-secondary,
.btn-primary {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--bg-primary);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ad-placeholder.vertical {
    min-height: 250px;
    min-width: 300px;
}

.ad-placeholder small {
    font-size: 0.7rem;
    opacity: 0.6;
}

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

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Responsive Design */
@media (min-width: 768px) {
    body {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: start;
        padding-top: 2rem;
    }

    .container {
        grid-column: 2;
        padding: 3rem 2rem;
        max-width: 800px;
        margin: 0;
    }

    .app-title {
        font-size: 4.5rem;
    }

    .calculator {
        padding: 3rem;
    }

    .amount-input {
        font-size: 3rem;
        padding: 2rem 2rem 2rem 4rem;
    }
    
    .amount-display {
        font-size: 3rem;
        padding: 2rem 2rem 2rem 4rem;
    }

    .currency-symbol {
        font-size: 2.5rem;
        left: 2rem;
    }

    .results-section {
        gap: 2rem;
    }

    .result-value {
        font-size: 2.5rem;
    }
    
    /* Ajustes de tamaños dinámicos para tablets */
    .result-value.size-6 {
        font-size: 2.2rem;
    }
    
    .result-value.size-7 {
        font-size: 2rem;
    }
    
    .result-value.size-8 {
        font-size: 1.8rem;
    }
    
    .result-value.size-9 {
        font-size: 1.7rem;
    }
    
    .result-value.size-10 {
        font-size: 1.5rem;
    }
    
    .result-value.size-11 {
        font-size: 1.35rem;
    }
    
    .result-value.size-12 {
        font-size: 1.2rem;
    }

    .adsense-mobile {
        display: none;
    }

    .adsense-desktop-left {
        display: block;
        grid-column: 1;
        position: sticky;
        top: 2rem;
        margin-left: 2rem;
        z-index: 10;
    }

    .adsense-desktop {
        display: block;
        grid-column: 3;
        position: sticky;
        top: 2rem;
        margin-right: 2rem;
        z-index: 10;
    }

    .adsense-desktop-bottom {
        display: block;
        grid-column: 1 / -1;
        position: fixed;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10;
        max-width: 728px;
        width: 90%;
    }
}

@media (max-width: 767px) {
    body {
        display: block;
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 1.5rem 1rem;
        margin: 0 auto;
    }
    
    
    .adsense-desktop,
    .adsense-desktop-left,
    .adsense-desktop-bottom {
        display: none !important;
    }

    .app-title {
        font-size: 2.5rem;
    }

    .calculator {
        padding: 1.5rem;
        border-radius: 1.5rem;
        overflow: visible;
        box-sizing: border-box;
    }
    
    .input-section {
        overflow: visible;
        box-sizing: border-box;
    }

    .amount-input {
        font-size: 2rem;
        padding: 1.25rem 1.25rem 1.25rem 3rem;
    }
    
    .amount-display {
        font-size: 2rem;
        padding: 1.25rem 1.25rem 1.25rem 3rem;
    }

    .results-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .result-value {
        font-size: 1.75rem;
    }
    
    /* Ajustes de tamaños dinámicos para móviles */
    .result-value.size-6 {
        font-size: 1.6rem;
    }
    
    .result-value.size-7 {
        font-size: 1.5rem;
    }
    
    .result-value.size-8 {
        font-size: 1.3rem;
    }
    
    .result-value.size-9 {
        font-size: 1.15rem;
    }
    
    .result-value.size-10 {
        font-size: 1rem;
    }
    
    .result-value.size-11 {
        font-size: 0.9rem;
    }
    
    .result-value.size-12 {
        font-size: 0.85rem;
    }

    .retention-display {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    /* Asegurar que retention-display-inline se mantenga en línea */
    .retention-display-inline {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        gap: 0.25rem;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: visible;
        box-sizing: border-box;
    }
    
    .retention-label {
        font-size: 0.75rem;
        flex-shrink: 0;
        flex-grow: 0;
        white-space: nowrap !important;
        word-break: keep-all;
        overflow: visible;
    }
    
    .retention-display-inline .retention-label {
        margin-right: 0.25rem;
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    .retention-value {
        font-size: 0.8rem;
        flex-shrink: 0;
        flex-grow: 0;
        white-space: nowrap !important;
        word-break: keep-all;
        overflow: visible;
    }
    
    .retention-value-clickable {
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    .date-modal-overlay {
        align-items: flex-start;
        justify-content: center;
        padding: 1rem;
        padding-top: 3rem;
        overflow-y: auto;
    }
    
    .date-modal-content {
        min-width: auto;
        max-width: 100%;
        width: calc(100% - 2rem);
        margin: 0 auto auto auto;
        max-height: calc(100vh - 4rem);
        margin-top: 0;
    }
    
    /* Reducir padding interno en móvil para hacer el modal más compacto */
    .date-modal-header {
        padding: 1rem 1.25rem;
    }
    
    .date-modal-header h3 {
        font-size: 1rem;
    }
    
    .date-selectors {
        padding: 1rem 1.25rem;
        gap: 1rem;
        flex-direction: column; /* Apilar verticalmente en móvil */
    }
    
    .date-select-group {
        gap: 0.4rem;
        width: 100%; /* Ancho completo en móvil */
    }
    
    .date-select {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .date-modal-footer {
        padding: 1rem 1.25rem;
        gap: 0.75rem;
        flex-direction: column; /* Apilar botones verticalmente en móvil */
        width: 100%;
        box-sizing: border-box;
    }
    
    .date-cancel-btn,
    .date-confirm-btn,
    .date-today-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100%; /* Ancho completo en móvil */
        justify-content: center;
        text-align: center;
    }
    
    .date-today-btn {
        margin-right: 0; /* Quitar margin-right en móvil */
        order: -1; /* Mover el botón "Hoy" al principio */
    }
    
    /* Reorganizar para alinear botón de fecha con el label */
    .date-selector-container {
        padding-right: 1.5rem;
        top: 1.5rem; /* Padding del calculator - coincide con el inicio del input-section */
        align-items: flex-start;
        display: flex;
    }
    
    .date-display {
        padding: 0.35rem 0.6rem;
        gap: 0.3rem;
        max-width: fit-content;
        line-height: 1.275; /* Aproximadamente igual al line-height del label (0.85rem * 1.5 = 1.275rem) */
        margin-top: 0.1rem; /* Ajuste fino para alinear con el texto del label */
    }
    
    .date-icon {
        width: 0.9rem;
        height: 0.9rem;
        flex-shrink: 0;
    }
    
    #selected-date-text {
        font-size: 0.7rem;
        line-height: 1.275;
    }
    
    /* Ajustar input-section para alinear con el botón */
    .input-section {
        margin-top: 0;
        padding-top: 0;
        position: relative;
    }
    
    .input-label {
        font-size: 0.85rem;
        padding-right: 8rem; /* Espacio para el botón de fecha */
        margin-bottom: 0.75rem;
        line-height: 1.5; /* 0.85rem * 1.5 = 1.275rem de altura */
        display: flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 2rem;
    }
    
    /* Botón de fecha aún más pequeño en pantallas muy pequeñas */
    .date-display {
        padding: 0.3rem 0.5rem;
    }
    
    .date-icon {
        width: 0.85rem;
        height: 0.85rem;
    }
    
    #selected-date-text {
        font-size: 0.65rem;
    }
    
    .input-label {
        font-size: 0.8rem;
    }

    .amount-input {
        font-size: 1.75rem;
    }
    
    .amount-display {
        font-size: 1.75rem;
    }

    .result-value {
        font-size: 1.5rem;
    }
    
    /* Tamaños aún más pequeños para retention en pantallas muy pequeñas */
    .retention-label {
        font-size: 0.75rem;
    }
    
    .retention-value {
        font-size: 0.8rem;
    }
}

/* Background animado de puntos tipo olas */
.wave-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Detrás de todo el contenido */
    opacity: 0.25; /* Mayor transparencia */
    pointer-events: none;
    overflow: hidden;
    background: transparent; /* Asegurar que sea transparente */
    transition: opacity 0.5s ease-in-out;
}

.wave-background-container.hidden {
    display: none;
}

.wave-background {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: waveFlow 10s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.wave-grid {
    width: 100%;
    height: 100%;
    position: relative;
}

.wave-dot {
    position: absolute;
    font-size: 24px; /* Tamaño duplicado - fijo en px */
    color: var(--primary-color);
    transform: scale(0);
    opacity: 0;
    will-change: transform, opacity;
    pointer-events: none;
    font-weight: 300;
    line-height: 1;
}

/* Forzar emojis a color sólido igual que otros símbolos */
/* El filtro convierte el emoji a escala de grises y luego lo tinte con el color primario (#6366f1) */
.wave-dot[data-symbol="🍑"] {
    filter: grayscale(100%) brightness(0.4) sepia(100%) hue-rotate(240deg) saturate(600%) contrast(1.2);
    color: var(--primary-color);
}

/* Animación del movimiento de olas */
@keyframes waveFlow {
    0% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-10px) scale(1.05);
    }
    50% {
        transform: translateY(-20px) scale(1.1);
    }
    75% {
        transform: translateY(-10px) scale(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Animación de cada punto individual */
@keyframes dotAnimation {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    30% {
        transform: scale(0.5);
        opacity: 0.4;
    }
    50% {
        transform: scale(0.7);
        opacity: 0.6;
    }
    70% {
        transform: scale(0.5);
        opacity: 0.4;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Dropdown de configuración */
.settings-dropdown {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
}

.settings-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.settings-toggle-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

[data-theme="dark"] .settings-toggle-btn {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .settings-toggle-btn:hover {
    background: rgba(30, 41, 59, 1);
    border-color: var(--primary-color);
}

.settings-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.settings-icon.rotating {
    animation: gearRotate 0.5s ease-in-out;
}

@keyframes gearRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(180deg);
    }
}

.settings-menu {
    position: absolute;
    top: 3rem;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem;
    animation: slideDownFadeSettings 0.25s ease-out forwards;
    transform-origin: top right;
}

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

.settings-section {
    margin-bottom: 0.5rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
}

.settings-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.settings-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

.settings-option.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
}

.settings-option.active .option-check {
    display: inline-block !important;
    color: var(--primary-color);
    font-weight: 600;
}

.option-icon {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.option-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.option-check {
    font-size: 0.85rem;
    color: var(--primary-color);
}

@media (max-width: 767px) {
    .header-top {
        position: relative;
        width: 100%;
    }
}
/* ============================================
   SECCIÓN WAITLIST
   ============================================ */
.waitlist-section {
    min-height: 50vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    width: 100%;
    max-width: 100%;
    clear: both;
}

.container-waitlist {
    text-align: center;
    padding: 4rem 2rem;
}

.container-waitlist h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.container-waitlist p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* ============================================
   SECCIÓN GUÍA DE BOLETAS
   ============================================ */
.guia-section {
    width: 100%;
    max-width: 100%;
    background: #e7e7e7;
    padding: 4rem 0;
    display: block !important;
    clear: both;
    float: none !important;
}

[data-theme="dark"] .guia-section {
    background: #273245;
}

.container-guia {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    display: block;
}

.guia-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 700;
}

.guia-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.guia-article {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.guia-article:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Ilustraciones de los artículos */
.guia-illustration {
    float: right;
    width: 220px;
    max-width: 35%;
    height: auto;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    /* El texto fluye alrededor del contorno rectangular de la imagen */
}

/* Shape-outside específico para cada imagen - usa el canal alfa del PNG */
.guia-article:nth-child(1) .guia-illustration {
    shape-outside: url('img/cont1.png');
    shape-margin: 0.8rem;
    shape-image-threshold: 0.5;
}

.guia-article:nth-child(2) .guia-illustration {
    shape-outside: url('img/cont2.png');
    shape-margin: 0.8rem;
    shape-image-threshold: 0.5;
}

.guia-article:nth-child(3) .guia-illustration {
    shape-outside: url('img/cont3.png');
    shape-margin: 0.8rem;
    shape-image-threshold: 0.5;
}

.guia-article:nth-child(4) .guia-illustration {
    shape-outside: url('img/cont4.png');
    shape-margin: 0.8rem;
    shape-image-threshold: 0.5;
}

.guia-article:nth-child(5) .guia-illustration {
    shape-outside: url('img/cont5.png');
    shape-margin: 0.8rem;
    shape-image-threshold: 0.5;
}

.guia-article h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.guia-article p {
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.guia-example,
.guia-formula {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
}

.guia-steps {
    padding-left: 1.5rem;
    color: var(--text-primary);
}

.guia-steps li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.guia-steps a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.guia-steps a:hover {
    text-decoration: underline;
}

/* ============================================
   ACORDEONES
   ============================================ */
.faq-section {
    margin-top: 2rem;
}

.faq-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

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

.accordion-item {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: var(--shadow-md);
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 1.25rem 1.5rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.accordion-header:hover {
    background: rgba(99, 102, 241, 0.05);
}

.accordion-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 300;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
    padding: 0 1.5rem 1.25rem 1.5rem;
}

.accordion-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.accordion-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    width: 100%;
    background: var(--bg-card);
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
    display: block;
}

[data-theme="dark"] .footer {
    background: #1e293b;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.footer-contact-btn {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.footer-contact-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   MEDIA QUERIES - MÓVIL
   ============================================ */
@media (max-width: 767px) {
    body {
        padding-top: 60px;
    }

    .navbar-container {
        padding: 0 1rem;
    }

    .navbar-title {
        font-size: 1.25rem;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .navbar-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        opacity: 0;
        visibility: hidden;
    }

    .navbar-menu.active {
        max-height: 600px;
        padding: 1rem;
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        padding: 1rem;
        border-bottom: 1px solid var(--glass-border);
    }

    .settings-dropdown {
        position: relative;
        width: 100%;
        right: auto;
        top: auto;
        margin-top: 0.5rem;
    }

    .settings-menu {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        width: 100% !important;
        max-width: none !important;
    }

    .guia-title {
        font-size: 1.8rem;
    }

    .guia-article h3 {
        font-size: 1.25rem;
    }
    
    /* En móvil, la imagen va debajo del texto */
    .guia-illustration {
        float: none;
        display: block;
        width: 100%;
        max-width: 300px;
        margin: 1rem auto;
        shape-outside: none;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    /* Ajustes para modal de cotización en móvil */
    .modal-content {
        max-height: 95vh;
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .quote-preview-document {
        padding: 1rem;
        padding-top: 1.25rem;
        min-height: auto;
        box-sizing: border-box;
    }
    
    .quote-preview-header {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        flex-wrap: nowrap;
        align-items: flex-start;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
        overflow: visible;
    }
    
    .quote-logo-container {
        flex-shrink: 0;
        min-width: 60px;
        width: 60px;
        position: relative;
        padding-top: 12px;
        box-sizing: border-box;
    }
    
    .quote-logo-initials {
        width: 60px;
        height: 40px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .quote-logo-preview {
        max-width: 60px;
        max-height: 40px;
        width: 60px;
        height: auto;
    }
    
    .remove-logo-btn {
        top: 4px;
        right: -4px;
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
    
    .quote-preview-title {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 75px);
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .quote-preview-title h3 {
        font-size: 1.1rem;
        margin: 0 0 0.5rem 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
        box-sizing: border-box;
        line-height: 1.3;
    }
    
    .quote-preview-date {
        font-size: 0.75rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
        box-sizing: border-box;
        line-height: 1.4;
    }
}

