﻿/*!
 * tabulator-custom.css
 * Scoped Tabulator styles for this project
 * File purpose: central place for Tabulator grid styles used across pages.
 * NOTE: All rules are scoped under .tu-grid-root / .tu-grid-panel to avoid
 * interfering with other Tabulator instances or library defaults.
 */

/* =========================
   PANEL / CARD WRAPPER
   Applies to the outer container that wraps a grid (title + content + pager)
   Target element: .tu-grid-panel
   ========================= */
.tu-grid-panel {
    /* wrapper background tint and spacing */
    background: #f5faff; /* very faint tint */
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
    max-width: 1100px;
    /* typography fallback stack for text inside the panel */
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    color: #21323a;
}

    /* Inner white card (the inner "card" that sits inside the panel) */
    /* Target element: .tu-grid-panel .panel-inner */
    .tu-grid-panel .panel-inner {
        background: #ffffff;
        border: 1px solid #c8d8e5; /* darker edge */
        border-radius: 8px;
        box-shadow: 0 4px 14px rgba(20, 30, 40, 0.08);
    }

    /* --- PANEL TITLE BAR --- */
    /* Target element: .tu-grid-panel .panel-title */
    .tu-grid-panel .panel-title {
        background: linear-gradient(180deg, #d7ecff 0%, #cbe6ff 100%) !important;
        height: 28px; /* fixed total height */
        line-height: 28px; /* vertically center the text */
        padding: 0 10px !important; /* remove vertical padding, keep side spacing */
        font-weight: 700;
        font-size: 12.5px;
        color: #074b82;
        border-bottom: 1px solid #bcd9f3;
        letter-spacing: 0.3px;
        text-transform: uppercase;
        overflow: hidden; /* ensure content fits within height */
        white-space: nowrap;
    }

    /* Panel content padding (reduces spacing so header aligns tightly) */
    /* Target element: .tu-grid-panel .panel-content */
    .tu-grid-panel .panel-content {
        padding: 4px 6px;
    }

/* =========================
   TABULATOR BASE + CONTAINERS
   Scope your Tabulator visuals so they don't leak across the site.
   Target elements: .tu-grid-root .tabulator, .tabulator
   ========================= */

/* Outer grid outline and base look */
.tu-grid-root .tabulator,
.tabulator {
    border: 1px solid #cdd9e6 !important; /* thin light-blue-gray outer border */
    border-radius: 6px;
    box-shadow: none;
}

    /* Remove default Tabulator shadow and collapse borders for consistent lines */
    .tabulator .tabulator-header,
    .tabulator .tabulator-tableholder,
    .tabulator .tabulator-table {
        border-collapse: collapse !important;
    }

    /* Header area (full header background) */
    /* Target element: .tabulator .tabulator-header */
    .tabulator .tabulator-header {
        background: linear-gradient(180deg, #e0f0ff 0%, #d4ebff 100%) !important;
        border-bottom: 1px solid #c0d6e8 !important;
        min-height: 20px !important; /* compact header */
        box-shadow: none !important;
    }

    /* Column header cell (the header "pill" for each column) */
    /* Target element: .tabulator .tabulator-col */
    .tabulator .tabulator-col {
        background: linear-gradient(180deg, #e0f0ff 0%, #d4ebff 100%) !important;
        border-right: 1px solid #c0d6e8;
        padding: 0 !important; /* remove extra internal padding */
        height: 28px !important; /* keeps uniform height */
    }

        /* Column header title text */
        /* Target: .tabulator .tabulator-col .tabulator-col-title */
        .tabulator .tabulator-col .tabulator-col-title {
            color: #074b82 !important;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            padding: 4px 6px !important; /* tighter top/bottom padding */
            font-size: 12px !important;
            line-height: 1.2 !important;
        }

    /* Remove injected greys and shadows inside header cells */
    .tabulator .tabulator-header-contents,
    .tabulator .tabulator-frozen,
    .tabulator .tabulator-col-group,
    .tabulator .tabulator-col-content {
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Optional header hover highlight */
    .tabulator .tabulator-col:hover {
        background: linear-gradient(180deg, #d4ebff 0%, #c7e2ff 100%) !important;
    }

    /* Header filter input (if used) */
    /* Target: .tabulator .tabulator-header-filter input */
    .tabulator .tabulator-header-filter input {
        padding: 2px 4px;
        font-size: 11px;
    }

    /* =========================
   ROWS & CELLS
   Target elements: .tabulator .tabulator-row, .tabulator .tabulator-row .tabulator-cell
   ========================= */

    /* Grid cell base styling and thin separators */
    .tabulator .tabulator-row .tabulator-cell {
        padding: 4px 6px !important;
        font-size: 12px !important;
        color: #243238;
        border-right: 1px solid #d6e2f0 !important; /* thin vertical lines */
        border-bottom: 1px solid #e3ebf5 !important; /* thin horizontal lines */
        box-shadow: none !important;
    }

    /* Slightly darker bottom line for final row */
    .tabulator .tabulator-row:last-child .tabulator-cell {
        border-bottom: 1px solid #cfd9e4 !important;
    }

    /* Remove rightmost border so it doesn't look doubled */
    .tabulator .tabulator-row .tabulator-cell:last-child,
    .tabulator .tabulator-col:last-child {
        border-right: none !important;
    }

    /* Zebra row backgrounds for readability */
    .tabulator .tabulator-row:nth-child(odd) {
        background: #ffffff;
    }

    .tabulator .tabulator-row:nth-child(even) {
        background: #fbfeff;
    }

    /* Row hover and selected states */
    .tabulator .tabulator-row:hover {
        background: #f5fbff !important;
    }

    .tabulator .tabulator-row.tabulator-selected {
        background: linear-gradient(90deg, rgba(11,132,207,0.06), rgba(11,132,207,0.03)) !important;
        box-shadow: inset 0 0 0 1px rgba(11,132,207,0.06);
    }

    /* Placeholder (when no data) */
    .tabulator .tabulator-placeholder {
        padding: 28px;
        text-align: center;
        color: #7b8a90;
        font-style: italic;
        font-weight: 500;
    }

/* Tiny responsive tweaks */
@media (max-width: 720px) {
    .tabulator .tabulator-col .tabulator-col-title {
        font-size: 11px;
    }

    .tabulator-cell {
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* =========================
   PAGINATION AREA
   Targets: #pager, #pager1 (your custom pager containers)
   ========================= */
#pager, #pager1 {
    display: flex;
    justify-content: flex-end;
    padding: 4px 6px;
    gap: 6px;
    font-size: 12px;
    color: #475569;
}
