/* Dashboard-specific table styles */
.dashboard-table {
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid #e5e7eb; /* neutral gray border */
    border-radius: 10px;
    background: #fff;
    margin-bottom: 1rem;
    overflow-x: auto;
    overflow-y: visible !important;
    position: relative;
}

.dashboard-action-stack {
    gap: 0.4rem;
}

.dashboard-action-stack .btn {
    width: 142px;
    min-width: 142px;
}

.dashboard-scroll-target {
    scroll-margin-top: 5rem;
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.95rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.94) 55%, rgba(241, 245, 249, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(6px);
}

.dashboard-toolbar--embedded {
    padding: 0.1rem 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.dashboard-action-stack--secondary {
    width: 100%;
    justify-content: flex-end;
}

.dashboard-control-btn {
    display: inline-flex;
    align-items: center;
    width: 142px;
    min-width: 142px;
    min-height: 32px;
    border-radius: 0.5rem;
    padding: 0.24rem 0.56rem;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.15;
    justify-content: center;
    gap: 0.2rem;
    white-space: nowrap;
}

.dashboard-toolbar-toggle {
    min-width: 0;
    min-height: 0;
    margin-right: 0;
    padding: 0;
    padding-left: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    gap: 0.35rem;
}

.dashboard-toolbar-toggle .form-check-input {
    margin-top: 0;
    margin-left: 0;
    flex: 0 0 auto;
    cursor: pointer;
}

.dashboard-toolbar-toggle .form-check-label {
    color: var(--qs-slate-700);
    font-weight: 500;
    font-size: 0.8125rem;
    line-height: 1.2;
    cursor: pointer;
}

.dashboard-bulk-btn {
    border: 0;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.dashboard-bulk-btn:hover,
.dashboard-bulk-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(15, 23, 42, 0.14);
    filter: saturate(1.03);
}

.dashboard-bulk-btn:disabled {
    transform: none;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.07);
}

.btn-ai-gradient {
    background: linear-gradient(135deg, #7c3aed, #a855f7, #ec4899);
    border: 0;
    color: #fff;
}

.btn-ai-gradient:hover,
.btn-ai-gradient:focus {
    background: linear-gradient(135deg, #6d28d9, #9333ea, #db2777);
    color: #fff;
}

.btn-ai-gradient:disabled {
    opacity: 0.8;
}

@media (max-width: 991.98px) {
    .dashboard-toolbar {
        padding: 0.75rem 0;
    }
    .dashboard-control-btn,
    .dashboard-toolbar-toggle {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
    }
    .dashboard-action-stack {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }
    .dashboard-action-stack .btn {
        width: 100%;
    }
    .dashboard-attention-item {
        grid-template-columns: auto 1fr;
        align-items: start;
    }
    .dashboard-attention-metric {
        grid-column: 2;
        min-width: 0;
        text-align: left;
    }
}
.dashboard-attention-list {
    display: grid;
    gap: 0.55rem;
}

.dashboard-attention-card .card-body,
.dashboard-aging-card .card-body {
    padding: 0.9rem 1rem;
}

.dashboard-card-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid rgba(37, 99, 235, 0.32);
    border-radius: 999px;
    padding: 0.48rem 0.92rem;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.dashboard-card-toggle:hover,
.dashboard-card-toggle:focus {
    border-color: rgba(29, 78, 216, 0.5);
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e3a8a;
    box-shadow: 0 11px 24px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

.dashboard-card-toggle i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(29, 78, 216, 0.14);
    transition: transform 0.18s ease;
}

.dashboard-card-toggle[aria-expanded="false"] i {
    transform: rotate(180deg);
}

.dashboard-card-toggle[aria-expanded="false"] + * {
    margin-top: 0;
}

.dashboard-attention-card .collapse:not(.show) {
    display: none;
}

@media (max-width: 991.98px) {
    .dashboard-card-toggle {
        padding: 0.52rem 1rem;
        font-size: 0.84rem;
    }
}

.dashboard-attention-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 0.8rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dashboard-attention-item:hover,
.dashboard-attention-item:focus {
    transform: translateY(-1px);
    box-shadow: 0 0.4rem 1.15rem rgba(15, 23, 42, 0.08);
    color: inherit;
}

.dashboard-attention-item--warning {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(180deg, #fffdf7 0%, #fff7e6 100%);
}

.dashboard-attention-item--info {
    border-color: rgba(37, 99, 235, 0.18);
}

.dashboard-attention-item--clear {
    border-color: rgba(16, 185, 129, 0.2);
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.dashboard-attention-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--qs-slate-700);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.dashboard-attention-copy {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.dashboard-attention-title {
    font-weight: 600;
    color: var(--qs-slate-900);
    line-height: 1.2;
}

.dashboard-attention-text {
    font-size: 0.76rem;
    line-height: 1.3;
    color: var(--bs-secondary-color);
}

.dashboard-attention-metric {
    min-width: 5.75rem;
    text-align: right;
    font-weight: 700;
    color: var(--qs-slate-900);
    font-size: 0.82rem;
}

.dashboard-aging-list {
    display: grid;
    gap: 0.25rem;
}

.dashboard-aging-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.38rem 0.05rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.dashboard-aging-row--overdue .dashboard-aging-label {
    color: var(--qs-slate-900);
}

.dashboard-aging-row--overdue .dashboard-aging-value {
    color: #b45309;
}

.dashboard-aging-row--total {
    margin-top: 0.05rem;
    padding-top: 0.55rem;
    border-bottom: 0;
    border-top: 2px solid rgba(15, 23, 42, 0.1);
}

.dashboard-aging-label {
    font-weight: 600;
    color: var(--qs-slate-700);
    line-height: 1.2;
}

.dashboard-aging-value {
    font-weight: 700;
    color: var(--qs-slate-900);
    text-align: right;
    line-height: 1.2;
}
.dashboard-table-card {
    overflow: visible !important;
}

.dashboard-empty-review-card .card-body {
    padding: 0.75rem 0.75rem 0.8rem;
}

.dashboard-empty-review-panel {
    display: grid;
    gap: 0.2rem;
}

.dashboard-empty-review-panel .fw-semibold {
    color: var(--qs-slate-900);
}

.dashboard-table-card .card-body {
    overflow: visible !important;
}
.dashboard-table table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    overflow: visible !important;
}
.dashboard-table table thead,
.dashboard-table table tbody,
.dashboard-table table tr,
.dashboard-table table td,
.dashboard-table table th {
    overflow: visible !important;
}
.dashboard-table table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    /* Soft blue header for clearer separation */
    background: linear-gradient(180deg, #eaf4ff 0%, #dbeafe 100%);
    color: #0f172a;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.015em;
    vertical-align: middle;
    border-bottom: 1px solid #bfdbfe; /* blue-200 */
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.08);
}
/* Rounded top corners on the first header row */
.dashboard-table table thead th:first-child {
    border-top-left-radius: 10px;
}
.dashboard-table table thead th:last-child {
    border-top-right-radius: 10px;
}
.dashboard-table table tbody tr {
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.dashboard-table table tbody tr:hover {
    background: #f9fafb;
}
/* Main document row: subtle left accent + slightly tinted bg */
.dashboard-table table tbody tr.document-row {
    border-bottom: 1px solid #e5e7eb;
}
.dashboard-table table tbody tr.document-row {
    background: #fcfdff;
}
.dashboard-table table tbody tr.document-row td:first-child {
    position: relative;
}
.dashboard-table table tbody tr.document-row td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3b82f6; /* blue accent */
    border-top-left-radius: 10px;
}
/* Clearer row separators */
.dashboard-table table tbody tr.document-row td,
.dashboard-table table tbody tr.line-items-row td {
    border-bottom: 1px solid #eef2f7;
}
.dashboard-table table tbody tr.document-row td {
    padding-top: 0.26rem;
    padding-bottom: 0.26rem;
    vertical-align: middle;
    font-size: 0.78rem;
}
.dashboard-table table tbody tr.line-items-row td {
    /* Compact line item rows */
    padding-top: 0.25rem;
    padding-bottom: 0.35rem;
}
/* Make inputs/selects inside line item rows more compact */
.dashboard-table table tbody tr.line-items-row td .form-control,
.dashboard-table table tbody tr.line-items-row td .form-select {
    padding: 0.25rem 0.5rem;
    line-height: 1.2;
}
/* Toggle chevron visibility and behavior */
.dashboard-table .line-items-toggle {
    cursor: pointer;
}
.dashboard-table .line-items-toggle i {
    color: #64748b;
}
.dashboard-table .line-items-toggle:hover i {
    color: #111827;
}
/* Expanded state accent and background */
.dashboard-table table tbody tr.document-row.expanded {
    background: #f3f6ff;
}
.dashboard-table table tbody tr.document-row.expanded td:first-child::before {
    background: #2563eb; /* deeper blue when expanded */
}
/* Line item rows: grouped background with soft separators */
.dashboard-table table tbody tr.line-items-row {
    background: #f8fafc;
}
.dashboard-table input.form-control,
.dashboard-table select.form-select {
    background: #fff;
    border: 1px solid #e2e8f0; /* slate gray */
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.dashboard-table table tbody tr.document-row td .form-control,
.dashboard-table table tbody tr.document-row td .form-select {
    padding: 0.18rem 0.4rem;
    min-height: 1.6rem;
    line-height: 1.05;
    font-size: 0.78rem;
}
.dashboard-table input.form-control:focus,
.dashboard-table select.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.dashboard-table .searchable-select {
    width: 100%;
}
.dashboard-table .searchable-select .input-group {
    margin-bottom: 0.2rem;
}
.dashboard-table .searchable-select .input-group.mb-2 {
    margin-bottom: 0.15rem !important;
}
.dashboard-table table tbody tr.line-items-row .searchable-select .input-group {
    margin-bottom: 0.2rem;
}
.dashboard-table table tbody tr.document-row td.searchable-cell {
    vertical-align: middle;
    padding-top: 0.28rem;
    padding-bottom: 0.28rem;
}
.dashboard-table .searchable-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    width: 100%;
    min-width: 0;
    padding: 0;
}
.dashboard-table .searchable-stack .searchable-select .input-group {
    margin-bottom: 0;
}
.dashboard-table .searchable-stack select.form-select {
    padding-top: 0.18rem;
    padding-bottom: 0.18rem;
    line-height: 1.08;
    min-height: 1.56rem;
    font-size: 0.76rem;
}
.dashboard-table table tbody tr.document-row .searchable-select .input-group-text,
.dashboard-table table tbody tr.document-row .searchable-select .form-control {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    line-height: 1.02;
    font-size: 0.78rem;
}
.dashboard-table .searchable-select .input-group .form-control {
    height: 1.52rem;
    font-size: 0.72rem;
}
.dashboard-table .searchable-select .input-group .input-group-text {
    display: flex;
    align-items: center;
    padding: 0.18rem 0.3rem;
    height: 1.52rem;
    font-size: 0.66rem;
}
.js-dashboard-search-results {
    z-index: 1200;
    min-width: 220px;
    max-width: min(360px, calc(100vw - 2rem));
    width: auto !important;
    white-space: normal;
}
.js-dashboard-search-results .dropdown-header {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--bs-emphasis-color, #212529);
    background: transparent;
    border: 0;
    padding: 0.45rem 0.75rem 0.2rem;
}
.js-dashboard-search-results .dropdown-item {
    white-space: normal;
}
.dashboard-table .action-dropdown .dropdown-toggle {
    padding: 0.18rem 0.46rem;
    line-height: 1.02;
    font-weight: 600;
    font-size: 0.7rem;
    background-color: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.dashboard-table .action-dropdown .dropdown-toggle:hover,
.dashboard-table .action-dropdown .dropdown-toggle:focus {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}
.dashboard-table .action-dropdown .dropdown-toggle i {
    font-size: 0.95rem;
}
.dashboard-table .action-dropdown .dropdown-menu {
    min-width: 8.5rem;
    font-size: 0.72rem;
    padding: 0.28rem 0;
}
.dashboard-table .action-dropdown .dropdown-item {
    padding: 0.24rem 0.7rem;
}
.dashboard-table .action-dropdown .dropdown-item i {
    width: 0.85rem;
    text-align: center;
    font-size: 0.8rem;
}
.dashboard-table .action-dropdown .dropdown-item.text-danger {
    color: #dc2626;
}
.dashboard-table th.actions-header {
    border-left: 1px solid #dbeafe;
    box-shadow: inset 1px 0 0 rgba(37,99,235,0.08);
}
.dashboard-table th.extraction-header {
    text-align: center;
    border-left: 1px solid #dbeafe;
}
.dashboard-table .project-stack {
    flex: 1 1 auto;
    padding-right: 0.4rem;
    min-width: 0;
}
.dashboard-table td.extraction-cell {
    vertical-align: top;
    text-align: left;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    border-left: 1px solid #e2e8f0;
    min-width: 160px;
}
.dashboard-table td.extraction-cell .extraction-status-stack {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.dashboard-table td.extraction-cell .badge {
    font-size: 0.7rem;
    font-weight: 600;
}
.dashboard-table td.extraction-cell .btn.run-full-extraction-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dashboard-table td.actions-cell {
    vertical-align: middle;
    text-align: center;
    border-left: 1px solid #e2e8f0;
    background: #f8fafc;
}
.dashboard-table table tbody tr.document-row:hover td.actions-cell {
    background: #f1f5f9;
}
.dashboard-table table tbody tr.document-row.expanded td.actions-cell {
    background: #eef2ff;
}
.dashboard-table td.actions-cell .action-dropdown {
    display: inline-flex;
    align-items: center;
}
.dashboard-table .add-line-item-btn {
    width: 100%;
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    background-color: #3b82f6; /* toned-down blue */
    color: #fff;
    border: 1px solid #93c5fd; /* softer border */
    border-radius: 8px;
    font-weight: 500; /* slightly less bold */
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: background 0.15s, box-shadow 0.15s;
}

    .add-line-item-row.line-items-empty {
        background-color: #f8fafc;
    }

    .line-item-empty-stack {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        align-items: center;
    }

    .line-item-empty-text {
        max-width: 420px;
    }
.dashboard-table .add-line-item-btn:hover,
.dashboard-table .add-line-item-btn:focus {
    background-color: #2563eb; /* modest darken on hover */
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    text-decoration: none;
}
.dashboard-table .line-item-amount-cell {
    min-width: 0;
}
.dashboard-table .line-item-amount-cell .line-item-amount-input {
    width: 100%;
    max-width: none;
}
/* VAT toggle alignment */
.dashboard-table .form-check.form-switch {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0;
    margin-bottom: 0;
}
.dashboard-table .form-check.form-switch .form-check-input {
    cursor: pointer;
    margin-top: 0;
}
.dashboard-table .form-check.form-switch .form-check-label.small {
    margin-left: 0;
    color: #334155;
    white-space: nowrap;
    font-size: 0.72rem;
}

/* Pipeline chart card layout and sizing */
.sales-pipeline-card { display: flex; flex-direction: column; }
.sales-pipeline-card .card-body { display: flex; flex-direction: column; gap: .5rem; }
.sales-pipeline-card .sales-pipeline-controls { flex: 0 0 auto; }
.sales-pipeline-card .sales-pipeline-chart-container {
    position: relative;
    flex: 1 1 360px; /* grow to fill, min height approx chart */
    min-height: 320px;
    max-height: 420px; /* cap height to prevent overflow */
    overflow: hidden;
}
.sales-pipeline-card .sales-pipeline-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* --- Spend Chart Containers: allow unlimited vertical growth --- */
.spend-chart-container {
    /* Remove any scrolling and fixed caps inherited from shared styles */
    overflow: visible !important;
    overflow-y: visible !important;
    max-height: none !important;
}
.spend-chart-container canvas {
    /* Use width:100%, let the canvas height attribute from JS dictate vertical size */
    max-height: none !important;
}

/* In case a dashboard-chart-card wrapper is applied around spend charts, uncap it */
.dashboard-chart-card .spend-chart-container,
.dashboard-chart-card .spend-chart-container canvas {
    max-height: none !important;
}

/* --- Revenue vs Expenses: give the chart more vertical space --- */
.dashboard-chart-card.revenue-expenses-wrapper {
    max-height: none !important;
}
.dashboard-chart-card.revenue-expenses-wrapper .card-body {
    height: 520px !important;
}

.dashboard-chart-card.dashboard-chart-card--empty {
    max-height: none !important;
}

.dashboard-chart-card.dashboard-chart-card--empty .card-body {
    height: auto !important;
}

.dashboard-chart-card.dashboard-chart-card--empty .cash-flow-card,
.dashboard-chart-card.dashboard-chart-card--empty .revenue-expenses-card {
    height: auto !important;
}

.dashboard-chart-card.dashboard-chart-card--empty .dashboard-empty-controls,
.dashboard-chart-card.dashboard-chart-card--empty .dashboard-empty-summary,
.dashboard-chart-card.dashboard-chart-card--empty .dashboard-empty-inline-summary,
.dashboard-chart-card.dashboard-chart-card--empty .dashboard-empty-footnotes {
    display: none !important;
}

.dashboard-chart-card.dashboard-chart-card--empty .chart-container,
.dashboard-chart-card.dashboard-chart-card--empty .sales-pipeline-chart-container {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

.dashboard-chart-card.dashboard-chart-card--empty .dashboard-empty-header {
    margin-bottom: 0.75rem !important;
}

.dashboard-empty-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.75rem;
    align-items: start;
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px dashed rgba(15, 23, 42, 0.14);
    border-radius: 0.875rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    text-align: left;
}

.dashboard-empty-panel i {
    grid-row: 1 / span 2;
    margin: 0 !important;
    font-size: 1.45rem !important;
    color: var(--qs-slate-700) !important;
}

.dashboard-empty-panel h6 {
    margin: 0;
    font-size: var(--font-size-md);
    line-height: 1.25;
}

.dashboard-empty-panel p {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.dashboard-chart-card.dashboard-chart-card--empty .dashboard-empty-panel {
    position: static !important;
    inset: auto !important;
    transform: none !important;
}

.top-line-items-card.top-line-items-card--empty .dashboard-empty-inline-summary {
    display: none !important;
}

.top-line-items-card.top-line-items-card--empty .dashboard-empty-header {
    margin-bottom: 0.75rem !important;
}

/* The shared .chart-container rule uses a fixed height calculation.
   For this card we want the chart area to consume remaining flex space
   after header + summary + footnotes. */
.revenue-expenses-card .chart-container {
    height: auto !important;
    min-height: 300px;
    flex: 1 1 auto;
}

.spend-chart-empty {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.spend-card-stack {
    display: block;
}

.spend-category-card .card-body {
    padding: 0.75rem 0.75rem 0.8rem;
}

.spend-category-card {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    box-shadow: 0 0.45rem 1.25rem rgba(15, 23, 42, 0.08), 0 0.15rem 0.45rem rgba(15, 23, 42, 0.06) !important;
}

.spend-category-card:last-child {
    margin-bottom: 0;
}

.spend-category-card h5 {
    font-size: var(--font-size-md);
    line-height: 1.2;
    font-weight: 600;
}

.spend-category-icon {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--qs-indigo-800);
    background: linear-gradient(180deg, var(--qs-indigo-50) 0%, var(--qs-indigo-100) 100%);
    box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.08);
}

.spend-category-icon i {
    font-size: 0.9rem;
}

.spend-category-totals {
    min-width: 8rem;
    font-size: var(--font-size-sm);
    line-height: 1.35;
}

.spend-accordion {
    display: grid;
    gap: 0.75rem;
}

.spend-status-accordion {
    gap: 0;
}

.spend-status-accordion > .spend-accordion-item:first-child {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.spend-status-accordion > .spend-accordion-item:last-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.spend-status-accordion > .spend-accordion-item + .spend-accordion-item {
    margin-top: -1px;
}

.spend-status-accordion > .spend-accordion-item:last-child .accordion-button {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.spend-accordion-item {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.06);
}

.spend-accordion-item .accordion-button {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    font-size: var(--font-size-md);
    font-weight: 600;
    padding: 0.65rem 0.875rem;
    color: var(--qs-slate-900);
    box-shadow: none;
}

.spend-accordion-item .accordion-body {
    padding: 0.75rem 0.875rem;
}

.spend-accordion-item .accordion-button:not(.collapsed) {
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    color: var(--qs-slate-900);
}

.spend-accordion-summary {
    font-size: 0.8125rem;
    font-weight: 600;
}

.spend-subgroup-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.spend-subgroup-grid-single {
    grid-template-columns: 1fr;
}

.spend-subgroup {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-radius: 0.75rem;
}

.spend-subgroup .spend-chart-container {
    min-height: 190px;
}

.spend-subgroup canvas {
    width: 100% !important;
}

.spend-status-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem 0.85rem;
}

.spend-status-empty {
    border: 1px dashed rgba(15, 23, 42, 0.14);
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 0.75rem 0.85rem;
}

.spend-card-header {
    margin-bottom: 0.625rem !important;
}

.spend-status-header {
    margin-bottom: 0.5rem !important;
}

.spend-status-panel .small,
.spend-status-empty .small {
    line-height: 1.35;
}

.spend-chart-container {
    min-height: 0 !important;
}

@media (max-width: 768px) {
    .dashboard-chart-card.revenue-expenses-wrapper .card-body {
        height: 560px !important;
    }
    .revenue-expenses-card .chart-container {
        min-height: 260px;
    }
    .dashboard-chart-card.dashboard-chart-card--empty .dashboard-empty-panel {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .dashboard-chart-card.dashboard-chart-card--empty .dashboard-empty-panel i {
        grid-row: auto;
    }
    .spend-category-totals {
        min-width: 0;
        width: 100%;
        text-align: left !important;
    }
}
