/* Brand OS component library. Layout and parts are the same for every brand; colours, type and logo come from
   the theme file's custom properties. Status colours are fixed and always paired with an icon and words. */
:root {
  --ok: #1B6E44; --ok-bg: #E2F2E8;
  --warn: #7A4F00; --warn-bg: #FBEFD5;
  --over: #A3221B; --over-bg: #FBE3E1;
  --info: #24477A; --info-bg: #E4ECF7;
  --focus: #1A5FD0;
  --space: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-weight: var(--font-weight-body); font-size: 16px; line-height: 1.55;
}
a { color: var(--color-primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: var(--font-weight-heading); line-height: 1.2; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; max-width: 68ch; }
.title { font-family: var(--font-display); text-transform: var(--title-case); font-style: var(--title-style); letter-spacing: .005em; }
.muted { color: var(--color-muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: calc(var(--space) * 2); }
.stack-lg { display: flex; flex-direction: column; gap: calc(var(--space) * 4); }
.row { display: flex; gap: calc(var(--space) * 1.5); align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer */
.bos-header { background: var(--color-header); color: var(--color-onHeader); border-bottom: 1px solid var(--color-line); position: relative; }
.bos-header-inner { max-width: 1160px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 24px; }
.bos-logo { display: block; width: 168px; height: 36px; background: var(--logo-on-header) left center / contain no-repeat; flex: none; }
.bos-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.bos-nav a { color: inherit; text-decoration: none; padding: 6px 12px; border-radius: var(--radius-control); font-size: 15px; }
.bos-nav a[aria-current="page"] { background: color-mix(in srgb, currentColor 14%, transparent); font-weight: 700; }
.bos-nav a:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.bos-user { font-size: 14px; display: flex; gap: 12px; align-items: center; }
.bos-user a { color: inherit; }
.bos-wave { height: 6px; background: var(--color-accent); }
.bos-main { width: 100%; max-width: 1160px; margin: 0 auto; padding: 32px 24px 56px; flex: 1; display: flex; flex-direction: column; gap: 28px; }
.bos-footer { font-size: 13px; color: var(--color-muted); border-top: 1px solid var(--color-line); padding: 16px 24px; text-align: center; }

/* Buttons */
.btn {
  font: inherit; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 18px; border-radius: var(--radius-control); border: 1.5px solid var(--color-primary);
  background: transparent; color: var(--color-primary); cursor: pointer; text-decoration: none; min-height: 42px;
}
.btn:hover { background: color-mix(in srgb, var(--color-primary) 8%, transparent); }
.btn-primary { background: var(--color-primary); color: var(--color-onPrimary); font-size: 17px; }
.btn-primary:hover { background: color-mix(in srgb, var(--color-primary) 88%, black); }
.btn-quiet { border-color: transparent; color: var(--color-text); font-weight: 500; }
.btn-danger { border-color: var(--over); color: var(--over); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.arrow::after { content: ""; width: 16px; height: 12px; background: currentColor; display: inline-block;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpath d='M1 6h13M9 1l5 5-5 5' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-card); padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-plain { background: var(--color-bg); }
.tool-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--color-primary); color: var(--color-onPrimary); display: grid; place-items: center; font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-line); border-radius: var(--radius-card); background: var(--color-bg); }
table.data { border-collapse: collapse; width: 100%; font-size: 15px; }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--color-line); vertical-align: top; }
table.data th { font-size: 13px; color: var(--color-muted); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.attention td { background: var(--warn-bg); }

/* Status: fixed colours, always with an icon and words */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 2px 10px 2px 6px; border-radius: 999px; white-space: nowrap; }
.chip::before { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; line-height: 1; color: #fff; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.ok::before { content: "✓"; background: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.warn::before { content: "!"; background: var(--warn); }
.chip.over { background: var(--over-bg); color: var(--over); } .chip.over::before { content: "×"; background: var(--over); }
.chip.info { background: var(--info-bg); color: var(--info); } .chip.info::before { content: "i"; background: var(--info); }
.chip.neutral { background: var(--color-surface); color: var(--color-muted); border: 1px solid var(--color-line); } .chip.neutral::before { content: "–"; background: var(--color-muted); }

/* Limit meter */
.meter { height: 10px; border-radius: 999px; background: var(--color-line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.meter.warn > span { background: var(--warn); }
.meter.over > span { background: var(--over); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 8px; }
.bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; font-size: 12px; color: var(--color-muted); }
.bars > div > span { width: 100%; max-width: 44px; background: var(--color-primary); border-radius: 4px 4px 0 0; min-height: 2px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-weight: 700; font-size: 14px; }
input[type=text], input[type=email], input[type=number], input[type=password], input[type=url], select, textarea {
  font: inherit; font-size: 16px; padding: 9px 12px; border: 1.5px solid var(--color-line); border-radius: 4px;
  background: var(--color-bg); color: var(--color-text); min-height: 42px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
fieldset { border: 1px solid var(--color-line); border-radius: var(--radius-card); padding: 16px 20px 20px; margin: 0; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 700; padding: 0 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }

/* Banners and notices */
.notice { border-radius: var(--radius-card); padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.over { background: var(--over-bg); color: var(--over); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.info { background: var(--info-bg); color: var(--info); }
.bos-banner { position: sticky; top: 0; z-index: 50; padding: 10px 24px; display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.bos-banner.warn { background: var(--warn-bg); color: var(--warn); border-bottom: 2px solid var(--warn); }
.bos-banner.info { background: var(--info-bg); color: var(--info); border-bottom: 2px solid var(--info); }
.bos-banner.over { background: var(--over-bg); color: var(--over); border-bottom: 2px solid var(--over); }
.bos-banner button { font: inherit; font-size: 14px; padding: 5px 12px; border-radius: 4px; border: 1.5px solid currentColor; background: #fff; color: inherit; cursor: pointer; }

/* Side panel */
.panel-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 80; display: flex; justify-content: flex-end; }
.panel { background: var(--color-bg); width: min(460px, 100%); height: 100%; padding: 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }

/* The NMIC display panel on sign-in and key pages */
.split-page { flex: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.display-panel { background: var(--color-display); color: var(--color-onDisplay); padding: 56px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.display-panel .display-line { font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; font-weight: 700; max-width: 14ch; }
.display-panel .bos-logo { background-image: var(--logo); filter: brightness(0) invert(1); }
.form-panel { padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 500px; }
.key-art { width: 96px; height: 96px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.action-box { border: 1.5px solid var(--color-line); border-radius: var(--radius-card); padding: 18px 20px; background: var(--color-surface); display: flex; flex-direction: column; gap: 8px; }
.action-box ul { margin: 0; padding-left: 20px; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }
.codebox { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 26px; letter-spacing: .12em; background: var(--color-surface); padding: 10px 16px; border-radius: 6px; display: inline-block; }

@media (max-width: 800px) {
  .split-page { grid-template-columns: 1fr; }
  .display-panel, .form-panel { padding: 32px 20px; }
  .bos-header-inner { padding: 12px 16px; flex-wrap: wrap; }
  .bos-main { padding: 24px 16px 40px; }
}
.btn-header { font: inherit; font-size: 14px; background: none; border: 1px solid currentColor; color: inherit; border-radius: var(--radius-control); padding: 4px 12px; cursor: pointer; }
.bos-user form { margin: 0; }
#root { display: contents; }
.big { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.1; }
.qr { background: #fff; padding: 8px; border-radius: 6px; border: 1px solid var(--color-line); width: 216px; height: 216px; }
.bos-feedback-button { position: fixed; right: 16px; bottom: 16px; z-index: 60; font: inherit; font-size: 14px; font-weight: 700; padding: 8px 14px;
  border-radius: 999px; border: 1.5px solid var(--color-primary); background: var(--color-bg); color: var(--color-primary); cursor: pointer; }
.bos-feedback { border: 1px solid var(--color-line); border-radius: var(--radius-card); padding: 24px; width: min(440px, calc(100% - 32px)); background: var(--color-bg); color: var(--color-text); }
.bos-feedback::backdrop { background: rgba(0, 0, 0, .35); }
.nowrap { white-space: nowrap; }

/* Microsoft's own sign-in button (Microsoft identity branding guidelines): white, grey border, four-square logo. */
.btn-microsoft { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 42px; padding: 0 16px;
  background: #fff; color: #5E5E5E; border: 1px solid #8C8C8C; border-radius: 0; font: 600 15px "Segoe UI", system-ui, -apple-system, sans-serif;
  text-decoration: none; cursor: pointer; }
.btn-microsoft:hover { background: #F3F3F3; }
.btn-microsoft svg { width: 21px; height: 21px; flex: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--color-muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--color-line); }
.signin-actions { display: flex; flex-direction: column; gap: 14px; }
.signin-actions > .btn, .signin-actions > .btn-microsoft, .signin-actions > form > .btn-microsoft { width: 100%; }

/* NMIC's administration: grouped navigation on the left. */
.bos-layout { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; flex: 1; display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 40px; }
.bos-layout > .bos-main { padding: 32px 0 56px; max-width: none; }
.bos-side { padding: 32px 0; display: flex; flex-direction: column; gap: 22px; font-size: 15px; }
.bos-side h2 { font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); margin: 0 0 6px 12px; }
.bos-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bos-side a { display: block; color: var(--color-text); text-decoration: none; padding: 6px 12px; border-radius: var(--radius-control); }
.bos-side a:hover { background: var(--color-surface); }
.bos-side a[aria-current="page"] { background: var(--color-surface); font-weight: 700; box-shadow: inset 3px 0 0 var(--color-primary); }
.bos-header-inner .grow { flex: 1; }

/* A tool on a client's front page: the whole card opens it. */
a.tool-card { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.tool-card:hover { border-color: var(--color-primary); box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
a.tool-card .open { margin-top: auto; padding-top: 6px; color: var(--color-primary); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.usage { display: flex; flex-direction: column; gap: 10px; }
.usage h2 { font-size: 15px; }

/* Cards used as filters, and quiet table actions */
button.card { font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.card[aria-pressed="true"] { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.stat-label { font-size: 14px; color: var(--color-muted); }
.link-btn { font: inherit; font-size: 14px; background: none; border: 0; padding: 0; color: var(--color-primary); text-decoration: underline; cursor: pointer; }
.link-btn.danger { color: var(--over); }
table.data select { width: auto; min-width: 8.5em; font-size: 14px; min-height: 34px; padding: 4px 8px; }
.cards.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
table.data td.actions { white-space: nowrap; text-align: right; }
table.data td.actions .row { justify-content: flex-end; flex-wrap: nowrap; gap: 14px; }
.bos-footer .bos-feedback-button { position: static; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 500; color: inherit; text-decoration: underline; margin-left: 4px; }

@media (max-width: 800px) {
  .bos-layout { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
  .bos-layout > .bos-main { padding: 20px 0 40px; }
  .bos-side { padding: 12px 0 0; flex-direction: row; gap: 4px; overflow-x: auto; }
  .bos-side h2 { display: none; }
  .bos-side ul { flex-direction: row; }
  .bos-side a { white-space: nowrap; }
  .bos-nav { flex-wrap: nowrap; overflow-x: auto; order: 3; flex-basis: 100%; }
  .bos-nav a { white-space: nowrap; }
}
