/* ==========================================================================
   grants.css — Grant Management tab visual system
   Scoped with .gr-* prefix. Loaded only on Work.html.
   ========================================================================== */

/* ── Tokens — match the light Carbon theme used by the rest of Work ───── */
.wk-tab-panel[data-wk-panel="grants"] {
  --gr-surface: var(--surf, #ffffff);
  --gr-surface-2: var(--wt-neutral-bg, #f4f4f4);
  --gr-border: var(--border, #e0e0e0);
  --gr-ink: var(--ink, #161616);
  --gr-ink-2: var(--ink2, #525252);
  --gr-blue: #3A86FF;
  --gr-green: #10B981;
  --gr-amber: #F59E0B;
  --gr-red: #EF4444;
  --gr-violet: #8B5CF6;
  --gr-pink: #EC4899;
  --gr-cyan: #06B6D4;
}

/* ── Section header (replaces inline-styled flex divs) ──────────────── */
.gr-section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 12px; flex-wrap: wrap;
}
.gr-section-head h2,
.gr-section-head .gr-h {
  font-size: 1.05rem; font-weight: 700; color: var(--gr-ink); margin: 0;
}
.gr-section-head .gr-sub {
  font-size: .78rem; color: var(--gr-ink-2); margin-top: 2px;
}
.gr-section-head .gr-tools {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

/* ── KPI row enhancements ───────────────────────────────────────────── */
.wk-tab-panel[data-wk-panel="grants"] .ax-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  cursor: default;
}
.wk-tab-panel[data-wk-panel="grants"] .ax-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,.32);
}

/* ── Grant card (overview grid) ─────────────────────────────────────── */
.gr-card {
  --gr-accent: #64748b;
  background: var(--gr-surface);
  border: 1px solid var(--gr-border);
  border-radius: 14px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  will-change: transform;
}
.gr-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gr-accent);
  opacity: .9;
  transition: width .18s ease;
}
.gr-card:hover {
  border-color: var(--gr-accent);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0,0,0,.32);
}
.gr-card:hover::before { width: 5px; }
.gr-card:active { transform: translateY(-1px); }

.gr-card-title {
  font-weight: 700; font-size: .95rem; color: var(--gr-ink);
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.gr-card-pills {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px;
}
.gr-card-bar-row {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: var(--gr-ink-2); margin-bottom: 4px;
}
.gr-bar {
  height: 6px; border-radius: 3px;
  background: var(--gr-border);
  overflow: hidden;
}
.gr-bar > i {
  display: block; height: 100%; border-radius: 3px;
  transition: width .35s cubic-bezier(.25,.8,.25,1);
}
.gr-card-grid3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; font-size: .72rem;
}
.gr-card-grid3 > div { text-align: center; }
.gr-card-grid3 .gr-lbl {
  color: var(--gr-ink-2); text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600; font-size: .65rem;
}
.gr-card-grid3 .gr-val {
  font-weight: 700; color: var(--gr-ink);
  font-size: .88rem; margin-top: 2px;
}
.gr-card-foot {
  display: flex; gap: 10px; font-size: .7rem; color: var(--gr-ink-2);
  border-top: 1px solid var(--gr-border); padding-top: 8px;
}
.gr-card-contact {
  font-size: .72rem; color: var(--gr-ink-2);
  border-top: 1px solid var(--gr-border); padding-top: 8px;
}
.gr-card-contact strong { color: var(--gr-ink); font-weight: 600; }
.gr-card-contact a { color: var(--gr-blue); text-decoration: none; }
.gr-card-contact a:hover { text-decoration: underline; }

/* ── Pill helper ────────────────────────────────────────────────────── */
.gr-pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .68rem; font-weight: 600;
  background: rgba(58,134,255,.13);
  color: var(--gr-blue);
  border: 1px solid rgba(58,134,255,.28);
  white-space: nowrap;
}

/* ── Filter inputs (consistent look) ────────────────────────────────── */
.wk-tab-panel[data-wk-panel="grants"] .gr-input,
.wk-tab-panel[data-wk-panel="grants"] .gr-select {
  font-size: .85rem; padding: 6px 10px; border-radius: 8px;
  background: var(--gr-surface-2); border: 1px solid var(--gr-border);
  color: var(--gr-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wk-tab-panel[data-wk-panel="grants"] .gr-input:focus,
.wk-tab-panel[data-wk-panel="grants"] .gr-select:focus {
  outline: none;
  border-color: var(--gr-blue);
  box-shadow: 0 0 0 3px rgba(58,134,255,.18);
}

/* ── Data table polish ──────────────────────────────────────────────── */
.wk-tab-panel[data-wk-panel="grants"] .wk-data-table tbody tr {
  transition: background .12s ease;
}
.wk-tab-panel[data-wk-panel="grants"] .wk-data-table tbody tr:hover {
  background: rgba(58,134,255,.06);
}
.wk-tab-panel[data-wk-panel="grants"] .wk-data-table tbody tr.gr-row-clickable { cursor: pointer; }
.wk-tab-panel[data-wk-panel="grants"] .wk-data-table tbody tr.gr-section-row {
  background: var(--gr-surface-2);
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--gr-ink-2);
}
.wk-tab-panel[data-wk-panel="grants"] .wk-data-table tbody tr.gr-section-row td {
  padding: 8px 12px;
}
.wk-tab-panel[data-wk-panel="grants"] .wk-data-table tbody tr.gr-section-row strong { color: var(--gr-ink); }

/* ── Progress bar (table cells) ─────────────────────────────────────── */
.gr-progress {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.gr-progress .gr-bar { width: 64px; }
.gr-progress .gr-pct { font-size: .72rem; font-weight: 600; }

/* Floating Log Hours FAB removed by design — modal still reachable via
   _wkGrants.openTimeEntry() for drawer/quick actions. */
.gr-fab { display: none !important; }

/* ── Right-side insight modules (Overview / Grants / Documents) ─────── */
.wk-tab-panel[data-wk-panel="grants"] .wk-support-stack { gap: 14px; }
.gr-side-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  background: var(--surf-2, rgba(255,255,255,.03));
  border: 1px solid var(--border, rgba(255,255,255,.06));
  margin-bottom: 6px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  cursor: default;
}
.gr-side-row[data-gr-grant] { cursor: pointer; }
.gr-side-row[data-gr-grant]:hover {
  background: var(--surf-hover, rgba(58,134,255,.08));
  border-color: var(--c-blue, #3A86FF);
  transform: translateX(2px);
}
.gr-side-row-main { min-width: 0; flex: 1; }
.gr-side-row-title {
  font-size: .82rem; font-weight: 600; color: var(--ink, #e2e8f0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.gr-side-row-meta {
  font-size: .72rem; color: var(--ink-2, #94a3b8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* A rail row is the item, not a headline — two lines beat an ellipsis that
   hides which grant it is, or clips a figure to "$36,750 sti…". */
.gr-side-row-title,
.gr-side-row-meta {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; line-height: 1.3;
}

/* Right-aligned value chip on a rail row (days left, burn %, hours). */
.gr-side-chip {
  flex-shrink: 0; align-self: center;
  font-size: .68rem; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  color: var(--_chip, #94a3b8);
  background: color-mix(in srgb, var(--_chip, #94a3b8) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--_chip, #94a3b8) 34%, transparent);
}
/* Horizon band label — "Overdue" / "Next 30 days" / "Later". */
.gr-side-band {
  font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3, #94a3b8); opacity: .75;
  margin: 8px 2px 4px;
}
.gr-side-band:first-child { margin-top: 0; }
/* Headline figure a rail panel leads with (unspent balance, hours this week). */
.gr-side-clear {
  padding: 10px 12px; margin-bottom: 8px; border-radius: 10px;
  background: var(--surf-2, rgba(255,255,255,.03));
  border: 1px solid var(--border, rgba(255,255,255,.06));
}
.gr-side-clear--tight { padding: 8px 12px; }
.gr-side-clear-v {
  font-size: 1.15rem; font-weight: 800; line-height: 1.15;
  color: var(--_sm-color, var(--ink, #e2e8f0));
}
/* An all-clear figure must not borrow the panel's alarm colour — "nothing at
   risk" printed in red reads as the opposite of what it says. */
.gr-side-clear--ok .gr-side-clear-v { color: var(--c-green, #059669); }
.gr-side-clear-l {
  font-size: .7rem; color: var(--ink-2, #94a3b8); margin-top: 2px; line-height: 1.35;
}
/* Face on a rail row (who logged the hours). */
.gr-side-face {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--surf-3, rgba(255,255,255,.07));
  font-size: .64rem; font-weight: 800; color: var(--ink-2, #94a3b8);
}
.gr-side-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* "+N more at risk" → applies that scorecard filter to the list. */
.gr-side-more {
  margin-top: 4px; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  font-size: .72rem; font-weight: 700; text-align: center;
  color: var(--c-blue, #3A86FF);
  background: color-mix(in srgb, var(--c-blue, #3A86FF) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--c-blue, #3A86FF) 32%, transparent);
  transition: background .15s ease;
}
.gr-side-more:hover { background: color-mix(in srgb, var(--c-blue, #3A86FF) 16%, transparent); }
.gr-side-more:focus-visible { outline: 2px solid var(--c-blue, #3A86FF); outline-offset: 1px; }

/* These panels carry banded lists and a headline figure now — the shared 260px
   cap sliced the last row in half behind a hidden scrollbar, so nothing said
   there was more below. */
.wk-tab-panel[data-wk-panel="grants"] .wk-support-body { max-height: 420px; }

/* "hours charged but nobody set a rate" — the honest reason a burn bar is 0%. */
.grant-card-norate {
  margin-top: 5px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--c-amber, #b45309);
  background: rgba(245, 158, 11, .1);
  border-radius: 6px;
  padding: 3px 7px;
}

.gr-side-rank { margin-bottom: 10px; }
.gr-side-rank:last-child { margin-bottom: 0; }
.gr-side-rank-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.gr-side-rank-label {
  font-size: .78rem; font-weight: 600; color: var(--ink, #e2e8f0);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 65%;
}
.gr-side-rank-val {
  font-size: .78rem; font-weight: 700; color: var(--ink, #e2e8f0);
}
.gr-side-rank-bar {
  height: 6px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden;
}
.gr-side-rank-fill {
  height: 100%; background: linear-gradient(90deg, #3A86FF, #06B6D4);
  border-radius: 3px; transition: width .5s cubic-bezier(.22,.7,.3,1);
}
.gr-side-rank-meta {
  font-size: .68rem; color: var(--ink-2, #94a3b8); margin-top: 3px;
}

.gr-side-stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px;
}
.gr-side-stat {
  text-align: center; padding: 8px 6px; border-radius: 8px;
  background: var(--surf-2, rgba(255,255,255,.03));
  border: 1px solid var(--border, rgba(255,255,255,.06));
}
.gr-side-stat-v {
  font-size: 1.05rem; font-weight: 700; color: var(--ink, #e2e8f0); line-height: 1.1;
}
.gr-side-stat-l {
  font-size: .66rem; color: var(--ink-2, #94a3b8); margin-top: 2px;
  text-transform: uppercase; letter-spacing: .04em;
}
.gr-side-progress-head {
  display: flex; justify-content: space-between;
  font-size: .74rem; color: var(--ink-2, #94a3b8); margin-bottom: 4px;
}
.gr-side-progress-bar {
  height: 6px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden;
}
.gr-side-progress-fill {
  height: 100%; border-radius: 3px;
  transition: width .5s cubic-bezier(.22,.7,.3,1);
}

/* Smooth fade for grant card grid swaps when scorecard filter changes */
.gr-card-grid {
  transition: opacity .18s ease;
}
.ax-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.ax-card:hover { transform: translateY(-2px); }

/* ── Modal (Log Hours) ──────────────────────────────────────────────── */
.gr-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 12001;
  background: rgba(8, 14, 26, .65);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 16px;
  animation: gr-fade .18s ease;
}
.gr-modal.is-open { display: flex; }
@keyframes gr-fade { from { opacity: 0; } to { opacity: 1; } }

.gr-modal-card {
  background: var(--gr-surface);
  border: 1px solid var(--gr-border);
  border-radius: 16px;
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  animation: gr-slide .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes gr-slide { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.gr-modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gr-border);
}
.gr-modal-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #3A86FF, #06B6D4);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.gr-modal-icon svg { width: 18px; height: 18px; }
.gr-modal-title { font-weight: 700; font-size: 1.02rem; color: var(--gr-ink); }
.gr-modal-sub { font-size: .76rem; color: var(--gr-ink-2); margin-top: 2px; }
.gr-modal-x {
  margin-left: auto;
  background: none; border: none; color: var(--gr-ink-2);
  font-size: 1.4rem; cursor: pointer; padding: 4px 10px;
  border-radius: 8px; transition: background .12s ease, color .12s ease;
}
.gr-modal-x:hover { background: rgba(255,255,255,.06); color: var(--gr-ink); }

.gr-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.gr-modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--gr-border);
  display: flex; justify-content: flex-end; gap: 8px;
}

.gr-field { display: flex; flex-direction: column; gap: 5px; }
.gr-field > label {
  font-size: .76rem; font-weight: 600; color: var(--gr-ink);
}
.gr-field .gr-hint { font-weight: 400; opacity: .65; font-size: .72rem; }
.gr-field input,
.gr-field select,
.gr-field textarea {
  font-size: .9rem; padding: 9px 12px;
  background: var(--gr-surface-2); border: 1px solid var(--gr-border);
  color: var(--gr-ink); border-radius: 9px;
  width: 100%; box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gr-field input:focus,
.gr-field select:focus,
.gr-field textarea:focus {
  outline: none; border-color: var(--gr-blue);
  box-shadow: 0 0 0 3px rgba(58,134,255,.18);
}
.gr-field input:disabled,
.gr-field select:disabled,
.gr-field textarea:disabled {
  opacity: .55; cursor: not-allowed;
}
.gr-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .gr-field-row { grid-template-columns: 1fr; } }

.gr-rate-suggest { font-size: .72rem; color: var(--gr-amber); margin-top: 3px; min-height: 14px; }

.gr-form-error {
  display: none;
  padding: 10px 12px; border-radius: 9px;
  background: rgba(239,68,68,.1); color: var(--gr-red);
  border: 1px solid rgba(239,68,68,.3);
  font-size: .82rem;
}

/* ── Multi-allocation rows (split hours across grants) ──────────────── */
.gr-alloc-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; color: var(--gr-ink-2);
  cursor: pointer;
}
.gr-alloc-toggle input { width: auto; margin: 0; }
.gr-alloc-list { display: flex; flex-direction: column; gap: 8px; }
.gr-alloc-row {
  display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 8px;
  align-items: center;
  background: var(--gr-surface-2);
  border: 1px solid var(--gr-border);
  border-radius: 10px; padding: 8px;
}
.gr-alloc-row .gr-alloc-x {
  background: none; border: none; cursor: pointer;
  color: var(--gr-ink-2); font-size: 1.2rem; padding: 4px 8px;
  border-radius: 6px;
}
.gr-alloc-row .gr-alloc-x:hover { color: var(--gr-red); background: rgba(239,68,68,.1); }
.gr-alloc-add {
  background: rgba(58,134,255,.1); color: var(--gr-blue);
  border: 1px dashed rgba(58,134,255,.4);
  padding: 8px 12px; border-radius: 9px; font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: background .12s ease;
}
.gr-alloc-add:hover { background: rgba(58,134,255,.18); }
.gr-alloc-summary {
  font-size: .76rem; color: var(--gr-ink-2);
  text-align: right; padding-right: 4px;
}
.gr-alloc-summary.gr-mismatch { color: var(--gr-red); font-weight: 600; }

/* ── Toast ──────────────────────────────────────────────────────────── */
.gr-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 12100;
  display: none;
  background: var(--gr-surface);
  color: var(--gr-ink);
  padding: 11px 18px;
  border-radius: 10px;
  border-left: 4px solid var(--gr-green);
  box-shadow: 0 10px 28px rgba(0,0,0,.4);
  font-size: .85rem; font-weight: 500;
  max-width: 90vw;
  animation: gr-toast-in .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes gr-toast-in {
  from { transform: translate(-50%, 16px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

/* ── Detail drawer (click a grant card) ─────────────────────────────── */
.gr-drawer {
  display: none;
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 520px;
  z-index: 12000;
  background: var(--gr-surface);
  border-left: 1px solid var(--gr-border);
  box-shadow: -16px 0 40px rgba(0,0,0,.45);
  flex-direction: column;
  animation: gr-drawer-in .26s cubic-bezier(.2,.8,.2,1);
}
.gr-drawer.is-open { display: flex; }
@keyframes gr-drawer-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.gr-drawer-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 11999;
  background: rgba(8,14,26,.5);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.gr-drawer-backdrop.is-open { display: block; }

.gr-drawer-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--gr-border);
}
.gr-drawer-head .gr-drawer-title {
  font-weight: 700; font-size: 1.02rem; color: var(--gr-ink); flex: 1;
}
.gr-drawer-head .gr-drawer-x {
  background: none; border: none; color: var(--gr-ink-2);
  font-size: 1.4rem; cursor: pointer; padding: 2px 10px;
  border-radius: 8px;
}
.gr-drawer-head .gr-drawer-x:hover { background: rgba(255,255,255,.06); color: var(--gr-ink); }
.gr-drawer-body {
  padding: 16px 20px; overflow: auto; flex: 1;
  display: flex; flex-direction: column; gap: 16px;
}
.gr-drawer-section h4 {
  margin: 0 0 6px; font-size: .72rem; font-weight: 700;
  color: var(--gr-ink-2); text-transform: uppercase; letter-spacing: .06em;
}
.gr-drawer-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.gr-drawer-stats .gr-st {
  background: var(--gr-surface-2); border: 1px solid var(--gr-border);
  border-radius: 10px; padding: 10px; text-align: center;
}
.gr-drawer-stats .gr-st-lbl {
  font-size: .65rem; color: var(--gr-ink-2);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.gr-drawer-stats .gr-st-val {
  font-weight: 800; font-size: 1rem; margin-top: 3px; color: var(--gr-ink);
}
.gr-drawer-list {
  display: flex; flex-direction: column; gap: 6px;
}
.gr-drawer-item {
  background: var(--gr-surface-2); border: 1px solid var(--gr-border);
  border-radius: 8px; padding: 9px 11px;
  font-size: .82rem; color: var(--gr-ink);
  display: flex; justify-content: space-between; gap: 8px;
}
.gr-drawer-item .gr-meta { color: var(--gr-ink-2); font-size: .72rem; }
.gr-drawer-foot {
  border-top: 1px solid var(--gr-border);
  padding: 12px 20px;
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ── Sidebar badge: keep blue accent ────────────────────────────────── */
#wkSidebarGrants .ph-sb-badge {
  background: rgba(58,134,255,.18);
  color: var(--gr-blue);
}

/* ── Linked-Grants chip picker (used by GrantsLink in programs/projects) ─ */
.gl-picker {
  background: var(--surf, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 10px;
  padding: 10px 12px;
}
.gl-picker-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.gl-picker-title {
  font-size: .82rem; font-weight: 700; color: var(--ink, #e2e8f0);
}
.gl-picker-sub { font-size: .72rem; color: var(--ink-2, #94a3b8); }
.gl-chip-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.gl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(58,134,255,.14); color: #3A86FF;
  border: 1px solid rgba(58,134,255,.32);
  border-radius: 999px; padding: 3px 4px 3px 10px;
  font-size: .76rem; font-weight: 600;
  max-width: 100%;
}
.gl-chip span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-chip-x {
  background: none; border: none;
  color: #3A86FF; cursor: pointer;
  font-size: 1rem; line-height: 1;
  padding: 0 6px; border-radius: 999px;
  transition: background .12s ease;
}
.gl-chip-x:hover { background: rgba(58,134,255,.25); }
.gl-add-wrap { display: flex; gap: 6px; margin-top: 8px; }
.gl-add-wrap select {
  flex: 1; font-size: .82rem; padding: 6px 8px;
  background: var(--surf-2, #0f172a); border: 1px solid var(--border, #334155);
  color: var(--ink, #e2e8f0); border-radius: 8px;
}
.gl-add-wrap button {
  background: rgba(58,134,255,.18); color: #3A86FF;
  border: 1px solid rgba(58,134,255,.32);
  border-radius: 8px; font-weight: 600; font-size: .8rem;
  padding: 6px 12px; cursor: pointer;
  transition: background .12s ease;
}
.gl-add-wrap button:hover { background: rgba(58,134,255,.28); }
.gl-empty { font-size: .76rem; color: var(--ink-2, #94a3b8); font-style: italic; }

/* ── Inline grant chips (for programs.js Linked Grants section) ─── */
.prog-grant-chips { display:flex; flex-wrap:wrap; gap:6px; padding:8px 4px 0; }
.prog-grant-chips .gl-chip {
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 10px;
  background: rgba(58,134,255,.14);
  border: 1px solid rgba(58,134,255,.32);
  border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  color: #cfe1ff;
  cursor: pointer;
  transition: background .12s ease, transform .12s ease;
}
.prog-grant-chips .gl-chip:hover { background: rgba(58,134,255,.22); transform: translateY(-1px); }
.prog-grant-chips .gl-chip-x {
  background: transparent; border: 0; color: inherit;
  width: 16px; height: 16px; line-height: 1;
  border-radius: 50%; cursor: pointer; font-size: 14px;
  opacity: .6; padding: 0;
}
.prog-grant-chips .gl-chip-x:hover { opacity: 1; background: rgba(255,255,255,.15); }

.wk-btn.wk-btn-sm {
  padding: 4px 10px; font-size: .76rem; line-height: 1.4; border-radius: 6px;
}

/* ── Picker overlay (renderPicker) ──────────────────────────────── */
.gl-overlay {
  position: fixed; inset: 0; z-index: 10010;
  background: rgba(8,11,18,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: glFade .18s ease;
}
@keyframes glFade { from { opacity:0 } to { opacity:1 } }
.gl-overlay-card {
  width: min(560px, 100%);
  background: linear-gradient(180deg, #161b27 0%, #11151f 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  display: flex; flex-direction: column;
  max-height: 80vh;
}
.gl-overlay-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.gl-overlay-title { font-size: 1.05rem; font-weight: 700; color: #f3f6fb; }
.gl-overlay-sub { font-size: .82rem; color: var(--ink-2, #9aa6b8); margin-top: 2px; }
.gl-overlay-x {
  background: transparent; border: 0; color: #9aa6b8;
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
}
.gl-overlay-x:hover { background: rgba(255,255,255,.08); color: #f3f6fb; }
.gl-overlay-body {
  padding: 14px 20px; overflow-y: auto; flex: 1;
}
.gl-overlay-foot {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex; gap: 10px; justify-content: flex-end;
}
.gl-grant-list { display: flex; flex-direction: column; gap: 6px; }
.gl-grant-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.gl-grant-row:hover { background: rgba(58,134,255,.08); border-color: rgba(58,134,255,.28); }
.gl-grant-row input { width: 16px; height: 16px; accent-color: #3A86FF; }
.gl-grant-row-title { font-size: .88rem; font-weight: 600; color: #e7ecf5; }
.gl-grant-row-meta { font-size: .76rem; color: var(--ink-2, #9aa6b8); font-variant-numeric: tabular-nums; }

/* ── Inline mount strip (mountInline) ────────────────────────────── */
.gl-inline {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(58,134,255,.18);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
}
.gl-inline-compact { padding: 6px 10px; margin: 4px 0; }
.gl-inline-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.gl-inline-lbl { font-size: .78rem; font-weight: 700; color: #cfe1ff; letter-spacing: .02em; }
.gl-inline-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  background: rgba(58,134,255,.22); color: #cfe1ff;
  border-radius: 9px; font-size: .68rem; font-weight: 700;
}
.gl-inline-add {
  margin-left: auto;
  background: rgba(58,134,255,.18);
  border: 1px solid rgba(58,134,255,.32);
  color: #cfe1ff;
  padding: 3px 10px; font-size: .72rem; font-weight: 600;
  border-radius: 6px; cursor: pointer;
}
.gl-inline-add:hover { background: rgba(58,134,255,.28); }
.gl-inline-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gl-inline-chips .gl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  background: rgba(58,134,255,.14);
  border: 1px solid rgba(58,134,255,.28);
  border-radius: 999px;
  font-size: .74rem; font-weight: 600; color: #cfe1ff;
  cursor: pointer;
}
.gl-inline-chips .gl-chip:hover { background: rgba(58,134,255,.22); }
.gl-inline-chips .gl-chip-x {
  background: transparent; border: 0; color: inherit; padding: 0;
  width: 14px; height: 14px; line-height: 1;
  border-radius: 50%; font-size: 13px; cursor: pointer; opacity: .6;
}
.gl-inline-chips .gl-chip-x:hover { opacity: 1; background: rgba(255,255,255,.15); }
.gl-inline-empty { font-size: .74rem; color: var(--ink-2, #94a3b8); font-style: italic; }

/* ══════════════════════════════════════════════════════════════════════════
   GRANT CARD — rich prog-card visual language adapted for dark theme
   Uses .grant-card prefix; replaces the simpler .gr-card where full fidelity
   is needed (overview grid). The existing .gr-card remains for compact usage.
   ══════════════════════════════════════════════════════════════════════════ */
.grant-card {
  /* status accent driven by JS via --gc-accent */
  --gc-accent: #3A86FF;
  --gc-bar:    #06B6D4;
  /* type badge color — set per-card in JS, never uses status colors */
  --gc-type:   #64748b;
  position: relative;
  background: var(--gr-surface, #1e293b);
  border: 1px solid var(--gr-border, #334155);
  border-radius: 16px;
  padding: 20px 20px 16px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 360px;
  min-height: 260px;
  transition: border-color .2s ease, box-shadow .25s ease, transform .2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  will-change: transform;
}
/* Top accent rail (matches prog-card-rail) */
.grant-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--gc-accent), var(--gc-bar));
  border-radius: 16px 16px 0 0;
}
.grant-card:hover {
  border-color: var(--gc-accent);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.45),
              0 4px 12px -4px color-mix(in srgb, var(--gc-accent) 35%, transparent);
  transform: translateY(-3px);
}
.grant-card:active { transform: translateY(-1px); }

/* ── Funder chip row (analogous to prog-card-client) ── */
.grant-card-top {
  display: flex; align-items: flex-start; gap: 10px;
  justify-content: space-between;
}
.grant-card-funder {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
}
.grant-card-funder-logo {
  width: 42px; height: 42px; border-radius: 10px;
  background: color-mix(in srgb, var(--gc-type) 16%, #0f172a);
  border: 1px solid color-mix(in srgb, var(--gc-type) 30%, transparent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 13px; font-weight: 800;
  color: var(--gc-type);
  letter-spacing: .5px;
  overflow: hidden;
}
.grant-card-funder-logo--icon svg {
  width: 22px; height: 22px;
  stroke: var(--gc-type); fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.grant-card-funder-logo--img img {
  width: 100%; height: 100%; object-fit: cover;
}
.grant-card-funder-meta { min-width: 0; }
.grant-card-funder-name {
  font-size: 14px; font-weight: 800; color: var(--gr-ink, #e2e8f0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.grant-card-funder-sub {
  font-size: 11px; color: var(--gr-ink-2, #94a3b8); font-weight: 500;
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ── Status pill (top-right corner) ── */
.grant-card-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  border: 1px solid;
  white-space: nowrap; flex-shrink: 0;
}
.grant-card-status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

/* ── Grant title ── */
.grant-card-title {
  font-size: 17px; font-weight: 800; color: var(--gr-ink, #e2e8f0);
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Type + end-date badge row ── */
.grant-card-sub {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; margin-top: -6px;
}
.grant-card-type {
  font-weight: 700; color: var(--gc-type, #64748b);
  padding: 3px 9px;
  background: color-mix(in srgb, var(--gc-type, #64748b) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc-type, #64748b) 24%, transparent);
  border-radius: 999px;
  font-size: 11px;
}
.grant-card-end-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  border: 1px solid;
}
.grant-card-end-badge.is-overdue   { color: #ef4444; background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.25); }
.grant-card-end-badge.is-soon      { color: #f59e0b; background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); }
.grant-card-end-badge.is-normal    { color: var(--gr-ink-2, #94a3b8); background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
.grant-card-end-badge.is-complete  { color: #6366f1; background: rgba(99,102,241,.1); border-color: rgba(99,102,241,.25); }

/* ── Award amount stats grid ── */
.grant-card-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--gr-border, #334155);
  border-bottom: 1px solid var(--gr-border, #334155);
}
.grant-card-stat { text-align: left; min-width: 0; }
.grant-card-stat-v {
  font-size: 16px; font-weight: 800; color: var(--gr-ink, #e2e8f0);
  line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grant-card-stat-l {
  font-size: 10px; font-weight: 700; color: var(--gr-ink-2, #94a3b8);
  text-transform: uppercase; letter-spacing: .5px;
  margin-top: 2px;
}

/* ── Budget progress bar ── */
.grant-card-progress { display: flex; flex-direction: column; gap: 4px; }
.grant-card-progress-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 700; color: var(--gr-ink-2, #94a3b8);
  text-transform: uppercase; letter-spacing: .4px;
}
.grant-card-progress-pct { font-size: 12px; font-weight: 800; }
.grant-card-bar {
  height: 7px; background: var(--gr-border, #334155);
  border-radius: 999px; overflow: hidden;
}
.grant-card-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gc-accent), var(--gc-bar));
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

/* ── Footer badges row (deliverables / docs / contact) ── */
.grant-card-badges {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px;
}
.grant-card-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; font-size: 11px; font-weight: 700;
  border-radius: 999px; border: 1px solid var(--gr-border, #334155);
  color: var(--gr-ink-2, #94a3b8); background: rgba(255,255,255,.04);
}
.grant-card-badge.badge-green  { color: #10b981; background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.22); }
.grant-card-badge.badge-amber  { color: #f59e0b; background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.22); }
.grant-card-badge.badge-red    { color: #ef4444; background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.22); }
.grant-card-badge.badge-violet { color: #8b5cf6; background: rgba(139,92,246,.08); border-color: rgba(139,92,246,.22); }
.grant-card-badge.badge-blue   { color: #3A86FF; background: rgba(58,134,255,.08); border-color: rgba(58,134,255,.22); }

/* Status-accent variants (mirror burnColor → gc-accent overrides) */
.grant-card.status-active    { --gc-accent: #10b981; --gc-bar: #34d399; }
.grant-card.status-progress  { --gc-accent: #3A86FF; --gc-bar: #06B6D4; }
.grant-card.status-pending   { --gc-accent: #f59e0b; --gc-bar: #fcd34d; }
.grant-card.status-complete  { --gc-accent: #6366f1; --gc-bar: #8b5cf6; }
.grant-card.status-overdue   { --gc-accent: #ef4444; --gc-bar: #f97316; }
.grant-card.status-spent     { --gc-accent: #6366f1; --gc-bar: #818cf8; }

/* ── FINISHED WORK LOOKS FINISHED ──────────────────────────────────────
   An archived grant sits in a board of archived grants, so it must not
   shout the way a live card does — but it stays fully legible, because
   the reason anyone opens this tab is to read the record. */
.grant-card.is-archived {
  opacity: .88;
  background-image: linear-gradient(180deg, rgba(99,102,241,.05), transparent 40%);
}
.grant-card.is-archived:hover { opacity: 1; }

/* ── THE CLOSE-OUT CAPTION ──
   Says the grant is done, in words, with the one action it still needs. */
.grant-card-done {
  margin-top: 10px; padding: 10px 11px; border-radius: 10px;
  background: color-mix(in srgb, #6366f1 8%, transparent);
  border: 1px solid color-mix(in srgb, #6366f1 26%, transparent);
}
.grant-card-done-head {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: .76rem; font-weight: 700; line-height: 1.35;
  color: #4f46e5;
}
.grant-card-done-head svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.grant-card-done-sub {
  font-size: .69rem; color: var(--gr-ink-2, #64748b);
  margin-top: 4px; line-height: 1.4;
}
.grant-card-done-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.grant-card-done-btn {
  font: inherit; font-size: .7rem; font-weight: 700; cursor: pointer;
  padding: 5px 10px; border-radius: 7px;
  color: var(--gr-ink, #1e293b);
  background: var(--surf-2, rgba(255,255,255,.55));
  border: 1px solid var(--border, rgba(15,23,42,.14));
  transition: background .13s ease, border-color .13s ease, transform .13s ease;
}
.grant-card-done-btn:hover { transform: translateY(-1px); border-color: #6366f1; }
.grant-card-done-btn.is-primary {
  color: #fff; background: #4f46e5; border-color: #4f46e5;
}
.grant-card-done-btn.is-primary:hover { background: #4338ca; }
.grant-card-done-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 1px; }
.grant-card-done.is-archived {
  background: var(--surf-2, rgba(15,23,42,.03));
  border-color: var(--border, rgba(15,23,42,.1));
}

@media (max-width: 720px) {
  .grant-card { min-width: 0; }
  .grant-card-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════
   Demo-mode banner — surfaced when SmartSuite API is offline
   so the user knows the table is populated with demo data
   instead of wondering if the tab is broken.
   ══════════════════════════════════════════════════════════ */
.gr-demo-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  margin: 12px 16px 0;
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
  border: 1px solid #fdba74;
  border-radius: 12px;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.45;
}
.gr-demo-banner svg { flex-shrink: 0; margin-top: 1px; color: #c2410c; }
.gr-demo-banner-msg strong { font-weight: 700; color: #7c2d12; }

/* ══════════════════════════════════════════════════════════════════════════
   PAGE BACKGROUND — match the light Carbon page used by Home/CRM
   ══════════════════════════════════════════════════════════════════════════ */
.wk-tab-panel[data-wk-panel="grants"] .ph-content {
  background: var(--wt-neutral-bg, #f4f4f4);
  border-radius: 14px;
  padding: 18px 18px 96px;
}
.wk-tab-panel[data-wk-panel="grants"] .ph-sub { animation: gr-fade .18s ease; }

/* ══════════════════════════════════════════════════════════════════════════
   SCORECARDS — clickable, drill into filtered grant list
   ══════════════════════════════════════════════════════════════════════════ */
.gr-scorecard-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.gr-scorecard {
  --_ac: #3A86FF;
  position: relative;
  text-align: left;
  background: linear-gradient(160deg, var(--gr-surface, #1e293b) 0%, var(--gr-surface-2, #0f172a) 100%);
  border: 1px solid var(--gr-border, #334155);
  border-radius: 12px;
  padding: 14px 16px 14px 18px;
  cursor: pointer;
  font: inherit; color: inherit;
  display: flex; flex-direction: column; gap: 4px;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .2s ease;
}
.gr-scorecard::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--_ac); opacity: .9; transition: width .18s ease;
}
.gr-scorecard:hover {
  transform: translateY(-2px);
  border-color: var(--_ac);
  box-shadow: 0 12px 28px -8px rgba(0,0,0,.5),
              0 4px 10px -3px color-mix(in srgb, var(--_ac) 40%, transparent);
}
.gr-scorecard:hover::before { width: 5px; }
.gr-scorecard:focus-visible {
  outline: 2px solid var(--_ac);
  outline-offset: 2px;
}
.gr-scorecard-lbl {
  font-size: .68rem; font-weight: 700;
  color: var(--gr-ink-2, #94a3b8);
  text-transform: uppercase; letter-spacing: .05em;
}
.gr-scorecard-val {
  font-size: 1.45rem; font-weight: 800;
  color: var(--gr-ink, #e2e8f0);
  line-height: 1.1;
}
.gr-scorecard-sub {
  font-size: .7rem;
  color: var(--gr-ink-2, #94a3b8);
}
.gr-scorecard.is-zero .gr-scorecard-val { color: var(--gr-ink-2, #94a3b8); }
.gr-scorecard.is-alert {
  border-color: color-mix(in srgb, var(--_ac) 50%, var(--gr-border));
  background: linear-gradient(160deg, color-mix(in srgb, var(--_ac) 14%, var(--gr-surface)) 0%, var(--gr-surface-2) 100%);
}

/* ══════════════════════════════════════════════════════════════════════════
   CARD GRID — used by the grants list and PO list sub-panels
   ══════════════════════════════════════════════════════════════════════════ */
.gr-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.gr-po-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.gr-empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--gr-ink-2, #64748b);
  background: var(--gr-surface, #1e293b);
  border: 1px dashed var(--gr-border, #334155);
  border-radius: 14px;
  font-size: .9rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   FILTER CHIPS — toggle group above each card grid
   ══════════════════════════════════════════════════════════════════════════ */
.gr-filter-chips {
  display: inline-flex;
  gap: 4px;
  background: var(--gr-surface-2, #0f172a);
  border: 1px solid var(--gr-border, #334155);
  border-radius: 999px;
  padding: 3px;
}
.gr-chip {
  border: 0;
  background: transparent;
  color: var(--gr-ink-2, #94a3b8);
  padding: 5px 12px;
  font-size: .76rem; font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  white-space: nowrap;
}
.gr-chip:hover { color: var(--gr-ink, #e2e8f0); }
.gr-chip.is-active {
  background: rgba(58,134,255,.18);
  color: #cfe1ff;
  box-shadow: 0 1px 0 rgba(58,134,255,.25) inset;
}

/* ══════════════════════════════════════════════════════════════════════════
   PO CARD — parallel to grant-card but tighter/PO-specific
   ══════════════════════════════════════════════════════════════════════════ */
.gr-po-card {
  --_ac: #06B6D4;
  position: relative;
  background: var(--gr-surface, #1e293b);
  border: 1px solid var(--gr-border, #334155);
  border-radius: 14px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .2s ease;
}
.gr-po-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, var(--_ac), color-mix(in srgb, var(--_ac) 50%, #3A86FF));
}
.gr-po-card:hover {
  transform: translateY(-2px);
  border-color: var(--_ac);
  box-shadow: 0 14px 30px -10px rgba(0,0,0,.5);
}
.gr-po-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.gr-po-card-num {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1rem; font-weight: 800;
  color: var(--gr-ink, #e2e8f0);
}
.gr-po-card-grant {
  font-size: .76rem;
  color: var(--gr-ink-2, #94a3b8);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 220px;
}
.gr-po-card-period {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  border: 1px solid;
}
.gr-po-card-period.is-overdue { color: #ef4444; background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.25); }
.gr-po-card-period.is-soon    { color: #f59e0b; background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); }
.gr-po-card-period.is-normal  { color: var(--gr-ink-2, #94a3b8); background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
.gr-po-card-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--gr-border, #334155);
  border-bottom: 1px solid var(--gr-border, #334155);
}
.gr-po-card-stats .gr-po-stat-v {
  font-size: 13px; font-weight: 800;
  color: var(--gr-ink, #e2e8f0);
}
.gr-po-card-stats .gr-po-stat-l {
  font-size: 10px; font-weight: 700;
  color: var(--gr-ink-2, #94a3b8);
  text-transform: uppercase; letter-spacing: .5px;
  margin-top: 1px;
}
.gr-po-card-bar-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 700;
  color: var(--gr-ink-2, #94a3b8);
  text-transform: uppercase; letter-spacing: .4px;
}
.gr-po-card-bar {
  height: 7px; background: var(--gr-border, #334155);
  border-radius: 999px; overflow: hidden;
}
.gr-po-card-bar > i {
  display: block; height: 100%; border-radius: 999px;
  transition: width .35s cubic-bezier(.22,1,.36,1);
}

/* ══════════════════════════════════════════════════════════════════════════
   RISK PILL — shown on grant cards when riskState() flags them
   ══════════════════════════════════════════════════════════════════════════ */
.grant-card-badge.badge-risk {
  color: #fff; background: linear-gradient(135deg, #ef4444, #f97316);
  border-color: rgba(239,68,68,.6);
  font-weight: 800;
}

/* ══════════════════════════════════════════════════════════════════════════
   GRANT POPUP (wdpOpen 'grant') — small overrides on the wdp shell
   ══════════════════════════════════════════════════════════════════════════ */
.wdp-popup .grant-popup-section { display: flex; flex-direction: column; gap: 14px; }
.wdp-popup .grant-popup-row {
  display: grid; grid-template-columns: 140px 1fr; gap: 10px;
  font-size: .85rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.wdp-popup .grant-popup-row:last-child { border-bottom: 0; }
.wdp-popup .grant-popup-row .gp-lbl {
  color: var(--gr-ink-2, #94a3b8); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; font-size: .7rem;
}
.wdp-popup .grant-popup-row .gp-val {
  color: var(--gr-ink, #e2e8f0); font-weight: 600;
}
.wdp-popup .grant-popup-empty {
  padding: 20px; text-align: center;
  color: var(--gr-ink-2, #94a3b8); font-size: .85rem;
  background: rgba(255,255,255,.02);
  border: 1px dashed var(--gr-border, #334155);
  border-radius: 10px;
}

/* ══════════════════════════════════════════════════════════════════════════
   DOCUMENT CARDS — SharePoint-style grid (mirrors Training-Materials cards)
   These will be replaced with live SharePoint data; same visual language so
   any document anywhere in the app uses one consistent card.
   ══════════════════════════════════════════════════════════════════════════ */
.gr-doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gr-doc-card {
  position: relative;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  display: flex; flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .25s, transform .2s, border-color .2s;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.gr-doc-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  transform: translateY(-4px);
}
.gr-doc-card-header {
  position: relative;
  padding: 28px 16px 20px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 120px;
  overflow: hidden;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.gr-doc-card-icon {
  width: 56px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.1));
}
.gr-doc-card-icon svg { width: 100%; height: 100%; }
.gr-doc-card-badge {
  position: absolute; top: 8px; right: 8px;
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 6px;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  z-index: 2;
}
.gr-doc-card-type-chip {
  margin-top: 10px;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink2, #475569);
  background: rgba(0,0,0,.06);
  padding: 3px 10px; border-radius: 6px;
  position: relative; z-index: 2;
}
.gr-doc-card-body {
  padding: 14px 16px 14px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}
.gr-doc-card-title {
  font-size: 13px; font-weight: 700; color: var(--text, #111);
  line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.gr-doc-card-sub {
  font-size: 11px; color: var(--text-3, #9ca3af);
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gr-doc-card-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto; padding-top: 8px;
  font-size: 10px; font-weight: 600;
  color: var(--ink-2, #94a3b8);
  text-transform: uppercase; letter-spacing: .4px;
}
.gr-doc-card-source {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink-2, #64748b);
}
.gr-doc-card-source svg { width: 11px; height: 11px; }

/* ── Equal-height document cards ──────────────────────────────────────────
   The grid stretches each wrap to the tallest card in the row; make the
   MaterialCard fill that height and let its body grow so every card lines up
   regardless of title length. Grant chips pin to the bottom edge. */
.gr-doc-card-wrap { display: flex; height: 100%; }
.gr-doc-card-wrap > .mb-material-card {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  width: 100%;
}
.gr-doc-card-wrap .mb-card-body { flex: 1 1 auto; display: flex; flex-direction: column; }

/* ── Clickable grant tag on a document card ───────────────────────────── */
.gr-doc-card-grants {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: auto;            /* pin to the bottom of the card body */
  padding-top: 8px;
}
.gr-doc-grant-chip {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid rgba(100,153,84,.35);
  border-radius: 999px;
  background: rgba(100,153,84,.10);
  color: #4a7a3a;
  font-size: .72rem; font-weight: 600; line-height: 1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.gr-doc-grant-chip svg { width: 11px; height: 11px; flex: 0 0 auto; }
.gr-doc-grant-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-doc-grant-chip:hover {
  background: rgba(100,153,84,.20);
  border-color: rgba(100,153,84,.60);
  box-shadow: 0 2px 8px rgba(100,153,84,.28);
  transform: translateY(-1px);
}
.gr-doc-grant-chip:active { transform: translateY(0) scale(.98); }
.gr-doc-grant-chip:focus-visible {
  outline: 2px solid rgba(100,153,84,.55);
  outline-offset: 1px;
}
@media (prefers-color-scheme: dark) {
  .gr-doc-grant-chip { color: #8fc27a; background: rgba(100,153,84,.16); }
  .gr-doc-grant-chip:hover { background: rgba(100,153,84,.28); }
}

/* ══════════════════════════════════════════════════════════════════════════
   ADVANCED FILTER POPOVER — multi-facet filter for grants/docs panels
   ══════════════════════════════════════════════════════════════════════════ */
.gr-adv-pop {
  width: 720px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--card, #fff);
  color: var(--text, #111);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.08);
  padding: 14px 14px 16px;
  font-size: 13px;
  animation: grAdvPopIn .14s ease-out;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 18px;
  row-gap: 0;
  align-content: start;
}
.gr-adv-pop-head { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .gr-adv-pop { grid-template-columns: 1fr; }
}
@keyframes grAdvPopIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gr-adv-pop-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.gr-adv-pop-title {
  flex: 1; font-weight: 700; font-size: 13px; color: var(--text, #111);
}
.gr-adv-pop-clear {
  background: transparent; border: 0; color: var(--c-blue, #3A86FF);
  font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 8px;
  border-radius: 6px;
}
.gr-adv-pop-clear:hover { background: rgba(58,134,255,.08); }
.gr-adv-pop-x {
  background: transparent; border: 0; cursor: pointer;
  width: 24px; height: 24px; border-radius: 6px;
  font-size: 18px; line-height: 1; color: var(--ink-2, #64748b);
}
.gr-adv-pop-x:hover { background: var(--bg-2, #f1f5f9); }

.gr-adv-facet { margin-top: 10px; }
.gr-adv-facet-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--ink-2, #64748b);
  margin-bottom: 6px;
}
.gr-adv-chip-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.gr-adv-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-2, #f1f5f9);
  border: 1px solid var(--border, #e5e7eb);
  color: var(--text, #111);
  padding: 5px 11px;
  font-size: 12px; font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.gr-adv-chip:hover {
  background: rgba(58,134,255,.08);
  border-color: rgba(58,134,255,.35);
}
.gr-adv-chip.is-on {
  background: var(--c-blue, #3A86FF);
  border-color: var(--c-blue, #3A86FF);
  color: #fff;
}
.gr-adv-toggle {
  background: var(--bg-2, #f1f5f9);
  border: 1px solid var(--border, #e5e7eb);
  color: var(--text, #111);
  padding: 6px 14px;
  font-size: 12px; font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}
.gr-adv-toggle.is-on {
  background: var(--c-blue, #3A86FF);
  border-color: var(--c-blue, #3A86FF);
  color: #fff;
}
/* ══════════════════════════════════════════════════════════════════════════
   ENHANCED TRANSITIONS & INTERACTIONS — grants tab polish pass
   ══════════════════════════════════════════════════════════════════════════ */

/* ── ax-card sub-text (overview scorecard context lines) ─────────────────── */
.ax-card-sub {
  font-size: .62rem;
  color: var(--ink3, #94a3b8);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
  min-height: .75rem;
  transition: color .25s ease, opacity .25s ease;
}
.ax-card.is-active .ax-card-sub {
  color: color-mix(in srgb, var(--_ac, #3A86FF) 60%, var(--ink3, #94a3b8));
}

/* ── Active filter context bar ───────────────────────────────────────────── */
.gr-filter-ctx {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  margin: -6px 0 14px;
  background: rgba(58,134,255,.08);
  border: 1px solid rgba(58,134,255,.22);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gr-ink, #161616);
  width: fit-content;
  max-width: 100%;
  animation: gr-ctx-in .22s cubic-bezier(.2,.8,.2,1);
}
.gr-filter-ctx.is-hidden { display: none; }
.gr-filter-ctx-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gr-blue, #3A86FF);
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  transition: background .12s ease, color .12s ease;
  margin-left: 2px;
  white-space: nowrap;
}
.gr-filter-ctx-clear:hover { background: rgba(58,134,255,.14); }
@keyframes gr-ctx-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
/* Rail-set filters sit in their own bar in their own colour, because they
   stack with the scorecard bar and two identical pills would read as one
   filter shown twice. */
.gr-filter-ctx--rail {
  background: rgba(99,102,241,.09);
  border-color: rgba(99,102,241,.26);
}
.gr-filter-ctx--rail .gr-filter-ctx-clear { color: #4f46e5; }
.gr-filter-ctx--rail .gr-filter-ctx-clear:hover { background: rgba(99,102,241,.15); }

/* ══════════════════════════════════════════════════════════════════════════
   THE RIGHT RAIL IS AN INPUT, NOT A POSTER
   Every module — its heading, its ranked bars, its stat tiles — sets the
   filter it is about on the grid beside it. These are the affordances that
   say so, plus the .is-on paint that says which one is currently applied.
   ══════════════════════════════════════════════════════════════════════════ */
.wk-tab-panel[data-wk-panel="grants"] .wk-support-head.is-click {
  cursor: pointer; border-radius: 8px;
  margin: -3px -5px 0; padding: 3px 5px;
  transition: background .14s ease;
}
.wk-tab-panel[data-wk-panel="grants"] .wk-support-head.is-click:hover {
  background: color-mix(in srgb, var(--_sm-color, #3A86FF) 10%, transparent);
}
.wk-tab-panel[data-wk-panel="grants"] .wk-support-head.is-click:focus-visible {
  outline: 2px solid var(--_sm-color, #3A86FF); outline-offset: 1px;
}
/* The chevron only appears on a head you can actually click. */
.wk-tab-panel[data-wk-panel="grants"] .wk-support-head.is-click .wk-support-title::after {
  content: '›'; margin-left: 5px; font-weight: 800; opacity: .45;
  transition: transform .14s ease, opacity .14s ease; display: inline-block;
}
.wk-tab-panel[data-wk-panel="grants"] .wk-support-head.is-click:hover .wk-support-title::after {
  transform: translateX(2px); opacity: .9;
}

.gr-side-rank.is-click,
.gr-side-stat.is-click {
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.gr-side-rank.is-click {
  border-radius: 8px; padding: 6px 7px; margin-left: -7px; margin-right: -7px;
  border: 1px solid transparent;
}
.gr-side-rank.is-click:hover {
  background: color-mix(in srgb, var(--c-blue, #3A86FF) 8%, transparent);
  border-color: color-mix(in srgb, var(--c-blue, #3A86FF) 26%, transparent);
}
.gr-side-stat.is-click:hover {
  background: color-mix(in srgb, var(--c-blue, #3A86FF) 10%, transparent);
  border-color: color-mix(in srgb, var(--c-blue, #3A86FF) 34%, transparent);
  transform: translateY(-1px);
}
.gr-side-rank.is-click:focus-visible,
.gr-side-stat.is-click:focus-visible {
  outline: 2px solid var(--c-blue, #3A86FF); outline-offset: 1px;
}
/* Applied. Without this the rail gives no sign which of its rows is the one
   currently narrowing the grid. */
.gr-side-rank.is-on,
.gr-side-stat.is-on {
  background: color-mix(in srgb, #6366f1 13%, transparent);
  border-color: color-mix(in srgb, #6366f1 42%, transparent);
}
.gr-side-rank.is-on .gr-side-rank-label,
.gr-side-stat.is-on .gr-side-stat-l { color: #4f46e5; font-weight: 700; }

/* Inline button on a rail row (Close out / Reopen). */
.gr-side-act {
  flex-shrink: 0; align-self: center; font: inherit;
  font-size: .67rem; font-weight: 700; cursor: pointer;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  color: #4f46e5;
  background: color-mix(in srgb, #6366f1 10%, transparent);
  border: 1px solid color-mix(in srgb, #6366f1 32%, transparent);
  transition: background .13s ease, color .13s ease;
}
.gr-side-act:hover { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.gr-side-act:focus-visible { outline: 2px solid #6366f1; outline-offset: 1px; }

/* ── Close-out sheet ──────────────────────────────────────────────────── */
.gr-modal-card--sm { max-width: 520px; }
.gr-closeout-list { display: flex; flex-direction: column; gap: 7px; }
.gr-closeout-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 11px; border-radius: 9px;
  background: var(--surf-2, rgba(15,23,42,.03));
  border: 1px solid var(--border, rgba(15,23,42,.09));
}
.gr-closeout-row.is-warn {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.28);
}
.gr-closeout-mark {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 900; margin-top: 1px;
  color: #fff; background: #10b981;
}
.gr-closeout-row.is-warn .gr-closeout-mark { background: #f59e0b; }
.gr-closeout-label { font-size: .8rem; font-weight: 700; color: var(--gr-ink, #1e293b); }
.gr-closeout-meta  { font-size: .71rem; color: var(--gr-ink-2, #64748b); margin-top: 2px; line-height: 1.4; }
.gr-closeout-note {
  font-size: .73rem; line-height: 1.5; color: var(--gr-ink-2, #64748b);
  padding: 9px 11px; border-radius: 9px;
  background: rgba(99,102,241,.07);
  border: 1px solid rgba(99,102,241,.2);
}
.gr-closeout-note strong { color: #4f46e5; }

/* ── Card grid — smooth swap animation ───────────────────────────────────── */
.gr-card-grid,
.gr-doc-card-grid {
  transition: opacity .16s ease, transform .16s ease;
  will-change: opacity, transform;
}

/* ── Ripple on scorecard click ───────────────────────────────────────────── */
.gr-ripple-el {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  width: 80px; height: 80px;
  margin-top: -40px; margin-left: -40px;
  pointer-events: none;
  animation: gr-ripple .55s ease-out forwards;
  z-index: 0;
}
@keyframes gr-ripple {
  from { transform: scale(0); opacity: .28; }
  to   { transform: scale(3);  opacity: 0;  }
}

/* ── Grants-tab ax-card — richer hover/active ────────────────────────────── */
.wk-tab-panel[data-wk-panel="grants"] .ax-card {
  cursor: pointer;
  overflow: hidden;
  transition: transform .22s cubic-bezier(.22,1,.36,1),
              box-shadow .22s ease,
              border-color .22s ease,
              background .22s ease;
}
.wk-tab-panel[data-wk-panel="grants"] .ax-card:hover      { transform: translateY(-4px) scale(1.015); }
.wk-tab-panel[data-wk-panel="grants"] .ax-card:active     { transform: translateY(-1px) scale(.96); transition-duration: .07s; }
.wk-tab-panel[data-wk-panel="grants"] .ax-card.is-active  { transform: translateY(-2px); }
.wk-tab-panel[data-wk-panel="grants"] .ax-card.is-active:hover { transform: translateY(-4px) scale(1.015); }
.wk-tab-panel[data-wk-panel="grants"] .ax-card:focus-visible { outline: 2px solid var(--_ac, #3A86FF); outline-offset: 2px; }

/* ── Grant card — hover details ──────────────────────────────────────────── */
.grant-card {
  transition: border-color .22s ease,
              box-shadow .28s cubic-bezier(.22,1,.36,1),
              transform .22s cubic-bezier(.22,1,.36,1);
}
.grant-card:hover .grant-card-title {
  color: color-mix(in srgb, var(--gc-accent, #3A86FF) 80%, var(--gr-ink, #e2e8f0));
  transition: color .2s ease;
}
.grant-card:hover .grant-card-bar-fill { filter: brightness(1.12); transition: filter .2s ease; }
.grant-card-stat-v, .grant-card-stat-l { transition: color .18s ease; }
.grant-card-badge  { transition: background .15s ease, transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.grant-card:hover .grant-card-badge   { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.grant-card-status { transition: background .18s ease, border-color .18s ease; }
.grant-card-funder-logo { transition: transform .2s ease, box-shadow .2s ease; }
.grant-card:hover .grant-card-funder-logo { transform: scale(1.08); box-shadow: 0 4px 10px rgba(0,0,0,.25); }

/* ── Focus-panel buttons ─────────────────────────────────────────────────── */
.wk-tab-panel[data-wk-panel="grants"] .wk-focus-new-btn {
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.wk-tab-panel[data-wk-panel="grants"] .wk-focus-new-btn:hover  { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(58,134,255,.35); }
.wk-tab-panel[data-wk-panel="grants"] .wk-focus-new-btn:active { transform: scale(.97); transition-duration: .07s; }
.wk-tab-panel[data-wk-panel="grants"] .wk-focus-filter-btn     { transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.wk-tab-panel[data-wk-panel="grants"] .wk-focus-filter-btn:hover { transform: translateY(-1px); }

/* ── Support modules ─────────────────────────────────────────────────────── */
.wk-tab-panel[data-wk-panel="grants"] .wk-support-module { transition: box-shadow .22s ease, transform .22s ease; }
.wk-tab-panel[data-wk-panel="grants"] .wk-support-module:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }

/* ── Filter chips ────────────────────────────────────────────────────────── */
.gr-chip { transition: background .14s ease, color .14s ease, transform .14s ease, box-shadow .14s ease; }
.gr-chip:hover  { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.gr-chip.is-active { box-shadow: 0 2px 10px rgba(58,134,255,.22); }
.gr-chip:active { transform: scale(.96); transition-duration: .07s; }

/* ── Sidebar rows ────────────────────────────────────────────────────────── */
.gr-side-row { transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.gr-side-row[data-gr-grant]:hover { box-shadow: 0 4px 14px rgba(58,134,255,.12); }

/* ── Drawer items ────────────────────────────────────────────────────────── */
.gr-drawer-item { transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.gr-drawer-item:hover { background: rgba(58,134,255,.06); border-color: rgba(58,134,255,.25); transform: translateX(2px); }

/* ── PO card ─────────────────────────────────────────────────────────────── */
.gr-po-card { cursor: pointer; }
.gr-po-card:hover .gr-po-card-num { color: var(--_ac, #06B6D4); transition: color .18s ease; }

/* ── Close buttons ───────────────────────────────────────────────────────── */
.gr-modal-x, .gr-drawer-x {
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.gr-modal-x:hover, .gr-drawer-x:hover { transform: rotate(90deg) scale(1.1); }

/* ── Table rows ──────────────────────────────────────────────────────────── */
.wk-tab-panel[data-wk-panel="grants"] .wk-data-table tbody tr { transition: background .12s ease, box-shadow .12s ease; }
.wk-tab-panel[data-wk-panel="grants"] .wk-data-table tbody tr:hover { background: rgba(58,134,255,.06); box-shadow: inset 3px 0 0 rgba(58,134,255,.4); }

/* ── Adv-filter chips ────────────────────────────────────────────────────── */
.gr-adv-chip { transition: background .12s ease, border-color .12s ease, color .12s ease, transform .12s ease; }
.gr-adv-chip:hover { transform: translateY(-1px); }
.gr-adv-chip.is-on { box-shadow: 0 2px 8px rgba(58,134,255,.25); }

/* ── gr-scorecard (compact scorecard variant) ────────────────────────────── */
.gr-scorecard {
  transition: transform .2s cubic-bezier(.22,1,.36,1),
              border-color .2s ease, box-shadow .22s ease, background .2s ease;
}
.gr-scorecard:hover  { transform: translateY(-3px) scale(1.01); }
.gr-scorecard:active { transform: translateY(-1px) scale(.97); transition-duration: .07s; }

/* ── Doc card ────────────────────────────────────────────────────────────── */
.gr-doc-card { transition: box-shadow .22s ease, transform .22s cubic-bezier(.22,1,.36,1), border-color .22s ease; }

/* ── Alloc add ───────────────────────────────────────────────────────────── */
.gr-alloc-add { transition: background .12s ease, transform .12s ease; }
.gr-alloc-add:hover { transform: translateY(-1px); }

/* ── Grant builder drawer open ───────────────────────────────────────────── */
.gr-side-rank-fill { transition: width .55s cubic-bezier(.22,1,.36,1); }
