/* ========================================
   ESTILOS EXTENDIDOS - GastoClaro v2.0
   Navegación por Tabs, Préstamos, Objetivos, Resumen Mensual
   ======================================== */

/* ========================================
   Navigation Tabs
   ======================================== */
.main-nav {
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 65px;
    z-index: 90;
    transition: var(--transition);
}

.nav-tabs {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
    height: 3px;
}

.nav-tab {
    flex: 1;
    min-width: 120px;
    padding: 16px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.nav-tab svg {
    stroke-width: 2;
}

.nav-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-secondary);
}

/* ========================================
   Tab Content
   ======================================== */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ========================================
   Balance Extra
   ======================================== */
.balance-extra {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Ingresos - Verde brillante */
.balance-item.income {
    background: linear-gradient(135deg, rgba(187, 247, 208, 0.4), rgba(134, 239, 172, 0.4));
    border: 2px solid rgba(187, 247, 208, 0.8);
    box-shadow: 0 4px 12px rgba(134, 239, 172, 0.3);
}

.balance-item.income .label {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.balance-item.income .amount {
    color: #dcfce7;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Gastos - Rojo brillante */
.balance-item.expense {
    background: linear-gradient(135deg, rgba(252, 165, 165, 0.4), rgba(248, 113, 113, 0.4));
    border: 2px solid rgba(252, 165, 165, 0.8);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

.balance-item.expense .label {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.balance-item.expense .amount {
    color: #fee2e2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Préstamos a Pagar - Rojo anaranjado (coral) */
.balance-item.warning {
    background: linear-gradient(135deg, rgba(253, 164, 175, 0.4), rgba(251, 113, 133, 0.4));
    border: 2px solid rgba(253, 164, 175, 0.8);
    box-shadow: 0 4px 12px rgba(251, 113, 133, 0.3);
}

.balance-item.warning .label {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.balance-item.warning .amount {
    color: #ffe4e6;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Préstamos a Cobrar - Verde esmeralda más brillante */
.balance-item.success {
    background: linear-gradient(135deg, rgba(110, 231, 183, 0.4), rgba(52, 211, 153, 0.4));
    border: 2px solid rgba(110, 231, 183, 0.8);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3);
}

.balance-item.success .label {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.balance-item.success .amount {
    color: #d1fae5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ========================================
   Loans Section
   ======================================== */
.loans-header,
.goals-header,
.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.loans-header h2,
.goals-header h2,
.summary-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.loans-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 20px;
    align-items: center;
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.summary-card.loan-give {
    border-left: 4px solid var(--income-color);
}

.summary-card.loan-receive {
    border-left: 4px solid var(--expense-color);
}

.summary-icon {
    font-size: 48px;
    line-height: 1;
}

.summary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-count {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ========================================
   Loans Tabs
   ======================================== */
.loans-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.loan-tab {
    flex: 1;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.loan-tab:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.loan-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ========================================
   Loans List
   ======================================== */
.loans-list-container {
    position: relative;
    min-height: 300px;
}

.loans-list {
    display: none;
}

.loans-list.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.loan-item {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.loan-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

.loan-item.toCollect::before {
    background: var(--income-color);
}

.loan-item.toPay::before {
    background: var(--expense-color);
}

.loan-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.loan-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.loan-person {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.loan-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.loan-amount-display {
    font-size: 24px;
    font-weight: 700;
}

.loan-item.toCollect .loan-amount-display {
    color: var(--income-color);
}

.loan-item.toPay .loan-amount-display {
    color: var(--expense-color);
}

.loan-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.loan-dates {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.loan-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.loan-status-badge.pending {
    background: rgba(239, 68, 68, 0.1);
    color: var(--expense-color);
}

.loan-status-badge.partial {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.loan-status-badge.completed {
    background: rgba(34, 197, 94, 0.1);
    color: var(--income-color);
}

.loan-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.loan-progress {
    margin-top: 12px;
}

.loan-progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.loan-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.loan-progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========================================
   Goals Section
   ======================================== */
.goals-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.goal-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.goal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.goal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.goal-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.goal-category-badge {
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.goal-progress {
    margin: 20px 0;
}

.goal-progress-bar {
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #86efac);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.goal-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.goal-amounts {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.goal-current,
.goal-target {
    display: flex;
    flex-direction: column;
}

.goal-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.goal-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.goal-percentage {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 12px 0;
}

.goal-deadline {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 12px;
}

.goal-deadline.overdue {
    color: var(--expense-color);
    font-weight: 600;
}

.goal-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.goal-actions button {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

/* ========================================
   Summary / Statistics Section
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 16px;
    align-items: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 36px;
    line-height: 1;
}

.stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.monthly-chart-container,
.top-categories {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.monthly-chart-container h3,
.top-categories h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

#monthlyChart {
    max-height: 300px;
}

/* Category Charts */
.category-charts-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
}

.category-charts-container > h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.chart-with-legend {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    width: 100%;
}

.chart-section {
    flex: 0 0 280px;
    min-width: 280px;
}

.chart-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.chart-section canvas {
    display: block;
    margin: 0 auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chart-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    min-width: 0;
}

/* Personalizar scrollbar para que sea más sutil */
.chart-legend::-webkit-scrollbar {
    width: 6px;
}

.chart-legend::-webkit-scrollbar-track {
    background: transparent;
}

.chart-legend::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.chart-legend::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    animation: slideInRight 0.4s ease forwards;
    opacity: 0;
    border-left: 3px solid var(--category-color, transparent);
    min-width: 0;
    flex-shrink: 0;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chart-legend-item:nth-child(1) { animation-delay: 0.05s; }
.chart-legend-item:nth-child(2) { animation-delay: 0.1s; }
.chart-legend-item:nth-child(3) { animation-delay: 0.15s; }
.chart-legend-item:nth-child(4) { animation-delay: 0.2s; }
.chart-legend-item:nth-child(5) { animation-delay: 0.25s; }
.chart-legend-item:nth-child(6) { animation-delay: 0.3s; }
.chart-legend-item:nth-child(7) { animation-delay: 0.35s; }
.chart-legend-item:nth-child(8) { animation-delay: 0.4s; }
.chart-legend-item:nth-child(9) { animation-delay: 0.45s; }
.chart-legend-item:nth-child(10) { animation-delay: 0.5s; }
.chart-legend-item:nth-child(11) { animation-delay: 0.55s; }
.chart-legend-item:nth-child(12) { animation-delay: 0.6s; }

.chart-legend-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.chart-legend-item.active {
    background: var(--bg-secondary);
    transform: translateX(4px) scale(1.05);
    border-left-width: 4px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.legend-color-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.legend-value {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.legend-percentage {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* Responsive adjustments */
@media (max-width: 968px) {
    .chart-with-legend {
        flex-direction: column;
        align-items: center;
    }

    .chart-section {
        flex: none;
        width: 100%;
        max-width: 320px;
        min-width: 0;
    }

    .chart-legend {
        width: 100%;
        max-height: 250px;
    }
}

@media (max-width: 768px) {
    .charts-grid {
        gap: 24px;
    }

    .chart-section canvas {
        width: 100% !important;
        height: auto !important;
    }

    .chart-legend {
        max-height: 200px;
    }

    .legend-label {
        font-size: 13px;
    }

    .legend-value {
        font-size: 12px;
    }
}

.top-category-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--category-color, var(--primary-color));
    margin-bottom: 12px;
    transition: var(--transition);
}

.top-category-item:hover {
    background: var(--bg-tertiary);
}

.category-rank {
    width: 36px;
    height: 36px;
    background: var(--category-color, var(--primary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.category-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.category-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--expense-color);
}

.category-percentage {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-left: 8px;
}

/* ========================================
   Filters Section Conditional
   ======================================== */
.filters-section {
    display: block;
}

/* ========================================
   Form Elements Extended
   ======================================== */
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

/* ========================================
   Responsive Design Extended
   ======================================== */
@media (max-width: 768px) {
    .nav-tab span {
        font-size: 11px;
    }

    .nav-tab svg {
        width: 18px;
        height: 18px;
    }

    .balance-extra {
        grid-template-columns: 1fr;
    }

    .loans-summary {
        grid-template-columns: 1fr;
    }

    .summary-amount {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .goals-list {
        grid-template-columns: 1fr;
    }

    .loans-header,
    .goals-header,
    .summary-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .loans-header button,
    .goals-header button {
        width: 100%;
    }
}

@media (min-width: 769px) {
    .main-nav {
        top: 80px;
    }
}

/* ========================================
   Animations Extended
   ======================================== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.goal-card.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(134, 239, 172, 0.1));
    border: 2px solid var(--income-color);
}

.goal-card.completed::before {
    background: var(--income-color);
}

/* ========================================
   Metas Container (Fusión Presupuestos + Objetivos)
   ======================================== */
.metas-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.metas-section {
    width: 100%;
}

.metas-section .section-header h2,
.metas-section .goals-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .metas-container {
        gap: 32px;
    }
}

/* ========================================
   Transaction Notes
   ======================================== */
.transaction-notes {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-style: italic;
    line-height: 1.4;
}

/* ========================================
   Accounts Summary
   ======================================== */
.accounts-summary {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.accounts-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.account-item {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.account-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.account-name {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    opacity: 0.8;
}

.account-icon svg {
    width: 18px;
    height: 18px;
}

.account-balance {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.account-balance.positive {
    color: var(--income-color);
}

.account-balance.negative {
    color: var(--expense-color);
}

@media (max-width: 768px) {
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Split Calculator
   ======================================== */
.btn-split {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-split:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.split-calculator {
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: var(--radius-md);
    margin-top: 16px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.split-calculator h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.split-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.split-input-group label {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.split-input-group #splitTotal {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.split-input-group input {
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 14px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.split-result {
    margin-top: 16px;
    padding: 16px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(34, 197, 94, 0.3);
    text-align: center;
}

.split-result p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.split-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--income-color);
}

/* ========================================
   Daily Summary
   ======================================== */
.daily-summary-section {
    padding: 12px 0;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(59, 130, 246, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.daily-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.summary-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.summary-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.summary-text.summary-today {
    flex: 1.5;
    padding: 0 8px;
}

.summary-text.summary-today .summary-label {
    font-size: 14px;
    color: var(--primary-color);
}

.summary-text.summary-today .summary-detail {
    font-size: 14px;
    font-weight: 600;
}

.summary-divider {
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    flex-shrink: 0;
}

.summary-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-detail {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.summary-detail.positive {
    color: #6ee7b7;
    font-weight: 700;
}

.summary-detail.negative {
    color: #fca5a5;
    font-weight: 700;
}

@media (max-width: 768px) {
    .daily-summary-section {
        padding: 8px 0;
    }

    .daily-summary {
        padding: 10px 16px;
    }

    .summary-icon {
        font-size: 28px;
    }

    .summary-detail {
        font-size: 14px;
    }
}

/* ========================================
   Swipe Actions
   ======================================== */
.transaction-item {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    transition: transform 0.3s ease;
}

.transaction-item.swiping {
    transition: none;
}

.swipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0;
    z-index: 1;
}

.swipe-action-btn {
    height: 100%;
    width: 80px;
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
}

.swipe-action-btn.edit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.swipe-action-btn.delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.swipe-action-btn:active {
    filter: brightness(0.9);
}

.swipe-action-btn svg {
    width: 20px;
    height: 20px;
}

.swipe-action-btn span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ocultar swipe actions en desktop para evitar superposición */
/* Swipe actions deshabilitadas - siempre mostrar botones normales */
.swipe-actions {
    display: none !important;
}

/* Ajustar categoría para que solo abarque el texto */
.transaction-category {
    display: inline-block;
    width: auto;
    max-width: fit-content;
}
