/* PH table grid. One look for every list and grid on every PH page. Needs ph-tokens.css (and ph-buttons.css for the toolbar and pager buttons).
   <div class="ph-table-wrap">
     <div class="ph-table-bar">…search, filters, actions…</div>          optional toolbar
     <div class="ph-table-scroll">
       <table class="ph-table ph-table--hover">
         <thead><tr><th>Name</th><th class="is-sortable" aria-sort="ascending">Date</th><th class="is-num">Hours</th></tr></thead>
         <tbody><tr><td>…</td><td>…</td><td class="is-num">3.5</td></tr></tbody>
       </table>
     </div>
     <div class="ph-table-foot">…count and pager…</div>                  optional footer
   </div>
   Modifiers on the table: --hover (row highlight), --striped, --compact, --sticky (header stays while scrolling the wrapper), --fixed (equal columns).
   Rows: .is-selected, .is-muted. Cells: .is-num (right aligned numbers), .is-actions (right aligned buttons), .is-nowrap, .is-truncate (needs a max-width).
   Status chips: <span class="ph-pill ph-pill--ok">Done</span>  (--ok, --warn, --bad, --info, default grey).
   Nothing to show: <div class="ph-table-empty">…</div>. While loading, put a ph-skeleton table in its place.
   Row actions: a three-dots menu in the last cell, <td class="is-actions">' + rowMenu(id, items) + '</td> (js/ph-row-menu.js). Items with cls 'is-danger' show red. */
/* 2026-11-12 | Monique ("do a audit where i need to update all my tables to match the layout how my address Book look"): this file is now the Address Book
   grid, written once for every page on .ph-table. What changed, and what it was before (ph-address-book.css #abApp is the reference):
     frame radius     12          was 16 (--ph-r-lg)
     header           44px tall, sentence case, 12px / .06em / weight 400, --ink-muted on #F7F9F8      was 36px, UPPERCASE, 12.5px / .04em / weight 500 on --paper
     row              12px 16px, 64px tall, hairline in --border                                       was 11px 14px, no height, --border-soft
     cell text        13.5px      was 14.5px
     hover            #EEF6F6 (the Address Book's teal wash)                                           was --acc-lite #F0F8F8
   The head and hover colours come from --sf7f9f8 / --seef6f6 in ph-tokens.css, which already carry the dark-mode pair - NOT from --paper, which
   ph-matter-form.css redefines as #f6f5f1 on .mf-shell, so a table inside the Matter Form was coming out a different colour from every other table.
   Dense lists that cannot afford 64px rows keep .ph-table--compact, which is now the old density. */
.ph-table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-card); color: var(--ink); font-family: var(--font); }
.ph-table-scroll { overflow: auto; max-width: 100%; }
.ph-table-wrap--tall .ph-table-scroll { max-height: min(70vh, 640px); }

.ph-table-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ph-table-bar .ph-grow { flex: 1 1 220px; min-width: 0; }
.ph-table-bar input[type=search], .ph-table-bar input[type=text], .ph-table-bar select { height: var(--ph-h); padding: 0 12px; border: 1px solid var(--border); border-radius: var(--ph-r); background: var(--card); color: var(--ink); font: inherit; font-size: var(--ph-fs); min-width: 0; }
.ph-table-bar input:focus, .ph-table-bar select:focus { outline: none; border-color: var(--acc); box-shadow: var(--ph-ring); }

.ph-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--ph-table-size, 13.5px); line-height: 1.35; }
/* the Address Book types its own headings in capitals (ph-address-book.js: label.toUpperCase()), so the capitals stay here - every page on .ph-table writes
   its headings in sentence case and text-transform does the same job. Everything else is the Address Book's: 44px, 12px, .06em, weight 400, muted on #F7F9F8. */
.ph-table th { position: relative; text-align: left; height: 44px; padding: 0 16px; background: var(--sf7f9f8, #F7F9F8); color: var(--ink-muted); font-size: 12px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid var(--border); }
.ph-table tbody tr { height: 64px; }   /* a minimum on a table row: a row with more in it still grows */
.ph-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ph-table tbody tr:last-child td { border-bottom: 0; }
.ph-table td small, .ph-table td .ph-sub { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 12px; line-height: 1.3; }

.ph-table--hover tbody tr:hover td { background: var(--seef6f6, #EEF6F6); }
.ph-table--striped tbody tr:nth-child(even) td { background: var(--sf7f9f8, #F7F9F8); }
.ph-table--striped.ph-table--hover tbody tr:hover td { background: var(--seef6f6, #EEF6F6); }
/* the old density, for a list that cannot give every row 64px */
.ph-table--compact th { height: 36px; padding: 0 12px; }
.ph-table--compact tbody tr { height: auto; }
.ph-table--compact td { padding: 8px 12px; font-size: 13px; }
.ph-table--sticky thead th { position: sticky; top: 0; z-index: 2; }
.ph-table--fixed { table-layout: fixed; }
.ph-table tr.is-selected td { background: var(--acc-tint); }
.ph-table tr.is-muted td { color: var(--ink-faint); }
.ph-table tr[data-href], .ph-table tr.is-click { cursor: pointer; }

.ph-table input[type=checkbox], .ph-table input[type=radio] { accent-color: var(--acc); width: 17px; height: 17px; vertical-align: middle; }
.ph-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.ph-table .is-actions { text-align: right; white-space: nowrap; }
.ph-table .is-nowrap { white-space: nowrap; }
.ph-table .is-truncate { max-width: 1px; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-table th.is-num { text-align: right; }

/* sortable headers: a small arrow that shows the direction */
.ph-table th.is-sortable { cursor: pointer; user-select: none; padding-right: 26px; }
.ph-table th.is-sortable:hover { color: var(--ink); }
.ph-table th.is-sortable::after { content: ''; position: absolute; right: 10px; top: 50%; width: 0; height: 0; margin-top: -2px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .35; }
.ph-table th[aria-sort="ascending"]::after { border-top: 0; border-bottom: 5px solid currentColor; opacity: 1; margin-top: -3px; }
.ph-table th[aria-sort="descending"]::after { opacity: 1; }
.ph-table th[aria-sort] { color: var(--ink); }

/* the foot reads as the Address Book's totals row: the head tone, 44px, 13px muted */
.ph-table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 44px; padding: 6px 16px; border-top: 1px solid var(--border); background: var(--sf7f9f8, #F7F9F8); color: var(--ink-muted); font-size: 13px; }
.ph-pager { display: inline-flex; align-items: center; gap: 4px; }
.ph-pager button { min-width: var(--ph-h-sm); height: var(--ph-h-sm); padding: 0 8px; border: 1px solid transparent; border-radius: var(--ph-r-sm); background: none; color: var(--ink-muted); font: inherit; font-size: 13px; cursor: pointer; }
.ph-pager button:hover:not(:disabled) { background: var(--card); border-color: var(--border); color: var(--ink); }
.ph-pager button[aria-current="page"] { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.ph-pager button:disabled { opacity: .4; cursor: default; }

.ph-table-empty { padding: 40px 20px; text-align: center; color: var(--ink-muted); font-size: var(--ph-fs); }
.ph-table-empty b { display: block; margin-bottom: 4px; color: var(--ink); font: 500 16px var(--font-display); }

/* row actions: the three-dots menu from js/ph-row-menu.js (the script places the open menu with position: fixed, so the wrapper's overflow does not clip it) */
.ph-table .is-actions { width: 1%; }
.rm-wrap { position: relative; display: inline-block; vertical-align: middle; }
.rm-wrap .card-3-btn { width: var(--ph-h-sm); height: var(--ph-h-sm); border: 0; border-radius: var(--ph-r-sm); background: none; color: var(--ink-muted); font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.rm-wrap .card-3-btn:hover, .rm-wrap .card-3-btn[aria-expanded="true"] { background: var(--paper-alt); color: var(--ink); }
.rm-wrap .card-3-btn:focus-visible { outline: none; box-shadow: var(--ph-ring); }
.rm-pop { position: absolute; right: 0; top: 100%; z-index: 1300; min-width: 170px; padding: 4px 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--ph-r); box-shadow: var(--shadow-pop); text-align: left; }
.rm-pop .card-3-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border: 0; background: none; color: var(--ink); font: inherit; font-size: var(--ph-fs); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.rm-pop .card-3-item svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--ink-muted); }
.rm-pop .card-3-item:hover, .rm-pop .card-3-item:focus-visible { outline: none; background: var(--paper-alt); }
.rm-pop .card-3-item.is-danger, .rm-pop .card-3-item.is-danger svg { color: var(--red); }
.rm-pop .card-3-item:disabled { opacity: .45; cursor: default; }
/* 2026-11-28 | Monique ("update all ... not dropdowns but the three dots or the more buttons"): every ⋮ menu on the site (the shared row menu .rm-pop /
   .card-3-pop) has the cards' menu look (ph-picker-card.css .rv-cdots, measured on the record's More menu): 6px inside, 16px corners, the soft shadow;
   42px rows, 12px sides, 14px words, 16px grey icons 12px from the words, 10px rounded hover; Remove / Delete red. The phone sheet (ph-subs-table.css) keeps its own. */
html body :is(.rm-pop, .card-3-pop):not(#_n#_n) { min-width: 240px; padding: 6px; border: 1px solid var(--le1e8e7); border-radius: 16px; background: var(--sffffff); box-shadow: 0 18px 44px rgba(18, 52, 59, .16); box-sizing: border-box; }
html body :is(.rm-pop, .card-3-pop) .card-3-item:not(#_n#_n) { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; min-height: 42px; margin: 0; padding: 0 12px; border: 0; border-radius: 10px; background: none; box-shadow: none; font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 14px; font-weight: 400; line-height: 1.3; color: var(--i12343b); text-align: left; text-decoration: none; white-space: nowrap; }
html body :is(.rm-pop, .card-3-pop) .card-3-item svg:not(#_n#_n) { width: 16px; height: 16px; flex: none; color: var(--i8a989c); }
html body :is(.rm-pop, .card-3-pop) .card-3-item:not(#_n#_n):is(:hover, :focus-visible) { background: var(--sf4f8f8); outline: none; }
html body :is(.rm-pop, .card-3-pop) .card-3-item.is-danger:not(#_n#_n), html body :is(.rm-pop, .card-3-pop) .card-3-item.is-danger svg:not(#_n#_n) { color: var(--ib42318); }
html body :is(.rm-pop, .card-3-pop) .card-3-item.is-danger:not(#_n#_n):is(:hover, :focus-visible) { background: var(--sfdf0ee); }
/* 2026-11-30 | Monique ("these should also be reorder and nicely grouped like the other places"): a ⋮ menu's group heading (.rm-hd - THIS EVENT, VIEW & EDIT,
   ADD, as the More menus' headings) and the thin line between groups (.rm-sep) */
html body :is(.rm-pop, .card-3-pop) .rm-hd:not(#_n#_n) { display: block; padding: 8px 12px 4px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--i8a989c); font-weight: 400; pointer-events: none; }
html body :is(.rm-pop, .card-3-pop) .rm-sep:not(#_n#_n) { display: block; height: 1px; margin: 6px 4px; background: var(--se1e8e7); }

/* status pills (.ph-pill, --ok, --warn, --bad, --info, --plain) moved to ph-pills-checkboxes.css: load that file wherever pills are used */

/* ===== 2026-11-16 | Monique ("we can add more styling, like tablegrids" > "Options in Site settings"): a space's own table grid look =====
   Chosen on the space's Settings > Site settings > Table grids and put on <html> by PhHeader.ascx (TableGridHtml): ph-tg-compact (48px rows),
   ph-tg-striped (every second row tinted), ph-tg-head-teal / ph-tg-head-dark (the heading row). None chosen = the look above, unchanged.
   .ph-tg-pv is the preview on that Settings page, which carries the same classes itself. A table that asks for --compact keeps its own density.
   The Address Book's grid follows the same classes at the end of ph-address-book.css. */
:is(html, .ph-tg-pv).ph-tg-compact .ph-table:not(.ph-table--compact) th { height: 38px; }
:is(html, .ph-tg-pv).ph-tg-compact .ph-table:not(.ph-table--compact) tbody tr { height: 48px; }
:is(html, .ph-tg-pv).ph-tg-compact .ph-table:not(.ph-table--compact) td { padding-top: 7px; padding-bottom: 7px; }
:is(html, .ph-tg-pv).ph-tg-striped .ph-table tbody tr:nth-child(even) td { background: var(--sf7f9f8, #F7F9F8); }
:is(html, .ph-tg-pv).ph-tg-striped .ph-table--hover tbody tr:hover td { background: var(--seef6f6, #EEF6F6); }
:is(html, .ph-tg-pv).ph-tg-striped .ph-table tr.is-selected td { background: var(--acc-tint); }
:is(html, .ph-tg-pv).ph-tg-head-teal .ph-table th { background: var(--seef6f6, #EEF6F6); color: var(--acc-ink, #0B5C64); }
:is(html, .ph-tg-pv).ph-tg-head-dark .ph-table th { background: var(--rail, #12343B); color: rgba(255,255,255,.88); border-bottom-color: var(--rail, #12343B); }
:is(html, .ph-tg-pv).ph-tg-head-dark .ph-table th:is(.is-sortable:hover, [aria-sort]) { color: #fff; }

/* a link inside a cell (a task, a record): the action colour, underlined on hover */
.ph-table td a { color: var(--acc-ink); text-decoration: none; }
.ph-table td a:hover { text-decoration: underline; }
/* 2026-11-28 | Monique ("Yes, do them" - the More buttons' own menus, not dropdowns): the menus the "More" / ⋮ buttons draw themselves get the same card
   menu look as .rm-pop above. Each keeps its own place and width (at least 240px); its rows (role menuitem, or the menu's own row class) are 42px tall
   (taller when a row has two lines), 12px sides, 14px words, 16px grey icons 12px from the words, 10px rounded hover; Delete / Remove red.
   Record More (.rv-mmenu), pop-up More (.ph-pp-mmenu), record full-page More (.rv-fb-mm), record tab More (.rv-tmenu), form header More (.hd2-menu),
   matter row More (.trmenu), comment More (.trcm-menu), Address Book quick-note More (.qn-mm), whiteboards (.wl-menu), reminders (.prm-menu),
   grid select (.phgs-menu), interactions (.lt4-menu), task page More (.tpx-mm, .tpg-mmenu), shell More (#phshMenu). */
html body :is(.rv-mmenu, .ph-pp-mmenu, .rv-fb-mm, .rv-tmenu, .hd2-menu, .trmenu, .trcm-menu, .qn-mm, .wl-menu, .prm-menu, .phgs-menu, .lt4-menu, .tpx-mm, .tpg-mmenu, #phshMenu):not(#_n#_n#_n) { min-width: 240px; padding: 6px; border: 1px solid var(--le1e8e7); border-radius: 16px; background: var(--sffffff); box-shadow: 0 18px 44px rgba(18, 52, 59, .16); box-sizing: border-box; }
html body :is(.rv-mmenu, .ph-pp-mmenu, .rv-fb-mm, .rv-tmenu, .hd2-menu, .trmenu, .trcm-menu, .qn-mm, .wl-menu, .prm-menu, .phgs-menu, .lt4-menu, .tpx-mm, .tpg-mmenu, #phshMenu) :is([role^="menuitem"], .trcm-mi, .wl-mb):not([hidden]):not(#_n#_n#_n) { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; margin: 0; padding: 8px 12px; border: 0; border-radius: 10px; background: none; box-shadow: none; box-sizing: border-box; font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 14px; font-weight: 400; line-height: 1.3; color: var(--i12343b); text-align: left; text-decoration: none; }
html body :is(.rv-mmenu, .ph-pp-mmenu, .rv-fb-mm, .rv-tmenu, .hd2-menu, .trmenu, .trcm-menu, .qn-mm, .wl-menu, .prm-menu, .phgs-menu, .lt4-menu, .tpx-mm, .tpg-mmenu, #phshMenu) :is([role^="menuitem"], .trcm-mi, .wl-mb) > svg:first-child:not(#_n#_n#_n) { width: 16px; height: 16px; flex: none; color: var(--i8a989c); }
html body :is(.rv-mmenu, .ph-pp-mmenu, .rv-fb-mm, .rv-tmenu, .hd2-menu, .trmenu, .trcm-menu, .qn-mm, .wl-menu, .prm-menu, .phgs-menu, .lt4-menu, .tpx-mm, .tpg-mmenu, #phshMenu) :is([role^="menuitem"], .trcm-mi, .wl-mb):not(#_n#_n#_n):is(:hover, :focus-visible) { background: var(--sf4f8f8); outline: none; }
html body :is(.rv-mmenu, .ph-pp-mmenu, .rv-fb-mm, .rv-tmenu, .hd2-menu, .trmenu, .trcm-menu, .qn-mm, .wl-menu, .prm-menu, .phgs-menu, .lt4-menu, .tpx-mm, .tpg-mmenu, #phshMenu) :is([role^="menuitem"], .trcm-mi, .wl-mb):is(.is-danger, .danger, .del, .is-del, .dg, .red):not(#_n#_n#_n),
html body :is(.rv-mmenu, .ph-pp-mmenu, .rv-fb-mm, .rv-tmenu, .hd2-menu, .trmenu, .trcm-menu, .qn-mm, .wl-menu, .prm-menu, .phgs-menu, .lt4-menu, .tpx-mm, .tpg-mmenu, #phshMenu) :is([role^="menuitem"], .trcm-mi, .wl-mb):is(.is-danger, .danger, .del, .is-del, .dg, .red) > svg:not(#_n#_n#_n) { color: var(--ib42318); }
html body :is(.rv-mmenu, .ph-pp-mmenu, .rv-fb-mm, .rv-tmenu, .hd2-menu, .trmenu, .trcm-menu, .qn-mm, .wl-menu, .prm-menu, .phgs-menu, .lt4-menu, .tpx-mm, .tpg-mmenu, #phshMenu) :is([role^="menuitem"], .trcm-mi, .wl-mb):is(.is-danger, .danger, .del, .is-del, .dg, .red):not(#_n#_n#_n):is(:hover, :focus-visible) { background: var(--sfdf0ee); }
