/* SoFIE 3.0 Admin, in ReThink-IT's colours (rethinkit.be): red #e62528, near-black and greys; Raleway for headings
   and Open Sans for text, served from the portal itself (fonts/, SIL Open Font License). */
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("/fonts/raleway-latin.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/open-sans-latin.woff2") format("woff2"); }

:root {
  --accent: #e62528; --accent-hover: #ff282f; --accent-soft: #fdecec;
  --ink: #1f1f1f; --ink-2: #333333; --muted: #6b6b6b; --line: #e4e4e4; --bg: #f5f5f5;
  --side: #1c1c1c; --side-2: #2d2d2d; --side-text: #c8c8c8;
  --ok: #17733a; --ok-soft: #e7f5ec; --info: #1f4fd1; --info-soft: #eef3ff;
  --head: "Raleway", "Segoe UI", system-ui, sans-serif;
  --body: "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--body); font-size: 15px; color: var(--ink); background: var(--bg); }
h1, h2, h3, .brand-name { font-family: var(--head); color: var(--ink); font-variant-numeric: lining-nums; }
h1 { font-size: 1.55rem; font-weight: 700; margin: 0 0 0.35rem; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 1.6rem 0 0.6rem; }
h3 { font-size: 0.95rem; font-weight: 700; margin: 1.4rem 0 0.5rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.lede { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.3rem; }
.message { color: #b3171b; }
.check { color: var(--ok); font-size: 0.85rem; }

/* ---------------------------------------------------------------- shell: menu left, top bar, content */
.layout { display: flex; min-height: 100vh; }
.column { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; padding: 1.6rem 2rem 3rem; max-width: 84rem; width: 100%; }

#menu { width: 248px; flex: none; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; }
body.menu-collapsed #menu { display: none; }
.brand { display: flex; align-items: center; gap: 0.7rem; padding: 1.05rem 1.1rem 1rem; border-bottom: 1px solid var(--side-2); }
.brand img { width: 40px; height: auto; display: block; }
.brand-name { font-family: var(--head); font-weight: 700; color: #fff; font-size: 1.02rem; }
.brand-product { font-size: 0.72rem; color: #9a9a9a; letter-spacing: 0.06em; text-transform: uppercase; }
#menu-nav { padding: 0.4rem 0.7rem 1rem; }
.menu-group { margin-top: 0.9rem; }
.menu-category { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: #7c7c7c; font-weight: 700; padding: 0 0.6rem 0.4rem; }
#menu-nav a { display: flex; align-items: center; gap: 0.65rem; padding: 0.48rem 0.7rem; border-radius: 6px; color: var(--side-text); text-decoration: none; font-size: 0.9rem; }
#menu-nav a:hover { background: #262626; color: #fff; }
#menu-nav a.active { background: #2a2a2a; color: #fff; box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
#menu-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#menu-nav svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }

.topbar { height: 60px; flex: none; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: 0 1.6rem 0 1rem; position: sticky; top: 0; z-index: 4; }
button.icon { background: none; border: 1px solid transparent; color: var(--ink); padding: 0.25rem 0.55rem; font-size: 1.1rem; line-height: 1; border-radius: 6px; }
button.icon:hover { border-color: var(--line); background: #fafafa; }
.crumb { font-size: 0.86rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.env { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; padding: 0.2rem 0.55rem; border-radius: 4px; background: var(--accent); color: #fff; }
.env.env-other { background: #555; }
.usermenu { position: relative; }
.userbtn { display: flex; align-items: center; gap: 0.55rem; border: 1px solid transparent; background: none; color: var(--ink); padding: 0.25rem 0.6rem 0.25rem 0.25rem; border-radius: 999px; font: inherit; font-size: 0.88rem; cursor: pointer; }
.userbtn:hover, .usermenu.open .userbtn { border-color: var(--line); background: #fafafa; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink-2); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.78rem; }
.caret { color: var(--muted); font-size: 0.75rem; }
.dropdown { position: absolute; right: 0; top: 46px; width: 290px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); padding: 1rem; z-index: 10; font-size: 0.86rem; }
.dropdown-label { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin: 0.8rem 0 0.25rem; }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 0.9rem 0; }
.role { display: inline-block; background: #f1f1f1; border-radius: 4px; padding: 0.05rem 0.45rem; font-size: 0.78rem; margin: 0 0.3rem 0.3rem 0; }

/* sign in */
.signin { min-height: 80vh; display: grid; place-items: center; }
.signin-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 2.4rem 2.6rem; text-align: center; max-width: 26rem; box-shadow: 0 8px 30px rgba(0,0,0,0.06); }
.signin-card img { width: 72px; height: auto; margin-bottom: 0.8rem; }

/* ---------------------------------------------------------------- controls */
.button, button { display: inline-block; padding: 0.5rem 1rem; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font: inherit; font-size: 0.86rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.quiet { background: #fff; color: var(--ink); border: 1px solid #d6d6d6; padding: 0.38rem 0.85rem; }
button.quiet:hover { border-color: #bdbdbd; background: #fafafa; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; text-align: left; }
button.link:hover { background: none; color: var(--accent-hover); }
button.block { width: 100%; }
button:disabled, button:disabled:hover { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, .button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin-bottom: 1.3rem; }
label { display: inline-flex; flex-direction: column; gap: 0.3rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
label:has(> input[type="checkbox"]) { flex-direction: row; align-items: center; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-weight: 400; }
input, select { font: inherit; font-size: 0.9rem; padding: 0.45rem 0.6rem; border: 1px solid #d6d6d6; border-radius: 6px; background: #fff; color: var(--ink); min-width: 14rem; text-transform: none; letter-spacing: 0; font-weight: 400; }
input[type="checkbox"] { min-width: 0; accent-color: var(--accent); }
textarea { font: inherit; font-size: 0.9rem; padding: 0.55rem; border: 1px solid #d6d6d6; border-radius: 6px; width: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
label:has(> textarea) { display: flex; }
fieldset { border: 1px solid var(--line); border-radius: 6px; display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; padding: 0.7rem 0.9rem; }
legend { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 0 0.3rem; }

/* ---------------------------------------------------------------- cards and tables */
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 1.3rem; overflow: hidden; }
.card > h2 { margin: 0; font-size: 1.02rem; padding: 0.95rem 1.1rem; border-bottom: 1px solid var(--line); }
.card > table { border: 0; border-radius: 0; margin: 0; }
.card-empty { margin: 0; padding: 1rem 1.1rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem 1.3rem; margin: 1rem 0 1.3rem; }
.panel > h2:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.9rem 1rem; }
.grid .wide { grid-column: 1 / -1; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0.5rem 0 1.3rem; font-size: 0.88rem; }
th { text-align: left; font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: #fafafa; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }
td { text-align: left; vertical-align: top; padding: 0.75rem 1rem; border-bottom: 1px solid #f0f0f0; }
tbody tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions button + button { margin-left: 0.4rem; }
td.tick { text-align: center; color: var(--ok); font-weight: 700; }
tr.pick { cursor: pointer; }
tr.pick:hover td { background: #fcfcfc; }
tr.history td { background: #fafafa; }

/* ---------------------------------------------------------------- status */
.pill { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 600; padding: 0.18rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-late { background: var(--accent-soft); color: #b3171b; }
.pill-quiet { background: #f0f0f0; color: #555; }
.pill-running { background: var(--info-soft); color: var(--info); }
.spinner { width: 0.72rem; height: 0.72rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-right-color: currentColor; opacity: 0.6; } }
.badge { font-size: 0.72rem; font-weight: 600; padding: 0.08rem 0.45rem; border-radius: 4px; background: #f0f0f0; color: var(--ink-2); }
.state-submitted { color: #a35200; font-weight: 600; }
.state-sent { color: var(--ok); }
.due-on-time { color: var(--ok); font-weight: 600; }
.due-late { color: #b3171b; font-weight: 600; }
.due-waiting { color: var(--muted); }

/* ---------------------------------------------------------------- odds and ends */
.copy input { width: 100%; max-width: 48rem; }
code { font-size: 1.15rem; letter-spacing: 0.1em; padding: 0.1rem 0.4rem; background: #f1f1f1; border-radius: 4px; }
code.plain { font-size: 0.88rem; letter-spacing: 0; background: none; padding: 0; }
ol.events { margin: 0.3rem 0; padding-left: 1.4rem; }
ol.events li { margin-bottom: 0.35rem; }
.notice-line { margin-bottom: 0.4rem; }
pre.letter { white-space: pre-wrap; font: inherit; background: #fafafa; border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem; }

/* narrow screens: the menu slides over the page */
@media (max-width: 760px) {
  #menu { position: fixed; z-index: 5; top: 0; bottom: 0; left: 0; box-shadow: 0 0 24px rgba(0,0,0,0.3); }
  main { padding: 1.2rem 1rem 2rem; }
  .crumb { display: none; }
  .userbtn #who-name { display: none; }
}

/* ---------------------------------------------------------------- the page of a one-time link (share.html) */
body.share { display: flex; flex-direction: column; min-height: 100vh; }
.share-head { background: var(--side); color: #fff; display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.5rem; }
.share-head img { width: 36px; height: auto; }
.share-head span { font-family: var(--head); font-weight: 700; }
.share main { max-width: 46rem; margin: 2.5rem auto; padding: 0 1.2rem; }
.share .card { padding: 1.4rem 1.5rem; }
.share .card table { margin: 0.8rem 0 0; }
.share footer { margin-top: auto; padding: 1rem 1.5rem; font-size: 0.78rem; color: var(--muted); text-align: center; }
#r-periods td:first-child, #r-schedule td:nth-child(2) { white-space: nowrap; }
body.is-signed-out main { max-width: none; padding: 0; }
body.is-signed-out .signin { min-height: 100vh; }

/* ---------------------------------------------------------------- the Overview */
.hello { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; margin-bottom: 1.2rem; }
.hello .muted { font-size: 0.9rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.kpi { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem 1.1rem; color: var(--ink); text-decoration: none; }
a.kpi:hover { border-color: #cfcfcf; }
.kpi-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.kpi-value { font-family: var(--body); font-size: 1.7rem; font-weight: 700; }
.kpi-value.text { font-size: 1.15rem; padding-top: 0.45rem; }
.kpi-sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.kpi.alert { border-left: 4px solid var(--accent); }
.kpi.alert .kpi-value { color: #b3171b; }
.kpi.calm .kpi-value { color: var(--ok); }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.3rem; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }
.item { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.8rem 1.1rem; border-bottom: 1px solid #f0f0f0; }
.item:last-child { border-bottom: 0; }
.item .what { flex: 1; min-width: 0; font-size: 0.88rem; }
.item .what .small { margin-top: 0.15rem; }
.item .go { white-space: nowrap; }
.item .pill { margin-left: 0.4rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 0.4rem; flex: none; background: #bbb; }
.dot.red { background: var(--accent); } .dot.blue { background: var(--info); } .dot.green { background: var(--ok); } .dot.amber { background: #d98c00; }
.feed .item { padding: 0.6rem 1.1rem; }
.feed time { color: var(--muted); font-size: 0.78rem; white-space: nowrap; min-width: 3.2rem; padding-top: 0.1rem; }
input.run-month { min-width: 0; width: 9.5rem; padding: 0.32rem 0.5rem; font-size: 0.84rem; }

/* ---------------------------------------------------------------- release and outage notifications */
.page-head { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; }
.page-head .grow { flex: 1; min-width: 0; }
.page-head .lede { margin: 0; }
.notice-card-top { display: flex; align-items: flex-start; gap: 0.6rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.notice-card-top .grow { flex: 1; min-width: 0; }
.notice-card-top h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.notice-card-top .when { color: var(--ink-2); font-size: 0.9rem; margin-top: 0.2rem; }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.45rem; }
.chip { font-size: 0.75rem; background: #f1f1f1; border-radius: 4px; padding: 0.08rem 0.45rem; }
.card.open-outage { border-left: 4px solid var(--accent); }
.warn-band { font-size: 0.84rem; padding: 0.55rem 1.1rem; background: #fff7e6; color: #8a5300; border-bottom: 1px solid #f3e2bf; }
.warn-band div + div { margin-top: 0.2rem; }
.info-band { font-size: 0.84rem; padding: 0.55rem 1.1rem; background: var(--info-soft); color: var(--info); border-bottom: 1px solid #d9e4fb; }
table.matrix { border: 0; border-radius: 0; margin: 0; }
table.matrix th:first-child, table.matrix td:first-child { width: 13rem; }
table.matrix td { vertical-align: middle; }
.cell { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.cell + .cell { margin-top: 0.35rem; }
.cell .small { flex-basis: 100%; }
.pill-wait { background: #fff2dc; color: #8a5300; }
.ai-tag { font-size: 0.68rem; font-weight: 700; color: #6b4fbb; background: #f1edfb; border-radius: 4px; padding: 0.02rem 0.35rem; }
.cell button.link { font-weight: 600; font-size: 0.82rem; }
.steps { display: flex; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
.step { flex: 1; text-align: center; font-size: 0.8rem; color: var(--muted); }
.step b { display: block; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; margin: 0 auto 0.3rem; background: #eee; color: #777; }
.step.done b { background: var(--ok); color: #fff; }
.step.now b { background: var(--accent); color: #fff; }
.step.now { color: var(--ink); font-weight: 600; }
details.past summary { cursor: pointer; padding: 0.9rem 1.1rem; font-family: var(--head); font-weight: 700; list-style: none; }
details.past summary::-webkit-details-marker { display: none; }
details.past summary::before { content: "\25B8  "; color: var(--muted); }
details.past[open] summary::before { content: "\25BE  "; }
.past-row { display: flex; gap: 1rem; padding: 0.6rem 1.1rem; border-top: 1px solid #f0f0f0; font-size: 0.88rem; align-items: center; }
.past-row .grow { flex: 1; }
p.card.card-empty { padding: 1rem 1.1rem; }
.warn-band.sending-off { border: 1px solid #f3e2bf; border-radius: 10px; margin-bottom: 1.2rem; padding: 0.8rem 1.1rem; }
