/*
 * systems/module.css: the Systems tab, a client's systems, the dashboard
 * panel. Theme tokens only; --mustard is the accent.
 */

.row.systems{grid-template-columns:minmax(0,1.4fr) minmax(0,1.2fr) minmax(0,1.6fr) minmax(0,0.8fr) 150px;}

.sys-status{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:500;letter-spacing:0.1em;text-transform:uppercase;color:var(--ink-soft);}
.sys-status::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--line-strong);}
.sys-status.live{color:var(--mustard);}
.sys-status.live::before{background:var(--mustard);}
.sys-status.building::before{background:var(--ink-soft);}
.sys-status.retired{color:var(--text-muted);}

.sys-mods{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;}
.sys-mods.compact{display:flex;flex-wrap:wrap;gap:3px;}
.sys-mod{font-size:10.5px;padding:3px 6px;border:1px solid var(--line);border-radius:var(--radius);color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sys-mod.on{border-color:var(--mustard);color:var(--ink);}
.sys-mod.on::before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--mustard);margin-right:5px;vertical-align:1px;}
@media (max-width:760px){ .sys-mods{grid-template-columns:repeat(2,minmax(0,1fr));} }

.sys-card{border-top:1px solid var(--line-strong);padding:12px 0 4px;margin-top:6px;}
.sys-card-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:6px;}
.sys-kv{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-top:1px solid var(--line);font-size:13px;}
.sys-kv > span:first-child{color:var(--ink-soft);}
.sys-kv > span:last-child{text-align:right;}
.sys-renewal{color:var(--brick);}
.sys-renewal.soon{color:var(--mustard);}

.sys-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:4px 0 10px;}
@media (max-width:760px){ .sys-kpis{grid-template-columns:repeat(2,minmax(0,1fr));} }
.sys-kpi{border-top:1px solid var(--line);padding-top:10px;}
.sys-kpi-label{font-size:10.5px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--ink-soft);}
.sys-kpi-value{font-family:var(--font-display);font-size:30px;font-weight:300;letter-spacing:-0.03em;line-height:1.15;margin-top:4px;}
.sys-kpi-value.accent{color:var(--mustard);}
.sys-module-picks{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:4px 12px;}
/* `.field label` and `.field input` stretched each box above its own name; this keeps box and name on one line (core's .field .inline-checkbox fix). */
.sys-module-picks .check-row{display:flex;align-items:center;gap:6px;margin-bottom:0;font-size:13px;color:var(--ink);font-weight:500;cursor:pointer;min-width:0;}
.sys-module-picks .check-row input{width:16px;height:16px;padding:0;margin:0;flex:none;}
@media (max-width:760px){ .sys-module-picks{grid-template-columns:repeat(2,minmax(0,1fr));} }

.cal-systems{background:var(--brick-soft);color:var(--brick-ink);}

.sys-eyebrow{font-size:10.5px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--ink-soft);margin:0 0 8px;}
.sys-num{color:var(--mustard);margin-right:8px;}
.sys-line{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:8px 0;border-top:1px solid var(--line);cursor:pointer;}
.sys-line:hover .primary-text{color:var(--mustard);}
.sys-when{font-size:12px;color:var(--ink);white-space:nowrap;}
.sys-when.late{color:var(--brick);}

/* Health: one row per live system, problems first. Red is a problem (it rang
   the bell), the accent is worth a look, grey is fine. */
.row.sys-health{grid-template-columns:minmax(0,2.4fr) 80px 90px 80px minmax(0,1fr) minmax(0,0.9fr);font-size:13px;}
.row.sys-health.selected{background:var(--subtle-bg);box-shadow:inset 2px 0 0 var(--mustard);}
.sys-health-who{display:flex;align-items:flex-start;gap:10px;min-width:0;}
.sys-dot{flex:0 0 auto;width:8px;height:8px;border-radius:50%;margin-top:6px;background:var(--line-strong);}
.sys-dot.problem{background:var(--brick);}
.sys-dot.warning{background:var(--mustard);}
.sys-health-issue{font-size:12px;margin-top:3px;}
.sys-health-issue.problem{color:var(--brick);}
.sys-health-issue.warning{color:var(--mustard);}
.row.sys-health .problem{color:var(--brick);}
.row.sys-health .warning{color:var(--mustard);}
.sys-health-behind{color:var(--mustard);}
.sys-health-label{display:none;}
@media (max-width:760px){ .sys-health-label{display:inline;color:var(--text-muted);font-size:11px;text-transform:uppercase;letter-spacing:0.08em;} }

.sys-strip{display:grid;grid-template-columns:repeat(60,minmax(0,1fr));gap:2px;height:28px;margin-top:10px;}
.sys-tick{border-radius:1px;background:var(--text-muted);opacity:0.55;}
.sys-tick.bad{background:var(--brick);opacity:1;}
/* padding:0, or core's `.empty` (the empty-state block) pads each tick to 40px and the strip runs off a phone. */
.sys-tick.empty{background:var(--line);opacity:1;padding:0;}
.sys-strip-foot{display:flex;justify-content:space-between;margin-top:6px;}
.sys-health-note{border-top:1px solid var(--line);padding:14px 0 4px;max-width:760px;}
.sys-health-note p{margin:6px 0 0;line-height:1.55;}

.sys-reportin-line{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 0;border-top:1px solid var(--line);}
.sys-reportin-line code{font-family:var(--font-mono);font-size:12px;overflow-wrap:anywhere;}
/* A token is one long word: it breaks rather than widening the form on a phone. */
.sys-reportin-line > span{min-width:0;overflow-wrap:anywhere;}
/* The buttons keep their width: shrunk by the flex row, their tracked labels ran past the border on a phone. */
.sys-reportin-line .btn{flex:none;white-space:nowrap;}
.sys-reportin-line > span:has(> .btn){flex:none;display:flex;gap:6px;}
/* The modules and the Inquiries block share one column, beside the taller Report-in, so no gap opens under the modules. */
.sys-form-stack{min-width:0;align-self:start;}
/* Open admin under the status on a register row. */
.sys-row-action{margin-top:8px;}
.sys-reportin code{font-family:var(--font-mono);font-size:12px;overflow-wrap:anywhere;}

/* A project's Health tab (the Projects screen is the shell's): the level as a
   label, the problems in their color, the five readings as hairline rows, and
   the strip of recent checks under its own section head. */
.sys-ph{margin-top:2px;}
.sys-ph-kv{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:11px 0;border-top:1px solid var(--line);font-size:14.4px;}
.rh + .sys-ph > .sys-ph-kv:first-child{border-top:0;}
.sys-ph-issue{margin:6px 0 10px;color:var(--mustard);}
.sys-ph-issue.problem{color:var(--brick);}
.sys-ph-none{margin:6px 0 0;max-width:640px;}
.sys-ph-meta{margin:14px 0 0;}
.sys-ph-strip{margin-top:36px;}
.sys-strip-head{margin-bottom:4px;}
.sys-strip-head .lb.cut{flex:0 1 auto;}

/* The register in the two Physare themes: a module is the small outlined
   label, a status is a label (live in the accent), never a dot or a pill. */
html:is([data-theme="plasmodium"],[data-theme="oat"]) .sys-mod{border-radius:0;padding:2px 7px;font-size:11px;font-weight:500;letter-spacing:0.1em;text-transform:uppercase;color:var(--text-muted);}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .sys-mod.on{border-color:var(--line-strong);color:var(--ink-soft);}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .sys-mod.on::before{display:none;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .sys-status{font-size:11.52px;letter-spacing:0.12em;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .sys-status::before{display:none;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .sys-kpi-label{font-size:11.52px;color:var(--text-muted);}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .sys-kpi-value{font-size:24px;letter-spacing:-0.015em;}

/* In Physare's two themes the picked system sits on the tile, as Today's picked row does. */
html:is([data-theme="plasmodium"],[data-theme="oat"]) .row.sys-health.selected{background:var(--paper-raised);box-shadow:none;}
