/* RoboReady licence portal. Tokens come from the Figma design "RoboReady Licence Portal (mockup)", light theme. */
:root {
  --bg: #f4f5fa; --surface: #ffffff; --surface2: #eef0f7; --field: #f7f8fc; --border: #d5d9e6;
  --text: #14161f; --text2: #575c70; --blue: #3f5bf0; --selected: #e8ecff; --button: #e9ecf8;
  --live: #0b8f63; --live-bg: #ddf5eb; --warn: #9a5b00; --warn-bg: #fff0d2; --danger: #c8261b; --danger-bg: #fde3e0;
  --brand: linear-gradient(90deg, #3f5bf0, #8b50f0);
  --radius: 5px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); font-size: 14px; line-height: 1.4; }
a { color: var(--blue); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
.mono { font-family: "JetBrains Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace; font-size: 12.5px; }
.muted { color: var(--text2); }
.warn { color: var(--warn); } .bad { color: var(--danger); } .good { color: var(--live); }

/* ---------- sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
  background: radial-gradient(900px 500px at 0% 0%, #d9defa 0, transparent 60%), radial-gradient(800px 500px at 100% 100%, #e5dcf6 0, transparent 60%), var(--bg); }
.login .brand-top { position: absolute; left: 30px; top: 18px; }
.login .version { position: absolute; left: 30px; bottom: 18px; font-size: 12px; color: var(--text2); }
.login-card { width: 428px; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 30px 31px;
  box-shadow: 0 1px 2px rgba(20, 22, 31, .04); }
.eyebrow { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); font-weight: 600; }
.login-card h1 { font-size: 26px; font-weight: 700; margin: 4px 0 6px; }
.login-card .lead { color: var(--text2); margin-bottom: 14px; }
.or { display: flex; align-items: center; gap: 14px; color: var(--text2); font-size: 12px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.login-card .fine { color: var(--text2); font-size: 12.5px; margin-top: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text2); }

/* ---------- shell */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.brand .logo { width: 32px; height: 32px; border-radius: 7px; background: linear-gradient(135deg, #3f5bf0, #8b50f0); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand .sub { color: var(--text2); font-weight: 500; margin-left: 2px; }
.shell { min-height: 100vh; display: grid; grid-template-rows: 64px 1fr; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 24px; }
.topbar .grow { flex: 1; }
.search { width: 320px; max-width: 40vw; height: 34px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--field); padding: 0 12px; font: inherit; }
.live { display: flex; align-items: center; gap: 6px; color: var(--text2); font-size: 12px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); display: inline-block; }
.live.off i { background: var(--border); }
.user { display: flex; align-items: center; gap: 8px; cursor: pointer; border: 0; background: none; padding: 4px; border-radius: var(--radius); }
.user:hover { background: var(--surface2); }
.avatar { width: 32px; height: 32px; border-radius: 6px; background: var(--selected); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.body { display: grid; grid-template-columns: 232px 1fr; min-height: 0; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 16px; }
.side a { display: flex; justify-content: space-between; align-items: center; height: 37px; padding: 0 12px; border-radius: var(--radius); color: var(--text); font-weight: 500; margin-bottom: 4px; }
.side a:hover { background: var(--surface2); text-decoration: none; }
.side a.on { background: var(--selected); color: var(--blue); font-weight: 600; }
.side a span { color: var(--text2); font-weight: 400; font-size: 13px; }
.main { padding: 32px; max-width: 1280px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 24px; font-weight: 700; }
.head .lead { color: var(--text2); margin-top: 4px; }
.head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { color: var(--text2); margin-bottom: 14px; }
.crumbs a { font-weight: 500; }

/* ---------- controls */
.btn { height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius); background: var(--button); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn.solid-danger { background: var(--danger); color: #fff; }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.wide { width: 100%; }
label.field { display: block; margin-top: 12px; font-size: 13px; color: var(--text); }
label.field > span { display: block; margin-bottom: 5px; color: var(--text2); }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--field); padding: 0 12px; font: inherit; color: var(--text); }
textarea { height: auto; padding: 8px 12px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .user:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
input[readonly], .ro { background: var(--surface2); }
.hint { color: var(--text2); font-size: 12.5px; margin-top: 4px; }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; }

/* ---------- cards, stats, tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 20px; margin-bottom: 20px; }
.card h2 { font-size: 15px; font-weight: 700; }
.card .lead { color: var(--text2); font-size: 13px; margin: 2px 0 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px 18px; }
.stat .label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.stat .label::before { content: ""; width: 3px; height: 12px; background: var(--bar, var(--text)); display: inline-block; }
.stat .big { font-size: 30px; font-weight: 700; margin: 2px 0; }
.stat .note { color: var(--text2); font-size: 13px; }
.chips { display: flex; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 500; }
.chip.on { background: var(--selected); border-color: var(--blue); color: var(--blue); }
.tablewrap { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow-x: auto; margin-bottom: 20px; }
table { border-collapse: collapse; width: 100%; }
th { background: var(--surface2); text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); font-weight: 600; padding: 12px 20px; }
td { padding: 12px 20px; border-top: 1px solid var(--border); vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f5f7ff; }
td .name { font-weight: 700; white-space: nowrap; } td .sub { color: var(--text2); font-size: 12.5px; }
td.mono, td .mono { white-space: nowrap; }
td.num, th.num { text-align: right; }
.empty { padding: 32px; text-align: center; color: var(--text2); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px; font-size: 12.5px; font-weight: 600; background: var(--surface2); color: var(--text2); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.active { background: var(--live-bg); color: var(--live); }
.status.grace { background: var(--warn-bg); color: var(--warn); }
.status.suspended, .status.expired { background: var(--danger-bg); color: var(--danger); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 12.5px; font-weight: 500; background: var(--surface2); color: var(--text2); }
.tag.green { background: var(--live-bg); color: var(--live); } .tag.amber { background: var(--warn-bg); color: var(--warn); }
.tag.red { background: var(--danger-bg); color: var(--danger); } .tag.blue { background: var(--selected); color: var(--blue); }
.bar { height: 6px; background: var(--surface2); border-radius: 3px; width: 100%; min-width: 90px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--live); } .bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--danger); }
.notice { border: 1px solid var(--blue); background: var(--selected); border-radius: 6px; padding: 12px 16px; margin-bottom: 20px; }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }

/* ---------- detail page */
.detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title h1 { font-size: 26px; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: center; margin: 4px 0 16px; }
.flow .step { padding: 12px 14px; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface2); color: var(--text2); }
.flow .step b { display: block; color: var(--text); }
.flow .step.on.active { background: var(--live-bg); border-color: var(--live-bg); } .flow .step.on.active b { color: var(--live); }
.flow .step.on.grace { background: var(--warn-bg); border-color: var(--warn); } .flow .step.on.grace b { color: var(--warn); }
.flow .step.on.suspended { background: var(--danger-bg); border-color: var(--danger); } .flow .step.on.suspended b { color: var(--danger); }
.flow .arrow { color: var(--text2); }
dl.facts { margin: 0; } dl.facts div { display: grid; grid-template-columns: 190px 1fr; padding: 9px 0; border-top: 1px solid var(--border); }
dl.facts dt { color: var(--text2); } dl.facts dd { margin: 0; word-break: break-word; }
.log { margin: 0; padding: 0; list-style: none; }
.log li { display: grid; grid-template-columns: 4px 112px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); align-items: center; }
.log li i { width: 3px; height: 16px; background: var(--text2); display: block; }
.log li.green i { background: var(--live); } .log li.amber i { background: var(--warn); } .log li.red i { background: var(--danger); } .log li.blue i { background: var(--blue); }
.preview { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 16px; }
.preview .bar-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.preview .banner { border: 1px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; color: var(--warn); }
.preview .banner.red { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.preview .banner b { display: block; }
.preview .ready { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.preview .ready b { display: block; }

/* ---------- dialogs and toasts */
.overlay { position: fixed; inset: 0; background: rgba(20, 22, 31, .45); display: grid; place-items: center; padding: 20px; z-index: 50; }
.dialog { width: 500px; max-width: 100%; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 8px; padding: 26px; box-shadow: 0 12px 40px rgba(20, 22, 31, .25); }
.dialog h2 { font-size: 20px; } .dialog.danger h2 { border-left: 3px solid var(--danger); padding-left: 10px; }
.dialog .lead { color: var(--text2); margin: 4px 0 8px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.what { background: var(--danger-bg); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; color: var(--text); }
.what b { color: var(--danger); display: block; margin-bottom: 4px; } .what ul { margin: 4px 0 0; padding-left: 18px; }
.codebox { border: 1px solid var(--blue); background: var(--selected); border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.codebox .code { font-size: 24px; color: var(--blue); letter-spacing: .04em; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--text); color: #fff; padding: 12px 16px; border-radius: var(--radius); z-index: 80; max-width: 380px; }
.toast.error { background: var(--danger); }
.menu { position: absolute; right: 24px; top: 58px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20, 22, 31, .15); min-width: 180px; z-index: 40; padding: 6px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 4px; cursor: pointer; }
.menu button:hover { background: var(--surface2); }

@media (max-width: 900px) {
  .body { grid-template-columns: 1fr; } .side { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side a { margin: 0; } .detail { grid-template-columns: 1fr; } .main { padding: 16px; } .search { display: none; }
  .flow { grid-template-columns: 1fr; } .flow .arrow { display: none; } th, td { padding: 10px 12px; }
}

/* ---------- accounts: set-up page, recovery codes, users */
.login-card.wide { width: 600px; }
.login-card .stepname { font-size: 15px; margin: 18px 0 6px; }
.login-card .muted { font-size: 13px; }
.qrline { display: flex; gap: 20px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.qrline img { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.keytext { font-size: 15px; letter-spacing: .04em; margin: 4px 0 8px; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 12px 0; font-size: 15px; }
.linktext { word-break: break-all; font-size: 12px; margin: 4px 0; }
.user .tag { margin-left: 4px; }

td.num { white-space: nowrap; } td.muted, td .muted { white-space: nowrap; }
