/**
 * SCH CIS — reusable page SHELL: identity card + module dock + quiet sub-nav +
 * panel primitives (buttons, light-band tables, readable pills, verdict bar,
 * coach preview rows). Translated 1:1 from docs/mockups/sch-fa-portal-redesign-v1.html
 * (the design contract). Scoped under .sch-shell so any CIS page can opt in and
 * inherit the dock/sub-nav without redefining them. Rendered by SCH_CIS_Chrome.
 *
 * INVARIANT: exactly ONE filled pill exists at a time — the active module tab
 * (.sch-mod[aria-selected="true"]). Sub-tabs (.sch-sub) are never filled.
 */
.sch-shell{
  --teal:#227F77; --teal-lt:#5dcaa5; --navy:#122B46; --yellow:#F1C40F;
  --ink:var(--l-ink,#122B46); --ink-60:var(--l-ink-60,rgba(18,43,70,.62)); --ink-40:var(--l-ink-40,rgba(18,43,70,.42)); --ink-25:var(--l-ink-25,rgba(18,43,70,.25));
  --sheet:#FFFFFF; --band:#EEF2F3; --hair:rgba(18,43,70,.10); --hair-2:rgba(18,43,70,.06);
  --shadow-card:0 1px 2px rgba(18,43,70,.04), 0 12px 32px -12px rgba(18,43,70,.16);
  --r:14px; --r-sm:10px;
  background:var(--sheet); border:1px solid var(--hair); border-radius:var(--r);
  box-shadow:var(--shadow-card); overflow:hidden;
  font-family:'Rajdhani',system-ui,sans-serif; color:var(--ink);
}
.sch-shell *{box-sizing:border-box}
.sch-shell::before{
  content:"";display:block;height:3px;
  background:linear-gradient(90deg,var(--teal) 0%,var(--teal-lt) 55%,var(--yellow) 100%);
}

/* Identity bar */
.sch-shell .sch-identity{display:flex;align-items:center;gap:16px;padding:20px 24px 18px}
.sch-shell .sch-id-chip{
  width:46px;height:46px;border-radius:12px;flex:none;display:grid;place-items:center;
  background:rgba(93,202,165,.14);border:1px solid rgba(34,127,119,.18);color:var(--teal);
}
.sch-shell .sch-id-chip svg{width:24px;height:24px}
.sch-shell .sch-id-text{min-width:0}
.sch-shell .sch-id-text h1{margin:0;font-size:23px;font-weight:700;letter-spacing:.005em;line-height:1.15;color:var(--ink)}
.sch-shell .sch-id-text p{margin:2px 0 0;font-size:14.5px;font-weight:500;color:var(--ink-60);letter-spacing:.05em;text-transform:uppercase}
.sch-shell .sch-id-right{margin-left:auto;display:flex;align-items:center;gap:12px}
.sch-shell .sch-user-chip{
  display:flex;align-items:center;gap:9px;padding:8px 15px 8px 12px;border-radius:999px;
  background:rgba(93,202,165,.10);border:1px solid rgba(34,127,119,.16);
  font-size:12.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--teal);white-space:nowrap}
.sch-shell .sch-user-chip .sch-dot{width:7px;height:7px;border-radius:50%;background:var(--teal-lt);flex:none}

/* Module dock — SIGNATURE ELEMENT (welded to the identity card, merges into the panel) */
.sch-shell .sch-dock{
  display:flex;gap:2px;padding:8px 14px 0;background:var(--navy);
  overflow-x:auto;scrollbar-width:none;
}
.sch-shell .sch-dock::-webkit-scrollbar{display:none}
.sch-shell .sch-mod{
  position:relative;flex:none;border:0;background:transparent;cursor:pointer;
  font-family:inherit;font-size:15px;font-weight:600;color:rgba(255,255,255,.66);
  padding:13px 20px 14px;display:flex;align-items:center;gap:9px;
  border-radius:10px 10px 0 0;transition:background .16s ease,color .16s ease;white-space:nowrap;
}
.sch-shell .sch-mod svg{width:18px;height:18px;opacity:.75}
.sch-shell .sch-mod:hover{background:rgba(255,255,255,.08);color:#fff}
.sch-shell .sch-mod[aria-selected="true"]{
  background:var(--sheet);color:var(--navy);font-weight:700;
}
/* v2.1: the ACTIVE tab carries NO teal — no top bar, no icon tint. White tab
   merging into the sheet, navy text, navy icon. */
.sch-shell .sch-mod[aria-selected="true"] svg{opacity:1;color:currentColor}
.sch-shell .sch-mod:focus-visible{outline:2px solid var(--teal-lt);outline-offset:-3px}

/* Panel head */
.sch-shell .sch-shpanel{padding:26px 28px 30px;background:var(--sheet)}
.sch-shell .sch-shpanel-head{display:flex;align-items:flex-start;gap:20px;flex-wrap:wrap}
.sch-shell .sch-shpanel-head h2{margin:0;font-size:30px;font-weight:700;letter-spacing:-.01em;line-height:1.05;color:var(--ink)}
.sch-shell .sch-shpanel-head p{margin:5px 0 0;font-size:15.5px;color:var(--ink-60);max-width:62ch;font-weight:500}
.sch-shell .sch-head-actions{margin-left:auto;display:flex;gap:10px;flex-wrap:wrap}

/* Quiet sub navigation — never a pill fill */
.sch-shell .sch-subnav{
  display:flex;gap:30px;margin:22px 0 0;border-bottom:1px solid var(--hair);
  overflow-x:auto;scrollbar-width:none;
}
.sch-shell .sch-subnav::-webkit-scrollbar{display:none}
.sch-shell .sch-sub{
  border:0;background:transparent;cursor:pointer;font-family:inherit;
  font-size:13px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;
  color:var(--ink-40);padding:2px 2px 14px;white-space:nowrap;
  border-bottom:3px solid transparent;margin-bottom:-1px;transition:color .15s ease,border-color .15s ease;
}
.sch-shell .sch-sub:hover{color:var(--ink)}
.sch-shell .sch-sub[aria-selected="true"]{color:var(--navy);border-bottom-color:var(--teal)}
.sch-shell .sch-sub:focus-visible{outline:2px solid var(--teal);outline-offset:3px}

/* Buttons */
.sch-shell .sch-sbtn{
  font-family:inherit;font-size:14px;font-weight:600;letter-spacing:.02em;border-radius:9px;
  padding:10px 18px;cursor:pointer;display:inline-flex;align-items:center;gap:8px;
  transition:transform .12s ease,box-shadow .12s ease,background .15s ease;border:1px solid transparent;text-decoration:none;
}
.sch-shell .sch-sbtn:active{transform:translateY(1px)}
.sch-shell .sch-sbtn svg{width:17px;height:17px}
.sch-shell .sch-sbtn-primary{background:var(--teal);color:#fff;box-shadow:0 6px 16px -8px rgba(34,127,119,.9)}
.sch-shell .sch-sbtn-primary:hover{background:#1c6e67}
.sch-shell .sch-sbtn-ghost{background:#fff;color:var(--navy);border-color:var(--ink-25)}
.sch-shell .sch-sbtn-ghost:hover{border-color:var(--teal);color:var(--teal)}
.sch-shell .sch-sbtn-quiet{background:transparent;color:var(--ink-60);border-color:transparent;padding:8px 10px}
.sch-shell .sch-sbtn-quiet:hover{color:var(--teal)}
.sch-shell .sch-sbtn:focus-visible{outline:2px solid var(--navy);outline-offset:2px}
.sch-shell .sch-sbtn[disabled]{opacity:.55;cursor:default}

/* Tables — DESIGN CONTRACT v2: navy header band (shared --l-thead tokens), hairline row borders, last column right-aligned. */
.sch-shell table.sch-t{width:100%;border-collapse:collapse}
.sch-shell table.sch-t thead th{
  background:var(--l-thead-bg,#122B46);font-size:11px;font-weight:700;letter-spacing:.13em;text-transform:uppercase;
  color:var(--l-thead-ink,rgba(255,255,255,.92));text-align:left;padding:12px 16px;
  border-top:1px solid var(--l-thead-line,rgba(255,255,255,.16));border-bottom:1px solid var(--l-thead-line,rgba(255,255,255,.16));
}
.sch-shell table.sch-t thead th:first-child{border-radius:8px 0 0 0}
.sch-shell table.sch-t thead th:last-child{border-radius:0 8px 0 0;text-align:right}
.sch-shell table.sch-t tbody td:last-child{text-align:right}
.sch-shell table.sch-t tbody td{padding:13px 14px;border-bottom:1px solid var(--hair-2);font-size:15px;font-weight:600;color:var(--ink)}
.sch-shell table.sch-t tbody tr:last-child td{border-bottom:0}
.sch-shell table.sch-t .sch-num{font-variant-numeric:tabular-nums}
.sch-shell .sch-date{font-weight:500;color:var(--ink-60);font-variant-numeric:tabular-nums}
.sch-shell .sch-dash{color:var(--ink-25)}
.sch-shell .sch-note{font-weight:500;color:var(--ink-60)}

/* Readable match/status pill — light teal tint, dark teal text, ✓ glyph (never solid-teal-black) */
.sch-shell .sch-pill{
  display:inline-flex;align-items:center;gap:6px;background:rgba(93,202,165,.16);
  border:1px solid rgba(34,127,119,.28);color:#12665F;
  font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;padding:5px 10px;border-radius:999px;
}
.sch-shell .sch-pill svg{width:13px;height:13px}
.sch-shell .sch-pill--muted{background:var(--band);border-color:var(--hair);color:var(--ink-40)}
.sch-shell .sch-pill--warn{background:rgba(192,57,43,.10);border-color:rgba(192,57,43,.28);color:#9b2d22}

/* ── IMPORT PANEL ── */
.sch-shell .sch-tools{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:24px}
@media(max-width:860px){.sch-shell .sch-tools{grid-template-columns:1fr}}
.sch-shell .sch-tool{border:1px solid var(--hair);border-radius:var(--r-sm);padding:20px 20px 18px;background:#FCFDFD;display:flex;flex-direction:column}
.sch-shell .sch-tool .sch-eyebrow{font-size:11.5px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:var(--teal);margin:0 0 6px}
.sch-shell .sch-tool h3{margin:0;font-size:19px;font-weight:700;color:var(--ink)}
.sch-shell .sch-tool p{margin:6px 0 16px;font-size:14.5px;color:var(--ink-60);font-weight:500}
.sch-shell .sch-tool .sch-tool-row{margin-top:auto;display:flex;gap:10px;align-items:center;flex-wrap:wrap}

/* Verdict bar */
.sch-shell .sch-verdict{margin-top:26px;display:flex;align-items:center;gap:0;flex-wrap:wrap;border:1px solid var(--hair);border-radius:var(--r-sm);background:#fff;overflow:hidden}
.sch-shell .sch-v-stat{padding:16px 24px;border-right:1px solid var(--hair-2);min-width:132px}
.sch-shell .sch-v-stat .n{font-size:30px;font-weight:700;line-height:1;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.sch-shell .sch-v-stat .l{font-size:11.5px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-40);margin-top:5px}
.sch-shell .sch-v-stat.create .n{background:linear-gradient(92deg,var(--teal),var(--teal-lt));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.sch-shell .sch-v-stat.zero .n{color:var(--ink-25)}
.sch-shell .sch-v-note{padding:16px 24px;font-size:14px;font-weight:600;color:var(--ink-60);display:flex;align-items:center;gap:9px}
.sch-shell .sch-v-note svg{width:17px;height:17px;color:var(--teal)}
.sch-shell .sch-v-cta{margin-left:auto;padding:14px 18px}

/* Coach preview row */
.sch-shell .sch-tool-rows{margin-top:20px;display:flex;flex-direction:column;gap:12px}
.sch-shell .sch-coachrow{border:1px solid var(--hair);border-radius:var(--r-sm);background:#fff;overflow:hidden}
.sch-shell .sch-coachrow.is-create{border-color:rgba(34,127,119,.30);box-shadow:0 10px 26px -18px rgba(34,127,119,.55)}
.sch-shell .sch-coachrow.is-create .sch-c-head{background:linear-gradient(180deg,rgba(93,202,165,.09),rgba(93,202,165,0))}
.sch-shell .sch-c-head{display:flex;align-items:center;gap:14px;padding:16px 18px;flex-wrap:wrap}
.sch-shell .sch-status{font-size:11px;font-weight:700;letter-spacing:.13em;text-transform:uppercase;padding:6px 11px;border-radius:6px;flex:none}
.sch-shell .sch-status.create{background:var(--teal);color:#fff}
.sch-shell .sch-status.skip{background:#fff;color:var(--ink-40);border:1px solid var(--ink-25)}
.sch-shell .sch-status.error{background:#9b2d22;color:#fff}
.sch-shell .sch-c-name{font-size:21px;font-weight:700;letter-spacing:-.005em;line-height:1.1;color:var(--ink)}
.sch-shell .sch-c-id{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;font-weight:500;letter-spacing:.04em;color:var(--ink-60);background:var(--band);border:1px solid var(--hair-2);border-radius:6px;padding:4px 9px}
.sch-shell .sch-c-reason{margin-left:auto;font-size:13.5px;font-weight:600;color:var(--ink-40);display:flex;align-items:center;gap:7px;text-align:right}
.sch-shell .sch-c-meta{display:flex;gap:26px;flex-wrap:wrap;padding:0 18px 14px 18px;font-size:14px;font-weight:500;color:var(--ink-60)}
.sch-shell .sch-c-meta b{font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
.sch-shell .sch-licwrap{padding:0 18px 18px}
.sch-shell .sch-lic-cap{font-size:11.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-40);margin:0 0 8px}
.sch-shell .sch-credits{font-size:16px;font-weight:700;font-variant-numeric:tabular-nums}
.sch-shell .sch-c-errs{margin:0 18px 14px;padding-left:18px;color:#9b2d22;font-size:13.5px;font-weight:600}

/* Skipped group — collapsed by default */
.sch-shell .sch-skipped{border:1px dashed var(--ink-25);border-radius:var(--r-sm);background:#FAFBFB}
.sch-shell .sch-sk-head{width:100%;display:flex;align-items:center;gap:12px;padding:15px 18px;background:transparent;border:0;cursor:pointer;font-family:inherit;font-size:15px;font-weight:600;color:var(--ink-60);text-align:left}
.sch-shell .sch-sk-head:hover{color:var(--ink)}
.sch-shell .sch-sk-head .sch-chev{margin-left:auto;transition:transform .2s ease}
.sch-shell .sch-sk-head[aria-expanded="true"] .sch-chev{transform:rotate(180deg)}
.sch-shell .sch-sk-head svg{width:18px;height:18px;flex:none}
.sch-shell .sch-sk-body{display:none;padding:0 12px 12px}
.sch-shell .sch-sk-body.open{display:flex;flex-direction:column;gap:10px}
.sch-shell .sch-skipped .sch-coachrow{background:#fff}

.sch-shell .sch-placeholder{margin-top:26px;padding:56px 24px;text-align:center;border:1px dashed var(--ink-25);border-radius:var(--r-sm);color:var(--ink-40);font-size:15px;font-weight:600}
.sch-shell .sch-backlink{display:inline-flex;align-items:center;gap:7px;font-size:14px;font-weight:600;color:var(--teal);text-decoration:none;margin-bottom:14px}
.sch-shell .sch-backlink:hover{text-decoration:underline}

@media (prefers-reduced-motion:reduce){.sch-shell *{transition:none!important;animation:none!important}}
@media (max-width:560px){
  .sch-shell .sch-identity{flex-wrap:wrap}
  .sch-shell .sch-id-right{margin-left:0;width:100%}
  .sch-shell .sch-shpanel{padding:20px 16px 24px}
}

/* v2 RULE — 26px between the subnav divider and the first content element of EVERY
   sub-tab, and 26px between sibling content blocks. ONE shared rule (owl selector),
   never per-panel margins. */
.sch-shell .sch-shpanel-body{margin-top:26px}
.sch-shell .sch-shpanel-body>*+*{margin-top:26px}

/* v2 — coach-detail licence cards: the licence NAME clearly dominates the chip row. */
.sch-shell .sch-fap-lic__head>strong{font-size:20px;font-weight:700;color:var(--navy);line-height:1.15}

/* ── Toast stack (shared notification primitive; used by every CIS page) ── */
.sch-toast-stack{position:fixed;right:18px;bottom:18px;z-index:99999;display:flex;flex-direction:column;gap:10px;max-width:360px}
.sch-toast{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:10px;color:#fff;
  font-family:'Rajdhani',system-ui,sans-serif;font-size:14.5px;font-weight:600;line-height:1.35;
  box-shadow:0 10px 30px -10px rgba(18,43,70,.5);animation:schToastIn .18s ease}
.sch-toast--success{background:#227F77}
.sch-toast--error{background:#9b2d22}
.sch-toast--info{background:#122B46}
.sch-toast__close{margin-left:auto;flex:none;background:none;border:0;color:rgba(255,255,255,.75);cursor:pointer;font-size:16px;line-height:1;padding:0 0 0 6px}
.sch-toast__close:hover{color:#fff}
@keyframes schToastIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.sch-toast{animation:none}}

/* Pending button state (shared): inline spinner + dimmed label. */
.sch-btn-pending{position:relative;opacity:.75;pointer-events:none}
.sch-spin{display:inline-block;width:13px;height:13px;border:2px solid rgba(255,255,255,.4);border-top-color:currentColor;border-radius:50%;
  vertical-align:-2px;margin-right:6px;animation:schSpin .7s linear infinite}
@keyframes schSpin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.sch-spin{animation-duration:1.6s}}

/* Quiet-danger variant (destructive inline actions, e.g. Undo import). */
.sch-shell .sch-sbtn-danger{color:#9b2d22}
.sch-shell .sch-sbtn-danger:hover{color:#7f1d1d}
/* Native file input pattern: visually-hidden input + styled label + filename echo. */
.sch-shell .sch-file-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;border:0;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap}
.sch-shell .sch-file-name{font-size:13.5px;font-weight:500;color:var(--ink-60);max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Disclosure toggles inside the shell (details/summary) — portal styling, no theme link blue. */
.sch-shell details>summary{cursor:pointer;font-weight:600;color:var(--ink);font-size:13px}
.sch-shell details>summary:hover{color:var(--teal)}
