/* Admin page only. Builds on styles.css (same tokens, sidebar, cards, pills and buttons). */

.admin-tag {
  display: inline-block; margin-top: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 6px;
}
.mobile-top .admin-tag { margin: 0 0 0 10px; }

/* Sign-in */
.signin-wrap {
  min-height: 100vh; display: grid; place-items: center;
  padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.signin-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.signin-card .brand-logo { height: 40px; }
.signin-card h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin-top: 6px; }
.gsi-slot { min-height: 44px; margin-top: 6px; }
.signin-error { color: var(--hot-ink); background: var(--hot-bg); padding: 10px 12px; border-radius: 10px; font-size: 13px; width: 100%; }

.signout {
  margin-left: auto; flex: none; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
}
.signout:hover { background: var(--surface-2); color: var(--ink); }

/* Page parts */
.kpis.eight { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpis.eight, .kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi.attention { border-color: var(--hot-ink); background: var(--hot-bg); }
.kpi.attention .kpi-label, .kpi.attention .kpi-value { color: var(--hot-ink); }
.kpi-value.small { font-size: 22px; }
.delta.down { color: var(--hot-ink); background: var(--hot-bg); }

.bars { width: 100%; height: auto; display: block; }
.bars .bar { fill: var(--s1); }
.bars .bar.partial { opacity: .45; }
.bars .grid-line { stroke: var(--line); stroke-width: 1; }
.bars text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.bars-empty { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }

.flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.flags li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.flags li:first-child { border-top: 0; padding-top: 2px; }
.flags .sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--warm-ink); }
.flags .sev.hot { background: var(--hot-ink); }
.flags .t { font-weight: 600; font-size: 13.5px; }
.flags .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.flags-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }

.atable-wrap { overflow-x: auto; margin-inline: -18px; }
table.atable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.atable th, .atable td { padding: 10px 18px; text-align: left; white-space: nowrap; }
.atable th { font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); }
.atable th button { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.atable th button:hover, .atable th button[aria-sort] { color: var(--ink); }
.atable th button[aria-sort]::after { content: ""; border: 4px solid transparent; }
.atable th button[aria-sort="descending"]::after { border-top-color: currentColor; margin-top: 4px; }
.atable th button[aria-sort="ascending"]::after { border-bottom-color: currentColor; margin-bottom: 4px; }
.atable .num { text-align: right; }
.atable td.feats { white-space: normal; min-width: 150px; }
.atable td.feats .tag { margin-block: 2px; }
.atable th.num button { flex-direction: row-reverse; }
.atable td { border-bottom: 1px solid var(--line); }
/* Users on the account page sit in half the width, so names and emails wrap. */
.atable.users th, .atable.users td { padding-inline: 10px; }
.atable.users th:first-child, .atable.users td:first-child { padding-left: 18px; white-space: normal; }
.atable.users th:last-child, .atable.users td:last-child { padding-right: 18px; text-align: right; }
.atable.users .acct-email { max-width: none; overflow-wrap: anywhere; }
.atable tbody tr:last-child td { border-bottom: 0; }
.atable tbody tr.link { cursor: pointer; }
.atable tbody tr.link:hover td { background: var(--surface-2); }
.atable .muted, .muted { color: var(--muted); }
.acct-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.acct-name:hover { color: var(--accent); }
.acct-email { display: block; font-size: 12px; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

.tag {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--cold-bg); color: var(--cold-ink); margin-right: 4px;
}
.tag.on { background: var(--accent-soft); color: var(--accent); }
.pill.good { background: var(--accent-soft); color: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar .search { max-width: 280px; }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 500; margin-bottom: 10px; }
.back:hover { color: var(--accent); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
a.btn { text-decoration: none; }
.btn.light { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn.light:hover { background: var(--surface-2); }
.btn.small { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.danger { background: var(--hot-bg); color: var(--hot-ink); border-color: transparent; }

.details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13.5px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .cols-3 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 16px; }

.add-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 140px auto; gap: 10px; align-items: end; }
@media (max-width: 900px) { .add-form { grid-template-columns: minmax(0, 1fr); } }
.select { height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 0 10px; font: inherit; font-size: 13.5px; }
.role-select { height: 30px; font-size: 12.5px; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.activity li:first-child { border-top: 0; }
.activity time { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .activity li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* Health */
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.dot.ok { background: var(--accent); box-shadow: none; }
.dot.warn { background: var(--warm-ink); box-shadow: none; }
.dot.fail { background: var(--hot-ink); box-shadow: none; }
.checks, .actions { list-style: none; margin: 0; padding: 0; }
.checks li, .actions li { display: grid; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.checks li { grid-template-columns: 9px minmax(0, 1fr) auto; }
.actions li { grid-template-columns: minmax(0, 1fr) auto; }
.checks li:first-child, .actions li:first-child { border-top: 0; padding-top: 2px; }
.checks .t, .actions .t { font-weight: 600; font-size: 13.5px; }
.checks .s, .actions .s { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.checks .s.detail { overflow-wrap: anywhere; }
.actions .btn { white-space: nowrap; }
.checks .row-end { display: flex; align-items: center; gap: 8px; }
.pick { width: 16px; height: 16px; accent-color: var(--hot-ink); }
#remove-box .confirm-box { margin: 0 0 14px; }

.progress-panel { margin-bottom: 16px; }
.progress-panel .t { font-weight: 600; font-size: 13.5px; margin-bottom: 10px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s ease; }

.check-blocks { display: flex; flex-direction: column; }
.check-block { padding: 12px 0; border-top: 1px solid var(--line); }
.check-block:first-child { border-top: 0; padding-top: 2px; }
.check-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-head .t { font-weight: 600; font-size: 14px; }
.check-head .muted { font-size: 12.5px; }
.check-items { list-style: none; margin: 8px 0 0; padding: 0 0 0 19px; display: flex; flex-direction: column; gap: 6px; }
.check-items li { display: grid; grid-template-columns: 9px minmax(120px, 220px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.check-items .acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-items .msg { color: var(--ink-2); min-width: 0; }
.check-items .since { font-size: 12px; white-space: nowrap; }
@media (max-width: 720px) {
  .check-items { padding-left: 0; }
  .check-items li { grid-template-columns: 9px minmax(0, 1fr); row-gap: 2px; }
  .check-items .msg, .check-items .since { grid-column: 2; }
}
.link-btn { border: 0; background: none; padding: 6px 0 0 19px; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.confirm-box { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--hot-bg); display: flex; flex-direction: column; gap: 10px; }
.confirm-box .t { font-weight: 700; color: var(--hot-ink); }
.confirm-box .s { font-size: 13px; color: var(--ink-2); margin: 0; }
.confirm-box .label b { font-family: var(--mono); font-weight: 500; overflow-wrap: anywhere; }
.confirm-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger.solid { background: var(--hot-ink); color: #fff; }
.btn.danger.solid[disabled] { opacity: .45; cursor: not-allowed; }

.loading { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }
.demo-banner { margin-bottom: 16px; }

@media (max-width: 820px) {
  .atable-wrap { margin-inline: -14px; }
}

/* Invite codes */
.invites { margin-bottom: 16px; }
.inv-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 680px; }
.inv-result { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.inv-result > .sub { margin: 0; }
.inv-warn { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--warm-bg, var(--surface-2)); color: var(--warm-ink); font-size: 13px; }
.inv-sample a { color: var(--accent); }
.inv-copy { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.inv-copy h3 { margin: 0; font-size: 14px; }
.inv-copy .sub { margin: 0; }
.inv-copy code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.copy-row { display: flex; gap: 8px; align-items: flex-start; }
.copy-row .textarea, .copy-row .input { flex: 1; min-width: 0; font-size: 13px; }
.copy-row .btn { flex: none; }
.inv-note { margin: 0; color: var(--muted); font-size: 12.5px; grid-column: 1 / -1; }
.inv-note .inv-page { padding: 0; margin-right: 12px; font-size: 12.5px; }
.inv-progress { margin-top: 8px; max-width: 420px; }
.inv-actions { margin-top: 12px; }
.inv-copy { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
