/* ═══════════════════════════════════════════════════════════════════════════
   FIREASSISTIQ PRO - FINANCIAL DASHBOARD CSS
   Version 2.0 - Professional Burgundy Colour System
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Brand Burgundy */
    --burgundy-primary: #E53935;
    --burgundy-dark: #C62828;
    --burgundy-medium: #EF5350;
    --burgundy-light: #EF9A9A;
    
    /* Functional Colours */
    --color-success: #059669;
    --color-warning: #F59E0B;
    --color-critical: #DC2626;
    
    /* Neutral System */
    --slate-900: #0F172A;
    --slate-600: #475569;
    --slate-400: #94A3B8;
    --slate-200: #E2E8F0;
    --slate-100: #F1F5F9;
}

.financial-dashboard {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* HEADER */
.financial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}

.financial-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.financial-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.financial-header h2 i {
    color: #4CAF50;
}

.subscription-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: #E3F2FD;
    color: #1976D2;
}

.subscription-badge.expired {
    background: #FFEBEE;
    color: #C62828;
}

.financial-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
}

.month-nav {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.month-nav:hover {
    background: #f0f2f5;
    color: #333;
}

.current-month {
    font-weight: 600;
    color: #333;
    min-width: 150px;
    text-align: center;
}

.btn-export,
.btn-refresh {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-export {
    background: linear-gradient(135deg, #E53935, #C62828);
    color: white;
}

.btn-export:hover {
    background: linear-gradient(135deg, #C62828, #B71C1C);
}

.btn-refresh {
    background: #f0f2f5;
    color: #333;
}

.btn-refresh:hover {
    background: #e0e2e5;
}

/* SUMMARY CARDS */
.financial-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.summary-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.summary-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.summary-card.income .summary-icon {
    background: #E8F5E9;
    color: #4CAF50;
}

.summary-card.expense .summary-icon {
    background: #FFEBEE;
    color: #F44336;
}

.summary-card.profit .summary-icon {
    background: #E3F2FD;
    color: #2196F3;
}

.summary-card.profit.negative .summary-icon {
    background: #FFF3E0;
    color: #FF9800;
}

.summary-card.vat .summary-icon {
    background: #F3E5F5;
    color: #9C27B0;
}

.summary-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.summary-count {
    font-size: 12px;
    color: #999;
}

/* MAIN CONTENT GRID */
.financial-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ENTRY FORMS */
.financial-entry-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* entry-forms is the actual wrapper rendered by renderQuickEntryForms() */
.entry-forms {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.entry-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.entry-card h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.entry-card h3 i {
    color: #4CAF50;
}

.entry-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group small {
    font-size: 12px;
    color: #999;
}

.btn-submit {
    padding: 12px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-submit:hover {
    background: #45a049;
}

.btn-submit.expense {
    background: #F44336;
}

.btn-submit.expense:hover {
    background: #E53935;
}

/* TRANSACTION LISTS */
.financial-lists-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* transaction-lists is the actual wrapper rendered by renderTransactionLists() */
.transaction-lists {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.list-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-count {
    background: #E3F2FD;
    color: #1976D2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.list-body {
    max-height: 400px;
    overflow-y: auto;
}

.list-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.list-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.list-empty p {
    margin: 0;
    font-size: 14px;
}

.transaction-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: #f8f9fa;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.transaction-icon.income {
    background: #E8F5E9;
    color: #4CAF50;
}

.transaction-icon.expense {
    background: #FFEBEE;
    color: #F44336;
}

.transaction-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.transaction-date,
.transaction-method,
.transaction-desc {
    font-size: 12px;
    color: #666;
}

.btn-delete-small,
.btn-receipt-small {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f2f5;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-delete-small:hover {
    background: #FFEBEE;
    color: #F44336;
}

.btn-receipt-small:hover {
    background: #E3F2FD;
    color: #2196F3;
}

/* VAT REPORT */
.financial-reports-section {
    margin-top: 24px;
}

.vat-report-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.vat-report-header {
    padding: 16px 20px;
    background: #F3E5F5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vat-report-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #6A1B9A;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download {
    padding: 8px 16px;
    background: #9C27B0;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-download:hover {
    background: #7B1FA2;
}

.vat-report-body {
    padding: 20px;
}

.vat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.vat-row:last-child {
    border-bottom: none;
}

.vat-row.total {
    border-top: 2px solid #9C27B0;
    margin-top: 8px;
    padding-top: 16px;
    font-weight: 700;
    font-size: 16px;
}

.vat-amount {
    font-weight: 600;
    color: #333;
}

.vat-amount.highlight {
    color: #9C27B0;
    font-size: 20px;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .financial-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .financial-dashboard {
        padding: 12px 8px;
    }

    .financial-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .financial-header-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .financial-summary {
        grid-template-columns: 1fr 1fr;
    }

    .month-selector {
        flex: 1;
    }

    /* Fix content grid - single column on mobile */
    .financial-content {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    /* entry-forms wrapper — stack vertically with gap */
    .entry-forms {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Entry cards - full width, no overflow */
    .entry-card {
        width: 100%;
        box-sizing: border-box;
        padding: 16px;
    }

    /* All inputs full width */
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }

    /* Entry section spacing */
    .financial-entry-section {
        gap: 16px;
    }

    /* Transaction items */
    .transaction-item {
        padding: 10px 12px;
    }

    /* Summary cards - 1 col on very small screens */
    .summary-card {
        padding: 14px;
    }

    .summary-value {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .financial-summary {
        grid-template-columns: 1fr;
    }
}
