/**
 * Colored grid styling for Cashbook Reports
 * Used by: PaymentsList, ShiftReport, CashPointsSummary, CollectionsBreakdown,
 *          DailyRevenueBreakdown, DepartmentsRevenue, ItemSalesSummary, PatientsSummary
 */

/* ---------- Container ---------- */
.cashbook-colored-grid {
    border: 1px solid #cbd5e1;
}

/* ---------- Column headers ---------- */
.cashbook-colored-grid .x-grid-header-ct,
.cashbook-colored-grid .x-grid-header-ct-default {
    background-color: #0f766e !important;
    background-image: none !important;
    border-bottom: 2px solid #115e59;
}

.cashbook-colored-grid .x-column-header,
.cashbook-colored-grid .x-column-header-default {
    background-color: #0f766e !important;
    background-image: none !important;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.3px;
    border-color: #115e59 !important;
}

/* Force white text on all descendants of column headers — Ext sets color on
   the inner .x-column-header-text-inner span, which overrides the parent. */
.cashbook-colored-grid .x-column-header,
.cashbook-colored-grid .x-column-header *,
.cashbook-colored-grid .x-column-header-inner,
.cashbook-colored-grid .x-column-header-text,
.cashbook-colored-grid .x-column-header-text-container,
.cashbook-colored-grid .x-column-header-text-inner {
    color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.cashbook-colored-grid .x-column-header-over,
.cashbook-colored-grid .x-column-header-open {
    background-color: #0d9488 !important;
    background-image: none !important;
}

.cashbook-colored-grid .x-column-header-trigger,
.cashbook-colored-grid .x-column-header-trigger-default,
.cashbook-colored-grid .x-column-header-trigger::before {
    color: #ffffff !important;
    background-color: transparent !important;
}

.cashbook-colored-grid .x-column-header-inner {
    padding: 7px 8px;
}

/* sort indicator arrow */
.cashbook-colored-grid .x-column-header-sort-ASC .x-column-header-text-inner::after,
.cashbook-colored-grid .x-column-header-sort-DESC .x-column-header-text-inner::after {
    color: #fde047 !important;
}

/* ---------- Row striping ---------- */
.cashbook-colored-grid .x-grid-row {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.cashbook-colored-grid .x-grid-row-alt,
.cashbook-colored-grid .x-grid-row:nth-child(even) {
    background-color: #f1f5f9 !important;
}

.cashbook-colored-grid .x-grid-row-over,
.cashbook-colored-grid .x-grid-row-over .x-grid-cell {
    background-color: #dbeafe !important;
}

.cashbook-colored-grid .x-grid-row-selected,
.cashbook-colored-grid .x-grid-row-selected .x-grid-cell {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* ---------- Cells ---------- */
.cashbook-colored-grid .x-grid-cell {
    border-right-color: #e2e8f0;
    border-bottom-color: #e2e8f0;
}

.cashbook-colored-grid .x-grid-cell-inner {
    padding: 6px 8px;
    font-size: 12px;
    color: #1e293b;
}

/* ---------- Grouping header bar ---------- */
.cashbook-colored-grid .x-grid-group-hd,
.cashbook-colored-grid .x-grid-group-title {
    background-color: #475569 !important;
    background-image: none !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 10px;
    border-top: 1px solid #334155;
    border-bottom: 1px solid #334155;
}

.cashbook-colored-grid .x-grid-group-hd-collapsible::before {
    color: #fbbf24 !important;
}

/* ---------- Summary row (per group and grand total) ---------- */
.cashbook-colored-grid .x-grid-row-summary,
.cashbook-colored-grid .x-grid-row-summary .x-grid-cell {
    background-color: #fef3c7 !important;
    color: #78350f !important;
    font-weight: 700;
    border-top: 1px solid #f59e0b;
    border-bottom: 1px solid #f59e0b;
}

/* docked summary at the bottom of the grid */
.cashbook-colored-grid .x-docked-summary,
.cashbook-colored-grid .x-grid-item-container > .x-grid-row-summary {
    background-color: #fde68a !important;
}

/* ---------- Numeric/currency columns: subtle tint ---------- */
.cashbook-colored-grid .x-grid-cell[data-qtip*="Ksh"] .x-grid-cell-inner,
.cashbook-colored-grid .x-grid-cell-debit .x-grid-cell-inner,
.cashbook-colored-grid .x-grid-cell-credit .x-grid-cell-inner {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---------- Paging toolbar ---------- */
.cashbook-colored-grid .x-toolbar.x-toolbar-default[data-componentcls~="x-toolbar-default"] {
    background-color: #f1f5f9 !important;
    background-image: none !important;
    border-top: 1px solid #cbd5e1;
}

/* ---------- Top docked toolbar (filter row) ---------- */
.cashbook-colored-grid > .x-docked-top:first-of-type {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0;
}
