/* THE WORK HUB'S LIST TOOLBAR + SCORECARDS, for EMS lists (assets/js/ems-list.js).
   Tyler 11-15 on Members & Connections: "match how the Work Hub does it exactly".
   1. The toolbar block is a COPY of vo-app-work apps/Work/wk-work-lists.css (the
      same copy Finance keeps as wk-lists.css): search, Filters, Sort, + New,
      chips, the Filters popover and the Sort menu. Re-copy, never edit. Two
      differences, both on purpose: the dark-mode blocks are left out (the EMS
      Hub has no dark theme, so they would paint a dark toolbar on a light
      page), and the variables below point Work's names at EMS's tokens.
   2. The cards are the Program Dashboard's (.dsc-card): the card IS the
      filter (lit ring when on); plain and grey at zero. */
:root {
  /* Work's own face (vo-app-work work.css --f), so search, Filters, Sort and
     their pop-ups read exactly like the Work Hub's (Tyler 11-15). */
  --f: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --wl-surf: #ffffff;
  --wl-row: #ffffff;
  --wl-row-hover: #f8fafc;
  --wl-line: var(--ems-line, #e5e8ec);
  --wl-line-2: #eef0f3;
  --wl-soft: var(--ems-soft, #f2f4f7);
  --wl-ink: var(--ems-ink, #111827);
  --wl-ink2: var(--ems-mute, #4b5563);
  --wl-ink3: var(--ems-mute-2, #8a93a0);
  --wl-pri: var(--ems-navy-500, #2A3890);
  --wl-pri-mist: color-mix(in srgb, var(--wl-pri) 9%, transparent);
  --wl-pri-line: color-mix(in srgb, var(--wl-pri) 32%, transparent);
  --wl-red: #dc2626;   --wl-red-bg: #fef2f2;   --wl-red-line: #fecaca;
  --wl-amber: #b45309; --wl-amber-bg: #fffbeb; --wl-amber-line: #fde68a;
  --wl-blue: #2563eb;  --wl-blue-bg: #eff6ff;  --wl-blue-line: #bfdbfe;
  --wl-violet: #7c3aed; --wl-violet-bg: #f5f3ff; --wl-violet-line: #ddd6fe;
  --wl-green: #15803d; --wl-green-bg: #f0fdf4;
  --wl-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --wl-shadow-up: 0 6px 18px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
}

.wl-filter-btn, .wl-pick {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 36px;
  font: 600 12.5px/1 var(--f); color: var(--wl-ink2); padding: 0 12px; border-radius: 10px; border: 1px solid var(--wl-line); background: var(--wl-surf);
}
.wl-filter-btn svg, .wl-pick svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.wl-filter-btn:hover, .wl-pick:hover { border-color: #cfd5dc; color: var(--wl-ink); }
.wl-filter-btn.is-on { border-color: var(--wl-pri); color: var(--wl-pri); background: var(--wl-pri-mist); }
.wl-filter-btn b { background: var(--wl-pri); color: #fff; font: 700 10.5px/1 var(--f); padding: 3px 6px; border-radius: 99px; }
.wl-pick span { color: var(--wl-ink3); font-weight: 500; }
.wl-pick b { font-weight: 650; color: var(--wl-ink); }
.wl-scope-btn:focus-visible, .wl-view-btn:focus-visible, .wl-filter-btn:focus-visible, .wl-pick:focus-visible, .wl-new:focus-visible,
.wl-card:focus-visible, .wl-check:focus-visible, .wl-prio:focus-visible, .wl-due:focus-visible, .wl-stage:focus-visible, .wl-more:focus-visible,
.wl-row:focus-visible, .wl-bcard:focus-visible { outline: 2px solid var(--wl-pri); outline-offset: 2px; }
.wl-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wl-tools-gap { flex: 1 1 auto; }
.wl-search { flex: 0 1 380px; min-width: 200px; display: flex; align-items: center; gap: 8px; height: 36px; border: 1px solid var(--wl-line); border-radius: 10px; background: var(--wl-surf); padding: 0 10px; }
.wl-search svg { width: 14px; height: 14px; fill: none; stroke: var(--wl-ink3); stroke-width: 2; flex: none; }
.wl-search input { all: unset; flex: 1; min-width: 0; font: 400 13px/1 var(--f); color: var(--wl-ink); }
.wl-search input::placeholder { color: var(--wl-ink3); }
.wl-search:focus-within { border-color: var(--wl-pri); box-shadow: 0 0 0 3px var(--wl-pri-mist); }
.wl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: -2px; }
.wl-chip { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: 600 12px/1 var(--f); color: var(--wl-pri); background: var(--wl-pri-mist); padding: 6px 8px 6px 10px; border-radius: 99px; }
.wl-chip span { font-weight: 500; opacity: .8; }
.wl-chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.wl-link { all: unset; cursor: pointer; font: 600 12.5px var(--f); color: var(--wl-pri); padding: 4px 6px; border-radius: 6px; }
.wl-link:hover { text-decoration: underline; }
@keyframes wl-pop-in { from { opacity: 0; transform: scale(.96) translateY(-2px); } to { opacity: 1; transform: none; } }
.wl-pop, .wl-menu { position: fixed; z-index: 70000; background: var(--wl-surf); color: var(--wl-ink); border: 1px solid var(--wl-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.2); animation: wl-pop-in .14s ease-out; }
.wl-pop { display: flex; flex-direction: column; overflow: hidden; }
.wl-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--wl-line); font: 700 13px var(--f); }
.wl-pop-body { overflow-y: auto; padding: 4px 6px 8px; }
.wl-pop-sec { border: 0; margin: 0; padding: 8px 4px 2px; }
.wl-pop-sec legend { font: 700 11px var(--f); letter-spacing: .05em; text-transform: uppercase; color: var(--wl-ink3); padding: 0 4px 4px; }
.wl-pop-opt { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 7px; cursor: pointer; font: 500 13px var(--f); color: var(--wl-ink); }
.wl-pop-opt:hover { background: var(--wl-soft); }
.wl-pop-opt input { accent-color: var(--wl-pri); width: 15px; height: 15px; margin: 0; }
.wl-pop-opt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-pop-opt em { font: 600 11.5px var(--f); color: var(--wl-ink3); font-style: normal; }
.wl-menu { padding: 5px; min-width: 190px; display: flex; flex-direction: column; }
.wl-menu-item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; font: 500 13px var(--f); color: var(--wl-ink); }
.wl-menu-item svg { width: 13px; height: 13px; margin-left: auto; fill: none; stroke: var(--wl-pri); stroke-width: 3; }
.wl-menu-item:hover, .wl-menu-item:focus-visible { background: var(--wl-soft); outline: none; }
.wl-menu-item.is-on { font-weight: 700; }
.wl-menu-sep { height: 1px; background: var(--wl-line-2); margin: 4px 2px; }
.wl-menu-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wl-ink3); flex: none; }
.wl-menu-dot--high { background: #f59e0b; } .wl-menu-dot--medium { background: #94a3b8; } .wl-menu-dot--low { background: #cbd5e1; }
.wl-menu-dot--proposed { background: #818cf8; } .wl-menu-dot--in_progress { background: #60a5fa; }
.wl-menu-dot--delivered { background: #a78bfa; } .wl-menu-dot--accepted { background: #22c55e; } .wl-menu-dot--blocked { background: #f59e0b; }
.wl-src { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--wl-soft, #f4f6f8); }
.wl-src-tab { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 9px;
  font: 700 13.5px/1 var(--f); color: var(--wl-ink2); }
.wl-src-tab b { font: 800 11.5px/1 var(--f); padding: 3px 7px; border-radius: 999px; background: rgba(15, 23, 42, .06); color: var(--wl-ink3); }
.wl-src-tab:hover { color: var(--wl-ink); }
.wl-src-tab.is-on { background: var(--wl-surf, #fff); color: var(--wl-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px rgba(15, 23, 42, .05); }
.wl-src-tab.is-on b { background: var(--wl-pri-mist); color: var(--wl-pri); }
.wl-src-tab[data-wl-src="plans"].is-on b { background: #eef2ff; color: #4338ca; }
.wl-src-tab:focus-visible { outline: 2px solid var(--wl-pri); outline-offset: 2px; }
.wl-panel .wl-search { flex: 0 1 380px; }

/* Filters popover: a find box + counts per section. */
.wl-pop-n { display: inline-block; min-width: 18px; padding: 2px 6px; border-radius: 99px; background: var(--wl-pri); color: #fff; font: 700 10.5px/1.2 var(--f); text-align: center; letter-spacing: 0; vertical-align: 1px; box-sizing: border-box; }
.wl-pop-find { display: flex; align-items: center; gap: 8px; margin: 8px 10px 2px; height: 34px; padding: 0 10px; border: 1px solid var(--wl-line); border-radius: 9px; background: var(--wl-soft); }
.wl-pop-find:focus-within { border-color: var(--wl-pri); background: var(--wl-surf); }
.wl-pop-find svg { width: 13px; height: 13px; fill: none; stroke: var(--wl-ink3); stroke-width: 2; flex: none; }
.wl-pop-find input { all: unset; flex: 1; min-width: 0; font: 400 13px/1 var(--f); color: var(--wl-ink); }
.wl-pop-head .wl-link[disabled] { opacity: .4; pointer-events: none; }
.wl-pop-sec[hidden], .wl-pop-opt[hidden] { display: none; }
.wl-new {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 36px;
  font: 650 13px/1 var(--f); color: #fff; background: var(--wl-pri); padding: 0 14px; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.14);
}
.wl-new svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.wl-new:hover { filter: brightness(1.07); }
.wl-pop-none { margin: 10px 8px; font: 400 13px/1.45 var(--f); color: var(--wl-ink3); }

/* ── 2. Scorecards: Members uses the Program Dashboard's cards (.dsc-card,
   ems-dashboard.css: Work's spec, label on top), each in its own colour via
   --_ac. A card at zero goes plain and grey, as Work's do. */
.ems-mc-cards { margin: 0 0 16px; }
.ems-mc-cards .dsc-card.is-zero:not(.is-on) { border-color: var(--ems-line); background: #fff; }
.ems-mc-cards .dsc-card.is-zero .dsc-n { color: var(--ems-faint); }

/* ── 3. The white panel (Work's .wl-panel): its head holds the title + count,
   then search, Filters, Sort and the page's one action; chips under it. */
.ems-wl-panel { background: #fff; border: 1px solid var(--ems-line); border-radius: 18px; box-shadow: var(--ems-lift); overflow: visible; }
.ems-wl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 20px 12px; }
.ems-wl-title { display: flex; align-items: center; gap: 8px; margin: 0 auto 0 0; font: 700 var(--ems-fs-lg)/1.2 var(--ems-font-display); color: var(--ems-navy-800); }
.ems-wl-count { background: var(--wl-soft); color: var(--wl-ink2); padding: 3px 9px; border-radius: 99px; font: 700 11.5px/1.3 var(--ems-font-ui); }
.ems-wl-head .wl-search { flex: 0 1 340px; }
.ems-wl-panel > .wl-chips { margin: 0; padding: 0 20px 10px; }
.ems-wl-body { border-top: 1px solid var(--wl-line-2); }
.ems-wl-foot { margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--wl-line-2); font: 400 12.5px/1.5 var(--ems-font-body); color: var(--ems-mute-2); }
@media (max-width: 640px) { .ems-wl-head { padding: 14px 14px 10px; } .ems-wl-head .wl-search { flex: 1 1 100%; order: 3; } .ems-wl-panel > .wl-chips { padding: 0 14px 10px; } }

/* ── Members & Connections rows: colour that says something.
   Who they are = their own hue on the face and the tag (service member navy,
   spouse sky, family gold); mentor = green when connected, amber while they
   wait for one; last active turns amber after 30 days. */
.ems-mc { --mc: var(--ems-navy-500); --mc-bg: var(--ems-navy-50); }
.ems-mc[data-p="spouse"] { --mc: var(--ems-sky-700); --mc-bg: var(--ems-sky-50); }
.ems-mc[data-p="family"] { --mc: var(--ems-gold-700); --mc-bg: var(--ems-gold-50); }
.ems-mc-table { width: 100%; border-collapse: collapse; }
.ems-mc-table th { padding: 10px 14px; text-align: left; font: 800 11px/1.2 var(--ems-font-ui); letter-spacing: .6px; text-transform: uppercase; color: var(--ems-mute-2); background: var(--ems-soft); }
.ems-mc-table th:first-child, .ems-mc-table td:first-child { padding-left: 20px; }
.ems-mc-table th:last-child, .ems-mc-table td:last-child { padding-right: 20px; }
.ems-mc-table td { padding: 12px 14px; border-top: 1px solid var(--wl-line-2); vertical-align: top; font: 400 14px/1.4 var(--ems-font-body); color: var(--ems-ink-2); }
.ems-mc-table tbody tr.ems-mc { transition: background-color .14s ease; box-shadow: inset 3px 0 0 transparent; }
.ems-mc-table tbody tr.ems-mc:hover { background: var(--wl-row-hover); box-shadow: inset 3px 0 0 var(--mc); }
.ems-mc-table tbody tr.is-off td { opacity: .72; }
.ems-mc .ems-s-av { background: var(--mc-bg); color: var(--mc); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mc) 22%, transparent); }
.ems-mc-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font: 700 11.5px/1.5 var(--ems-font-ui); background: var(--mc-bg); color: var(--mc); }
.ems-mc-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ems-mc-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font: 650 12.5px/1.4 var(--ems-font-ui); white-space: nowrap; }
.ems-mc-pill.is-ok { background: var(--ems-good-50); color: var(--ems-good); }
.ems-mc-pill.is-wait { background: var(--ems-warn-50); color: var(--ems-warn); }
.ems-mc-pill.is-res { background: var(--ems-gold-50); color: var(--ems-gold-700); }
.ems-mc-pill.is-ask { background: var(--ems-red-50); color: var(--ems-red-600); }
.ems-mc-when.is-stale { color: var(--ems-warn); font-weight: 700; }
.ems-mc-empty { padding: 34px 20px; text-align: center; color: var(--ems-mute-2); font: 400 14px/1.5 var(--ems-font-body); }
.ems-mc-empty b { display: block; margin: 0 0 4px; color: var(--ems-ink); font: 700 15px var(--ems-font-ui); }
@media (max-width: 760px) {
  .ems-mc-table thead { display: none; }
  .ems-mc-table, .ems-mc-table tbody, .ems-mc-table tr, .ems-mc-table td { display: block; width: 100%; box-sizing: border-box; }
  .ems-mc-table td { border-top: 0; padding: 4px 14px; }
  .ems-mc-table tr.ems-mc { border-top: 1px solid var(--wl-line-2); padding: 10px 0; }
  .ems-mc-table td:first-child, .ems-mc-table td:last-child { padding-left: 14px; padding-right: 14px; }
}

/* ── Add someone: three ways in, each EMS US's own rule. */
.ems-add-link { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--ems-line); border-radius: 14px; background: var(--ems-soft); }
.ems-add-qr { flex: none; width: 112px; height: 112px; padding: 6px; box-sizing: border-box; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--ems-line); }
.ems-add-qr img, .ems-add-qr canvas { width: 100% !important; height: 100% !important; }
.ems-add-link-t { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ems-add-link-t b { font: 700 15px/1.3 var(--ems-font-ui); color: var(--ems-ink); }
.ems-add-link-t code { display: block; padding: 6px 8px; border-radius: 8px; background: #fff; border: 1px solid var(--ems-line); font: 500 12.5px/1.4 Consolas, Menlo, monospace; color: var(--ems-navy-700); word-break: break-all; }
.ems-add-link-t small { color: var(--ems-mute-2); font: 400 12.5px/1.4 var(--ems-font-body); }
@media (max-width: 520px) { .ems-add-link { flex-direction: column; align-items: flex-start; } }

/* The app's own text-field skin (border, padding, height on every input)
   outranks Work's `all: unset`, which drew a second box inside the search.
   :not(#_) lifts these above it without !important. */
.wl-search input:not(#_), .wl-pop-find input:not(#_) {
  all: unset; flex: 1; min-width: 0; height: auto; padding: 0; border: 0; background: none; box-shadow: none;
  font: 400 13px/1 var(--f); color: var(--wl-ink);
}
.wl-search input:not(#_)::placeholder, .wl-pop-find input:not(#_)::placeholder { color: var(--wl-ink3); }

/* The app's own tick-box skin (a 20px drawn circle on every input) outranks
   Work's native 15px box in the Filters pop-up. Back to the browser's box in
   the Work Hub's colour, exactly as Work draws it. */
.wl-pop-opt input:not(#_) {
  appearance: auto; -webkit-appearance: auto; width: 15px; min-width: 0; height: 15px; min-height: 0; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none; accent-color: var(--wl-pri); flex: none;
}
.wl-pop-opt input:not(#_)::before, .wl-pop-opt input:not(#_)::after { content: none; display: none; }
.wl-pop, .wl-menu, .wl-pop *, .wl-menu * { font-family: var(--f); }
