/*
 * Admin component layer — token-driven building blocks for internal pages.
 *
 * Use these classes in admin views instead of inline <style> blocks so the
 * design language stays consistent. Never apply to public/donor-facing
 * surfaces (donation form, checkout, web elements, campaign pages, donor
 * portal, receipts).
 */

/* -- Bootstrap tooltip background ---------------------------------------- */
/*
 * Bootstrap 5.3 defaults --bs-tooltip-bg to var(--bs-emphasis-color), which
 * is not defined by this app's CSS layer — leaving tooltips with a visible
 * arrow but a transparent body. Pin the dark scheme explicitly.
 */
.tooltip {
    --bs-tooltip-bg: #212529 !important;
    --bs-tooltip-color: #fff;
}

.tooltip .tooltip-arrow::before,
.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
    border-top-color: #212529;
}
.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-bottom-color: #212529;
}
.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: #212529;
}
.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: #212529;
}

/* -- Page header ---------------------------------------------------------- */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.page-header .page-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--color-text-strong);
}

.page-header__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-header__actions .btn,
.page-header__actions .btn-sm {
    padding: 6px 12px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

/* -- Toolbar -------------------------------------------------------------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 8px;
}

.toolbar__field {
    flex: 0 0 auto;
    min-width: 160px;
}

.toolbar__field--grow {
    flex: 1 1 200px;
}

.toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* -- Card ----------------------------------------------------------------- */

.surface-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 24px;
}

/*
 * Use only on cards that are actually clickable (dashboard tiles, link tiles).
 * Do NOT apply to filter cards — they're not clickable and the hover-lift
 * implies the wrong affordance.
 */
.surface-card--interactive {
    transition: box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.surface-card--interactive:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* -- Filter controls ------------------------------------------------------ */

.filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-default);
    margin-bottom: 4px;
}

.filter-input {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-input:focus {
    border-color: var(--color-border);
    box-shadow: 0 0 0 0.1rem rgba(21, 43, 75, 0.15);
    outline: 0;
}

/* -- Row actions menu ----------------------------------------------------- */

.actions-dropdown {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.actions-dropdown .btn-actions {
    background: none;
    border: none;
    padding: 6px 12px;
    color: var(--color-text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.actions-dropdown .btn-actions:hover {
    background-color: var(--color-bg-row-hover);
    color: var(--color-bg-sidebar);
}

.actions-dropdown .btn-actions:focus {
    outline: none;
    box-shadow: none;
}

/* -- DataTables shared overrides ----------------------------------------- */

.dataTable.table {
    box-shadow: none;
}

.data-table-wrapper {
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table-wrapper .dataTables_length,
.data-table-wrapper .dataTables_filter,
.data-table-wrapper .dataTables_info {
    display: none !important;
}

.data-table-wrapper .dataTables_paginate {
    margin-top: 20px !important;
}

.data-table-wrapper .page-link {
    color: var(--color-bg-sidebar);
    background-color: #fbfcfd;
    border-color: var(--color-border-subtle);
    box-shadow: none;
}

.data-table-wrapper .page-link:hover {
    color: var(--color-bg-sidebar);
    background-color: #f8f9fa;
    border-color: var(--color-border-subtle);
}

.data-table-wrapper .page-link.active,
.data-table-wrapper .active > .page-link {
    background-color: var(--color-bg-sidebar);
    border-color: var(--color-bg-sidebar);
    color: var(--color-text-on-dark);
}

.data-table-wrapper .page-link:focus {
    box-shadow: none !important;
}

.data-table-wrapper .page-item.disabled .page-link {
    color: var(--color-text-muted);
    background-color: #fbfcfd;
    border-color: var(--color-border-subtle);
}

.data-table-wrapper table.dataTable thead > tr > th.sorting,
.data-table-wrapper table.dataTable thead > tr > th.sorting_asc,
.data-table-wrapper table.dataTable thead > tr > th.sorting_desc {
    background-image: none !important;
    padding-right: 12px;
    position: relative;
    cursor: pointer;
}

.data-table-wrapper table.dataTable thead > tr > th.sorting:after,
.data-table-wrapper table.dataTable thead > tr > th.sorting:before {
    content: '';
}

.data-table-wrapper table.dataTable thead > tr > th.sorting_asc:after {
    content: '↑';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--color-bg-sidebar);
    font-weight: bold;
    opacity: 1;
}

.data-table-wrapper table.dataTable thead > tr > th.sorting_desc:after {
    content: '↓';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--color-bg-sidebar);
    font-weight: bold;
    opacity: 1;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .page-header__actions {
        flex-wrap: wrap;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .toolbar__field,
    .toolbar__field--grow {
        flex: 0 0 auto;
        min-width: 100%;
    }
    .toolbar__actions {
        margin-left: 0;
        justify-content: flex-start;
    }
}

/* -- Data table skin ------------------------------------------------------ */
/*
 * Generic styling for admin list tables (donors, donations, campaigns,
 * reports). Apply by wrapping a <table class="table"> in
 * <div class="data-table-wrapper">. View-specific column alignment and
 * column widths still live in the view.
 */

.data-table-wrapper .table {
    box-shadow: none;
    border-collapse: collapse;
    margin: 0 !important;
}

.data-table-wrapper .table thead tr { background: transparent; }

.data-table-wrapper .table th,
.data-table-wrapper .table td {
    text-align: left;
    vertical-align: middle;
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 12px;
}

.data-table-wrapper .table thead th {
    background-color: #fbfcfd;
    color: var(--color-text-default);
    border-bottom: 1px solid var(--color-border-subtle);
}

.data-table-wrapper .table tbody tr {
    background-color: var(--color-bg-surface);
    cursor: pointer;
}

.data-table-wrapper .table tbody tr:hover {
    background-color: #e8f4f8;
}

.data-table-wrapper .table tbody tr td > a {
    text-decoration: none;
    color: inherit;
    padding: 16px 12px;
    display: flex;
    align-items: center;
    height: 100%;
}

.data-table-wrapper .table tr td:first-child > a { padding-left: 20px; }
.data-table-wrapper .table tr td:last-child > a { padding-right: 20px; }

/* DataTables processing overlay + spinner */
.data-table-wrapper .dataTables_empty {
    text-align: center !important;
    padding: 2rem !important;
    color: var(--color-text-muted) !important;
    height: 84px;
}

.data-table-wrapper .dataTables_scrollBody {
    border: 1px solid var(--color-border-subtle);
}

.data-table-wrapper .dataTables_scrollHead,
.data-table-wrapper .dataTables_scrollBody {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table-wrapper .dataTables_wrapper {
    width: 100%;
    position: relative;
}

.data-table-wrapper .dataTables_processing {
    position: absolute;
    top: 50px !important;
    left: calc(var(--bs-gutter-x) * 0.5) !important;
    width: calc(100% - var(--bs-gutter-x)) !important;
    height: calc(100% - 50px) !important;
    min-height: 150px;
    display: block;
    background-color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 !important;
    z-index: 10;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    border: 1px solid var(--color-border-subtle);
}

.data-table-wrapper .dataTables_processing.card {
    background-color: unset;
    border-top: 0;
}

.data-table-wrapper .dataTables_processing div { display: none; }

@keyframes dataTableSpin { to { transform: rotate(360deg); } }

.data-table-wrapper .dataTables_processing::before {
    display: block;
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid rgba(21, 43, 75, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-bg-sidebar);
    animation: dataTableSpin 1s ease-in-out infinite;
    position: absolute;
    top: calc(50% - 40px);
    left: calc(50% - 25px);
}

.data-table-wrapper .dataTables_processing::after {
    display: block;
    content: 'Loading...';
    font-family: avenirnext-medium, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--color-bg-sidebar);
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 35px));
    white-space: nowrap;
}

/* DataTables Responsive plugin (dtr-*) child rows */
.data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
.data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    background-color: transparent;
    position: absolute;
    right: 18px;
    margin-top: 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-align: right;
}

.data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
.data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
    padding-left: 30px;
    min-width: 40px;
}

.data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details {
    width: 100%;
    padding-left: 0;
}

.data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details > li {
    border-bottom: 1px solid #e9ecef;
    padding: 12px 0;
}

.data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
    border-bottom: none;
}

.data-table-wrapper table.dataTable > tbody > tr.child span.dtr-title {
    font-weight: 600;
    color: var(--color-text-default);
    min-width: 120px;
    display: inline-block;
}

.data-table-wrapper table.dataTable > tbody > tr.child span.dtr-data {
    color: var(--color-text-strong);
}

/* Filter helpers shared by list pages */
.advanced-filters-toggle {
    color: var(--color-text-muted);
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease-in-out;
}

.advanced-filters-toggle:hover {
    color: var(--color-bg-sidebar);
    text-decoration: none;
}

#advancedFiltersContainer { overflow: hidden; }

.input-group-text {
    background-color: #f8f9fa;
    border-color: var(--color-border);
    color: var(--color-text-default);
}

/* -- Detail page components ----------------------------------------------- */
/*
 * Shared building blocks for single-record detail pages (donations/detail.php,
 * donors/detail.php, pledges/detail.php, recurring/detail.php, task/view.php,
 * etc.). View-specific layout (timeline content, fee breakdown rows, etc.)
 * still lives in the view, but the surface and typographic system is shared.
 */

.info-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.card-header-custom {
    background: var(--color-bg-surface);
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem 1.5rem;
}

.card-header-custom h5 {
    font-size: 1.2rem;
    color: #111827;
}

.card-body-custom {
    padding: 1.5rem;
}

.detail-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    display: block;
}

.detail-value {
    font-size: 0.9375rem;
    color: #111827;
    font-weight: 500;
}

.amount-value {
    font-family: avenirnext-medium;
    font-size: 1.75rem;
    color: #111827;
}

.amount-currency {
    color: #6b7280;
    font-size: 0.875rem;
}

.amount-icon {
    width: 60px;
    height: 60px;
    background: #10b981;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amount-icon i {
    font-size: 1.75rem;
    color: #ffffff;
}

/* Status badges */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.badge-success { background-color: #10b981; color: #ffffff; }
.badge-danger { background-color: #ef4444; color: #ffffff; }
.badge-warning { background-color: #f59e0b; color: #ffffff; }
.badge-secondary { background-color: #6b7280; color: #ffffff; }

/* Action buttons */
.action-btn {
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: start;
    text-decoration: none;
}

.action-btn-primary { background: #3b82f6; color: #ffffff; }
.action-btn-primary:hover { background: #2563eb; color: #ffffff; }

.action-btn-purple { background: #a855f7; color: #ffffff; }
.action-btn-purple:hover { background: #9333ea; color: #ffffff; }

.action-btn-green,
.action-btn-success { background: #10b981; color: #ffffff; }
.action-btn-green:hover,
.action-btn-success:hover { background: #059669; color: #ffffff; }

.action-btn-primary i, .action-btn-primary span,
.action-btn-purple i, .action-btn-purple span,
.action-btn-green i, .action-btn-green span,
.action-btn-success i, .action-btn-success span { color: #ffffff; }

.action-btn-outline {
    background: var(--color-bg-surface);
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.action-btn-outline:hover {
    background: #f9fafb;
    color: #111827;
}

.action-btn-outline-danger {
    background: var(--color-bg-surface);
    color: #ef4444;
    border: 1px solid #fecaca;
}

.action-btn-outline-danger i,
.action-btn-outline-danger span { color: #ef4444; }

.action-btn-outline-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.btn-text-shift-down {
    position: relative;
    top: 3px;
}

/* Timeline (donations/detail and similar) */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 3px;
    bottom: 25px;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e5e7eb;
}

.timeline-title {
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #111827;
}

.timeline-text { color: #6b7280; }

/* Detail page container */
.detail-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Fee breakdown (donations/detail, event-registrations/detail, attendees/view) */
.fee-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fee-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fee-breakdown-label {
    font-size: 0.875rem;
    color: #111827;
}

.fee-breakdown-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.fee-breakdown-item .text-muted {
    color: #6b7280 !important;
    font-weight: 400;
}

.fee-breakdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.fee-breakdown-total .fee-breakdown-label {
    font-weight: 600;
    font-size: 0.875rem;
}

.fee-breakdown-total .fee-breakdown-value {
    font-size: 0.875rem;
    font-weight: 700;
}

.action-btn-outline i,
.action-btn-outline span { color: #6b7280; }

/* -- Dashboard components ------------------------------------------------- */
/*
 * Shared building blocks for dashboard pages (campaign/dashboard.php,
 * event/dashboard.php, sponsorship/dashboard.php, donors/dashboard.php).
 * Surface aesthetic matches .surface-card / .info-card: hairline border,
 * subtle shadow, 8px radius.
 */

.dashboard-container {
    display: flex;
    flex-wrap: wrap;
    column-gap: 30px;
}

.dashboard-header {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex-basis: 100%;
}

.header-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tab button bar */
.tab-button-group {
    margin: 1rem 0;
    background: #fbfcfd;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-subtle);
    flex-basis: 100%;
}

.tab-buttons-container {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.tab-button {
    border: none;
    background: transparent;
    padding: 12px 20px;
    font-weight: 500;
    color: var(--color-text-default);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.tab-button:hover {
    background-color: var(--color-bg-row-hover);
}

.tab-button.active,
.tab-button[aria-selected="true"] {
    background-color: var(--color-bg-sidebar);
    color: var(--color-text-on-dark);
}

/* Content area / section panels */
.content-area {
    flex: 1;
    display: none;
}

.content-area.active {
    display: block;
}

.content-area form {
    height: 100%;
}

.content-section {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 2rem;
    display: none;
    height: 100%;
}

.content-section.active {
    display: block;
}

.content-section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-strong);
}

/* Sidebar menu (left rail in dashboard tabs) */
.sidebar-menu {
    width: 280px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 2rem 0;
    display: none;
    align-self: start;
}

.sidebar-menu.active {
    display: block;
}

.sidebar-section-title {
    padding: 0 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.sidebar-menu-item {
    padding: 0.75rem 1.5rem;
    margin: 0.25rem 0.75rem;
    color: var(--color-text-default);
    text-decoration: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-menu-item:hover,
.sidebar-menu-item.active {
    color: var(--color-text-strong);
    background: var(--color-bg-row-alt);
    border-color: var(--color-border-subtle);
}

.sidebar-menu-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Metric cards (KPIs) */
.metric-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex: 1 1 280px;
    min-width: 280px;
}

.metric-card--interactive {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.metric-card--interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.metric-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.metric-value {
    font-size: 2rem;
    font-family: avenirnext-medium;
    color: var(--color-text-strong);
    margin-bottom: 0.25rem;
}

.metric-subtitle {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Stat card (highlighted KPI tile with accent stripe) */
.stat-card {
    background: var(--color-bg-surface);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--color-border-subtle);
    border-left: 4px solid #2d4b82;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .metric-card {
        flex: 1 1 100%;
        min-width: 100%;
        padding: 1rem;
    }
    .metric-value {
        font-size: 1.5rem;
    }
    .stat-card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .metric-value {
        font-size: 1.25rem;
    }
    .stat-card {
        padding: 1rem;
    }
}

/* -- Status icon ---------------------------------------------------------- */
/*
 * Shared status icon base and unified color modifiers for all donation,
 * recurring, campaign, and event status indicators.
 */
.status-icon {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
}

/* Status color modifiers - used across donations, recurring, campaigns, events */
.status-complete {
    color: #28a745;
}

.status-refunded {
    color: #dc3545;
}

.status-refunded i {
    font-size: 14px;
}

.status-pending {
    color: #ffc107;
}

.status-failed {
    color: #dc3545;
}

.status-active {
    color: #28a745;
}

.status-canceled,
.status-cancelled {
    color: #6c757d;
}

.status-incomplete {
    color: #ffc107;
}

.status-pastdue {
    color: #dc3545;
}

.status-archived {
    color: #6c757d;
}

/* Donation type icons - recurring, offline, one-time */
.recurring-icon {
    color: var(--color-text-muted);
    font-size: 14px;
}

.offline-icon,
.onetime-icon {
    color: var(--color-text-muted);
    font-size: 18px;
}

/* Payment method icons - used across donations, events, registrations */
.payment-method-icon {
    color: var(--color-text-default);
    font-size: 16px;
    flex-shrink: 0;
}

.fa-apple-pay {
    color: #000000;
}

.fa-google-pay {
    color: #4285f4;
}

.fa-credit-card {
    color: var(--color-text-muted);
}

.fa-mobile-alt {
    color: #28a745;
}

.fa-university {
    color: #007bff;
}

/* Add item button - reusable for "Add Amount", "Add Designation", "Add Mapping", etc. */
.btn-add-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-add-item:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.btn-add-item:active {
    /* box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); */
}

@media screen and (max-width: 768px) {
    .data-table-wrapper .dataTables_processing {
        top: 32.5px !important;
        height: calc(100% - 32.5px) !important;
        left: 0 !important;
        width: 100% !important;
    }
    .data-table-wrapper .dataTables_wrapper .dataTables_paginate {
        margin-top: 15px !important;
    }
    .data-table-wrapper .dataTables_wrapper .dataTables_paginate .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
    .data-table-wrapper .page-item { margin: 0; }
    .data-table-wrapper .page-link {
        padding: 0.375rem 0.65rem;
        font-size: 0.875rem;
    }
    .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details {
        display: block;
        width: 100%;
        padding: 10px 15px;
        background-color: #f8f9fa;
        margin: 0;
    }
    .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details > li {
        display: flex;
        flex-direction: column;
        padding: 8px 0;
        border-bottom: 1px solid var(--color-border-subtle);
    }
    .data-table-wrapper table.dataTable > tbody > tr.child span.dtr-title {
        margin-bottom: 4px;
        font-size: 0.875rem;
    }
    .data-table-wrapper table.dataTable > tbody > tr.child span.dtr-data {
        font-size: 0.875rem;
        word-break: break-word;
    }
    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
        border-radius: 4px;
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 14px;
        margin-right: 0;
    }
    .export-button-text { display: none !important; }
}

@media screen and (max-width: 576px) {
    .data-table-wrapper .page-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.8125rem;
    }
    .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details {
        padding: 8px 12px;
    }
    .data-table-wrapper table.dataTable > tbody > tr.child span.dtr-title,
    .data-table-wrapper table.dataTable > tbody > tr.child span.dtr-data {
        font-size: 0.8125rem;
    }
    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .data-table-wrapper .dataTables_wrapper {
        width: 100%;
        overflow-x: auto;
    }
}

/* -- Admin index page chrome --------------------------------------------- */
/*
 * Shared helpers used by index views (campaign, donations, donors). Keep
 * view-specific column-hiding / nth-child rules in the views themselves;
 * everything below is mechanically identical across those pages.
 */
.admin-index input { margin-bottom: 0 !important; }
.admin-index select { padding: 7px 7px 3px 7px; }

.admin-index .modal-body { padding: 0; }

.admin-index__table-wrap { margin-top: 20px; }
.admin-index__table {
    width: 100%;
    display: table;
    height: 1px;
    border-collapse: collapse;
}

.admin-index__filter-toggle {
    color: var(--color-text-muted);
    transition: transform 0.2s ease;
    cursor: pointer;
}
.admin-index__filter-divider {
    border-color: var(--color-border-subtle);
    margin: 1rem 0;
}
.btn-clear-all {
    white-space: nowrap;
    padding: 6px 12px;
}

@media screen and (max-width: 768px) {
    .admin-index-table { font-size: 0.875rem; }
    .admin-index-table th,
    .admin-index-table td { padding: 8px 6px; }
    .admin-index-table tr td:last-child a { padding-right: 12px; }
}
@media screen and (max-width: 576px) {
    .admin-index-table { font-size: 0.8125rem; }
    .admin-index-table th,
    .admin-index-table td { padding: 6px 4px; }
    .data-table-wrapper .dataTables_wrapper .row,
    .data-table-wrapper .dataTables_wrapper .col-sm-12 { margin: 0; padding: 0; }
}
@media screen and (max-width: 480px) {
    .admin-index-table { min-width: 100%; }
}

/* -- Integration Modal Common Styles -------------------------------------- */
/*
 * Shared styles for all integration configuration modals
 * (Mailchimp, Meta Pixel, Bloomerang, Double the Donation, Meta Business)
 */

/* Message alerts */
.message-container {
    margin-bottom: 20px;
    display: none;
}

.message-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    position: relative;
    border: 1px solid;
}

.message-alert.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.message-alert.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.message-alert.info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.message-alert .close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.message-alert .close-btn:hover {
    opacity: 1;
}

/* Welcome/no-config state containers */
.no-api-key-container,
.no-pixel-id-container,
.no-keys-container {
    text-align: center;
    padding: 40px 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h3 {
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.welcome-section p {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 14px;
}

/* Form containers */
.api-key-form-centered,
.pixel-id-form-centered,
.keys-form {
    width: 100%;
    max-width: 400px;
}

.api-key-form-centered .form-group,
.pixel-id-form-centered .form-group,
.keys-form .form-group {
    margin-bottom: 20px;
}

.api-key-form-centered input[type="text"],
.api-key-form-centered input[type="password"],
.pixel-id-form-centered input[type="text"],
.pixel-id-form-centered input[type="password"],
.keys-form input[type="text"],
.keys-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out;
}

.api-key-form-centered input:focus,
.pixel-id-form-centered input:focus,
.keys-form input:focus {
    outline: 0;
}

.help-text {
    color: #6c757d;
    font-size: 12px;
    margin-top: 8px;
    text-align: left;
}

/* Connected state */
.connected-container {
    padding: 20px;
}

.account-info-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

/* Info items */
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.info-label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.info-value {
    color: #6c757d;
    font-size: 14px;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-connected {
    background-color: #d4edda;
    color: #155724;
}

.status-disconnected {
    background-color: #f8d7da;
    color: #721c24;
}

/* Disconnect section */
.disconnect-section {
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
    margin-top: 20px;
    text-align: center;
}

.btn-disconnect {
    background: #dc3545;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-disconnect:hover {
    background: #c82333;
}

.btn-disconnect:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Section titles with icons */
.section-title-with-icon {
    margin-top: 0;
    margin-bottom: 16px;
    color: #495057;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

.section-title-with-icon i {
    margin-right: 8px;
    font-size: 18px;
}

/* Section titles without icons */
.section-title {
    margin-top: 0;
    margin-bottom: 12px;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

