/* Control tower additions (on top of styles.css and ops.css). */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: min(560px, calc(100vw - 32px)); font-size: 13.5px; }
.toast[hidden] { display: none; }
.abtn { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--accent-wash); border: 1px solid transparent; border-radius: 8px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.abtn:hover { border-color: var(--accent); }
.abtn.solid { background: var(--accent); color: #fff; }
.owner { display: inline-block; font-size: 11.5px; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.sev-bad { color: var(--crit-text); font-weight: 650; }
.sev-warn { color: var(--warn-text, var(--text)); font-weight: 600; }
.tbl-wide td, .tbl-wide th { white-space: nowrap; }
.tbl-wide td.l { white-space: normal; min-width: 220px; }
.need { display: grid; gap: 10px; }
.need-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.need-row .rank { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--raised); color: var(--text-2); }
.need-row b { font-weight: 600; }
.need-row small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.agebar { display: flex; gap: 2px; height: 10px; min-width: 140px; border-radius: 999px; overflow: hidden; background: var(--raised); }
.agebar i { display: block; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.toolbar .hint { color: var(--text-3); font-size: 13px; }
@media (max-width: 760px) { .need-row { grid-template-columns: 28px minmax(0, 1fr); } .need-row .abtn { grid-column: 2; justify-self: start; } }

.tbl-wide th, .tbl-wide td { text-align: left; }
.tbl-wide td.l { min-width: 200px; }
.abtn { white-space: normal; text-align: left; max-width: 210px; line-height: 1.25; }

.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1400px) { .k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lead { margin: 0; color: var(--text-2); font-size: 14px; }
.lnk { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--text-3); }
.lnk:hover { color: var(--accent); }
.chip-s { display: inline-block; font-size: 11.5px; font-weight: 650; border-radius: 999px; padding: 2px 8px; margin: 1px 4px 1px 0; white-space: nowrap; }
.chip-s.urgent { background: color-mix(in srgb, var(--crit) 22%, transparent); color: var(--crit-text); }
.chip-s.action { background: color-mix(in srgb, var(--s4) 24%, transparent); color: var(--text); }
.rank.u { background: color-mix(in srgb, var(--crit) 28%, transparent); color: var(--crit-text); }
.rank.a { background: color-mix(in srgb, var(--s4) 28%, transparent); color: var(--text); }
.tile.alert { border-color: color-mix(in srgb, var(--crit) 55%, var(--border)); }
.tile.alert .tile-val { color: var(--crit-text); }
.tile.warn { border-color: color-mix(in srgb, var(--s4) 55%, var(--border)); }
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; padding: 20px; width: min(640px, 100%); max-height: 88vh; overflow: auto; }
.modal-card h2 { margin: 0 0 6px; font-size: 18px; }
.mail { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; margin: 12px 0; font-size: 13.5px; }
.mail dt { color: var(--text-3); } .mail dd { margin: 0; }
.mailbody { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; font-size: 13.5px; }
.mailbody ul { margin: 6px 0; padding-left: 18px; }
.mailfoot { display: flex; gap: 8px; margin-top: 14px; }
.abtn[disabled] { opacity: .5; cursor: not-allowed; }

.howto { background: var(--accent-wash); border-radius: 12px; padding: 12px 16px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.howto b { color: var(--text); font-weight: 600; }
.howto ul { margin: 8px 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.howto .hint { display: block; margin-top: 6px; color: var(--text-3); font-size: 12.5px; }
.dot-s { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; }

.k7 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chip-s.risk { background: color-mix(in srgb, var(--s2) 26%, transparent); color: var(--text); }
.sev-risk { color: var(--s2); font-weight: 650; }
.k6 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.tbl-wide td:last-child .abtn { min-width: 128px; }

.mailrow { display: flex; flex-wrap: wrap; gap: 10px; }
.mailrow .abtn { max-width: none; font-size: 13px; padding: 8px 12px; }
.mailrow .abtn:first-child { background: var(--accent); color: #fff; }
.need-row.calm { opacity: .85; }
.rank.z { background: var(--raised); color: var(--text-3); }
.chip-s.zero { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good-text, var(--text)); }

.need-row.multi { grid-template-columns: 28px minmax(180px, 1fr) auto; align-items: start; }
.mbtns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.mbtn { display: flex; flex-direction: column; gap: 3px; align-items: stretch; }
.mbtn .abtn { max-width: none; width: 100%; text-align: center; }
.mbtn .sent { color: var(--text-3); font-size: 11.5px; text-align: center; }
@media (max-width: 1180px) { .need-row.multi { grid-template-columns: 28px minmax(0, 1fr); } .mbtns { grid-column: 2; justify-content: flex-start; } }

a.dl { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--text-3); cursor: pointer; }
a.dl:hover { color: var(--accent); border-bottom-color: var(--accent); }
.tbl-wide td .mbtns { flex-wrap: nowrap; justify-content: flex-start; }
.tbl-wide td .mbtn .abtn { white-space: nowrap; font-size: 12px; padding: 5px 8px; }
.card-h { gap: 12px; }
.card-h .abtn { margin-left: auto; }
.toolbar .abtn { white-space: nowrap; }

.tbl-wide td .mbtns { flex-direction: column; align-items: flex-start; gap: 4px; }
.tbl-wide td .mbtn { flex-direction: row; align-items: center; gap: 8px; }
.tbl-wide td .mbtn .sent { text-align: left; white-space: nowrap; }
.tbl-wide td .mbtn .abtn { width: auto; min-width: 190px; text-align: left; }

.tbl-wide td .mbtn { flex-direction: column; align-items: stretch; gap: 2px; }
.tbl-wide td .mbtn .sent { text-align: left; }
.tbl-wide td .mbtn .abtn { min-width: 0; width: 100%; text-align: center; }
.tbl-wide td .mbtns { gap: 6px; }

.tbl-wide th { white-space: normal; vertical-align: bottom; }
.tbl-wide th, .tbl-wide td { padding-left: 8px; padding-right: 8px; }

/* readable colours: status tokens, buttons, chips */
:root { --st-ok: #1a8f4f; --st-sla: #8a6a00; --st-risk: #c25400; --st-prom: #c62828; --btn-bg: #1f5fbf; --btn-fg: #ffffff; --btn-hover: #174d9e; }
:root[data-theme="dark"] { --st-ok: #46c283; --st-sla: #e8be3a; --st-risk: #ff9f45; --st-prom: #ff6f66; --btn-bg: #2f6fd1; --btn-fg: #ffffff; --btn-hover: #4a86e6; }
.abtn { background: var(--btn-bg); color: var(--btn-fg); border: 1px solid transparent; font-weight: 600; }
.abtn:hover { background: var(--btn-hover); border-color: transparent; }
.abtn.solid, .mailrow .abtn:first-child { background: var(--btn-bg); color: var(--btn-fg); }
.abtn[disabled] { background: var(--raised); color: var(--text-3); opacity: 1; }
.chip-s { color: var(--text); border: 1px solid var(--border-strong); background: transparent; font-weight: 600; }
.chip-s::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; background: var(--text-3); }
.chip-s.urgent { background: transparent; color: var(--text); border-color: var(--st-prom); } .chip-s.urgent::before { background: var(--st-prom); }
.chip-s.risk { background: transparent; color: var(--text); border-color: var(--st-risk); } .chip-s.risk::before { background: var(--st-risk); }
.chip-s.action { background: transparent; color: var(--text); border-color: var(--st-sla); } .chip-s.action::before { background: var(--st-sla); }
.chip-s.zero { background: transparent; color: var(--text); border-color: var(--st-ok); } .chip-s.zero::before { background: var(--st-ok); }
.sev-bad { color: var(--st-prom); font-weight: 700; }
.sev-risk { color: var(--st-risk); font-weight: 700; }
.sev-warn { color: var(--st-sla); font-weight: 700; }
.tile.alert { border-color: var(--st-prom); } .tile.alert .tile-val { color: var(--st-prom); }
.tile.warn { border-color: var(--st-sla); }
.rank.u { background: var(--st-prom); color: #fff; }
.rank.a { background: var(--st-sla); color: #111; }
.rank.z { background: var(--raised); color: var(--text-2); }
a.dl { border-bottom-color: var(--text-2); }
.need-row b { color: var(--text); }
.mbtn .sent { color: var(--text-2); }
.dot-s { border-radius: 3px; }

.toolbar > div { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar .hint { flex: 1 1 220px; }

tr.grp td { background: var(--raised); color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

.toolbar .abtn { max-width: none; }

/* ---------- board redesign ---------- */
.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .k3 { grid-template-columns: 1fr; } }
.hero { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px 28px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px 32px; align-items: center; }
.hero-k { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { margin: 6px 0 8px; font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--text-2); font-size: 14px; max-width: 60ch; }
.hero-n { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero-n > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.hero-n span { display: block; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--st-prom); }
.hero-n small { display: block; margin-top: 2px; color: var(--text-2); font-size: 12.5px; }
.hero-l { grid-column: 1 / -1; margin: 0; display: flex; gap: 20px; flex-wrap: wrap; color: var(--text-2); font-size: 12.5px; }
.hero-l span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 1100px) { .hero { grid-template-columns: 1fr; } }
.band { font-size: 12px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); padding: 10px 2px 0; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.sec { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px 20px; }
.sec-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.sec-n { flex: none; width: 26px; height: 26px; border-radius: 999px; background: var(--raised); color: var(--text-2); font-size: 12.5px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.sec-h h2 { margin: 0; font-size: 16px; font-weight: 650; }
.sec-h p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.blkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.blkgrid.g9 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.blkgrid.esc4 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.blk { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.blk.total { border-color: var(--border-strong); background: var(--raised); }
.blk-n { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.blk-s { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.blk-v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; }
.blk-v a.dl, .blk-v { color: var(--st-prom); }
.blk-l { font-size: 12px; color: var(--text-3); }
.blk-r { font-size: 13px; color: var(--text-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.blk-r b a.dl, .blk-r b { color: var(--text); font-weight: 650; }
.dotc { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--st-risk); flex: none; }
.dotc.b { background: var(--st-prom); }
a.dl.big { font-size: inherit; }
.blk.esc .blk-v { color: var(--text); } .blk.esc .blk-v a.dl { color: var(--text); }
table.emini { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12.5px; }
table.emini th { text-align: right; font-weight: 600; color: var(--text-3); padding: 4px 0; border-bottom: 1px solid var(--border); }
table.emini th:first-child, table.emini td:first-child { text-align: left; }
table.emini td { padding: 6px 0; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
table.emini tr:last-child td { border-bottom: 0; }
table.emini td.bad a.dl, table.emini td.bad { color: var(--st-prom); font-weight: 650; }
table.emini td.amb a.dl, table.emini td.amb { color: var(--st-risk); font-weight: 650; }
table.emini th, table.emini td { padding-left: 14px; }
table.emini th:first-child, table.emini td:first-child { padding-left: 0; }

.tscroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table.agetbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
table.agetbl th { text-align: right; font-weight: 600; color: var(--text-2); padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: normal; }
table.agetbl th.l, table.agetbl td.l { text-align: left; padding-left: 14px; }
table.agetbl th.grp { text-align: center; color: var(--text-3); font-weight: 600; border-left: 1px solid var(--border); }
table.agetbl td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
table.agetbl td.tb a.dl, table.agetbl td.tb { color: var(--st-prom); font-weight: 700; }
table.agetbl td.ta a.dl, table.agetbl td.ta { color: var(--st-risk); font-weight: 650; }
table.agetbl td.bc { background: color-mix(in srgb, var(--st-prom) calc(var(--h) * 34%), transparent); }
table.agetbl td.bc:first-of-type { border-left: 0; }
table.agetbl td.tb + td.ta + td.bc { border-left: 1px solid var(--border); }
table.agetbl tr.tot td { background: var(--raised); border-bottom: 0; font-weight: 650; }
table.agetbl tr.tot td.bc { background: color-mix(in srgb, var(--st-prom) 10%, var(--raised)); }
table.agetbl a.dl { color: inherit; }
table.agetbl { min-width: 0; table-layout: fixed; font-size: 12.5px; }
table.agetbl th, table.agetbl td { padding: 8px 5px; }
table.agetbl th.l, table.agetbl td.l { width: 17%; padding-left: 12px; }
table.agetbl th:nth-child(2), table.agetbl th:nth-child(3) { width: 9%; }

/* ---------- SLA first board ---------- */
.blk-v.s-sla, .blk-v.s-sla a.dl { color: var(--st-sla); }
.blk-v.s-prom, .blk-v.s-prom a.dl { color: var(--st-prom); }
.blk-v { color: var(--text); }
.dotc.s { background: var(--st-sla); }
.glgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.gl { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.gl-n { font-size: 13.5px; font-weight: 650; margin-bottom: 8px; }
.gl-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gl .blk { background: var(--surface); height: 100%; }
.blk.na { opacity: .7; border-style: dashed; }
@media (max-width: 480px) { .gl-2 { grid-template-columns: 1fr; } }
table.agetbl td.ts a.dl, table.agetbl td.ts { color: var(--st-sla); font-weight: 700; }
table.agetbl td.ta a.dl, table.agetbl td.ta { color: var(--st-risk); font-weight: 650; }
table.agetbl td.tb a.dl, table.agetbl td.tb { color: var(--st-prom); font-weight: 700; }
table.agetbl td.bc { background: color-mix(in srgb, var(--st-sla) calc(var(--h) * 34%), transparent); }
table.agetbl tr.tot td.bc { background: color-mix(in srgb, var(--st-sla) 10%, var(--raised)); }
table.agetbl.prom td.bc { background: color-mix(in srgb, var(--st-prom) calc(var(--h) * 34%), transparent); }
table.agetbl th.grp { border-bottom: 1px solid var(--border); }
table.agetbl th.l { width: 14%; }
table.emini td.sl a.dl, table.emini td.sl { color: var(--st-sla); font-weight: 650; }
.blkgrid.esc4 { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
table.emini th, table.emini td { padding-left: 8px; }
table.agetbl th.l { width: auto; }
table.agetbl th { font-size: 12px; padding: 8px 4px; }

.dotc.ok { background: var(--st-ok); }
.gl-2.one { grid-template-columns: 1fr; }
.gl-2.one .blk { max-width: 420px; }
table.emini td.ok a.dl, table.emini td.ok { color: var(--st-ok); font-weight: 650; }
.blkgrid.esc4 { grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); }
table.emini th, table.emini td { padding-left: 6px; }
table.emini th { font-size: 11.5px; }

/* ---------- step pages ---------- */
.blkgrid.k5 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.blk-v.s-risk, .blk-v.s-risk a.dl { color: var(--st-risk); }
.blk-split { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.blk-split b, .blk-split b a.dl { color: var(--text); font-weight: 650; }
.blk.na .blk-v { color: var(--text-3); }
.howd { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; }
.howd summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.howd .howto { margin-top: 10px; }
table.acttbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
table.acttbl th { text-align: center; font-weight: 600; color: var(--text-2); padding: 10px 8px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12.5px; }
table.acttbl th.l, table.acttbl td.l { text-align: left; padding-left: 14px; min-width: 170px; }
table.acttbl td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: center; }
table.acttbl td.ac { white-space: normal; }
table.acttbl .ac-n { font-size: 16px; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
table.acttbl td.ac .abtn { font-size: 12px; padding: 4px 10px; }
table.acttbl td.ls { font-size: 12px; color: var(--text-3); text-align: left; min-width: 130px; }
table.acttbl tr.tot td { background: var(--raised); }
table.acttbl td .abtn[disabled] { opacity: .35; }
.blk-v:not(.s-sla):not(.s-prom):not(.s-risk) a.dl { color: var(--text); }

.dotc.e { background: var(--accent); }
table.agetbl th:nth-child(2), table.agetbl th:nth-child(3) { width: auto; }
