/* TrainerDesk · interface styles. Fonts: Inter (SIL OFL 1.1), self-hosted. */
@font-face { font-family: 'Inter'; src: url('fonts/Inter-400.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-500.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-600.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-700.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --brand: #3156e0;
  --brand-ink: color-mix(in srgb, var(--brand) 82%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 9%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 26%, #fff);
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #8a94a6;
  --line: #e7e9ee;
  --line-2: #eef0f3;
  --ok: #14804a;    --ok-soft: #e8f6ee;
  --warn: #b25e09;  --warn-soft: #fdf3e5;
  --bad: #c0362c;   --bad-soft: #fdeceb;
  --info: #2459c9;  --info-soft: #ebf1fd;
  --muted-soft: #f0f2f5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .08);
  --sidebar: 248px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--font); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Shell -------------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; }
.side-head { padding: 18px 18px 14px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.logo-img { height: 30px; width: auto; display: block; }
.tenant { margin: 14px 0 0; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.tenant-badge { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.tenant-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.tenant-sub { font-size: 11.5px; color: var(--ink-3); }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 14px 8px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; margin-bottom: 1px; }
.nav a:hover { background: var(--muted-soft); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.nav a.on svg { color: var(--brand); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 600; background: var(--bad-soft); color: var(--bad); border-radius: 20px; padding: 0 7px; line-height: 19px; }
.nav .count.n { background: var(--muted-soft); color: var(--ink-2); }
.side-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; }
.side-foot a:hover { color: var(--ink-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(245, 246, 248, .86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.top .menu-btn { display: none; }
.search-btn { flex: 1; max-width: 440px; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; color: var(--ink-3); text-align: left; }
.search-btn:hover { border-color: #d5d9e0; }
.search-btn kbd { margin-left: auto; font: 500 11px var(--font); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--ink-3); background: var(--surface-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.viewas { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 4px 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; color: var(--ink-3); }
.viewas select { border: 0; background: transparent; font-weight: 600; color: var(--ink); padding: 0 6px; height: 34px; outline: none; cursor: pointer; }
.today-pill { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

.page { padding: 8px 28px 56px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 14px 0 22px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a:hover { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- Buttons & inputs --------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); border-color: #d5d9e0; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--muted-soft); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #f5c6c1; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { color: var(--brand); font-weight: 600; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }
a.row-link { font-weight: 600; color: var(--ink); }
a.row-link:hover { color: var(--brand); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s; }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.sm, .select.sm { height: 32px; font-size: 13px; border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.hint { font-size: 12px; color: var(--ink-3); }
.warnbox { display: flex; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--warn-soft); color: #7a3f05; font-size: 13px; }
.warnbox svg { color: var(--warn); margin-top: 1px; }
.infobox { display: flex; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--info-soft); color: #1d3f86; font-size: 13px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { max-width: 280px; }
.toolbar .select { width: auto; min-width: 150px; }
.search-input { position: relative; flex: 1; max-width: 320px; min-width: 200px; }
.search-input svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-input .input { padding-left: 34px; max-width: none; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; display: inline-flex; background: var(--muted-soft); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { flex: none; border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button .n { font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* ---- Cards, tables, chips ----------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 650; }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.card-body { padding: 4px 18px 18px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack > * + * { margin-top: 18px; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.t th:first-child { border-top-left-radius: var(--radius); }
.t th:last-child { border-top-right-radius: var(--radius); }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--surface-2); }
.t tr.dim td { color: var(--ink-3); }
.t .r { text-align: right; }
.t .c { text-align: center; }
.t td.tight, .t th.tight { width: 1%; white-space: nowrap; }
.t input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); vertical-align: middle; }
.empty { padding: 38px 18px; text-align: center; color: var(--ink-3); }
.empty svg { width: 28px; height: 28px; color: #c4cad4; margin-bottom: 8px; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--muted-soft); color: var(--ink-2); }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.plain::before { display: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--muted-soft); color: var(--ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: 12px; background: var(--muted-soft); color: var(--ink-2); flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.sq { border-radius: 10px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .nm { font-weight: 600; }
.who .sb { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bar { height: 6px; background: var(--line-2); border-radius: 6px; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: #e59a3a; }
.fillcell { display: flex; align-items: center; gap: 10px; }
.fillcell .bar { flex: 1; max-width: 90px; }

/* ---- KPIs & insights ---------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.kpis.four { grid-template-columns: repeat(4, 1fr); }
.kpi { padding: 16px 18px; }
.kpi .k-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi .k-label svg { color: var(--ink-3); }
.kpi .k-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
a.kpi:hover { border-color: #d5d9e0; }

.insights { list-style: none; margin: 0; padding: 0; }
.insight { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.insight:first-child { border-top: 0; }
.insight .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.insight .ic.bad { background: var(--bad-soft); color: var(--bad); }
.insight .ic.warn { background: var(--warn-soft); color: var(--warn); }
.insight .ic.info { background: var(--info-soft); color: var(--info); }
.insight .ic.ok { background: var(--ok-soft); color: var(--ok); }
.insight .tt { font-weight: 600; }
.insight .ds { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }

/* ---- Calendar ----------------------------------------------------------------------------- */
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-head h3 { font-size: 15px; font-weight: 650; min-width: 150px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal .dow { font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em; }
.cal .day { min-height: 112px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { background: var(--surface-2); }
.cal .day.out .dn { color: #c4cad4; }
.cal .day.wkend { background: #fbfbfc; }
.cal .dn { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 2px 4px; display: flex; justify-content: space-between; }
.cal .day.today .dn span { background: var(--brand); color: #fff; border-radius: 6px; padding: 0 6px; }
.ev { display: flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 1.25; padding: 3px 6px; border-radius: 6px; background: var(--c-soft, var(--brand-soft)); color: var(--c-ink, var(--brand-ink)); border-left: 3px solid var(--c, var(--brand)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-weight: 500; }
.ev:hover { filter: brightness(.97); }
.ev.cancel { text-decoration: line-through; opacity: .55; }
.ev .tm { font-weight: 600; opacity: .8; }
.ev-more { font-size: 11px; color: var(--ink-3); padding: 0 6px; cursor: pointer; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { border-top: 1px solid var(--line-2); }
.agenda li:first-child { border-top: 0; }
.agenda a { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 11px 18px; }
.agenda a:hover { background: var(--surface-2); }
.datebox { width: 52px; text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 4px 0; line-height: 1.15; background: var(--surface); }
.datebox .m { font-size: 10.5px; font-weight: 700; color: var(--bad); text-transform: uppercase; letter-spacing: .05em; }
.datebox .d { font-size: 18px; font-weight: 700; }
.datebox .w { font-size: 10.5px; color: var(--ink-3); }

/* ---- Detail pages ------------------------------------------------------------------------- */
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 9px 12px; font-size: 13.5px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.hero { display: flex; gap: 16px; align-items: center; }
.hero h1 { font-size: 24px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.meta-row svg { color: var(--ink-3); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .n { font-size: 11.5px; background: var(--muted-soft); color: var(--ink-2); border-radius: 10px; padding: 0 6px; }

.notes { list-style: none; margin: 0; padding: 0; }
.note { padding: 12px 0; border-top: 1px solid var(--line-2); }
.note:first-child { border-top: 0; padding-top: 0; }
.note .nh { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.note .nh b { color: var(--ink); font-weight: 600; }
.note p { white-space: pre-wrap; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #c9cfd8; }
.timeline li::after { content: ''; position: absolute; left: 7px; top: 17px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .tm { font-size: 11.5px; color: var(--ink-3); }

.att { display: inline-flex; gap: 4px; }
.att button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink-3); font-size: 11px; font-weight: 700; }
.att button.present { background: var(--ok-soft); border-color: #b5e2c8; color: var(--ok); }
.att button.absent { background: var(--bad-soft); border-color: #f5c6c1; color: var(--bad); }
.mini-select { height: 28px; border: 1px solid var(--line); border-radius: 7px; padding: 0 24px 0 8px; font-size: 12.5px; font-weight: 600; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; cursor: pointer; }
.mini-select.ok { background-color: var(--ok-soft); color: var(--ok); border-color: #b5e2c8; }
.mini-select.warn { background-color: var(--warn-soft); color: var(--warn); border-color: #f2d3a6; }
.mini-select.bad { background-color: var(--bad-soft); color: var(--bad); border-color: #f5c6c1; }
.mini-select.info { background-color: var(--info-soft); color: var(--info); border-color: #c3d4f6; }

.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 10px; margin-bottom: 12px; font-size: 13px; flex-wrap: wrap; }
.bulkbar .btn { height: 30px; font-size: 12.5px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); color: #fff; }
.bulkbar .btn:hover { background: rgba(255, 255, 255, .18); }

/* Compliance matrix */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix th:first-child { background: var(--surface-2); z-index: 2; }
.mx { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 74px; height: 38px; border-radius: 8px; font-size: 11px; font-weight: 600; line-height: 1.2; }
.mx.valid { background: var(--ok-soft); color: var(--ok); }
.mx.expiring { background: var(--warn-soft); color: var(--warn); }
.mx.expired { background: var(--bad-soft); color: var(--bad); }
.mx.no_expiry { background: var(--info-soft); color: var(--info); }
.mx.none { background: transparent; color: #c4cad4; border: 1px dashed var(--line); }
.mx small { font-weight: 500; opacity: .85; }

/* ---- Modals, drawer, toasts, command palette ---------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .38); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; animation: fade .14s ease-out; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .16s ease-out; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 12px 20px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; align-items: center; gap: 10px; animation: pop .18s ease-out; max-width: 380px; }
.toast svg { color: #6ee7a8; }

.palette { max-width: 620px; }
.palette .p-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.palette .p-input input { flex: 1; border: 0; outline: none; font-size: 16px; }
.palette .p-results { max-height: 56vh; overflow-y: auto; padding: 6px; }
.palette .p-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 10px 12px 4px; }
.palette .p-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.palette .p-item.on, .palette .p-item:hover { background: var(--brand-soft); }
.palette .p-item .sb { font-size: 12.5px; color: var(--ink-3); }

.picker-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.picker-list .pi { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line-2); }
.picker-list .pi:first-child { border-top: 0; }
.picker-list .pi:hover { background: var(--surface-2); }

/* ---- Extensions --------------------------------------------------------------------------- */
.ext-hero { padding: 26px 28px; background: linear-gradient(135deg, var(--brand-soft), #fff 70%); border: 1px solid var(--brand-line); border-radius: 16px; margin-bottom: 20px; }
.ext-hero h2 { font-size: 20px; margin-bottom: 6px; }
.ext-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ext { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.ext .ei { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.ext h3 { font-size: 15px; }
.ext p { color: var(--ink-2); font-size: 13.5px; flex: 1; }

/* ---- Verify page -------------------------------------------------------------------------- */
.verify-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), transparent), var(--bg); }
.verify-card { width: 100%; max-width: 520px; padding: 28px; }
.verify-result { margin-top: 18px; padding: 18px; border-radius: 12px; }
.verify-result.ok { background: var(--ok-soft); }
.verify-result.bad { background: var(--bad-soft); }

/* ---- Trainer portal ----------------------------------------------------------------------- */
.tp-hello { margin: 14px 0 20px; }
.tp-hello h1 { font-size: 24px; font-weight: 700; }
.tp-today { padding: 20px; background: var(--ink); color: #fff; border-radius: 16px; margin-bottom: 20px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tp-today .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .65; font-weight: 600; }
.tp-today h2 { font-size: 20px; margin: 4px 0; }
.tp-today .btn.primary { background: #fff; color: var(--ink); border-color: #fff; }
.tp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tp-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tp-card:hover { border-color: #d5d9e0; }
.tp-person { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line-2); align-items: center; }
.tp-person:first-child { border-top: 0; }
.tp-person .hist { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.tp-person .req { font-size: 12.5px; color: var(--warn); margin-top: 3px; display: flex; gap: 6px; align-items: flex-start; }
.tp-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.att.big button { width: 40px; height: 36px; font-size: 12px; border-radius: 9px; }

/* ---- Responsive --------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpis.four { grid-template-columns: repeat(2, 1fr); }
  .cols-main { grid-template-columns: 1fr; }
  .ext-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease, visibility .2s; visibility: hidden; }
  .shell.nav-open .side { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .shell.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(16, 24, 40, .3); z-index: 35; }
  .top .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; }
  .page { padding: 4px 16px 48px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .today-pill { display: none; }
  .cal .day { min-height: 76px; padding: 4px; }
  .cal .ev .tm, .cal .ev .lbl { display: none; }
  .cal .ev { padding: 0; height: 6px; border-left: 0; background: var(--c); }
}
@media (max-width: 640px) {
  .kpis, .kpis.four { grid-template-columns: 1fr 1fr; }
  .kpi .k-value { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .ext-grid { grid-template-columns: 1fr; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { flex: 0 0 38px; padding: 0; justify-content: center; }
  .viewas > span { display: none; }
  .page-head h1 { font-size: 21px; }
  .dl { grid-template-columns: 110px 1fr; }
  .insight { grid-template-columns: 34px 1fr; }
  .insight > :last-child { grid-column: 2; justify-self: start; }
  .tp-person { grid-template-columns: 1fr; }
  .tp-controls { justify-content: flex-start; }
  .toolbar .select { min-width: 0; flex: 1; }
  .search-input { max-width: none; }
}
@media print {
  .side, .top, .actions, .toolbar, .btn { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; }
}
.verify-card input::placeholder { text-transform: none; }

/* ---- Product tour -------------------------------------------------------------------------- */
.tour-layer { position: fixed; inset: 0; z-index: 300; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 0 9999px rgba(10, 18, 34, .58); transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; pointer-events: none; }
.tour-card { position: fixed; width: 380px; max-width: calc(100vw - 24px); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(16, 24, 40, .06); padding: 18px 20px 16px; transition: top .25s ease, left .25s ease, opacity .15s; }
.tour-card.tour-loading { opacity: 0; }
.tour-card h3 { font-size: 17px; font-weight: 700; margin: 8px 0 6px; letter-spacing: -.01em; }
.tour-card p { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.tour-step { font-size: 12px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.tour-bar { height: 4px; border-radius: 4px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.tour-bar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width .25s ease; }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.tour-skip { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.tour-card.tour-center { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 480px; padding: 28px; text-align: left; }
.tour-layer.dim { background: rgba(10, 18, 34, .58); animation: fade .2s ease-out; }
.tour-center h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 18px 0 8px; }
.tour-center p + p { margin-top: 10px; }
.tour-center .tour-actions { margin-top: 22px; justify-content: flex-end; }
.tour-logo { height: 34px; width: auto; display: block; }
.tour-muted { color: var(--ink-3) !important; font-size: 13px !important; }
.tour-card.tour-dock { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; }
.tour-btn span { margin-left: 2px; }
@media (max-width: 640px) {
  .tour-btn span { display: none; }
  .tour-btn { width: 34px; padding: 0; }
  .tour-card.tour-center { width: calc(100vw - 32px); padding: 22px; }
}
