/* ========================================
   BUDGET APP STYLES - v1.6.0 CLEANUP
   ======================================== */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    color: #4a5568;
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 i {
    color: #667eea;
}

.back-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #667eea;
}

.back-btn i {
    font-size: 0.9rem;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Main content */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: 600px;
    width: 100%;
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    color: #2d3748;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Comparison styles */
.comparison {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.projected, .actual {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
}

.projected .label, .actual .label {
    font-weight: 600;
    font-size: 0.9rem;
}

.projected .amount, .actual .amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.savings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.savings-item .name {
    font-weight: 600;
    color: #2d3748;
}

.savings-item .amount {
    color: #4a5568;
    font-weight: 500;
}

/* Category Breakdown (for simple category lists) */
.category-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Base category item style (for simple lists - may be overridden by context-specific styles) */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.category-item .name {
    font-weight: 500;
    color: #2d3748;
}

.category-item .amount {
    font-weight: 600;
    color: #4a5568;
}

/* Income & Savings Styles */
.income-sources, .savings-goals {
    margin-bottom: 30px;
}

.income-sources h3, .savings-goals h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.income-list, .savings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.income-item, .savings-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.income-item:hover, .savings-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.income-item .info, .savings-item .info {
    flex: 1;
}

.income-item .name, .savings-item .name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.income-item .description, .savings-item .description {
    color: #718096;
    font-size: 0.9rem;
}

.income-item .amount, .savings-item .amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
}

/* Expense Tracker Styles */
.expense-filters {
    display: flex;
    gap: 15px;
    align-items: center;
}

.expense-filters select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
}

/* Month Navigation */
.month-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.month-navigation h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.month-picker {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.month-picker:hover {
    border-color: #cbd5e0;
}

.month-picker:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.expense-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.expense-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.expense-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.expense-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.expense-card-header h3 {
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.total-spent .expense-card-header h3 i {
    color: #f56565;
}

.total-projected .expense-card-header h3 i {
    color: #4299e1;
}

.difference .expense-card-header h3 i {
    color: #ed8936;
}

.expense-card-amount {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.total-spent .expense-card-amount {
    color: #f56565;
}

.total-projected .expense-card-amount {
    color: #4299e1;
}

.difference .expense-card-amount {
    color: #ed8936;
}

.expense-card-change {
    font-size: 0.85rem;
    font-weight: 500;
    color: #718096;
}

/* Lifetime Achievements */
.lifetime-achievements {
    margin-top: 40px;
    margin-bottom: 30px;
}

.achievements-header {
    color: #4a5568;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.achievements-header i {
    color: #d4af37;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.achievement-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.achievement-card-header h4 {
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.total-spending .achievement-card-header h4 i {
    color: #d4af37;
}

.net-gain .achievement-card-header h4 i {
    color: #d4af37;
}

.days-tracked .achievement-card-header h4 i {
    color: #d4af37;
}

.savings-rate .achievement-card-header h4 i {
    color: #d4af37;
}

.achievement-card-amount {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #d4af37;
}

.achievement-card-subtitle {
    font-size: 0.9rem;
    font-weight: 500;
    color: #718096;
}

/* Expense Charts */
.expense-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.chart-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.chart-section h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
}

.chart-section .chart-container {
    position: relative;
    height: 300px;
}

/* Projected Amounts */
.projected-amounts {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

.projected-amounts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.projected-amounts-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
}

.projected-amounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.projected-amount-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.category-header label {
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
    text-transform: capitalize;
    flex-shrink: 0;
}

.category-header input {
    width: 120px;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    text-align: right;
    transition: border-color 0.2s;
}

.category-header input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.subcategories-info {
    margin-top: 0;
}

.subcategories-info ul {
    margin: 0;
    padding: 0;
    padding-left: 16px;
    list-style: none;
}

.subcategories-info li {
    color: #718096;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 4px;
    position: relative;
}

.subcategories-info li:before {
    content: "•";
    color: #a0aec0;
    font-weight: bold;
    position: absolute;
    left: -12px;
}


.expense-categories, .recurring-expenses {
    margin-bottom: 30px;
}

.expense-categories h3, .recurring-expenses h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.category-list, .recurring-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.category-item, .recurring-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.category-item:hover, .recurring-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-item .info, .recurring-item .info {
    flex: 1;
}

.category-item .name, .recurring-item .name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.category-item .description, .recurring-item .description {
    color: #718096;
    font-size: 0.9rem;
}

.category-item .amount, .recurring-item .amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
}

.category-item .progress, .recurring-item .progress {
    margin-top: 8px;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.category-item .progress-bar, .recurring-item .progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    transform: translateY(-2px);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Transactions section */
.transactions-section h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filters select {
    padding: 10px 30px 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-weight: 500;
    color: #2d3748;
    min-width: 150px;
    text-align: center;
    text-align-last: center;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.filters select option {
    text-align: center;
    padding: 8px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-weight: 500;
    direction: ltr;
    text-align-last: center;
}

.filters input[type="month"] {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-weight: 500;
    color: #2d3748;
    min-width: 150px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.filters select:focus,
.filters input[type="month"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Two-column transactions layout */
.transactions-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
    max-width: none;
}

.transactions-column {
    display: flex;
    flex-direction: column;
}

.transactions-column h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.transactions-column .transactions-list {
    flex: 1;
}

/* Transaction list */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #e2e8f0;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    min-height: 80px;
}

.transaction-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.transaction-item.income {
    border-left-color: #38a169;
}

.transaction-item.expense {
    border-left-color: #e53e3e;
}

.transaction-item.auto-generated {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-left-color: #667eea;
}

.transaction-item.auto-generated .transaction-description {
    position: relative;
}

.auto-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.transaction-info {
    flex: 1;
    min-width: 250px;
}

.transaction-description {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.transaction-meta {
    display: flex;
    gap: 20px;
    color: #718096;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.transaction-amount {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: right;
    min-width: 100px;
}

.transaction-amount.income {
    color: #38a169;
}

.transaction-amount.expense {
    color: #e53e3e;
}

.transaction-actions {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.btn-danger {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.btn-danger:hover {
    background: #feb2b2;
}

.btn-warning {
    background: #fef5e7;
    color: #d69e2e;
    border: 1px solid #f6e05e;
}

.btn-warning:hover {
    background: #f6e05e;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #cbd5e0;
}

.empty-state h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #4a5568;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    
    .controls {
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .transaction-amount {
        text-align: left;
    }
    
    .transaction-actions {
        margin-left: 0;
        align-self: flex-end;
    }
    
    /* Two-column layout becomes single column on mobile */
    .transactions-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Section Actions */
.section-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Modal Styles - Essential for existing HTML structure */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 40px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    background: #f8fafc;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-top: 1px solid #e2e8f0;
}

/* Category Management */
.category-management {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    min-height: 500px;
}

.main-categories-section,
.subcategories-section {
    display: flex;
    flex-direction: column;
}

.main-categories-section h3,
.subcategories-section h3 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-categories-list,
.subcategories-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 400px;
    overflow-y: auto;
    flex: 1;
}

/* Manage Categories: compact item spacing and actions */
.main-categories-list .category-item,
.subcategories-list .subcategory-item {
    padding: 14px 16px;
    border-radius: 6px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

.main-categories-list .category-item .actions .category-count {
    font-size: 0.85rem;
    color: #6b7280;
}

.category-item,
.subcategory-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    min-height: 60px;
}

.category-item:hover,
.subcategory-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.category-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f3ff 100%);
}

.category-item .name,
.subcategory-item .name {
    font-weight: 600;
    color: #2d3748;
    flex: 1;
    font-size: 1.1rem;
}

.category-item .actions,
.subcategory-item .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.9rem;
    border-radius: 8px;
}

.btn-edit {
    background: #fef5e7;
    color: #d69e2e;
    border: 1px solid #f6e05e;
}

.btn-edit:hover {
    background: #f6e05e;
}

.btn-delete {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.btn-delete:hover {
    background: #feb2b2;
}

/* Delete Modal Styles */
.delete-modal {
    z-index: 3000 !important; /* Higher than vacation modal */
}

.delete-modal .modal-content {
    max-width: 320px !important;
    width: 320px !important;
    margin: 10% auto !important;
    border-radius: 12px;
    overflow: hidden;
}

.delete-modal .modal-body {
    padding: 16px !important;
    max-height: none !important;
}

.delete-modal .modal-footer {
    padding: 12px 16px !important;
    gap: 8px;
}

.delete-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    text-align: center;
}

.delete-icon {
    font-size: 1.75rem;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #fee2e2;
    border-radius: 50%;
    flex-shrink: 0;
}

.delete-message h3 {
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 1.1rem;
    font-weight: 600;
}

.delete-message p {
    color: #6b7280;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Vacation Section Styles */
#vacations {
    background: #f8fafc;
    color: #2d3748;
}

.vacations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.vacation-tile {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.vacation-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4a90e2, #38b2ac, #48bb78, #ed8936, #e53e3e);
    border-radius: 15px 15px 0 0;
}

.vacation-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #4a90e2;
}

.vacation-header {
    margin-bottom: 25px;
    flex-shrink: 0;
}

.vacation-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 8px 0;
    line-height: 1.2;
    word-wrap: break-word;
}

.vacation-destination {
    font-size: 1rem;
    color: #718096;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vacation-destination i {
    color: #4a90e2;
    font-size: 0.9rem;
}

.vacation-dates {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #718096;
    flex-wrap: wrap;
}

.vacation-dates i {
    color: #4a90e2;
    font-size: 0.9rem;
}

.vacation-duration {
    background: #e6fffa;
    color: #38b2ac;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: auto;
}

.vacation-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: auto;
    flex-shrink: 0;
}

.vacation-stat {
    text-align: center;
    padding: 15px;
    background: #f7fafc;
    border-radius: 12px;
    border-left: 4px solid #4a90e2;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vacation-stat-label {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vacation-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
}

.vacation-budget {
    border-left-color: #48bb78;
}

.vacation-spent {
    border-left-color: #ed8936;
}

.vacation-remaining {
    border-left-color: #38b2ac;
}

.vacation-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vacation-tile:hover .vacation-actions {
    opacity: 1;
}

.vacation-actions .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
}

/* Vacation Modals */
.vacation-modal .modal-content {
    max-width: 650px;
    background: white;
    color: #2d3748;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.vacation-modal .modal-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 30px 35px 25px 35px;
    position: relative;
}

.vacation-modal .modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a90e2, #38b2ac, #48bb78, #ed8936);
}

.vacation-modal .modal-body {
    padding: 40px 35px 35px 35px;
}

.vacation-modal .form-row {
    margin-bottom: 25px;
    gap: 25px;
}

.vacation-modal .form-group {
    margin-bottom: 0;
}

.vacation-modal .form-group label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 0.95rem;
    display: block;
}

.vacation-modal .form-group input,
.vacation-modal .form-group select {
    padding: 15px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.vacation-modal .form-group input:focus,
.vacation-modal .form-group select:focus {
    border-color: #4a90e2;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    outline: none;
}

.vacation-modal .form-group input::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.vacation-modal .modal-footer {
    padding: 25px 35px 35px 35px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 15px;
}

.vacation-modal .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.vacation-modal .btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border: none;
    color: white;
}

.vacation-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.vacation-modal .btn-secondary {
    background: white;
    border: 2px solid #e2e8f0;
    color: #718096;
}

.vacation-modal .btn-secondary:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
    transform: translateY(-1px);
}

/* Target the exact element: <div class="modal-content vacation-detail-modal large-modal"> */
.modal-content.vacation-detail-modal.large-modal {
    width: 66vw !important;         /* slightly wider (~66% of viewport width) */
    max-width: none !important;     /* remove any width caps */
    margin: 1% auto !important;     /* keep centered with small margins */
}

.large-modal {
    max-width: 95vw;
    max-height: 98vh;
    height: 95vh;
}

.vacation-detail-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
}

.vacation-detail-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    max-height: calc(90vh - 80px);
}

/* Expense Modal Styles */
.expense-modal .modal-content {
    max-width: 650px;
    background: white;
    color: #2d3748;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.expense-header {
    background: linear-gradient(135deg, #38b2ac 0%, #2c7a7b 100%);
    color: white;
    padding: 30px 35px 25px 35px;
    position: relative;
}

.expense-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #38b2ac, #4a90e2, #48bb78, #ed8936);
}

.expense-modal .modal-body {
    padding: 40px 35px 35px 35px;
}

.expense-modal .form-row {
    margin-bottom: 25px;
    gap: 25px;
}

.expense-modal .form-group {
    margin-bottom: 0;
}

.expense-modal .form-group label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 0.95rem;
    display: block;
}

.expense-modal .form-group input,
.expense-modal .form-group select {
    padding: 15px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.expense-modal .form-group input:focus,
.expense-modal .form-group select:focus {
    border-color: #38b2ac;
    background: white;
    box-shadow: 0 0 0 3px rgba(56, 178, 172, 0.1);
    outline: none;
}

.expense-modal .form-group input::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.expense-modal .modal-footer {
    padding: 25px 35px 35px 35px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 15px;
}

.expense-modal .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.expense-modal .btn-primary {
    background: linear-gradient(135deg, #38b2ac 0%, #2c7a7b 100%);
    border: none;
    color: white;
}

.expense-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 178, 172, 0.3);
}

.expense-modal .btn-secondary {
    background: white;
    border: 2px solid #e2e8f0;
    color: #718096;
}

.expense-modal .btn-secondary:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
    transform: translateY(-1px);
}

.vacation-summary {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    color: #2d3748;
}

.vacation-summary h3 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.3rem;
}

.vacation-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(180px, 1fr)); /* lock to 6 columns with slightly narrower min width */
    gap: 16px; /* a bit tighter spacing */
}

.vacation-summary-item {
    text-align: center;
    padding: 12px; /* slightly reduced to prevent wrapping */
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #4a90e2;
}

.vacation-summary-item h4 {
    margin: 0 0 8px 0;
    color: #718096;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vacation-summary-item .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3748;
}

.vacation-expenses {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    color: #2d3748;
}

.expenses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.expenses-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.2rem;
}

.expenses-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.expense-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    color: #2d3748;
    min-width: 180px;
    transition: border-color 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.category-total {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    font-weight: 600;
}

.total-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.total-amount {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Vacation Insights Section */
.vacation-insights {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.insights-header {
    margin-bottom: 25px;
}

.insights-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.insights-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.insight-tile {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    max-height: 280px;
    overflow: hidden;
}

.chart-container {
    position: relative;
}

.insight-tile.chart-container canvas {
    max-height: 100%;
}

.insight-tile.top-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: center;
}

.top-category h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
}

.top-category .category-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 10px 0;
}

.top-category .category-amount {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 5px 0;
}

.top-category .category-percentage {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 5px;
}

.top-spending-section,
.largest-transaction-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Make both sections use the same styling */
.top-spending-section h4,
.largest-transaction-section h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
}

.largest-transaction-section .transaction-description {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 10px 0;
    text-transform: capitalize;
    color: white;
}

.largest-transaction-section .transaction-amount {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 5px 0;
}

.largest-transaction-section .transaction-category {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 5px;
    text-transform: capitalize;
}

.insight-tile.category-breakdown {
    overflow-y: hidden;
}

.category-breakdown h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.category-breakdown-content {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.category-breakdown-content::-webkit-scrollbar {
    width: 6px;
}

.category-breakdown-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.category-breakdown-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.category-breakdown-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.insight-tile.burn-rate-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
}

.burn-rate-gauge h4 {
    margin: 0;
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 600;
}

.gauge-container {
    position: relative;
    width: 140px;
    height: 140px;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-background {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 12;
}

.gauge-progress {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-in-out, stroke 0.3s ease;
}

.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-percentage {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 3px;
}

.gauge-label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

.burn-rate-status {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    margin-top: 5px;
}

.burn-rate-status.on-pace {
    background: #d4edda;
    color: #155724;
}

.burn-rate-status.over-pace {
    background: #fff3cd;
    color: #856404;
}

.burn-rate-status.way-over {
    background: #f8d7da;
    color: #721c24;
}

.burn-rate-status.under-pace {
    background: #d1ecf1;
    color: #0c5460;
}

/* Category item for vacation insights breakdown */
.category-breakdown .category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
    margin-bottom: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.category-breakdown .category-item:hover {
    background: #f1f5f9;
}

.category-breakdown .category-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.category-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-breakdown .category-item .category-name {
    font-weight: 600;
    color: #2d3748;
    text-transform: capitalize;
    font-size: 0.95rem;
    line-height: 1.2;
}

.category-count {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 500;
}

.category-values {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-breakdown .category-item .category-amount {
    font-weight: 700;
    color: #4a90e2;
    font-size: 0.95rem;
}

.category-breakdown .category-item .category-percentage {
    font-size: 0.85rem;
    color: #718096;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Responsive design for insights */
@media (max-width: 768px) {
    .insights-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .vacation-detail-modal .modal-content {
        max-width: 95vw;
        margin: 20px;
    }
}

.expenses-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    border-left: 4px solid #4a90e2;
    margin-bottom: 12px;
}

.expense-info {
    flex: 1;
    margin-right: 20px;
}

.expense-description {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.expense-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #718096;
}

.expense-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e53e3e;
    margin-right: 20px;
    min-width: 120px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.expense-amount i {
    font-size: 1.1rem;
}

.expense-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Vacation Category Modal Styles */
.vacation-category-modal .modal-content {
    max-width: 600px;
    background: white;
    color: #2d3748;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.vacation-category-header {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    padding: 30px 35px 25px 35px;
    position: relative;
}

.vacation-category-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ed8936, #38b2ac, #4a90e2, #48bb78);
}

.vacation-category-management {
    padding: 30px;
}

.add-category-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.add-category-section h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
}

.add-category-form,
.add-subcategory-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 25px;
}

.add-category-form input,
.add-subcategory-form input {
    flex: 1;
    padding: 15px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.add-category-form input:focus,
.add-subcategory-form input:focus {
    border-color: #ed8936;
    background: white;
    box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.1);
    outline: none;
}

.categories-section h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
}

.vacation-categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.vacation-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: #f7fafc;
    border-radius: 12px;
    border-left: 4px solid #ed8936;
    transition: all 0.3s ease;
}

.vacation-category-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.vacation-category-item .name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.05rem;
}

.vacation-category-item .actions {
    display: flex;
    gap: 8px;
}

.vacation-category-item .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.vacation-category-modal .modal-footer {
    padding: 25px 35px 35px 35px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 15px;
}

/* Sankey Diagram Styles */
.sankey-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.sankey-header {
    margin-bottom: 20px;
}

.sankey-header h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sankey-header h3 i {
    color: #667eea;
}

.sankey-header p {
    color: #718096;
    font-size: 0.95rem;
    margin: 0;
}

.sankey-diagram {
    width: 100%;
    height: 500px;
    min-height: 500px;
}

/* Overview Section Styles */
.overview-metrics {
    margin-bottom: 40px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.metric-header {
    margin-bottom: 20px;
}

.metric-header h3 {
    color: #4a5568;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.income-expense .metric-header h3 i {
    color: #48bb78;
}

.income-savings .metric-header h3 i {
    color: #805ad5;
}

.cash-flow .metric-header h3 i {
    color: #4299e1;
}

.projected-actual .metric-header h3 i {
    color: #ed8936;
}

.vacation-spending .metric-header h3 i {
    color: #f56565;
}

.monthly-summary .metric-header h3 i {
    color: #9f7aea;
}

.metric-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    flex: 1;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 120px;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: #718096;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-amount {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.metric-item.income .metric-amount {
    color: #48bb78;
}

.metric-item.expense .metric-amount {
    color: #f56565;
}

.metric-item.savings .metric-amount {
    color: #805ad5;
}

.metric-item.projected .metric-amount {
    color: #4299e1;
}

.metric-item.actual .metric-amount {
    color: #ed8936;
}

.metric-divider {
    font-size: 1rem;
    font-weight: 700;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 10px;
    min-width: 30px;
}

.metric-result {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e2e8f0;
    margin-top: 15px;
}

.metric-result.positive {
    color: #38a169 !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: #38a169 !important;
}

.metric-result.negative {
    color: #e53e3e !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: #e53e3e !important;
}

.cash-flow-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.cash-flow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border-left: 3px solid #e2e8f0;
}

.cash-flow-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-top: 8px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.cash-flow-label {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cash-flow-amount {
    font-size: 1.1rem;
    font-weight: 700;
}

.cash-flow-amount.positive {
    color: #38a169;
}

.cash-flow-amount.negative {
    color: #e53e3e;
}

/* Vacation summary for overview metrics (inside metric cards) */
.metric-card .vacation-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.vacation-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border-left: 3px solid #f56565;
}

.vacation-label {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vacation-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f56565;
}

.vacation-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: #4299e1;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.summary-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border-left: 3px solid #9f7aea;
}

.summary-label {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: #9f7aea;
}

.summary-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f56565;
}


.overview-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Income & Savings Section Styles */

.income-overview {
    margin-bottom: 40px;
}

.income-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.income-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.income-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.income-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.income-card-header h3 {
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.total-income .income-card-header h3 i {
    color: #48bb78;
}

.recurring-income .income-card-header h3 i {
    color: #4299e1;
}

.one-time-income .income-card-header h3 i {
    color: #ed8936;
}

.income-card-amount {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.total-income .income-card-amount {
    color: #48bb78;
}

.recurring-income .income-card-amount {
    color: #4299e1;
}

.one-time-income .income-card-amount {
    color: #ed8936;
}

.income-card-change {
    font-size: 0.9rem;
    font-weight: 500;
    color: #718096;
}

.income-card-subtitle {
    font-size: 0.9rem;
    font-weight: 500;
    color: #718096;
}

.income-analytics {
    margin-bottom: 40px;
}

.income-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.chart-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chart-section h3 {
    color: #4a5568;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-section h3 i {
    color: #48bb78;
}

.chart-container {
    height: 300px;
    position: relative;
}

.income-container {
    margin-bottom: 40px;
}

.income-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.income-column {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.income-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.income-column-header h3 {
    color: #4a5568;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.income-column-header h3 i {
    color: #48bb78;
}

.income-count {
    font-size: 1rem;
    font-weight: 600;
    color: #718096;
    background: #e6fffa;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid #b2f5ea;
}

.income-list {
    min-height: 200px;
}

.income-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border-left: 4px solid #48bb78;
    transition: all 0.3s ease;
}

.income-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.income-info {
    flex: 1;
}

.income-description {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.income-details {
    font-size: 0.9rem;
    color: #718096;
    display: flex;
    gap: 15px;
    align-items: center;
}

.income-frequency {
    background: #e6fffa;
    color: #285e61;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.income-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #48bb78;
    min-width: 100px;
    text-align: right;
    margin-right: 15px;
}

.income-actions {
    display: flex;
    gap: 8px;
}

.income-actions .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: auto;
}

.income-list .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
}

.income-list .empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.income-list .empty-state p {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.income-list .empty-state small {
    font-size: 0.85rem;
    color: #a0aec0;
    opacity: 0.8;
}

/* Savings Tracking Styles */
.savings-tracking {
    margin-bottom: 40px;
}

.savings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.savings-header h3 {
    color: #4a5568;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.savings-header h3 i {
    color: #805ad5;
}

.savings-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.savings-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.savings-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.savings-card-header {
    margin-bottom: 12px;
}

.savings-card-header h4 {
    color: #4a5568;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-month .savings-card-header h4 i {
    color: #805ad5;
}

.total-saved .savings-card-header h4 i {
    color: #38b2ac;
}

.avg-monthly .savings-card-header h4 i {
    color: #ed8936;
}

.savings-card-amount {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.current-month .savings-card-amount {
    color: #805ad5;
}

.total-saved .savings-card-amount {
    color: #38b2ac;
}

.avg-monthly .savings-card-amount {
    color: #ed8936;
}

.savings-card-subtitle {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

.savings-entries {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.savings-entries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.savings-entries-header h4 {
    color: #4a5568;
    font-size: 1.2rem;
    font-weight: 600;
}

.entries-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: #718096;
    background: #f7fafc;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.savings-entries-list {
    min-height: 150px;
}

.savings-entry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border-left: 4px solid #805ad5;
    transition: all 0.3s ease;
}

.savings-entry-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.savings-entry-info {
    flex: 1;
}

.savings-entry-month {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.savings-entry-details {
    font-size: 0.9rem;
    color: #718096;
    display: flex;
    gap: 15px;
    align-items: center;
}

.savings-entry-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #805ad5;
    min-width: 100px;
    text-align: right;
    margin-right: 15px;
}

.savings-entry-actions {
    display: flex;
    gap: 8px;
}

.savings-entry-actions .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: auto;
}

.savings-entries-list .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
}

.savings-entries-list .empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.savings-entries-list .empty-state p {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.savings-entries-list .empty-state small {
    font-size: 0.85rem;
    color: #a0aec0;
    opacity: 0.8;
}

/* Savings Entry Modal Styles */
.savings-entry-modal .modal-content {
    max-width: 650px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.savings-entry-modal .modal-header {
    background: linear-gradient(135deg, #805ad5, #6b46c1);
    color: white;
    padding: 25px 30px;
    position: relative;
}

.savings-entry-modal .modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30px;
    right: 30px;
    height: 3px;
    background: linear-gradient(90deg, #a78bfa, #805ad5, #6b46c1);
    border-radius: 2px;
}

.savings-entry-modal .modal-body {
    padding: 35px 30px;
}

.savings-entry-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.savings-entry-modal .form-group {
    display: flex;
    flex-direction: column;
}

.savings-entry-modal .form-group.full-width {
    grid-column: 1 / -1;
}

.savings-entry-modal .form-group label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.savings-entry-modal .form-group input,
.savings-entry-modal .form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
}

.savings-entry-modal .form-group input:focus,
.savings-entry-modal .form-group textarea:focus {
    outline: none;
    border-color: #805ad5;
    box-shadow: 0 0 0 3px rgba(128, 90, 213, 0.1);
    background: white;
}

.savings-entry-modal .form-group input::placeholder,
.savings-entry-modal .form-group textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.savings-entry-modal .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.savings-entry-modal .modal-footer {
    padding: 20px 30px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.savings-entry-modal .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.savings-entry-modal .btn-primary {
    background: linear-gradient(135deg, #805ad5, #6b46c1);
    color: white;
}

.savings-entry-modal .btn-primary:hover {
    background: linear-gradient(135deg, #6b46c1, #553c9a);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(128, 90, 213, 0.3);
}

.savings-entry-modal .btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.savings-entry-modal .btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}


/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .category-management {
        grid-template-columns: 1fr;
        gap: 30px;
        min-height: auto;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .delete-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .delete-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .vacations-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .vacation-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .vacation-summary-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .income-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .income-overview-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .income-charts {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .savings-overview-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .savings-entry-modal .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .overview-charts {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .metric-comparison {
        flex-direction: column;
        gap: 20px;
    }
    
    .metric-divider {
        margin: 0;
        font-size: 0.8rem;
    }
    
    .metric-card {
        min-height: auto;
        padding: 20px;
    }
    
}

/* ========================================
   MODAL OVERLAY SYSTEM (for transactionModal)
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

/* Transaction Modal - 25% larger than original */
#transactionModal.modal-overlay .modal-content {
    max-width: 1250px !important;
    max-height: 98vh !important;
    width: 98vw !important;
    margin: 1% auto !important;
}

/* Category Management Modal - 10% wider */
#categoryModal.modal .modal-content {
    max-width: 1100px !important;
    width: 98vw !important;
    margin: 1% auto !important;
}
