/* License Manager console. Colours and sizes follow the design in design/. */
/* The fonts are part of the program (fonts/, SIL Open Font License), so nothing is loaded from the internet. */
@font-face { font-family: 'IBM Plex Sans'; src: url('fonts/ibm-plex-sans-latin-wght-normal.woff2') format('woff2'); font-weight: 100 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
:root {
  --ground: #F3F4F7; --panel: #FFFFFF; --sunk: #F7F8FA; --line: #E1E4EA; --line-strong: #CDD2DA;
  --ink: #131820; --muted: #566070; --faint: #6A7482;
  --side: #121821; --side-raised: #1A222E; --side-line: #2C3644; --side-text: #C6CDD8; --side-label: #8792A2;
  --accent: #2447D6; --accent-dark: #1A36AB; --accent-soft: #E6EBFB; --accent-tint: #F1F4FE;
  --green: #0B5E3C; --green-soft: #DFF3E8; --amber: #7A4A00; --amber-soft: #FBEBCB; --amber-bar: #B25E00;
  --red: #9E241B; --red-soft: #FBE4E1; --red-line: #D9A39D; --purple: #4B2E91; --purple-soft: #ECE6FA;
  --gray: #4A5462; --gray-soft: #ECEEF2;
  --sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.45; min-height: 100vh; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.grow { flex: 1 1 auto; min-width: 0; }

/* shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 232px; max-width: 280px; background: var(--side); padding: 20px 14px 20px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 14px; color: #fff; font-weight: 600; font-size: 15px; }
.product { width: 100%; min-height: 44px; padding: 0 10px; margin-bottom: 6px; border-radius: 6px; border: 1px solid var(--side-line); background: var(--side-raised); color: #fff; font-weight: 500; }
.side-label { color: var(--side-label); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 14px 12px 6px; }
.side a.nav { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 6px; color: var(--side-text); text-decoration: none; }
.side a.nav:hover { background: var(--side-raised); color: #fff; }
.side a.nav.on { background: var(--accent); color: #fff; font-weight: 500; }
.side-user { margin-top: auto; padding: 16px 12px 0; color: var(--side-text); border-top: 1px solid var(--side-line); }
.side-user .who { color: #fff; font-weight: 500; overflow-wrap: anywhere; }
.side-user button { margin-top: 8px; min-height: 40px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--side-line); background: transparent; color: var(--side-text); cursor: pointer; }
.side-user button:hover { color: #fff; border-color: #4A5567; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 760px) { .side { max-width: none; } .side-user { margin-top: 12px; } .main { padding: 20px 16px 40px; } }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.head h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.head .sub { color: var(--muted); margin-top: 2px; max-width: 680px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.cols > .wide { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.cols > .narrow { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; }
.card.flush { padding: 0; }
.card h2 { font-size: 16px; font-weight: 600; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 600; margin-top: 2px; }
.stat .value small { font-size: 15px; font-weight: 400; color: var(--muted); }
.stat .note { font-size: 13px; color: var(--muted); margin-top: 2px; }
.meter { height: 6px; border-radius: 3px; background: #E6E9EE; margin-top: 8px; overflow: hidden; }
.meter > i { display: block; height: 6px; border-radius: 3px; background: var(--accent); }
.meter.full > i { background: var(--amber-bar); }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #9AA3B0; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.danger { border-color: var(--red-line); color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { min-height: 36px; padding: 0 10px; font-size: 13px; }
.btn.block { display: flex; width: 100%; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0 6px; }
.btn:disabled { background: var(--gray-soft); border-color: var(--line); color: var(--faint); cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--gray-soft); color: var(--ink); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel); }
.textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
.select { width: auto; max-width: 100%; padding: 0 8px; }
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 13px; }
.input.narrow { width: 180px; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; }
.field .help { font-size: 12px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
.form-error { color: var(--red); font-weight: 500; }
.form-error:empty { display: none; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel); font-size: 18px; cursor: pointer; }
.stepper input { width: 84px; min-height: 44px; text-align: center; font-size: 18px; font-weight: 600; border-radius: 6px; border: 1px solid var(--line-strong); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { min-height: 44px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel); font-weight: 500; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pick { display: block; width: 100%; min-height: 84px; padding: 12px 14px; border-radius: 8px; border: 2px solid var(--line-strong); background: var(--panel); text-align: left; cursor: pointer; }
.pick[aria-pressed=true] { border-color: var(--accent); background: var(--accent-tint); }
.pick b { display: block; font-weight: 600; }
.pick span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.toggle { width: 44px; height: 44px; padding: 10px 0; border: 0; background: transparent; cursor: pointer; flex-shrink: 0; }
.toggle > span { display: block; position: relative; width: 44px; height: 24px; border-radius: 12px; background: #7C8696; transition: background 0.12s; }
.toggle > span > i { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 10px; background: #fff; transition: left 0.12s; }
.toggle[aria-pressed=true] > span { background: var(--accent); }
.toggle[aria-pressed=true] > span > i { left: 22px; }
.toggle:disabled { opacity: 0.5; cursor: not-allowed; }

/* tabs, badges, chips */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.tabs button { min-height: 48px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.tabs button[aria-pressed=true] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs button span { font-weight: 400; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; }
.toolbar .input { flex: 1 1 260px; width: auto; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--gray); background: var(--gray-soft); }
.badge.green { color: var(--green); background: var(--green-soft); }
.badge.amber { color: var(--amber); background: var(--amber-soft); }
.badge.red { color: var(--red); background: var(--red-soft); }
.badge.purple { color: var(--purple); background: var(--purple-soft); }
.badge.blue { color: var(--accent-dark); background: var(--accent-soft); }
.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--gray-soft); }
.chip.mono { font-family: var(--mono); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; background: var(--sunk); border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: middle; height: 58px; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td .sub { font-size: 12px; color: var(--muted); }
tr.pickable { cursor: pointer; }
tr.pickable:hover td { background: var(--sunk); }
tr.on td { background: var(--accent-tint); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.cellbtn { display: block; width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; font-size: 13px; }
.cellbtn:hover { border-color: var(--line-strong); background: var(--panel); }
.cellbtn.on { font-weight: 600; color: var(--green); }
.cellbtn.off { color: var(--faint); }
.cellbtn.val { font-weight: 600; }
.cellbtn.inherit { font-style: italic; font-weight: 400; }

/* key-value rows */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.kv > :first-child { color: var(--muted); flex-shrink: 0; }
.kv > :last-child { font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.line-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.line-item:first-child { border-top: 0; }
.line-item .when { flex: 0 0 130px; font-size: 13px; color: var(--muted); }
.line-item .code { flex: 0 0 220px; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.line-item .what { flex: 1 1 240px; min-width: 0; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; min-height: 58px; padding: 6px 0; border-top: 1px solid var(--line); }
.meta-row .name { min-width: 0; flex: 1 1 200px; }
.meta-row .name .src.over { color: var(--accent-dark); }
.meta-row .ctl { display: flex; align-items: center; gap: 8px; }
.attention { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.attention:first-of-type { border-top: 0; }
.attention:hover { color: var(--ink); }
.attention b { display: block; font-weight: 500; }
.attention span.d { display: block; font-size: 13px; color: var(--muted); }

/* code */
pre.code { margin: 0; padding: 16px; border-radius: 8px; background: var(--side); color: #D7DEE8; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre; overflow-x: auto; }
.note-box { padding: 12px 14px; border-radius: 8px; background: var(--ground); font-size: 13px; }
.secret-box { padding: 12px 14px; border-radius: 8px; background: var(--side); color: #fff; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

/* chart: validations per day */
.chart { display: flex; gap: 12px; margin-top: 20px; }
.chart .axis { display: flex; flex-direction: column; justify-content: space-between; height: 170px; font-size: 12px; color: var(--muted); text-align: right; min-width: 28px; }
.chart .plot { flex: 1; min-width: 0; }
.chart .bars { display: flex; align-items: flex-end; gap: 2px; height: 170px; border-bottom: 1px solid var(--line-strong); background: linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 100% 50%; }
.chart .bar { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.chart .bar > i { display: block; width: min(100%, 28px); border-radius: 4px 4px 0 0; background: var(--accent); min-height: 0; }
.chart .bar:hover > i, .chart .bar:focus-visible > i { background: var(--accent-dark); }
.chart .bar .tip { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 2; padding: 6px 10px; border-radius: 6px; background: var(--side); color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; }
.chart .bar:hover .tip, .chart .bar:focus-visible .tip { display: block; }
.chart .bar:first-child .tip { left: 0; transform: none; }
.chart .bar:last-child .tip { left: auto; right: 0; transform: none; }
.chart .days { display: flex; gap: 2px; margin-top: 6px; }
.chart .days span { flex: 1; font-size: 12px; color: var(--muted); text-align: center; }
.hbar { margin-top: 14px; }
.hbar:first-of-type { margin-top: 0; }
.hbar .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.hbar .track { height: 8px; border-radius: 4px; background: #E6E9EE; margin-top: 5px; }
.hbar .track > i { display: block; height: 8px; border-radius: 4px; background: var(--accent); }

/* modal and toasts */
.backdrop { position: fixed; inset: 0; background: rgba(15, 20, 30, 0.5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; z-index: 20; }
.modal { width: 100%; max-width: 560px; background: var(--panel); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
.modal.large { max-width: 820px; }
.modal h2 { font-size: 18px; font-weight: 600; }
.modal .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.modal form { display: flex; flex-direction: column; gap: 14px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 40; max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 12px 16px; border-radius: 8px; background: var(--side); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }
.toast.error { background: var(--red); }

/* sign-in */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.gate .card { width: 100%; max-width: 440px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.gate form { display: flex; flex-direction: column; gap: 14px; }
.gate h1 { font-size: 22px; font-weight: 600; }
