:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #6b7683;
  --line: #e3e7ec;
  --brand: #2b6cb0;
  --brand-dark: #234e7d;
  --green: #2f855a;
  --red: #c53030;
  --amber: #b7791f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--brand-dark); color: #fff; padding: 12px 20px;
}
.brand { font-weight: 700; font-size: 18px; }
.brand span { font-weight: 300; opacity: .85; }

.status { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: #999; }
.status--up .dot { background: #48bb78; box-shadow: 0 0 0 3px rgba(72,187,120,.25); }
.status--down .dot { background: #f56565; box-shadow: 0 0 0 3px rgba(245,101,101,.25); }

.banner {
  background: #fff5f5; color: var(--red); border-bottom: 1px solid #feb2b2;
  padding: 10px 20px; font-size: 14px;
}
.banner a { color: var(--red); font-weight: 600; }
.hidden { display: none; }

.tabs { display: flex; gap: 4px; padding: 0 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.tab {
  border: none; background: none; padding: 14px 16px; font-size: 14px; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent;
}
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

main { max-width: 960px; margin: 24px auto; padding: 0 20px; }
.panel { display: none; }
.panel.is-active { display: block; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row .grow { flex: 1 1 220px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px;
  background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(43,108,176,.35); border-color: var(--brand); }

.btn {
  padding: 8px 14px; border: 1px solid var(--line); background: #fff; border-radius: 7px;
  cursor: pointer; font-size: 14px; color: var(--ink);
}
.btn:hover { background: #f0f2f5; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--primary:disabled { background: #a0aec0; border-color: #a0aec0; cursor: not-allowed; }

.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.grid th, .grid td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.grid th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.grid tfoot td { background: #fafbfc; font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.right { text-align: right; }

.entry-grid input, .entry-grid select { width: 100%; }
.entry-grid td { vertical-align: middle; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill.ok { background: #f0fff4; color: var(--green); }
.pill.bad { background: #fff5f5; color: var(--red); }

.msg { font-size: 14px; min-height: 20px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }

.voucher-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.voucher-item .meta { display: flex; gap: 12px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.voucher-item .tag { background: #edf2f7; padding: 1px 8px; border-radius: 6px; }
.link { background: none; border: none; color: var(--red); cursor: pointer; font-size: 18px; line-height: 1; }

/* --- license badge + panel --- */
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* Session Time chip — ticks in index.html's inline script. Sits on the dark-blue topbar. */
.st-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px;
           background: rgba(255, 255, 255, 0.14); border-radius: 999px; white-space: nowrap;
           line-height: 1; user-select: none; }
.st-label { color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.st-d { display: inline-block; min-width: 17px; padding: 3px 0; text-align: center;
        background: rgba(0, 0, 0, 0.4); border-radius: 4px; color: #fff;
        font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-colon { color: #fff; font-weight: 800; font-size: 12.5px; margin: 0 -2px; }
@media (max-width: 560px) { .st-label { display: none; } }
.lic-badge { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: #e2e8f0; color: #4a5568; white-space: nowrap; }
.lic--active { background: #f0fff4; color: var(--green); }
.lic--inactive { background: #fff5f5; color: var(--red); }
.lic--unknown { background: #e2e8f0; color: #4a5568; }

.banner--warn { background: #fffaf0; color: var(--amber); border-color: #f6e05e; }
.banner--warn a { color: var(--amber); font-weight: 700; }

.lic-status { font-size: 14px; line-height: 1.9; }
.lic-status .k { color: var(--muted); display: inline-block; min-width: 92px; }
.lic-status code { background: #edf2f7; padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* --- support panel --- */
.card-title { margin: 0 0 6px; font-size: 15px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.sup-code {
  font-size: 22px; font-weight: 800; letter-spacing: 4px;
  background: #ebf8ff; color: var(--brand-dark);
  padding: 4px 14px; border-radius: 8px; align-self: center;
}
.audit { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fafbfc; }
.audit-row { font-size: 13px; padding: 3px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.audit-row:last-child { border-bottom: none; }
.audit-row .ts { color: var(--muted); white-space: nowrap; }
.audit-row .ev { font-weight: 600; }
.audit-row .ev.warn { color: var(--red); }
