/* Fratz WFM — tool pages (forecast, shifts, free checks, attrition, ramp, roster). Loaded after base.css + wfm.css. */

.tool-page {
  --c-a: #00909a;      /* primary series (required / forecast) */
  --c-b: #c8651a;      /* secondary series (scheduled / actual) */
  --c-c: #6b5bb5;      /* third series */
  --c-grid: color-mix(in srgb, var(--line) 80%, transparent);
}
@media (prefers-color-scheme: dark) { .tool-page { --c-a: #2ea396; --c-b: #d27b2c; --c-c: #9d8fe0; } }

/* ---------- hero ---------- */
.tool-hero { padding: 36px 0 22px; position: relative; overflow: hidden; }
.tool-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(640px 280px at 92% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
              radial-gradient(640px 300px at 6% 0%, color-mix(in srgb, var(--mark-a) 14%, transparent), transparent 70%);
}
.tool-hero .wrap { position: relative; }
.tool-hero .eyebrow { margin-bottom: 10px; }
.tool-hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.tool-hero .lede { margin-top: 12px; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-chip.on { border-color: var(--accent); color: var(--accent-ink); }
.status-chip.on .status-dot { background: var(--accent); }
.tier-tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-2); vertical-align: 2px; }
.tier-tag.is-all { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tier-tag.is-free { background: transparent; }

/* ---------- layout ---------- */
.tool-grid { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; padding-bottom: 64px; }
@media (min-width: 1000px) { .tool-grid { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 28px; } }
.tool-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.tool-form { padding: 22px; display: grid; gap: 22px; min-width: 0; }
.tool-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 14px; }
.tool-form fieldset:disabled { opacity: .62; }
.tool-form .step + .step, .tool-form .step + fieldset, .tool-form fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 20px; }
.step { display: grid; gap: 14px; min-width: 0; }
.step-title { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.step-num { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand); color: var(--brand-ink); font: 600 .8rem/1 var(--font-num); flex: none; }
@media (prefers-color-scheme: dark) { .step-num { background: var(--mark-a); color: #0b1a1d; } }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.field-row label { line-height: 1.25; }
.field-row .field label { font-size: .86rem; min-height: 2.4em; display: flex; align-items: flex-end; }
input[type="text"], input[type="time"], input[type="date"], input[type="search"] {
  width: 100%; min-width: 0; height: 46px; padding: 10px 12px;
  font: 500 1rem/1.2 var(--font-num); color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
}
input[type="text"] { font-family: var(--font-body); }
textarea {
  width: 100%; min-width: 0; resize: vertical; min-height: 110px;
  font: 500 .92rem/1.45 var(--font-num); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px;
}
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
@media (prefers-color-scheme: dark) { .check input { accent-color: var(--mark-a); } }
.btn-sm { min-height: 38px; padding: 8px 13px; font-size: .88rem; }
.btn-xs { min-height: 32px; padding: 6px 10px; font-size: .82rem; border-radius: 8px; }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost:disabled:hover { background: transparent; border-color: var(--line-strong); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.note { font-size: .88rem; color: var(--ink-2); line-height: 1.45; }
.note:empty { display: none; }
.note.is-bad { color: var(--warn); font-weight: 600; }
.note.is-good { color: var(--good); font-weight: 600; }
.lock-note { font-size: .88rem; color: var(--ink-2); background: var(--highlight); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 8px; }

/* ---------- gate (lock panel) ---------- */
.unlock-panel { padding: 22px; display: grid; gap: 20px; border: 2px solid var(--accent); }
@media (min-width: 760px) { .unlock-panel { grid-template-columns: 1.15fr 1fr; gap: 28px; padding: 24px 26px; } }
.unlock-copy .kicker { color: var(--accent-ink); }
.unlock-copy h2 { font-size: 1.3rem; margin: 6px 0 10px; }
.unlock-copy p:last-child { color: var(--ink-2); font-size: .95rem; }
.unlock-form { display: grid; gap: 10px; align-content: start; }
.unlock-msg { font-size: .85rem; color: var(--good); font-weight: 600; }
.unlock-msg:empty { display: none; }
.unlock-msg.is-bad { color: var(--warn); }
.unlock-form .fineprint { text-align: left; margin-top: 0; }

/* ---------- results ---------- */
.result-panel { padding: 22px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.result-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.result-head h2 { font-size: 1.3rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.kpi-label { font-size: .78rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { font: 600 1.45rem/1.2 var(--font-num); color: var(--ink); margin-top: 4px; overflow-wrap: anywhere; }
.kpi-sub { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.kpi.is-main { background: var(--brand); border-color: var(--brand); }
.kpi.is-main .kpi-label, .kpi.is-main .kpi-sub { color: var(--brand-muted); }
.kpi.is-main .kpi-value { color: var(--brand-ink); }
.plain { background: var(--highlight); border-radius: 12px; padding: 14px 16px; color: var(--ink); font-size: .95rem; line-height: 1.5; }
.plain strong { font-weight: 600; }
.explain { font-size: .92rem; color: var(--ink-2); line-height: 1.55; }
.explain summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.explain ol, .explain ul { margin: 10px 0 0 20px; display: grid; gap: 6px; }
.label-rule { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; border: 1px dashed var(--line-strong); color: var(--ink-2); }

/* ---------- chart ---------- */
.chart-box { min-width: 0; }
.chart-box svg { width: 100%; height: auto; display: block; }
.ch-grid line { stroke: var(--c-grid); stroke-width: 1; }
.ch-tick { font: 500 11px var(--font-num); fill: var(--muted); }
.ch-axis { stroke: var(--line-strong); stroke-width: 1; }
.ch-line { stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { opacity: .16; stroke: none; }
.ch-series rect { stroke: none; }
.s-a.ch-line { stroke: var(--c-a); } .s-a.ch-area, .s-a rect { fill: var(--c-a); }
.s-b.ch-line { stroke: var(--c-b); } .s-b.ch-area, .s-b rect { fill: var(--c-b); }
.s-c.ch-line { stroke: var(--c-c); stroke-dasharray: 5 4; } .s-c rect { fill: var(--c-c); }
.s-ink.ch-line { stroke: var(--ink-2); stroke-dasharray: 5 4; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--ink-2); margin: 0; padding: 0; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; flex: none; }
.sw-bar { width: 12px; height: 12px; border-radius: 3px; }
.sw-line { width: 18px; height: 3px; border-radius: 2px; }
.sw.s-a { background: var(--c-a); } .sw.s-b { background: var(--c-b); } .sw.s-c { background: var(--c-c); } .sw.s-ink { background: var(--ink-2); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.table-scroll.tall { max-height: 460px; overflow-y: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th, .data-table td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.data-table thead th { position: sticky; top: 0; background: var(--surface-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); z-index: 1; }
.data-table tbody th { text-align: left; font-weight: 600; font-family: var(--font-num); }
.data-table td { font-family: var(--font-num); }
.data-table tr:last-child > * { border-bottom: 0; }
.data-table .is-short { color: var(--warn); font-weight: 700; }
.data-table.text-left td, .data-table.text-left th { text-align: left; }

/* ---------- burnout band ---------- */
.band { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 4px 12px; border-radius: 999px; border: 1.5px solid currentColor; }
.band-low { color: var(--good); }
.band-moderate { color: var(--brand-2); }
.band-high { color: var(--accent-ink); }
.band-very-high { color: var(--warn); background: var(--warn-bg); }
@media (prefers-color-scheme: dark) { .band-moderate { color: var(--mark-a); } .band-high { color: var(--accent); } }

/* ---------- cap lock (shift list) ---------- */
.cap-lock { border: 2px dashed var(--accent); border-radius: 12px; padding: 16px 18px; background: var(--highlight); display: grid; gap: 10px; }
.cap-lock h3 { font-size: 1.1rem; }

/* ---------- shift list ---------- */
.shift-bars { display: grid; gap: 3px; }
.shift-bar { position: relative; height: 18px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.shift-bar .seg { position: absolute; top: 0; bottom: 0; background: var(--c-a); border-radius: 3px; }
.shift-bar .seg.pt { background: var(--c-c); }
.shift-bar .brk { position: absolute; top: 3px; bottom: 3px; background: var(--surface); border-radius: 2px; }
.shift-bar .brk.lunch { background: var(--bg-2); }

/* ---------- free checks page ---------- */
.tool-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); padding-bottom: 12px; }
.tool-card { padding: 18px; display: grid; gap: 8px; align-content: start; text-decoration: none; color: inherit; transition: border-color .15s; }
.tool-card:hover { border-color: var(--brand-2); }
.tool-card h3 { font-size: 1.08rem; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool-card p { font-size: .9rem; color: var(--ink-2); }
.section-title { font-size: 1.5rem; margin: 8px 0 14px; }
.calc-section { padding-bottom: 36px; scroll-margin-top: 90px; }

/* ---------- roster ---------- */
.agent-list { display: grid; gap: 10px; }
.agent-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; background: var(--surface); }
.agent-card .agent-top { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 8px; align-items: end; }
.avail-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.avail-grid label { display: grid; justify-items: center; gap: 2px; font-size: .74rem; color: var(--ink-2); }
.avail-grid input { width: 18px; height: 18px; accent-color: var(--brand); }
.agent-card .small-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agent-card input { height: 40px; font-size: .92rem; }
.sched-grid { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 760px; }
.sched-grid th, .sched-grid td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.sched-grid thead th { background: var(--surface-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.sched-grid tbody th { font-weight: 600; white-space: nowrap; }
.sched-grid select { width: 100%; min-width: 0; height: 34px; padding: 4px 6px; font-size: .8rem; }
.sched-grid .cell-time { font: 600 .8rem var(--font-num); white-space: nowrap; }
.sched-grid td.is-off { color: var(--muted); }
.sched-grid td.has-problem { background: var(--warn-bg); }
.sched-grid td.has-problem .problem { color: var(--warn); font-size: .75rem; display: block; margin-top: 3px; }
.sched-grid .unfilled th { color: var(--warn); }
.pub-meta { font-size: .88rem; color: var(--ink-2); }

.print-only { display: none; }
@media print {
  .site-header, .site-footer, .site-tabs, .skip-link, .tool-form, .unlock-panel, .actions, .tool-hero .lede, .status-chip, .tool-hero::before, .no-print { display: none !important; }
  .print-only { display: block; }
  .tool-grid { display: block; padding: 0; }
  .panel { box-shadow: none; border: 0; }
  .sched-grid { min-width: 0; font-size: 10pt; }
  .table-scroll { border: 0; overflow: visible; }
}
input[type="range"] { width: 100%; accent-color: var(--brand); height: 28px; }
@media (prefers-color-scheme: dark) { input[type="range"] { accent-color: var(--mark-a); } }
.data-table thead th:first-child { text-align: left; }
/* roster: full width, schedule first, agents in a card grid below */
@media (min-width: 1000px) { .roster-page .tool-grid { grid-template-columns: minmax(0, 1fr); } }
.roster-page .tool-col { order: -1; }
.roster-page .tool-form { grid-template-columns: minmax(0, 1fr); }
.roster-page .agent-list { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
@media (min-width: 1000px) { .roster-page #ro-form > .step:first-of-type { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; } .roster-page #ro-form > .step:first-of-type > legend { grid-column: 1 / -1; } }
