﻿/* =============================================
   SmartMoney — Dark Fintech Theme
   Color: #00D68F (green accent)
   Font: Inter
   ============================================= */

:root {
    --bg-primary: #0B0E11;
    --bg-secondary: #141820;
    --bg-card: rgba(20, 24, 32, 0.8);
    --bg-card-hover: rgba(30, 36, 48, 0.9);
    --bg-sidebar: #0D1117;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --text-primary: #FFFFFF;
    --text-secondary: #8B95A5;
    --text-muted: #5A6474;

    --accent: #00D68F;
    --accent-hover: #00BC7D;
    --accent-glow: rgba(0, 214, 143, 0.15);
    --accent-subtle: rgba(0, 214, 143, 0.08);

    --red: #FF4D6A;
    --orange: #FF9F43;
    --yellow: #FFCB45;
    --blue: #3B82F6;
    --purple: #A855F7;

    --sidebar-width: 240px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-ghost:hover {
    background: var(--accent-subtle);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
}

.btn-danger:hover {
    background: rgba(255, 77, 106, 0.1);
}

.btn-google {
    background: #fff;
    color: #333;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-google:hover {
    background: #f1f1f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =============================================
   PAGES
   ============================================= */

.page {
    display: none;
}

.page.active {
    display: block;
}

#app-page.active {
    display: flex;
}

/* =============================================
   LANDING PAGE
   ============================================= */

#landing-page {
    min-height: 100vh;
    background: var(--bg-primary);
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 60px;
    position: sticky;
    top: 0;
    background: rgba(11, 14, 17, 0.9);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 120px 20px 80px;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1.5px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), #00E5A0, #00F5B0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features */
.features-section {
    padding: 80px 60px;
    text-align: center;
}

.features-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(180deg, transparent, var(--accent-subtle));
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.cta-section p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 30px;
}

/* Footer */
.landing-footer {
    padding: 40px 60px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-disclaimer {
    color: var(--text-muted);
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

/* =============================================
   SIDEBAR
   ============================================= */

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.nav-item:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.sidebar-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-signin-sidebar {
    width: 100%;
    padding: 10px;
    background: var(--accent-subtle);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-signin-sidebar:hover {
    background: var(--accent);
    color: #000;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 4px 0;
    margin-top: 4px;
    font-family: 'Inter', sans-serif;
}

.btn-logout:hover {
    color: var(--red);
}

/* =============================================
   MAIN CONTENT
   ============================================= */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    padding: 0 24px 40px;
    position: relative;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.greeting {
    font-size: 1.1rem;
    font-weight: 600;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-lang-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-width: 1.5px;
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

/* =============================================
   AD PLACEMENTS
   ============================================= */

.ad-banner {
    margin: 16px 0 8px;
    text-align: center;
}

.ad-placeholder {
    background: var(--bg-secondary);
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-sidebar {
    position: fixed;
    right: 20px;
    top: 200px;
    width: 160px;
}

.ad-rect {
    width: 160px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   GLASS CARDS
   ============================================= */

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-hover);
}

/* =============================================
   STAT CARDS
   ============================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.stat-value.positive {
    color: var(--accent);
}

.stat-value.negative {
    color: var(--red);
}

.stat-change {
    font-size: 0.8rem;
    margin-top: 4px;
}

.stat-change.up {
    color: var(--accent);
}

.stat-change.down {
    color: var(--red);
}

/* =============================================
   SECTIONS & GRIDS
   ============================================= */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.full-width {
    grid-column: 1 / -1;
}

/* =============================================
   TABLES
   ============================================= */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--accent-subtle);
}

.amount-income {
    color: var(--accent);
    font-weight: 600;
}

.amount-expense {
    color: var(--red);
    font-weight: 600;
}

.category-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--accent-subtle);
    color: var(--accent);
}

/* =============================================
   PROGRESS BAR
   ============================================= */

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-green {
    background: var(--accent);
}

.progress-blue {
    background: var(--blue);
}

.progress-yellow {
    background: var(--yellow);
}

.progress-orange {
    background: var(--orange);
}

.progress-red {
    background: var(--red);
}

.progress-purple {
    background: var(--purple);
}

/* =============================================
   BUDGET CATEGORY CARDS
   ============================================= */

.budget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.budget-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.budget-card:hover {
    border-color: var(--border-hover);
}

.budget-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.budget-card-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.budget-card-amounts {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.budget-card-pct {
    font-size: 0.85rem;
    font-weight: 700;
}

/* =============================================
   SAVINGS GOAL CARDS
   ============================================= */

.goal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.goal-card:hover {
    border-color: var(--border-hover);
}

.goal-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.goal-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.goal-amounts {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.goal-target-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Progress Ring */
.progress-ring-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 12px;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 700;
}

/* =============================================
   DEBT CARDS
   ============================================= */

.debt-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.debt-card:hover {
    border-color: var(--border-hover);
}

.debt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.debt-name {
    font-weight: 700;
    font-size: 1rem;
}

.debt-apr {
    font-size: 0.85rem;
    color: var(--orange);
    font-weight: 600;
}

.debt-details {
    display: flex;
    gap: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Strategy Toggle */
.strategy-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.strategy-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.strategy-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* =============================================
   NET WORTH
   ============================================= */

.networth-hero {
    text-align: center;
    padding: 24px;
    margin-bottom: 24px;
}

.networth-amount {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.networth-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--accent-subtle);
    color: var(--accent);
}

/* =============================================
   SETTINGS
   ============================================= */

.settings-section {
    margin-bottom: 24px;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 16px;
}

.form-input,
.form-select,
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-input:hover,
.form-select:hover,
.form-control:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.form-input:focus,
.form-select:focus,
.form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 214, 143, 0.1);
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}


.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.toggle-label {
    font-size: 0.9rem;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--text-muted);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-switch.on {
    background: var(--accent);
}

.toggle-switch::after {
    content: '';
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle-switch.on::after {
    transform: translateX(20px);
}

/* =============================================
   MODAL
   ============================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 400px;
    width: 90%;
    position: relative;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-header {
    margin-bottom: 28px;
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 12px 0 8px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-guarantee {
    background: rgba(0, 214, 143, 0.1);
    border: 1px solid rgba(0, 214, 143, 0.3);
    padding: 10px 16px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 10px;
}

.modal-guarantee span {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
}

.modal-terms {
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =============================================
   CHART CONTAINERS
   ============================================= */

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-wrapper {
    position: relative;
    height: 280px;
}

/* =============================================
   MONTH SELECTOR
   ============================================= */

.month-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.month-selector button {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.month-selector button:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.month-selector span {
    font-weight: 600;
    min-width: 160px;
    text-align: center;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Nav Right */
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Toggle */
.btn-lang {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--accent);
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.btn-lang:hover {
    border-color: var(--accent);
    color: #000;
    background: var(--accent);
}

/* Free Badge */
.free-badge {
    display: inline-block;
    background: rgba(0, 214, 143, 0.1);
    border: 2px solid rgba(0, 214, 143, 0.4);
    color: var(--accent);
    padding: 16px 36px;
    border-radius: 40px;
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 32px;
    letter-spacing: 0.5px;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 214, 143, 0.2);
    }

    50% {
        box-shadow: 0 0 20px 4px rgba(0, 214, 143, 0.15);
    }
}

/* Trust Badges */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.trust-badge {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-card);
}

/* How It Works */
.how-it-works {
    padding: 80px 60px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
}

.how-it-works h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.hiw-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 50px;
}

.hiw-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    max-width: 1000px;
    margin: 0 auto;
}

.hiw-step {
    flex: 1;
    max-width: 300px;
    padding: 32px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.hiw-step:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.hiw-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.hiw-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.hiw-step h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hiw-step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.hiw-connector {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    color: var(--accent);
    padding: 0 16px;
    margin-top: 80px;
    font-weight: 700;
}

/* CTA Free Box */
.cta-free-box {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 2px solid rgba(0, 214, 143, 0.2);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
}

.cta-free-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.cta-free-list {
    margin: 24px auto;
    text-align: left;
    max-width: 320px;
}

.cta-free-item {
    padding: 8px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.cta-free-why {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 450px;
    margin: 16px auto 28px;
    line-height: 1.5;
}

@media (max-width: 1200px) {
    .ad-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }

    .sidebar-header .logo-text,
    .nav-item span:last-child,
    .sidebar-user-info,
    .sidebar-footer .btn-logout {
        display: none;
    }

    .sidebar-nav .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .main-content {
        margin-left: 60px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .landing-nav {
        padding: 16px 20px;
    }

    .features-section,
    .how-it-works {
        padding: 60px 20px;
    }

    .hiw-steps {
        flex-direction: column;
        align-items: center;
    }

    .hiw-connector {
        transform: rotate(90deg);
        margin: 8px 0;
        padding: 0;
    }

    .free-badge {
        font-size: 0.8rem;
        padding: 8px 16px;
    }

    .trust-badges {
        gap: 12px;
    }

    .budget-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =============================================
   CASH FLOW MODULE — PREMIUM
   ============================================= */

.cf-page {
    max-width: 90%;
}


/* ── Header ── */
.cf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.cf-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cf-eyebrow {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
    opacity: 0.9;
}

.cf-title {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
    background: linear-gradient(135deg, #fff 60%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Month pill ── */
.cf-month-pill {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.cf-arr {
    background: none;
    border: none;
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.cf-arr:last-child {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.cf-arr:hover {
    background: var(--accent-subtle);
    color: var(--accent);
}

.cf-month-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 20px;
    min-width: 150px;
    text-align: center;
    letter-spacing: 0.3px;
}

.cf-month-label em {
    font-style: normal;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.82rem;
    margin-left: 4px;
}

/* ── Summary cards ── */
.cf-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.cf-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.cf-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
}

.cf-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cf-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
}

.cf-card:hover::after {
    opacity: 1;
}

.cf-card-inc::before {
    background: linear-gradient(90deg, var(--accent), #00F5B0);
}

.cf-card-inc:hover {
    box-shadow: 0 8px 24px rgba(0, 214, 143, 0.12);
}

.cf-card-exp::before {
    background: linear-gradient(90deg, var(--red), #FF8FA3);
}

.cf-card-exp:hover {
    box-shadow: 0 8px 24px rgba(255, 77, 106, 0.12);
}

.cf-card-bal::before {
    background: linear-gradient(90deg, var(--blue), #60A5FA);
}

.cf-card-bal.cf-g::before {
    background: linear-gradient(90deg, var(--accent), #00F5B0);
}

.cf-card-bal.cf-r::before {
    background: linear-gradient(90deg, var(--red), #FF8FA3);
}

.cf-card-bal:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
}

.cf-card-icon {
    font-size: 1.8rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.cf-card-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.cf-card-val {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

/* ── Spreadsheet wrapper ── */
.cf-sheet-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.cf-sheet {
    width: 100%;
    border-collapse: collapse;
}

/* ── Table header ── */
.cf-sheet thead tr {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 2px solid var(--border-color);
}

.cf-sheet thead th {
    padding: 12px 14px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

.cf-rn-h {
    width: 40px;
    text-align: center;
    color: transparent;
}

.cf-th-c {
    text-align: left;
    color: var(--text-muted);
}

/* Ingresos header = green tint */
.cf-th-n:first-of-type,
th.cf-th-n:nth-child(3) {
    text-align: right;
    width: 145px;
    color: var(--accent);
    background: rgba(0, 214, 143, 0.05);
    border-left: 2px solid rgba(0, 214, 143, 0.2);
}

/* Egresos header = red tint */
th.cf-th-n:nth-child(4) {
    text-align: right;
    width: 145px;
    color: var(--red);
    background: rgba(255, 77, 106, 0.05);
    border-left: 2px solid rgba(255, 77, 106, 0.2);
}

/* .cf-th-n fallback */
.cf-th-n {
    text-align: right;
    width: 145px;
}


/* ── Rows ── */
.cf-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.035);
    transition: background 0.1s;
}

.cf-row:last-child {
    border-bottom: none;
}

.cf-row-alt {
    background: rgba(255, 255, 255, 0.012);
}

.cf-row:hover {
    background: rgba(0, 214, 143, 0.045) !important;
}

/* ── Row number ── */
.cf-rn {
    text-align: center;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.15);
    padding: 0 8px;
    width: 40px;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.cf-row:hover .cf-rn {
    color: var(--accent);
    font-weight: 700;
}

/* ── Cells ── */
.cf-cn {
    padding: 0 10px 0 8px;
}

/* Ingresos cells — subtle green column */
.cf-nn.cf-nn-inc {
    padding: 0 10px;
    width: 145px;
    background: rgba(0, 214, 143, 0.03);
    border-left: 2px solid rgba(0, 214, 143, 0.12);
}

/* Egresos cells — subtle red column */
.cf-nn.cf-nn-exp {
    padding: 0 10px;
    width: 145px;
    background: rgba(255, 77, 106, 0.03);
    border-left: 2px solid rgba(255, 77, 106, 0.12);
}

/* Generic fallback */
.cf-nn {
    padding: 0 10px;
    width: 145px;
}


/* ── Inputs — transparent, elegant ── */
.cf-cn input,
.cf-nn input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    outline: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    padding: 12px 4px;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    box-shadow: none !important;
    transition: color 0.15s;
}

.cf-nn input {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
    color: var(--text-secondary);
}

.cf-nn input:not(:placeholder-shown) {
    color: var(--text-primary);
}

.cf-cn input:focus,
.cf-nn input:focus {
    background: rgba(0, 214, 143, 0.05) !important;
    border-radius: 6px;
    color: var(--text-primary) !important;
}

.cf-cn input::placeholder {
    color: rgba(255, 255, 255, 0.1);
    font-style: italic;
    font-size: 0.82rem;
}

.cf-nn input::-webkit-outer-spin-button,
.cf-nn input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Footer rows ── */
.cf-sheet tfoot {
    border-top: 2px solid var(--border-color);
}

.cf-foot-total td,
.cf-foot-bal td {
    padding: 13px 14px;
    font-weight: 700;
}

.cf-foot-total {
    background: rgba(255, 255, 255, 0.025);
}

.cf-foot-bal {
    background: rgba(255, 255, 255, 0.045);
}

.cf-foot-lbl {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.cf-foot-num {
    text-align: right;
    font-size: 1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}

.cf-bal-val {
    font-size: 1.15rem;
}

/* ── Semaphore ── */
.cf-g {
    color: var(--accent) !important;
}

.cf-r {
    color: var(--red) !important;
}

/* ── Actions row ── */
.cf-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.cf-add-row-btn {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.cf-add-row-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

/* ── GUARDAR button — premium with glow ── */
.cf-import-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.cf-import-btn:hover {
    border-color: #60A5FA;
    color: #60A5FA;
    background: rgba(96, 165, 250, 0.08);
}

.cf-save-main-btn {
    background: var(--accent);
    color: #000;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 12px 36px;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 0 0 0 rgba(0, 214, 143, 0.4);
    animation: cf-pulse 2.5s ease-in-out infinite;
}

.cf-save-main-btn:hover {
    background: #00F5B0;
    box-shadow: 0 0 28px rgba(0, 214, 143, 0.5);
    transform: translateY(-1px);
    animation: none;
}

@keyframes cf-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 214, 143, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 214, 143, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 214, 143, 0);
    }
}

/* ── Toast ── */
.cf-toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: linear-gradient(135deg, var(--accent), #00F5B0);
    color: #000;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 14px 28px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    z-index: 9999;
    letter-spacing: 0.3px;
    box-shadow: 0 8px 32px rgba(0, 214, 143, 0.35);
    animation: cf-toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cf-toast-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Hint ── */
.cf-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 12px;
}

.cf-hint a {
    color: var(--accent);
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .cf-cards {
        grid-template-columns: 1fr;
    }

    .cf-page {
        max-width: 100%;
    }
}

/* ── Theme Toggle Button (Luna/Sol) ── */
.btn-theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 1.1rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-theme-toggle:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: rotate(15deg) scale(1.1);
}

/* ── Light Mode Overrides ── */
body.light-mode {
    --bg-primary: #F0F2F5;
    --bg-secondary: #E4E7EB;
    --bg-card: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --border-color: #D1D5DB;
    --border-hover: #9CA3AF;
    --sidebar-bg: #1a1a2e;
}

body.light-mode .top-bar {
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
}

body.light-mode .main-content {
    background: #F0F2F5;
}

body.light-mode .cf-sheet-wrapper {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

body.light-mode .cf-row:hover {
    background: rgba(0, 214, 143, 0.06) !important;
}

body.light-mode .cf-cn input,
body.light-mode .cf-nn input {
    color: #111827;
}

body.light-mode .cf-title {
    background: linear-gradient(135deg, #111827 60%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* -- Delete button column -- */
.cf-del-h {
    width: 40px;
    min-width: 40px;
}

.cf-del {
    width: 40px;
    min-width: 40px;
    text-align: center;
    padding: 0 6px;
    white-space: nowrap;
}

.cf-del-btn {
    background: none;
    border: none;
    color: transparent;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.15s;
}

.cf-row:hover .cf-del-btn {
    color: var(--red);
    background: rgba(255, 77, 106, 0.1);
}

.cf-del-btn:hover {
    background: rgba(255, 77, 106, 0.25) !important;
    transform: scale(1.15);
}

/* =====================================================
   PREMIUM CONFIRM MODAL
   ===================================================== */
.sm-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: smOverlayIn 0.2s ease;
}

@keyframes smOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sm-confirm-box {
    background: linear-gradient(145deg, rgba(20, 24, 32, 0.97), rgba(11, 14, 17, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 36px 40px 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(168, 85, 247, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: smBoxIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

@keyframes smBoxIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.sm-confirm-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    filter: drop-shadow(0 0 18px rgba(255, 159, 67, 0.6));
    animation: smIconPulse 1.8s ease-in-out infinite;
}

@keyframes smIconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.sm-confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

.sm-confirm-msg {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 28px;
}

.sm-confirm-msg strong {
    color: var(--orange);
}

.sm-confirm-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.sm-btn-yes {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
    transition: all 0.18s ease;
    letter-spacing: 0.03em;
}

.sm-btn-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(168, 85, 247, 0.55);
    background: linear-gradient(135deg, #6d28d9, #9333ea);
}

.sm-btn-no {
    flex: 1;
    padding: 12px 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.18s ease;
}

.sm-btn-no:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

/* =====================================================
   DASHBOARD PRESUPUESTO vs FLUJO DE CAJA — PREMIUM
   ===================================================== */
.dash-page {
    padding: 4px 0 32px;
    animation: dashFadeIn .4s ease;
}

@keyframes dashFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

/* ── Month nav ── */
.dash-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.dash-eyebrow {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.dash-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
}

.dash-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-month-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 40px;
    padding: 6px 16px;
}

.dash-month-pill span {
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
    min-width: 120px;
    text-align: center;
}

.dash-arr {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: .15s;
}

.dash-arr:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.dash-view-toggle {
    display: flex;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 40px;
    overflow: hidden;
}

.dash-view-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 600;
    padding: 7px 18px;
    cursor: pointer;
    transition: .18s;
    white-space: nowrap;
}

.dash-view-btn.active {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
}

/* ── KPI Cards ── */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media(max-width:900px) {
    .dash-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:500px) {
    .dash-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.dash-kpi-card {
    background: linear-gradient(145deg, rgba(20, 24, 32, .95), rgba(14, 18, 24, .97));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: .2s;
}

.dash-kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--kpi-glow, rgba(0, 214, 143, .04));
    pointer-events: none;
}

.dash-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
    border-color: rgba(255, 255, 255, .14);
}

.dash-kpi-icon {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.dash-kpi-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.dash-kpi-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}

.dash-kpi-group {
    display: flex;
    flex-direction: column;
}

.dash-kpi-sublabel {
    font-size: .67rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.dash-kpi-num {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.dash-kpi-num.green {
    color: var(--accent);
}

.dash-kpi-num.red {
    color: var(--red);
}

.dash-kpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
}

.dash-kpi-badge.up {
    background: rgba(0, 214, 143, .12);
    color: var(--accent);
}

.dash-kpi-badge.down {
    background: rgba(255, 77, 106, .12);
    color: var(--red);
}

.dash-kpi-badge.neu {
    background: rgba(255, 255, 255, .07);
    color: var(--text-secondary);
}

/* ── Charts row ── */
.dash-charts-row {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media(max-width:800px) {
    .dash-charts-row {
        grid-template-columns: 1fr;
    }
}

.dash-chart-card {
    background: linear-gradient(145deg, rgba(20, 24, 32, .95), rgba(14, 18, 24, .97));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 20px;
}

.dash-chart-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.dash-ring-center {
    position: relative;
}

.dash-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dash-ring-pct {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.dash-ring-sub {
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Variance Table ── */
.dash-var-wrap {
    margin-bottom: 24px;
}

.dash-var-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.dash-section-title {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dash-var-table-card {
    background: linear-gradient(145deg, rgba(20, 24, 32, .95), rgba(14, 18, 24, .97));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    overflow: hidden;
}

.dash-var-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.dash-var-table thead tr {
    background: rgba(255, 255, 255, .04);
}

.dash-var-table th {
    padding: 10px 14px;
    text-align: right;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dash-var-table th:nth-child(2) {
    text-align: left;
}

.dash-var-table td {
    padding: 9px 14px;
    border-top: 1px solid rgba(255, 255, 255, .04);
    text-align: right;
    color: var(--text-secondary);
}

.dash-var-table td:nth-child(2) {
    text-align: left;
    color: #fff;
    font-weight: 500;
}

.dash-var-table tr:hover td {
    background: rgba(255, 255, 255, .03);
}

.dash-var-table tr.dash-unplanned td {
    background: rgba(255, 159, 67, .04);
}

.dash-var-table tr.dash-unplanned td:nth-child(2)::after {
    content: ' ⚠️';
    font-size: .72rem;
}

.dash-delta.pos {
    color: var(--accent);
    font-weight: 700;
}

.dash-delta.neg {
    color: var(--red);
    font-weight: 700;
}

.dash-delta.neu {
    color: var(--text-muted);
}

.dash-sem {
    font-size: 1rem;
}

/* ── Alerts ── */
.dash-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media(max-width:700px) {
    .dash-bottom-row {
        grid-template-columns: 1fr;
    }
}

.dash-alert-card {
    background: linear-gradient(145deg, rgba(20, 24, 32, .95), rgba(14, 18, 24, .97));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 20px;
}

.dash-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    font-size: .8rem;
    color: var(--text-secondary);
}

.dash-alert-item:last-child {
    border-bottom: none;
}

.dash-alert-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.dash-alert-text strong {
    color: #fff;
}

.dash-no-alerts {
    color: var(--text-muted);
    font-size: .82rem;
    text-align: center;
    padding: 16px 0;
}

/* ── Summary Banner ── */
.dash-summary-card {
    border-radius: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, rgba(124, 58, 237, .18), rgba(0, 214, 143, .10));
    border: 1px solid rgba(124, 58, 237, .25);
    text-align: center;
}

.dash-summary-card.deficit {
    background: linear-gradient(135deg, rgba(255, 77, 106, .14), rgba(255, 100, 50, .08));
    border-color: rgba(255, 77, 106, .22);
}

.dash-savings-big {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -.02em;
    margin: 6px 0;
}

.dash-savings-big.pos {
    color: var(--accent);
    text-shadow: 0 0 30px rgba(0, 214, 143, .4);
}

.dash-savings-big.neg {
    color: var(--red);
    text-shadow: 0 0 30px rgba(255, 77, 106, .4);
}

.dash-savings-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
}

.dash-savings-rate {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ── Trend view (Por Mes) ── */
.dash-trend-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media(max-width:700px) {
    .dash-trend-charts {
        grid-template-columns: 1fr;
    }
}

.dash-trend-chart-card {
    background: linear-gradient(145deg, rgba(20, 24, 32, .95), rgba(14, 18, 24, .97));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 20px;
}

.dash-no-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: .9rem;
}

.dash-no-data-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* ── Loading ── */
.dash-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
    color: var(--text-muted);
    font-size: .9rem;
    gap: 10px;
}


/* ── Wise Affiliate Banner ── */
.wise-banner-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    margin-top: 8px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 185, 115, .12), rgba(0, 130, 80, .08));
    border: 1px solid rgba(0, 185, 115, .25);
    text-decoration: none;
    transition: all .22s ease;
    cursor: pointer;
}
.wise-banner-card:hover {
    background: linear-gradient(135deg, rgba(0, 185, 115, .2), rgba(0, 130, 80, .14));
    border-color: rgba(0, 185, 115, .45);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 185, 115, .18);
}
.wise-banner-left { display: flex; align-items: center; gap: 14px; }
.wise-banner-emoji { font-size: 1.6rem; flex-shrink: 0; }
.wise-banner-title { font-size: .92rem; font-weight: 700; color: #fff; margin-bottom: 3px; }
.wise-banner-sub { font-size: .75rem; color: rgba(0, 215, 150, .8); }
.wise-banner-cta {
    flex-shrink: 0;
    background: linear-gradient(135deg, #00b973, #00d996);
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    padding: 9px 20px;
    border-radius: 24px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 185, 115, .35);
    transition: all .18s;
}
.wise-banner-card:hover .wise-banner-cta { box-shadow: 0 6px 24px rgba(0, 185, 115, .55); transform: scale(1.04); }
@media(max-width:600px) { .wise-banner-card { flex-direction: column; align-items: flex-start; } }

/* ── Wise Sidebar Compact Banner ── */
.wise-sidebar-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 10px 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 185, 115, .14), rgba(0, 120, 70, .08));
    border: 1px solid rgba(0, 185, 115, .22);
    text-decoration: none;
    transition: all .2s;
    cursor: pointer;
}
.wise-sidebar-card:hover {
    background: linear-gradient(135deg, rgba(0, 185, 115, .25), rgba(0, 120, 70, .15));
    border-color: rgba(0, 185, 115, .45);
}
.wise-sidebar-icon { font-size: 1.2rem; flex-shrink: 0; }
.wise-sidebar-text { flex: 1; min-width: 0; }
.wise-sidebar-title { font-size: .78rem; font-weight: 700; color: #fff; }
.wise-sidebar-sub { font-size: .66rem; color: rgba(0, 215, 150, .75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wise-sidebar-arrow { font-size: .9rem; color: rgba(0, 215, 150, .8); flex-shrink: 0; }


/* =============================================
   CF LINK SELECT — Vincular egreso a Deuda/Ahorro
   ============================================= */
.cf-link-td {
    padding: 4px 4px;
    vertical-align: middle;
    width: 170px;
    min-width: 170px;
    max-width: 200px;
}

.cf-link-h {
    font-size: .65rem;
    color: var(--text-muted);
    padding: 8px 4px;
    width: 340px !important;
    min-width: 340px !important;
    max-width: 340px !important;
    white-space: nowrap;
}

.cf-link-sel {
    width: 330px !important;
    min-width: 330px !important;
    max-width: 330px !important;
    background: rgba(15, 20, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: .72rem;
    font-family: 'Inter', sans-serif;
    padding: 5px 8px;
    cursor: pointer;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238B95A5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

.cf-link-sel:focus {
    border-color: rgba(168, 85, 247, .6);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, .15);
    color: #fff;
}

.cf-link-sel.linked {
    border-color: rgba(168, 85, 247, .45);
    color: #c4b5fd;
    background-color: rgba(168, 85, 247, .08);
}

.cf-link-sel option,
.cf-link-sel optgroup {
    background: #141820;
    color: #fff;
}

.cf-link-h {
    font-size: .65rem;
    color: var(--text-muted);
    padding: 8px 6px;
    min-width: 160px;
}
/* ── Legal links in sidebar ───────────────────── */
.sidebar-legal {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem .4rem;
    padding: .75rem 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: .5rem;
}
.sidebar-legal a {
    color: var(--text-muted);
    font-size: .72rem;
    text-decoration: none;
    transition: color .2s;
}
.sidebar-legal a:hover { color: var(--accent); }
.sidebar-legal span { color: var(--text-muted); font-size: .72rem; }