/* @ekm-tags: style, hr */
/* Admin → People → Employee Command Center, in the Wave 1 look (Home / Unified Inbox / Day Sheet): open glass sheets on the
   theme's own ombre, Italiana display numerals, hairline tables, status as a small dot + word (no pills), every count centred
   in the provider stat lines, no horizontal scroll at any width (tables stack under 720px).
   Pearl and Pearl Night (and every Pearl look, e.g. Navy) take Pearl luxe's --lux-* glass and ink, as the kit does; every other
   theme falls back to its own --c-* tokens. Text is WCAG AA in each (tests/employee-command-center-browser.test.mjs). */

/* ── tokens ── */
.ecc {
  --e-ink: var(--c-ink, #1a1a1a);
  --e-muted: var(--c-muted, #5f5b52);
  --e-hair: var(--c-box-border, rgba(0, 0, 0, .08));
  --e-rule: var(--c-rule, rgba(0, 0, 0, .14));
  --e-sheet: var(--c-box, #ffffff);
  --e-well: rgba(0, 0, 0, .04);
  --e-shadow: none;
  --e-blur: none;
  --e-ok: #2F6B4F;
  --e-warn: #84530B;
  --e-alert: #9A3B2E;
  --e-display: 'Italiana', var(--font-display, Georgia, serif);
  --e-ui: var(--font-ui, 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}
html[data-dark] .ecc { --e-well: rgba(255, 255, 255, .06); --e-ok: #8FD1AE; --e-warn: #E7C87A; --e-alert: #EBA493; }
html[data-theme="pearl"] .ecc {
  --e-ink: var(--lux-ink, #1F1A17);
  --e-muted: var(--lux-muted, #5E5650);
  --e-hair: var(--lux-hair, rgba(31, 26, 23, .07));
  --e-rule: rgba(31, 26, 23, .12);
  --e-sheet: var(--lux-glass, rgba(255, 255, 255, .56));
  --e-well: var(--lux-well, rgba(31, 26, 23, .05));
  --e-shadow: var(--lux-shadow, 0 28px 56px -30px rgba(70, 52, 32, .22));
  --e-blur: blur(24px) saturate(1.2);
  --e-ok: #2F6B4F; --e-warn: #84530B; --e-alert: var(--lux-alert, #9A3B2E);
}
html[data-theme="pearl_night"] .ecc {
  --e-ink: var(--lux-ink, #F5F5F4);
  --e-muted: var(--lux-muted, #AEB2B9);
  --e-hair: var(--lux-hair, rgba(255, 255, 255, .07));
  --e-rule: rgba(255, 255, 255, .12);
  --e-sheet: var(--lux-glass, rgba(38, 39, 43, .52));
  --e-well: var(--lux-well, rgba(255, 255, 255, .06));
  --e-shadow: var(--lux-shadow, 0 28px 56px -30px rgba(0, 0, 0, .7));
  --e-blur: blur(24px) saturate(1.2);
  --e-ok: #8FD1AE; --e-warn: #E7C87A; --e-alert: var(--lux-alert, #EBA493);
}

/* ── page + header (no background of its own: the theme's ombre shows through) ── */
.ecc {
  box-sizing: border-box; display: grid; gap: 24px; max-width: 1180px; min-width: 0; margin: 0 auto; padding: 32px 32px 64px;
  color: var(--e-ink); font-family: var(--e-ui); overflow-wrap: break-word;
}
.ecc *, .ecc *::before, .ecc *::after { box-sizing: border-box; }
.ecc-head { display: grid; gap: 6px; text-align: center; justify-items: center; }
.ecc-eyebrow { margin: 0; font: 600 11px/1.3 var(--e-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--e-muted); }
.ecc-title { margin: 0; font: 400 clamp(30px, 3.4vw, 42px)/1.1 var(--e-display); letter-spacing: .02em; color: var(--e-ink); text-wrap: balance; }
.ecc-sub { margin: 0; font: 400 14px/1.5 var(--e-ui); color: var(--e-muted); max-width: 68ch; }
.ecc-h2 { margin: 0; font: 400 24px/1.2 var(--e-display); letter-spacing: .02em; color: var(--e-ink); }
.ecc-muted, .ecc-empty, .ecc-na { color: var(--e-muted); }
.ecc-empty { margin: 8px 0; font-size: 14px; }
.ecc-alert {
  padding: 12px 16px; border-radius: 12px; border-left: 3px solid var(--e-alert); background: var(--e-sheet); color: var(--e-ink);
  -webkit-backdrop-filter: var(--e-blur); backdrop-filter: var(--e-blur); font-size: 14px; line-height: 1.5;
}

/* ── the glass sheet: one per section, nothing boxed inside it ── */
.ecc-sheet {
  min-width: 0; padding: 20px 24px; border-radius: 18px; background: var(--e-sheet); box-shadow: var(--e-shadow);
  -webkit-backdrop-filter: var(--e-blur); backdrop-filter: var(--e-blur);
}
.ecc-sheet-h { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin: 0 0 8px; }
.ecc-sheet-hl { display: grid; gap: 4px; min-width: 0; flex: 1 1 280px; }
.ecc-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--e-rule);
  border-radius: 12px; background: var(--e-well); color: var(--e-ink); font: 500 14px/1.2 var(--e-ui); cursor: pointer; white-space: nowrap;
}
.ecc-btn:hover { background: var(--e-sheet); }
.ecc-btn:focus-visible, .ecc-how summary:focus-visible { outline: 2px solid var(--e-ink); outline-offset: 2px; }
.ecc-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* "How these are counted": a small disclosure under the section line */
.ecc-how { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--e-muted); }
.ecc-how summary { display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; color: var(--e-muted); text-decoration: underline; text-underline-offset: 3px; }
.ecc-how p { margin: 4px 0 8px; max-width: 80ch; color: var(--e-ink); }

/* ── hairline table (no horizontal scroll: cells wrap; rows stack under 720px) ── */
.ecc-table-wrap { min-width: 0; }
.ecc-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; table-layout: auto; }
.ecc-table th, .ecc-table td { padding: 10px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--e-hair); color: var(--e-ink); min-width: 0; }
.ecc-table thead th {
  border-bottom-color: var(--e-rule); font: 600 11px/1.3 var(--e-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--e-muted);
  overflow-wrap: normal; word-break: normal; hyphens: manual;
}
.ecc-table tbody th { font: 600 14px/1.4 var(--e-ui); letter-spacing: normal; text-transform: none; color: var(--e-ink); }
.ecc-table td { font: 400 14px/1.4 var(--e-ui); letter-spacing: normal; text-transform: none; }
.ecc-table tbody tr:last-child > * { border-bottom: 0; }
.ecc-fig { display: block; font: 600 15px/1.3 var(--e-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ecc-cap { display: block; font-size: 12px; line-height: 1.4; color: var(--e-muted); }
.ecc-cap[title] { cursor: help; text-decoration: underline dotted; text-underline-offset: 2px; }
.ecc-line { display: block; }

/* status: a small dot and a word, never a pill */
.ecc-st { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 500; }
.ecc-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--e-muted); transform: translateY(-1px); }
.ecc-st--ok .ecc-dot { background: var(--e-ok); }
.ecc-st--warn .ecc-dot { background: var(--e-warn); }
.ecc-st--alert .ecc-dot { background: var(--e-alert); }
.ecc-fig + .ecc-st, .ecc-cap + .ecc-st { display: flex; margin-top: 2px; }

/* ── provider performance: one sheet per provider, a centred stat line, the 8-week strip, two short lines ── */
.ecc-group { display: grid; gap: 16px; min-width: 0; }
.ecc-group-h { display: grid; gap: 4px; justify-items: center; text-align: center; }
.ecc-group-h .ecc-how { text-align: left; }
.ecc-prov { display: grid; gap: 16px; }
.ecc-prov-h { display: grid; gap: 2px; justify-items: center; text-align: center; }
.ecc-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); min-width: 0;
  border-top: 1px solid var(--e-rule); border-bottom: 1px solid var(--e-rule);
}
.ecc-stat { display: grid; gap: 4px; justify-items: center; align-content: start; min-width: 0; padding: 16px 12px; text-align: center; box-shadow: -1px 0 0 var(--e-hair); }
.ecc-stat-n { font: 400 40px/1 var(--e-display); font-variant-numeric: tabular-nums; color: var(--e-ink); }
.ecc-stat-l { font: 600 12px/1.3 var(--e-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--e-ink); }
.ecc-stat-c { font-size: 12px; line-height: 1.4; color: var(--e-muted); }
.ecc-stat-k { font: 600 12px/1.4 var(--e-ui); color: var(--e-ink); }
.ecc-stat-k.ecc-muted, .ecc-stat-k.ecc-na { font-weight: 400; color: var(--e-muted); }
.ecc-phases { display: grid; gap: 2px; margin-top: 2px; }
.ecc-phase { font-size: 12px; line-height: 1.4; color: var(--e-muted); }
.ecc-phase--cur { font-weight: 600; color: var(--e-ink); }
.ecc-share { display: block; width: 100%; max-width: 140px; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--e-alert); overflow: hidden; }
.ecc-share-met { display: block; height: 100%; background: var(--e-ok); }
.ecc-run-block { display: grid; gap: 8px; justify-items: center; }
.ecc-run-t { margin: 0; font: 600 12px/1.3 var(--e-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--e-ink); }
.ecc-run { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 640px; }
.ecc-run-cell { display: grid; gap: 4px; justify-items: center; min-width: 0; }
.ecc-run-wk { display: block; width: 100%; height: 10px; border-radius: 4px; background: var(--e-hair); }
.ecc-run-d { font-size: 11px; line-height: 1.2; color: var(--e-muted); font-variant-numeric: tabular-nums; }
.ecc-run-wk--met { background: var(--e-ok); }
.ecc-run-wk--missed { background: var(--e-alert); }
.ecc-run-wk--off { background: var(--e-rule); }
.ecc-run-wk--current { background: transparent; box-shadow: inset 0 0 0 1px var(--e-muted); }
.ecc-run-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 0; font-size: 12px; color: var(--e-muted); }
.ecc-run-key > span { display: inline-flex; align-items: center; gap: 6px; }
.ecc-key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--e-hair); }
.ecc-key.ecc-run-wk--met { background: var(--e-ok); }
.ecc-key.ecc-run-wk--missed { background: var(--e-alert); }
.ecc-key.ecc-run-wk--off { background: var(--e-rule); }
.ecc-lines { display: grid; gap: 6px; margin: 0; max-width: 760px; width: 100%; justify-self: center; font-size: 14px; line-height: 1.5; }
.ecc-lines > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
.ecc-lines dt { font: 600 12px/1.6 var(--e-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--e-muted); }
.ecc-lines dd { margin: 0; color: var(--e-ink); }

/* the pay-period / week log: collapsed by default, a 44px row with a chevron; opens inline (the page scrolls, no inner box) */
.ecc-log { border-top: 1px solid var(--e-rule); }
.ecc-log summary {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; cursor: pointer; list-style: none;
  font: 600 12px/1.3 var(--e-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--e-ink);
}
.ecc-log summary::-webkit-details-marker { display: none; }
.ecc-log summary:focus-visible { outline: 2px solid var(--e-ink); outline-offset: 2px; border-radius: 8px; }
.ecc-chev { width: 8px; height: 8px; border-right: 1.5px solid var(--e-muted); border-bottom: 1.5px solid var(--e-muted); transform: translateY(-2px) rotate(45deg); transition: transform .18s ease; }
.ecc-log[open] .ecc-chev { transform: translateY(2px) rotate(-135deg); }
.ecc-log-b { display: grid; gap: 16px; padding: 4px 0 8px; }
.ecc-log-h { margin: 0 0 2px; font: 600 13px/1.4 var(--e-ui); color: var(--e-ink); }
/* a pay period met or missed on its total: the dates in the theme's own AA green / red, as text */
.ecc-log-d--met { color: var(--e-ok); }
.ecc-log-d--missed { color: var(--e-alert); }
.ecc-log-pp .ecc-table { font-size: 13px; table-layout: fixed; }
/* the same column widths in every pay period, so the weeks line up down the log */
/* (header cells only: the row's own first cell must stay free to stretch when rows stack under 720px) */
.ecc-log-pp .ecc-table thead th:nth-child(1) { width: 18%; }
.ecc-log-pp .ecc-table thead th:nth-child(2) { width: 34%; }
.ecc-log-pp .ecc-table thead th:nth-child(3), .ecc-log-pp .ecc-table thead th:nth-child(4), .ecc-log-pp .ecc-table thead th:nth-child(6) { width: 10%; }
.ecc-log-pp .ecc-table thead th:nth-child(5) { width: 18%; }

@media (max-width: 720px) {
  .ecc { padding: 16px 16px 48px; gap: 16px; }
  .ecc-sheet { padding: 16px; }
  .ecc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ecc-table, .ecc-table tbody, .ecc-table tr, .ecc-table th, .ecc-table td { display: block; width: 100%; }
  .ecc-table tr { padding: 10px 0; border-bottom: 1px solid var(--e-hair); }
  .ecc-table tbody tr:last-child { border-bottom: 0; }
  .ecc-table th, .ecc-table td { padding: 4px 0; border-bottom: 0; }
  .ecc-table td { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: 12px; }
  .ecc-table td::before { content: attr(data-label); font: 600 11px/1.6 var(--e-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--e-muted); }
  .ecc-table td > * { grid-column: 2; }
  .ecc-fig { white-space: normal; }
  .ecc-lines > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { .ecc * { transition: none !important; } }
