/* GP Appointments (GPAD) dashboard.
 *
 * Phase 4C.31. The monolith's `<style>` block from website/gp_appointments.html and the shared
 * entity picker's `<style>` block from website/partials/_entity_picker.html, taken at monolith
 * commit cb02cf0 with no selector, value or colour changed. The only additions are at the end
 * and are listed there: they exist because the Content Security Policy admits no style
 * attribute and no inline style element, so the monolith's were moved here.
 */
  :root { --ga-border:#e6ebf1; --ga-ink:#0f172a; --ga-mut:#64748b; --ga-soft:#94a3b8;
          --ga-good:#15803d; --ga-goodbg:#e8f6ec; --ga-bad:#b91c1c; --ga-badbg:#fdeaea;
          --ga-amber:#b45309; --ga-amberbg:#fef6e7;
          --ga-practice:#0d5bb8; --ga-pcn:#16a085; --ga-icb:#8e44ad; --ga-national:#94a3b8; }

  /* Phase 4C.34-ui. The monolith's marketing-page wrapper (a fixed-width centred column with its own
     page padding) is gone: the Intelligence shell's `.content` supplies the padding and
     `.content-inner` the width cap every tool shares, so the page fills the workspace to the
     right of the sidebar like the other tools do. */
  .ga-wrap { max-width:none; margin:0; padding:0; }
  .ga-lead { color:var(--ga-mut); font-size:15px; margin:0 0 18px; max-width:820px; }
  .ga-attribution { background:#f6f8fc; border:1px solid var(--ga-border); border-left:3px solid var(--theme,#0d5bb8); border-radius:8px; padding:13px 17px; font-size:13px; color:#4b5563; margin-bottom:14px; }
  .ga-xlink { display:flex; align-items:center; gap:12px; background:#eef6ff; border:1px solid #cfe3fb; border-radius:9px; padding:12px 16px; font-size:13.5px; color:#1e3a5f; margin-bottom:22px; }
  .ga-xlink .ga-ico.lead { color:#0d5bb8; width:18px; height:18px; }
  .ga-xlink a { font-weight:700; color:#0d5bb8; white-space:nowrap; }

  .ga-card { background:#fff; border:1px solid var(--ga-border); border-radius:12px; padding:20px 22px; margin-bottom:18px; }
  .ga-h { font-size:16px; font-weight:800; color:var(--ga-ink); margin:0 0 4px; }
  .ga-sub { color:var(--ga-mut); font-size:12.5px; margin:0 0 14px; }

  .ga-controls { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
  .ga-modes { display:inline-flex; background:#eef2f7; border-radius:10px; padding:4px; }
  .ga-mode { border:none; background:none; padding:9px 20px; font-size:13.5px; font-weight:700; color:var(--ga-mut); border-radius:8px; cursor:pointer; }
  .ga-mode.active { background:#fff; color:var(--ga-ink); box-shadow:0 1px 3px rgba(15,23,42,.12); }
  .ga-ctl-label { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ga-mut); white-space:nowrap; }
  .ga-monthwrap { display:inline-flex; align-items:center; gap:9px; margin-left:auto; }
  .ga-month { padding:11px 14px; font-size:14px; font-weight:700; border:1px solid #d1d9e0; border-radius:10px; background:#fff; color:var(--ga-ink); cursor:pointer; }
  .ga-controls { min-height:46px; }

  .ga-msg { display:none; }
  .ga-msg.err { display:block; background:var(--ga-badbg); color:var(--ga-bad); border-radius:8px; padding:11px 15px; font-size:13.5px; margin:14px 0; }

  .ga-context { display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:10px; border-bottom:1px solid var(--ga-border); padding-bottom:14px; margin:18px 0; }
  .ga-context h2 { font-size:22px; font-weight:800; color:var(--ga-ink); margin:0; }
  .ga-context .meta { color:var(--ga-mut); font-size:13px; margin-top:4px; }

  .ga-kpis { display:grid; grid-template-columns:repeat(6,1fr); gap:13px; margin-bottom:18px; }
  @media (max-width:980px){ .ga-kpis { grid-template-columns:repeat(3,1fr); } }
  @media (max-width:560px){ .ga-kpis { grid-template-columns:repeat(2,1fr); } }
  .ga-kpi { border:1px solid var(--ga-border); border-radius:11px; padding:14px 16px; }
  .ga-kpi .lbl { font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:var(--ga-mut); line-height:1.3; min-height:26px; }
  .ga-kpi .big { font-size:1.6rem; font-weight:800; color:var(--ga-ink); line-height:1.1; margin-top:4px; }
  .ga-kpi .big small { font-size:.85rem; color:var(--ga-soft); font-weight:700; }
  .ga-kpi .sub { font-size:11px; color:var(--ga-soft); margin-top:4px; }
  .ga-kpi.good .big { color:var(--ga-good); } .ga-kpi.bad .big { color:var(--ga-bad); }
  .ga-kpi.warn .big { color:var(--ga-amber); }
  /* The same-day standing card carries a status in words; its helper line is read, so it meets AA. */
  .ga-kpi.sd .sub { color:#475569; }
  .ga-mom { font-size:10.5px; font-weight:800; margin-top:5px; display:flex; align-items:center; gap:5px; }
  .ga-mom .mom-l { font-weight:600; color:var(--ga-soft); font-size:9.5px; text-transform:none; letter-spacing:0; }
  .ga-mom.good { color:var(--ga-good); } .ga-mom.bad { color:var(--ga-bad); } .ga-mom.flat { color:var(--ga-soft); }
  .ga-kpi.accent .ga-mom { color:rgba(255,255,255,.92); } .ga-kpi.accent .ga-mom .mom-l { color:rgba(255,255,255,.7); }
  .ga-kpi.accent { background:linear-gradient(135deg,#0d3b6e,#0d5bb8); border:none; color:#fff; }
  .ga-kpi.accent .lbl, .ga-kpi.accent .sub { color:rgba(255,255,255,.82); }
  .ga-kpi.accent .big { color:#fff; }

  /* tabs */
  /* visual segmented tab rail */
  .ga-tabs { display:grid; grid-template-columns:repeat(11,1fr); gap:8px; margin-bottom:22px; }
  @media (max-width:1300px){ .ga-tabs { grid-template-columns:repeat(6,1fr); } }
  @media (max-width:1100px){ .ga-tabs { grid-template-columns:repeat(5,1fr); } }
  @media (max-width:600px){ .ga-tabs { grid-template-columns:repeat(3,1fr); } }
  .ga-tab { border:1px solid var(--ga-border); background:#fff; padding:13px 8px 11px; font-size:11.5px; font-weight:700;
    color:var(--ga-mut); border-radius:12px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:7px;
    line-height:1.15; text-align:center; transition:transform .1s, box-shadow .12s, border-color .12s; }
  .ga-tab i { font-size:18px; color:#94a3b8; transition:color .12s; }
  .ga-tab:hover { border-color:#bcd0ea; box-shadow:0 3px 10px rgba(13,91,184,.08); transform:translateY(-1px); }
  .ga-tab.active { background:linear-gradient(135deg,#0d3b6e,#0d5bb8); border-color:transparent; color:#fff; box-shadow:0 6px 16px rgba(13,91,184,.28); }
  .ga-tab.active i { color:#fff; }
  .ga-panel { display:none; animation:gaFade .2s ease-out; }
  .ga-panel.active { display:block; }
  @keyframes gaFade { from { opacity:0; transform:translateY(4px);} to { opacity:1; transform:none; } }

  /* inline autocomplete (compare) */
  .ga-csearch { position:relative; display:flex; align-items:center; gap:10px; border:1px solid #d1d9e0; border-radius:10px; padding:11px 14px; background:#fff; max-width:560px; }
  .ga-csearch i { color:#b6bfc8; }
  .ga-csearch input { flex:1; border:none; outline:none; font-size:15px; color:var(--ga-ink); background:none; }
  .ga-ac { position:absolute; top:calc(100% + 6px); left:0; right:0; background:#fff; border:1px solid var(--ga-border); border-radius:10px; box-shadow:0 18px 44px rgba(15,23,42,.18); max-height:300px; overflow-y:auto; display:none; z-index:50; }
  .ga-ac.show { display:block; }
  .ga-ac-item { display:flex; align-items:center; gap:12px; padding:10px 14px; cursor:pointer; border-bottom:1px solid #f5f7f9; }
  .ga-ac-item:hover, .ga-ac-item.active { background:#f0f6ff; }
  .ga-ac-item .c { font-size:11px; font-weight:800; color:#0d5bb8; min-width:58px; }
  .ga-ac-item .n { flex:1; font-size:13.5px; color:var(--ga-ink); }
  .ga-ac-item .n .s { display:block; color:#9aa5b1; font-size:11.5px; font-weight:600; }
  .ga-ac-empty { padding:18px 14px; color:#b6bfc8; font-size:13px; text-align:center; }
  .ga-cchip { display:inline-flex; align-items:center; gap:8px; background:#eef6ff; border:1px solid #cfe3fb; border-radius:20px; padding:6px 12px; font-size:12.5px; font-weight:700; color:#1e3a5f; }
  .ga-cchip .sw { width:10px; height:10px; border-radius:3px; display:inline-block; }
  .ga-cchip .x { cursor:pointer; color:#b91c1c; font-weight:800; }
  .ga-seg { display:inline-flex; background:#eef2f7; border-radius:9px; padding:3px; }
  .ga-seg button { border:none; background:none; padding:7px 14px; font-size:12.5px; font-weight:700; color:var(--ga-mut); border-radius:7px; cursor:pointer; }
  .ga-seg button.active { background:#fff; color:var(--ga-ink); box-shadow:0 1px 2px rgba(15,23,42,.12); }

  .ga-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
  .ga-grid12 { display:grid; grid-template-columns:1.3fr 1fr; gap:18px; }
  @media (max-width:860px){ .ga-grid2, .ga-grid12 { grid-template-columns:1fr; } }
  .ga-chart-box { position:relative; min-height:240px; }

  table.ga-table { width:100%; border-collapse:collapse; font-size:13px; }
  table.ga-table th { text-align:left; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ga-mut); padding:9px 10px; border-bottom:2px solid var(--ga-border); cursor:pointer; }
  table.ga-table td { padding:9px 10px; border-bottom:1px solid #f1f4f8; }
  table.ga-table tr.me { background:#eef6ff; font-weight:700; }
  .ga-bar { height:9px; border-radius:5px; background:#e2e8f0; overflow:hidden; }
  .ga-bar > span { display:block; height:100%; border-radius:5px; }

  .ga-chip { display:inline-block; padding:2px 9px; border-radius:20px; font-size:11.5px; font-weight:700; }
  .ga-chip.good { background:var(--ga-goodbg); color:var(--ga-good); }
  .ga-chip.bad { background:var(--ga-badbg); color:var(--ga-bad); }
  .ga-chip.neutral { background:#eef1f6; color:var(--ga-mut); }
  /* The neutral rating chip measured 4.2:1 on its tint; a step darker meets AA (4.5). */
  .ga-chip.neutral { color:#475569; }

  /* percentile gauge */
  .ga-gauge { height:14px; border-radius:8px; background:linear-gradient(90deg,#dc2626,#f59e0b,#84cc16,#16a34a,#2563eb); position:relative; margin:18px 0 26px; }
  .ga-gauge .pin { position:absolute; top:-7px; width:4px; height:28px; background:#0f172a; border-radius:2px; transform:translateX(-50%); }
  .ga-gauge .pin::after { content:attr(data-val); position:absolute; top:30px; left:50%; transform:translateX(-50%); font-size:11px; font-weight:800; color:#0f172a; white-space:nowrap; }
  .ga-quants { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
  .ga-quant { border:1px solid var(--ga-border); border-radius:8px; padding:8px; text-align:center; }
  .ga-quant .q-l { font-size:9px; font-weight:800; text-transform:uppercase; color:var(--ga-mut); }
  .ga-quant .q-v { font-size:14px; font-weight:800; color:var(--ga-ink); }
  .ga-quant.hl { border-color:#0d5bb8; background:#eef6ff; }

  .ga-callout { background:var(--ga-amberbg); border:1px solid #f7e2b8; border-left:3px solid var(--ga-amber); border-radius:8px; padding:13px 16px; font-size:13.5px; color:#7a4d09; }
  .ga-note { background:#fff7ed; border:1px solid #fed7aa; border-radius:8px; padding:12px 15px; font-size:12.5px; color:#9a3412; margin-bottom:16px; }

  .ga-empty { text-align:center; color:var(--ga-soft); padding:60px 20px; font-size:15px; }

  /* ── Phase 4C.31: what the monolith's inline style="" attributes became ─────────────────────
     The Content Security Policy admits no style attribute, so each one the template carried is
     a class here, with the same declarations. */
  .ga-ico { width:1em; height:1em; vertical-align:-.125em; fill:none; stroke:currentColor; stroke-width:2;
    stroke-linecap:round; stroke-linejoin:round; flex:none; }
  .ga-ico.me-1 { margin-right:.25rem; }
  .ga-title { font-size:28px; font-weight:800; color:var(--ga-ink); margin:0 0 10px; }
  .ga-tab .ga-ico { width:18px; height:18px; color:#94a3b8; transition:color .12s; }
  .ga-tab.active .ga-ico { color:#fff; }
  .ga-xlink-off { font-weight:700; color:#0d5bb8; }
  .ga-xlink > div { flex:1; }
  .ga-note.ga-note-info { background:#eff6ff; border-color:#bfdbfe; color:#1e3a5f; }
  .ga-empty .ga-ico { width:34px; height:34px; color:#cbd5e1; }
  .ga-empty p { margin-top:14px; }
  #ga-dash { display:none; }
  .ga-rankline { font-size:14px; font-weight:700; margin-bottom:6px; }
  .ga-mt14 { margin-top:14px; }
  .ga-mt16 { margin-top:16px; }
  .ga-mt20 { margin-top:20px; }
  .ga-mb16 { margin-bottom:16px; }
  .ga-minh140 { min-height:140px; }
  .ga-minh160 { min-height:160px; }
  .ga-minh320 { min-height:320px; }
  .ga-cmp-controls { margin:4px 0 12px; }
  .ga-grow { flex:1; }
  button.ga-seg.ga-clear { padding:8px 14px; font-weight:700; color:var(--ga-mut); cursor:pointer; }
  #ga-cmp-chips { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
  .ga-chip-note { background:none; }

  /* The same declarations for markup the script builds. The script cannot write a style
     attribute either, so `gpa.v1.js` moves each one into the stylesheet object model after it
     inserts the markup; these are the ones that are static and so can simply be classes. */

/* ── The shared entity picker (partials/_entity_picker.html) ── */
  .epick-chip { display:inline-flex; align-items:center; gap:10px; padding:10px 14px;
    background:#fff; border:1px solid #d1d9e0; border-radius:10px; font-size:14px;
    font-weight:600; color:#5a6b7b; cursor:pointer; transition:border-color .12s, box-shadow .12s; }
  .epick-chip:hover { border-color:#b6c2cd; }
  .epick-chip.set { color:#1a2a3b; border-color:#16a085; }
  .epick-chip .epick-trigger-val { font-weight:700; }
  .epick-chip > i:last-child { color:#aab4be; font-size:12px; }

  .epick-modal { position:fixed; inset:0; z-index:100000; display:flex; align-items:flex-start; justify-content:center; }
  .epick-modal[hidden] { display:none; }
  .epick-backdrop { position:absolute; inset:0; background:rgba(15,30,42,.45); backdrop-filter:blur(2px); }
  .epick-box { position:relative; background:#fff; width:min(560px,92vw); margin-top:clamp(110px,16vh,200px);
    border-radius:14px; box-shadow:0 24px 60px rgba(0,0,0,.3); overflow:hidden; animation:epickPop .14s ease-out; }
  @keyframes epickPop { from { opacity:0; transform:translateY(-8px) scale(.98); } to { opacity:1; transform:none; } }
  .epick-head { display:flex; align-items:center; gap:11px; padding:16px 18px; border-bottom:1px solid #eef1f4; }
  .epick-head > i { color:#16a085; }
  .epick-head span { font-size:15px; font-weight:800; color:#1a2a3b; flex:1; }
  .epick-head button { background:none; border:none; font-size:22px; line-height:1; color:#b6bfc8; cursor:pointer; }
  .epick-head button:hover { color:#1a2a3b; }
  .epick-search { display:flex; align-items:center; gap:10px; padding:14px 18px; }
  .epick-search i { color:#b6bfc8; }
  .epick-search input { flex:1; border:none; outline:none; font-size:16px; color:#1a2a3b; background:none; }
  .epick-hint { padding:0 18px 8px; font-size:11.5px; color:#9aa5b1; }
  .epick-results { max-height:46vh; overflow-y:auto; border-top:1px solid #f0f3f6; }
  .epick-item { display:flex; align-items:center; gap:12px; padding:11px 18px; cursor:pointer; border-bottom:1px solid #f5f7f9; }
  .epick-item:hover, .epick-item.active { background:#f0faf8; }
  .epick-item .epick-code { font-size:11px; font-weight:700; color:#16a085; min-width:62px; }
  .epick-item .epick-name { flex:1; font-size:13.5px; color:#1a2a3b; }
  .epick-item .epick-name .epick-sub { color:#9aa5b1; font-size:11.5px; font-weight:600; }
  .epick-item .epick-go { color:#cdd3da; font-size:12px; }
  .epick-item.active .epick-go { color:#16a085; }
  .epick-empty { padding:24px 18px; text-align:center; color:#b6bfc8; font-size:13px; }

/* Phase 4C.31: the monolith styled its Font Awesome `<i>` glyphs with `i` selectors. The icons
   here are inline SVG, so the same declarations apply to `svg`. */
.ga-csearch svg { color:#b6bfc8; }
.epick-chip > svg:last-child { color:#aab4be; font-size:12px; }
.epick-head > svg { color:#16a085; }
.epick-search svg { color:#b6bfc8; }
.epick-item .epick-go { width:12px; height:12px; }

/* ── Phase 4C.31: fitting the monolith's page inside this service's shell ──────────────────────
   The monolith's dashboard had the viewport to itself. Here a sidebar takes ~250px of it, so the
   viewport breakpoints the source chose (980px, 860px) fire too late: at 1024px the six-column KPI
   band and the five-column quartile row no longer fit. These rules only move those breakpoints
   out by the sidebar's width and let grid children shrink; no colour, size or arrangement the
   source defines changes at any width the source defined it for. A table wider than its card
   scrolls inside the card, so the document itself never gains a horizontal scrollbar. */
.ga-kpis > *, .ga-quants > *, .ga-grid2 > *, .ga-grid12 > * { min-width:0; }
div:has(> table.ga-table) { overflow-x:auto; }
@media (max-width:1280px){ .ga-kpis { grid-template-columns:repeat(3,1fr); } }
@media (max-width:560px){ .ga-kpis { grid-template-columns:repeat(2,1fr); } }
@media (max-width:1100px){ .ga-grid2, .ga-grid12 { grid-template-columns:1fr; } }
@media (max-width:560px){ .ga-quants { grid-template-columns:repeat(3,1fr); } }
