/* =====================================================================================================================
   grid_cards.css (2026-11-24) - ONE grid look for the whole app, taken from the owner's reference sheet
   "Grid_Card_Rows_Line_Icons_2026-11-21.html", variant 5D "Card rows - Pastel round chips":

     card rows   every row is a white rounded card on a soft grey band, with a 4px coloured left edge; the header
                 loses its rule and sits on the band as small slate titles.
     5D chips    an icon-only action button becomes a round chip in a light colour of its own, so the actions are
                 told apart at a glance instead of by hovering.
     hover       the row takes a light shade of its edge colour and the edge thickens. Nothing moves.

   Columns, pills, links, switches and every click stay exactly as they are - only the look changes.
   Loaded after site.css in _layout.html. Undo: remove that <link> and the <script> for js/grid_cards.js.

   TWO DELIBERATE DEPARTURES from the reference sheet, both to avoid breaking what is already there:
     1. FONT SIZES ARE NOT TOUCHED. The sheet sets 12.5px cells and 11.5px headers; several of these grids were
        deliberately shrunk below that in site.css (the .scr-table header went from .68rem down to .55rem)
        because they carry a lot of columns. Forcing the bigger type back would reopen that. Only the header
        colour, weight and UPPERCASE change.
     2. PER-PAGE ROW TINTS AND BANDING GO. Case Manager painted its rows pale blue and striped the even ones;
        Unique Name, Bulk and Unique-Name-Ongoing shaded every fourth row. A card row already separates itself,
        and the point of this file is ONE look, so those are painted over. The tints that carried MEANING rather
        than decoration are kept, as a left-edge colour - see the row-state section near the bottom.

   TWO THINGS MAKE THIS FILE LOOK HEAVY-HANDED, both unavoidable:
     - !important everywhere. These are Bootstrap 5.1 tables, and Bootstrap paints a row background with an
       "inset 0 0 0 9999px" box-shadow on EVERY cell, so a background underneath it is simply not visible; and
       each page carries its own style block, which the browser sees AFTER this file (pages render into the
       body, this link is in the head), so an ordinary rule here would lose every tie.
     - The #gc\.pad prefix in each selector list. Several pages colour their grid with an ID selector AND
       !important - Case Manager has "#cmTable tbody tr td { background:#f5f9ff !important }" - which no number
       of classes can out-rank. #gc\.pad is an id that cannot exist (an id containing a dot), present only so
       the :is() list takes its specificity: an :is() is as specific as its most specific member, and hands
       that to every member. Two of them for the grid rules, three for the row-state rules, so a state still
       wins over the plain card.
   ===================================================================================================================== */
:root {
    --gc-band: #f4f6fa;   /* soft grey behind the cards */
    --gc-line: #e5e9f0;   /* card border */
    --gc-head: #475569;   /* header text */
}

/* ---------------------------------------------------------------------------------------------------------------
   GRID = the tables that are a LIST OF RECORDS. Everything below hangs off this one list.
     .scr-table             Screening results, Case Manager, Case Reports, MIS, Canadian lists, Google link
     .table.align-middle    the Bootstrap grids: Bulk, Company Config, EDD Report, Unique Name (+ Ongoing), Periodic Log, Ongoing Monitoring
     .cy-table              Crypto screening
     .ogc-table             Screening Configuration - ongoing list
     .rr-table              Customer Risk Rating log
     .my-t                  Malaysian lists
     .uno-table             Unique Name ongoing - run log
     .cc-pay-table          Company Configuration - payments ledger
     .ask-table             Ask - answer grid
     .ins-table             Screening Insight - analysis grid
     .ins-ntable            Screening Insight - names drill-down
     .cd-crr-table          Case Manager - CRR factor breakdown
   Left out on purpose, because none of them is a list of records:
     .edd-table / .aud-table   the EDD report body - a printed report, not a grid
     .rr-eg-tbl                the worked example in the CRR help panel
     .sb-table                 the assigned / available sanction-body picker - a control, not a grid
     the two bare tables that case_reports.html builds for the print window
   --------------------------------------------------------------------------------------------------------------- */
:is(
    #gc\.pad#gc\.pad,
    html body table.scr-table,
    html body table.table.align-middle,
    html body table.cy-table,
    html body table.ogc-table,
    html body table.rr-table,
    html body table.my-t,
    html body table.uno-table,
    html body table.cc-pay-table,
    html body table.ask-table,
    html body table.ins-table,
    html body table.ins-ntable,
    html body table.cd-crr-table) {
    border-collapse: separate !important;
    border-spacing: 0 6px !important;
    background: var(--gc-band) !important;
    background-color: var(--gc-band) !important;
    border-radius: 10px;
}

/* ---- header: no rule under it, small slate titles on the band ---- */
:is(
    #gc\.pad#gc\.pad,
    html body table.scr-table,
    html body table.table.align-middle,
    html body table.cy-table,
    html body table.ogc-table,
    html body table.rr-table,
    html body table.my-t,
    html body table.uno-table,
    html body table.cc-pay-table,
    html body table.ask-table,
    html body table.ins-table,
    html body table.ins-ntable,
    html body table.cd-crr-table) > thead > tr > th {
    background: var(--gc-band) !important;        /* opaque: several of these headers are position:sticky */
    background-color: var(--gc-band) !important;
    color: var(--gc-head) !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    padding: 6px 10px !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* ---- body rows = cards. Skipped: the expanded detail panels, which are not records. ---- */
:is(
    #gc\.pad#gc\.pad,
    html body table.scr-table,
    html body table.table.align-middle,
    html body table.cy-table,
    html body table.ogc-table,
    html body table.rr-table,
    html body table.my-t,
    html body table.uno-table,
    html body table.cc-pay-table,
    html body table.ask-table,
    html body table.ins-table,
    html body table.ins-ntable,
    html body table.cd-crr-table) > tbody > tr:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row) {
    --gc-edge: #cbd5e1;   /* neutral edge, and the hover shade that goes with it */
    --gc-tint: #f3f7fd;
}
:is(
    #gc\.pad#gc\.pad,
    html body table.scr-table,
    html body table.table.align-middle,
    html body table.cy-table,
    html body table.ogc-table,
    html body table.rr-table,
    html body table.my-t,
    html body table.uno-table,
    html body table.cc-pay-table,
    html body table.ask-table,
    html body table.ins-table,
    html body table.ins-ntable,
    html body table.cd-crr-table) > tbody > tr:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row) > td {
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: none !important;          /* kills Bootstrap's inset 9999px row paint - see the header note */
    border-top: 1px solid var(--gc-line) !important;
    border-bottom: 1px solid var(--gc-line) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    padding: 10px 8px !important;
    vertical-align: middle !important;
}
/* rounded card ends: the coloured left edge, and a closing border on the right */
:is(
    #gc\.pad#gc\.pad,
    html body table.scr-table,
    html body table.table.align-middle,
    html body table.cy-table,
    html body table.ogc-table,
    html body table.rr-table,
    html body table.my-t,
    html body table.uno-table,
    html body table.cc-pay-table,
    html body table.ask-table,
    html body table.ins-table,
    html body table.ins-ntable,
    html body table.cd-crr-table) > tbody > tr:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row) > td:first-child {
    border-left: 4px solid var(--gc-edge) !important;
    border-radius: 8px 0 0 8px !important;
}
:is(
    #gc\.pad#gc\.pad,
    html body table.scr-table,
    html body table.table.align-middle,
    html body table.cy-table,
    html body table.ogc-table,
    html body table.rr-table,
    html body table.my-t,
    html body table.uno-table,
    html body table.cc-pay-table,
    html body table.ask-table,
    html body table.ins-table,
    html body table.ins-ntable,
    html body table.cd-crr-table) > tbody > tr:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row) > td:last-child {
    border-right: 1px solid var(--gc-line) !important;
    border-radius: 0 8px 8px 0 !important;
}

/* ---- hover: the row takes its own shade, the edge thickens INSIDE the cell so nothing moves ---- */
:is(
    #gc\.pad#gc\.pad,
    html body table.scr-table,
    html body table.table.align-middle,
    html body table.cy-table,
    html body table.ogc-table,
    html body table.rr-table,
    html body table.my-t,
    html body table.uno-table,
    html body table.cc-pay-table,
    html body table.ask-table,
    html body table.ins-table,
    html body table.ins-ntable,
    html body table.cd-crr-table) > tbody > tr:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row):hover > td {
    background: var(--gc-tint) !important;
    background-color: var(--gc-tint) !important;
}
:is(
    #gc\.pad#gc\.pad,
    html body table.scr-table,
    html body table.table.align-middle,
    html body table.cy-table,
    html body table.ogc-table,
    html body table.rr-table,
    html body table.my-t,
    html body table.uno-table,
    html body table.cc-pay-table,
    html body table.ask-table,
    html body table.ins-table,
    html body table.ins-ntable,
    html body table.cd-crr-table) > tbody > tr:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row):hover > td:first-child {
    box-shadow: inset 2px 0 0 var(--gc-edge) !important;
}

/* ---------------------------------------------------------------------------------------------------------------
   Rows that MEAN something. A card row carries meaning in its left edge rather than its fill, so the meaning
   survives the new look instead of being painted over with white.
   --------------------------------------------------------------------------------------------------------------- */

/* Screening Log: a name that matched. This one also keeps a tint at rest - it is an alert, and it has to be
   visible without hovering. The page paints it with an ID rule and !important, hence the three pad ids. */
html body #slTable > tbody > tr.sl-matched {
    --gc-edge: #dc2626 !important;
    --gc-tint: #fde0e0 !important;
}
:is(#gc\.pad#gc\.pad#gc\.pad, html body #slTable) > tbody > tr.sl-matched:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row) > td {
    background: #fff5f5 !important;
    background-color: #fff5f5 !important;
    box-shadow: none !important;
}
:is(#gc\.pad#gc\.pad#gc\.pad, html body #slTable) > tbody > tr.sl-matched:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row):hover > td {
    background: #fde0e0 !important;
    background-color: #fde0e0 !important;
}
:is(#gc\.pad#gc\.pad#gc\.pad, html body #slTable) > tbody > tr.sl-matched:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row):hover > td:first-child {
    box-shadow: inset 2px 0 0 var(--gc-edge) !important;
}

/* Ongoing Monitoring: monitoring switched off. Grey edge, and the row keeps the muted text it had. */
html body table.ogc-table > tbody > tr.ogc-off {
    --gc-edge: #cbd5e1 !important;
    --gc-tint: #f4f6fa !important;
}
:is(#gc\.pad#gc\.pad#gc\.pad, html body table.ogc-table) > tbody > tr.ogc-off:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row) > td {
    color: #64748b !important;
}

/* ---------------------------------------------------------------------------------------------------------------
   5D action chips. The grid action buttons already say what they do (.un-act-pdf, -pdfall, -ai, -case, -edd,
   -scr), so each gets its own light round chip - which is exactly what 5D is. Their old look was a white square
   that only took colour on hover; the colour now sits there at rest and hover just deepens it.
   js/grid_cards.js marks any OTHER icon-only button in a grid cell as .gc-chip + .gc-c1..6, for the grids whose
   rows are built in JavaScript (Ask, Screening Insight, Case Manager) and so carry no action class of their own.
   --------------------------------------------------------------------------------------------------------------- */
html body .un-act,
html body .gc-chip {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;
    padding: 0 !important;
    margin: 0 3px 0 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    text-decoration: none !important;
    box-shadow: none !important;
    background: #eef1f5;
    color: #64748b;
}
html body .un-act > i,
html body .gc-chip > i {
    font-size: 14px !important;
    line-height: 1 !important;
    margin: 0 !important;
    color: inherit !important;
}
html body .un-act:hover,
html body .gc-chip:hover { filter: brightness(.94); border: 0 !important; }
html body .un-act:disabled,
html body .gc-chip.locked { background: #f1f5f9 !important; color: #b6c0cc !important; filter: none; }

/* one colour per action - the hue each button already took on hover, now shown at rest */
html body .un-act-pdf,    html body .gc-c6 { background: #fde8e8 !important; color: #dc2626 !important; }
html body .un-act-pdfall, html body .gc-c2 { background: #fdf3e2 !important; color: #d48a1d !important; }
html body .un-act-scr                      { background: #fdf3e2 !important; color: #d48a1d !important; }
html body .un-act-case,   html body .gc-c3 { background: #e4f6ee !important; color: #1f9d6c !important; }
html body .un-act-ai,     html body .gc-c4 { background: #f0ebfb !important; color: #7c5cc9 !important; }
html body .un-act-edd,    html body .gc-c1 { background: #eaf2fe !important; color: #3b82f6 !important; }
html body .gc-c5 { background: #eef1f5 !important; color: #64748b !important; }

/* the actions cell keeps them on one line */
html body td.gc-actcell { white-space: nowrap !important; }

@media (prefers-reduced-motion: reduce) {
    html body .un-act:hover, html body .gc-chip:hover { filter: none; }
}


/* ---------------------------------------------------------------------------
   U2 — compact rows.

   The card-row padding above is set with !important on a deliberately heavy
   selector, so a density rule written anywhere else loses to it. This is that
   same selector with `html.density-compact` in front: identical shape, one
   class more specific, and later in the file — the only way to override it
   without weakening the rule everybody else depends on.

   Only the vertical padding changes. The card look — the white fill, the
   borders, the rounded ends — is untouched, so a compact grid is the same
   grid with less air in it.
   --------------------------------------------------------------------------- */
html.density-compact :is(
    #gc\.pad#gc\.pad,
    html body table.scr-table,
    html body table.table.align-middle,
    html body table.cy-table,
    html body table.ogc-table,
    html body table.rr-table,
    html body table.my-t,
    html body table.uno-table,
    html body table.cc-pay-table,
    html body table.ask-table,
    html body table.ins-table,
    html body table.ins-ntable,
    html body table.cd-crr-table) > tbody > tr:not(.gc-skip):not(.un-detail-row):not(.sl-detail-row):not(.scr-detail-row) > td {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}
html.density-compact body table tbody td { line-height: 1.3 !important; }
html.density-compact body .cm-badge,
html.density-compact body .cm-age,
html.density-compact body .badge { padding-top: 0 !important; padding-bottom: 0 !important; }
