/* Same palette as certopz.com and the portal's login page. */
:root {
  --bg: #f8fafc;          /* slate-50 */
  --card: #ffffff;
  --ink: #0f172a;         /* slate-900 */
  --muted: #64748b;       /* slate-500 */
  --line: #e2e8f0;        /* slate-200 */
  --soft: #f1f5f9;        /* slate-100 */
  --accent: #0891b2;      /* the portal's sign-in button */
  --accent-soft: #ecfeff; /* cyan-50 */
  --accent-ink: #ffffff;
  --accent-text: #0e7490; /* cyan-700 */
  --bar-from: #0f172a;    /* slate-900 */
  --bar-to: #1e293b;      /* slate-800 */
  --bar-ink: #f8fafc;
  --bar-tag: #5eead4;     /* teal-300 */
  --ok: #047857; --ok-soft: #d1fae5;
  --warn: #b45309; --warn-soft: #fef3c7;
  --off: #64748b; --off-soft: #f1f5f9;
  --danger: #dc2626; --danger-soft: #fef2f2;
  --demo: #6d28d9; --demo-soft: #ede9fe;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.5 "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar { background: linear-gradient(to bottom right, var(--bar-from), var(--bar-to)); color: var(--bar-ink); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px max(16px, 3vw); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; }
.brand-name { line-height: 1.2; }
.brand-word { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.brand-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.25em; color: var(--bar-tag); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.who .role { text-transform: capitalize; padding: 2px 8px; border-radius: 999px; background: rgb(255 255 255 / 12%); font-size: 12px; }
.who a { color: var(--bar-ink); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 20px max(16px, 3vw) 48px; display: flex; flex-direction: column; gap: 16px; }
.notice { background: var(--warn-soft); color: var(--ink); border-radius: 8px; padding: 9px 14px; font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; }
.tile .n { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .l { color: var(--muted); font-size: 13px; }
.tile:first-child .n { color: var(--warn); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { font: inherit; background: none; border: 0; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.badge { background: var(--warn); color: var(--card); border-radius: 999px; font-size: 11.5px; padding: 0 7px; font-weight: 600; }

.panel { min-height: 200px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.inline { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.find { display: inline-flex; gap: 6px; }
select, input, textarea { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; }
.find input { width: 240px; max-width: 60vw; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--soft); }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 6px; }
td.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; max-width: 260px; }
.msg-cell { max-width: 240px; font-size: 13.5px; color: var(--muted); white-space: pre-wrap; }
.sub { color: var(--muted); font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.empty-row { padding: 28px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 10px; margin: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.toolbar .hint { margin: 0; }
.error { color: var(--danger); }
.loading { color: var(--muted); }
.banner { background: var(--accent-soft); border-radius: 8px; padding: 9px 14px; margin-bottom: 12px; }
.empty { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 32px; text-align: center; }
.empty h2 { margin: 0 0 6px; font-size: 18px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--off-soft); color: var(--off); text-transform: capitalize; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.off { background: var(--off-soft); color: var(--off); }
.pill.demo, .pill.dev { background: var(--demo-soft); color: var(--demo); }
.pill.prod { background: var(--accent-soft); color: var(--accent-text); }
.pill.role-admin { background: var(--danger-soft); color: var(--danger); }
.pill.role-operations { background: var(--accent-soft); color: var(--accent-text); }

.btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 7px; padding: 7px 14px; cursor: pointer; font-weight: 500; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost-danger { color: var(--danger); }
.btn.ghost-danger:hover { border-color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
button.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; }
button.link:hover { text-decoration: underline; text-underline-offset: 2px; }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / 25%); }
dialog::backdrop { background: rgb(15 23 42 / 50%); }
dialog form { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
dialog h2 { margin: 0; font-size: 18px; }
#dlg-body { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .field .label { font-size: 13px; font-weight: 600; }
.field .label:empty { display: none; }
.field input, .field select, .field textarea { width: 100%; padding: 8px 10px; }
.field input[readonly] { background: var(--soft); color: var(--muted); }
.field .help { font-size: 12.5px; color: var(--muted); }
.field .static { font-size: 14px; overflow-wrap: anywhere; }
.field.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.field.check input { width: auto; }
.dlg-error { color: var(--danger); margin: 0; min-height: 1.2em; font-size: 13.5px; }
.dlg-error:empty { display: none; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 10; max-width: calc(100% - 32px); }
