/* ── Shared Admin Page styles ──────────────────────────────────────── */

/* Outer wrapper */
.adm-page { display: flex; flex-direction: column; gap: 18px; }

/* ── Orange gradient header ── */
.adm-header {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #993C1D 0%, #C05415 55%, #EE7026 100%);
    border-radius: 12px;
    position: relative; overflow: hidden;
    flex-shrink: 0;
}
.adm-header-shine {
    position: absolute; top: -60%; left: 50%;
    width: 30%; height: 260%;
    background: rgba(255,255,255,0.09);
    transform: rotate(20deg); border-radius: 50%; pointer-events: none;
}
.adm-header-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.28);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white; flex-shrink: 0; position: relative; z-index: 1;
}
.adm-header-text {
    display: flex; flex-direction: column; gap: 2px;
    position: relative; z-index: 1; flex: 1; min-width: 0;
}
.adm-header-title { font-size: 17px; font-weight: 700; color: white; line-height: 1.2; }
.adm-header-sub   { font-size: 12px; color: rgba(255,255,255,0.72); }
.adm-header-actions {
    display: flex; align-items: center; gap: 8px;
    position: relative; z-index: 1; flex-shrink: 0;
}

/* Action buttons inside the header — white/ghost style */
.adm-header-actions .rz-button,
.adm-header-actions button {
    background: rgba(255,255,255,0.18) !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
    color: #fff !important;
    border-radius: 7px !important;
    font-size: 13px !important;
}
.adm-header-actions .rz-button:hover,
.adm-header-actions button:hover {
    background: rgba(255,255,255,0.30) !important;
}

/* ── Content card ── */
.adm-content {
    background: var(--rz-panel-background-color, #fff);
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 12px;
    overflow: hidden;
}

/* Padded section above or around a grid (search bar, alerts, etc.) */
.adm-content-body {
    padding: 16px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Remove inner border/radius on grids that live directly inside adm-content */
.adm-content .rz-data-grid {
    border: none !important;
    border-radius: 0 !important;
}

/* Also strip RadzenCard inside adm-content to avoid card-in-card look */
.adm-content .rz-card {
    box-shadow: none !important;
    border: none !important;
    border-bottom: 1px solid rgba(0,0,0,0.07) !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
}

/* ── Badge counts in header ── */
.adm-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.25); color: #fff;
    border-radius: 10px; font-size: 11px; font-weight: 700;
    padding: 2px 8px; min-width: 22px; margin-left: 4px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .adm-header { padding: 14px 16px; gap: 10px; }
    .adm-header-title { font-size: 14px; }
    .adm-header-actions { flex-wrap: wrap; }
}

/* ─────────────────────────────────────────────────────────── */
/* BRANDED DATA GRID                                           */
/* ─────────────────────────────────────────────────────────── */

/* Orange gradient header cells */
.adm-content .rz-datatable-header-cell {
    background: linear-gradient(135deg, #993C1D 0%, #C05415 55%, #EE7026 100%) !important;
    color: white !important;
    border-color: rgba(255,255,255,0.12) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 11px 14px !important;
    white-space: nowrap;
}

/* Column title text + sort icons */
.adm-content .rz-datatable-header-cell .rz-column-title,
.adm-content .rz-datatable-header-cell .rz-column-header-title { color: white !important; }
.adm-content .rz-datatable-header-cell .rzi { color: rgba(255,255,255,0.55) !important; }
.adm-content .rz-state-sorted .rzi { color: white !important; }

/* Checkboxes & filter icons in header */
.adm-content .rz-datatable-header-cell .rz-filter-icon,
.adm-content .rz-datatable-header-cell .rz-grid-filter-icon { color: rgba(255,255,255,0.7) !important; }

/* Filter row — tinted orange */
.adm-content .rz-datatable-filter-row td {
    background: #FFF4ED !important;
    border-bottom: 2px solid #F0997B !important;
}

/* Data cells */
.adm-content .rz-data-row td {
    border-bottom: 1px solid rgba(238,112,38,0.07) !important;
    border-right: none !important;
    font-size: 13px;
    padding: 10px 14px !important;
    vertical-align: middle;
}

/* Zebra striping (very subtle) */
.adm-content .rz-data-row:nth-child(even) td {
    background: rgba(238,112,38,0.025) !important;
}

/* Row hover */
.adm-content .rz-data-row:hover td {
    background: rgba(238,112,38,0.07) !important;
    cursor: pointer;
}

/* Selected row */
.adm-content .rz-state-highlight td {
    background: rgba(238,112,38,0.12) !important;
}
.adm-content .rz-state-highlight td:first-child {
    box-shadow: inset 3px 0 0 #EE7026;
}

/* ── Paginator branding ── */
.adm-content .rz-paginator {
    border-top: 2px solid rgba(238,112,38,0.15) !important;
    background: linear-gradient(to right, #FFFAF7, #fff) !important;
    padding: 10px 14px !important;
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    min-height: 52px;
}

/* "Page X of Y (Z items)" pill */
.adm-content .rz-pager-info,
.adm-content .rz-paginator-info {
    display: inline-flex !important; align-items: center !important;
    background: #FFF0E8 !important;
    border: 1px solid #F0997B !important;
    color: #C05415 !important;
    font-size: 11px !important; font-weight: 700 !important;
    padding: 4px 12px !important; border-radius: 20px !important;
    white-space: nowrap !important;
}

/* Page navigation buttons (first/prev/next/last) */
.adm-content .rz-pager-element {
    border-radius: 6px !important;
    border: 1px solid rgba(238,112,38,0.25) !important;
    color: #C05415 !important;
    background: transparent !important;
    min-width: 28px; height: 28px;
    font-size: 13px !important;
    transition: all 0.15s ease !important;
}
.adm-content .rz-pager-element:hover:not([disabled]) {
    background: #EE7026 !important; color: white !important;
    border-color: #EE7026 !important;
}
.adm-content .rz-pager-element[disabled],
.adm-content .rz-pager-element.rz-state-disabled {
    opacity: 0.35 !important; cursor: not-allowed !important;
}

/* Page number buttons */
.adm-content .rz-pager-page {
    border-radius: 6px !important;
    border: 1px solid rgba(238,112,38,0.2) !important;
    color: #C05415 !important;
    background: transparent !important;
    min-width: 28px; height: 28px;
    font-size: 12px !important; font-weight: 600 !important;
    transition: all 0.15s ease !important;
}
.adm-content .rz-pager-page:hover,
.adm-content .rz-pager-page.rz-state-active {
    background: #EE7026 !important; color: white !important;
    border-color: #EE7026 !important;
}

/* Page size dropdown inside paginator */
.adm-content .rz-paginator .rz-dropdown {
    border: 1px solid rgba(238,112,38,0.35) !important;
    border-radius: 8px !important;
    font-size: 12px !important;
}

/* Row-level action buttons */
.adm-content .rz-data-row .rz-button { border-radius: 6px !important; transition: all 0.15s ease !important; }
.adm-content .rz-data-row .rz-button.rz-light {
    background: transparent !important;
    border: 1px solid rgba(0,0,0,0.11) !important;
    color: #666 !important;
}
.adm-content .rz-data-row .rz-button.rz-light:hover {
    background: #FFF0E8 !important;
    border-color: #EE7026 !important;
    color: #C05415 !important;
}

/* ── Avatar chip (member/person initials) ── */
.adm-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: white;
    flex-shrink: 0; letter-spacing: -0.5px;
}

/* ── Branch chip ── */
.adm-branch-chip {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 700; color: white;
    white-space: nowrap;
}

/* ── Role icon chip ── */
.adm-role-chip {
    width: 32px; height: 32px; border-radius: 8px;
    background: #FFF0E8; color: #EE7026;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}

/* ── Advanced Reports filter card ── */
.rpt-filters-card { overflow: visible !important; }

.filter-accordion {
    border-bottom: 1px solid rgba(238,112,38,0.12);
    overflow: visible;
}
.filter-accordion:last-child { border-bottom: none; }

.filter-section-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 13px 18px;
    background: linear-gradient(135deg, #993C1D 0%, #C05415 55%, #EE7026 100%);
    color: white;
    cursor: pointer;
    transition: filter 0.15s ease;
    user-select: none;
}
.filter-section-header:hover { filter: brightness(1.08); }
.filter-section-header h3 {
    margin: 0; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.filter-section-header .toggle-icon { transition: transform 0.25s ease; }
.filter-section-header.collapsed .toggle-icon { transform: rotate(-90deg); }

.filter-section-body {
    padding: 16px 18px;
    background: #FFFAF7;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.filter-section-body.collapsed { display: none; }

/* Same accordion header/collapse behavior as .filter-section-body, but for
   sections whose content is a table/grid rather than a set of filter fields
   (block layout instead of a forced CSS grid of fields). */
.filter-section-body-table {
    padding: 16px 18px;
    background: #FFFAF7;
    display: block;
}
.filter-section-body-table.collapsed { display: none; }

.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-weight: 600; font-size: 12px; color: #555; text-transform: uppercase; letter-spacing: 0.04em; }
.filter-field .rz-dropdown,
.filter-field .rz-textbox,
.filter-field .rz-numeric,
.filter-field .rz-datepicker { width: 100%; }

.date-range-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-range-row span { font-size: 12px; color: #888; }

/* Active filters bar */
.active-filters-section {
    padding: 12px 18px;
    background: #FFFAF7;
    border-top: 2px solid rgba(238,112,38,0.15);
}
.active-filters-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.active-filters-header h4 {
    margin: 0; font-size: 12px; font-weight: 700;
    color: #C05415; text-transform: uppercase; letter-spacing: 0.05em;
    display: flex; align-items: center; gap: 6px;
}
.filter-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.filter-tag {
    display: inline-flex; align-items: center;
    background: #EE7026; color: white;
    padding: 4px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.filter-tag .remove-btn {
    margin-left: 6px; background: rgba(255,255,255,0.2); border: none; color: white;
    cursor: pointer; font-size: 14px; width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: background 0.15s;
    line-height: 1; padding: 0;
}
.filter-tag .remove-btn:hover { background: rgba(255,255,255,0.4); }
.no-filters { color: #aaa; font-size: 12px; font-style: italic; }

/* ── Report cards grid ── */
.rpt-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0;
}

.rpt-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(238,112,38,0.08);
    border-right: 1px solid rgba(238,112,38,0.08);
    cursor: pointer;
    transition: background 0.15s ease;
}
.rpt-card:hover { background: rgba(238,112,38,0.05); }
.rpt-card:hover .rpt-card-arrow { opacity: 1; transform: translateX(3px); }

.rpt-card-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white; flex-shrink: 0;
}

.rpt-card-body { flex: 1; min-width: 0; }
.rpt-card-title { font-size: 14px; font-weight: 700; }
.rpt-card-sub   { font-size: 11px; color: #888; margin-top: 2px; }

.rpt-card-arrow {
    font-size: 20px; color: #C05415; opacity: 0.4;
    transition: opacity 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

/* ─── Dark-mode overrides ─── */
@media (prefers-color-scheme: dark) {
    .adm-content .rz-datatable-filter-row td { background: rgba(238,112,38,0.08) !important; }
    .adm-content .rz-data-row:nth-child(even) td { background: rgba(255,255,255,0.02) !important; }
    .adm-content .rz-data-row:hover td { background: rgba(238,112,38,0.10) !important; }
    .adm-role-chip { background: rgba(238,112,38,0.15); }
    .adm-content .rz-data-row .rz-button.rz-light { border-color: rgba(255,255,255,0.15) !important; color: #aaa !important; }
    .adm-content .rz-data-row .rz-button.rz-light:hover { background: rgba(238,112,38,0.15) !important; border-color: #EE7026 !important; color: #F5832E !important; }
}
:root[data-theme="dark"] {
    .adm-content .rz-datatable-filter-row td { background: rgba(238,112,38,0.08) !important; }
    .adm-content .rz-data-row:hover td { background: rgba(238,112,38,0.10) !important; }
    .adm-role-chip { background: rgba(238,112,38,0.15); }
}
