/* ── Standard Data Tables (all admin pages) ─────────────────── */
.data-table-wrap,
.report-table-wrap,
.page-content .table-responsive:not(.list-table-wrap) {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    margin-bottom: 0.5rem;
}

.data-table,
.page-content .card-body > .table,
.page-content .card-body > .table-responsive .table {
    margin-bottom: 0 !important;
    font-size: 0.84rem;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th,
.page-content .table.data-table thead th,
.report-page .data-table thead th,
.page-content .table thead.table-dark th,
.page-content .table thead.table-success th {
    background: linear-gradient(180deg, #1e3a5f 0%, #2563eb 100%) !important;
    color: #f8fafc !important;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none !important;
    border-bottom: 2px solid #1d4ed8 !important;
    padding: 0.8rem 0.75rem !important;
    white-space: nowrap;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table thead th:first-child {
    border-radius: 0;
}

.data-table tbody td,
.page-content .table.table-bordered tbody td {
    padding: 0.65rem 0.75rem !important;
    vertical-align: middle;
    color: #334155;
    border-color: #eef2f7 !important;
}

.data-table tbody tr:nth-child(even) td,
.page-content .table-striped > tbody > tr:nth-of-type(even) > td {
    background-color: #f8fafc;
}

.data-table tbody tr:hover td,
.page-content .table-hover tbody tr:hover td {
    background-color: rgba(59, 130, 246, 0.06) !important;
}

/* Group / subtotal rows */
.data-table .table-secondary td,
.page-content .table .table-secondary td {
    background: linear-gradient(90deg, #e0e7ff 0%, #eff6ff 100%) !important;
    color: #1e40af;
    font-weight: 700;
    font-size: 0.8rem;
    border-top: 2px solid #bfdbfe !important;
    padding: 0.55rem 0.75rem !important;
}

.data-table .table-light td,
.page-content .table .table-light td {
    background: #f1f5f9 !important;
    font-weight: 700;
    color: #1e293b;
    border-top: 1px solid #cbd5e1 !important;
}

.data-table tfoot td,
.page-content .table tfoot.table-warning td {
    background: linear-gradient(90deg, #fef3c7 0%, #fffbeb 100%) !important;
    color: #92400e;
    font-weight: 700;
    border-top: 2px solid #fbbf24 !important;
    padding: 0.75rem !important;
}

.data-table .text-end,
.page-content .table .text-end {
    font-variant-numeric: tabular-nums;
}

.data-table td .badge.bg-danger {
    font-size: 0.75rem;
    padding: 0.35rem 0.55rem !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0.4rem !important;
}

.data-table-empty td,
.page-content .table td.text-center[colspan] {
    padding: 2.5rem 1rem !important;
    color: #94a3b8;
    font-style: italic;
    background: #fafbfc !important;
}

/* ── Report Pages ──────────────────────────────────────────── */
.report-page {
    --report-accent: #2563eb;
}

.report-card__header {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

.report-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.report-card__title i {
    color: var(--report-accent);
    font-size: 1rem;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 0.5rem;
}

.report-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.report-filter.list-filter {
    padding: 0.7rem 0.8rem !important;
    margin-bottom: 0.85rem !important;
}

.report-filter {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.85rem;
}

.report-filter .form-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.report-filter .form-control,
.report-filter .form-select,
.report-filter .form-control-sm {
    border-radius: 0.45rem;
    border-color: #cbd5e1;
    font-size: 0.8125rem;
    min-height: 2rem;
    padding: 0.3rem 0.6rem;
}

.report-filter .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.12rem rgba(59, 130, 246, 0.12);
}

.report-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.report-filter-actions .btn {
    border-radius: 0.45rem;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    min-width: auto;
    white-space: nowrap;
}

/* Report meta banner */
.report-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-left: 4px solid #3b82f6;
    border-radius: 0.65rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #1e40af;
}

.report-meta strong {
    color: #1e3a8a;
}

/* Stat cards grid */
.report-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.report-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.report-stat:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.report-stat__label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.3rem;
}

.report-stat__value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.report-stat--primary { border-left: 4px solid #3b82f6; }
.report-stat--primary .report-stat__value { color: #2563eb; }

.report-stat--success { border-left: 4px solid #10b981; }
.report-stat--success .report-stat__value { color: #059669; }

.report-stat--warning { border-left: 4px solid #f59e0b; }
.report-stat--warning .report-stat__value { color: #d97706; }

.report-stat--danger { border-left: 4px solid #ef4444; }
.report-stat--danger .report-stat__value { color: #dc2626; }

.report-stat--info { border-left: 4px solid #06b6d4; }
.report-stat--info .report-stat__value { color: #0891b2; }

.report-stat--secondary { border-left: 4px solid #64748b; }

/* Upgrade legacy alert stats inside reports */
.report-page .row.mb-3 > [class*="col-"] > .alert {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    margin-bottom: 0;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.report-page .alert-info { border-left-color: #3b82f6; background: #eff6ff; color: #1e40af; }
.report-page .alert-warning { border-left-color: #f59e0b; background: #fffbeb; color: #92400e; }
.report-page .alert-danger { border-left-color: #ef4444; background: #fef2f2; color: #b91c1c; }
.report-page .alert-success { border-left-color: #10b981; background: #ecfdf5; color: #047857; }
.report-page .alert-secondary { border-left-color: #64748b; background: #f8fafc; color: #475569; }

/* Balance report KPI cards */
.report-page .card.border-primary,
.report-page .card.border-info,
.report-page .card.border-success,
.report-page .card.border-danger,
.report-page .card.border-warning,
.report-page .card.border-secondary {
    border-radius: 0.75rem !important;
    border-width: 1px !important;
    border-left-width: 4px !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s ease;
}

.report-page .card.border-primary:hover,
.report-page .card.border-info:hover,
.report-page .card.border-success:hover,
.report-page .card.border-danger:hover,
.report-page .card.border-warning:hover,
.report-page .card.border-secondary:hover {
    transform: translateY(-2px);
}

.report-page .card.border-primary .card-body p,
.report-page .card.border-info .card-body p,
.report-page .card.border-success .card-body p {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b !important;
    margin-bottom: 0.35rem !important;
}

.report-export-btn {
    border-radius: 0.55rem;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Section divider in reports */
.report-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin: 1.25rem 0 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-section-title i {
    color: var(--report-accent);
}

@media (max-width: 767.98px) {
    .report-filter { padding: 0.85rem; }
    .report-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .data-table thead th,
    .data-table tbody td { font-size: 0.75rem; padding: 0.5rem 0.55rem !important; }
    .report-card__title { font-size: 1rem; }
}

@media (max-width: 575.98px) {
    .report-stat-grid { grid-template-columns: 1fr; }
}

[data-bs-theme="dark"] .report-stat { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .report-stat__value { color: #f1f5f9; }
[data-bs-theme="dark"] .report-filter { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .page-content .table.data-table thead th,
[data-bs-theme="dark"] .report-page .data-table thead th {
    background: linear-gradient(180deg, #1e3a5f 0%, #1d4ed8 100%) !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .data-table tbody td { color: #cbd5e1; }
