/* Vaultlink admin page -- on top of styles.css. */
.brand-sub { font-style: normal; color: var(--muted); font-weight: 500; margin-left: 4px; }
.admin-main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 16px; }

.admin-summary { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1 1 140px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 1.4rem; font-weight: 650; }
.stat span { font-size: 0.76rem; color: var(--muted); }
.stat.ok b { color: var(--ok); }
.stat.warn b { color: var(--warn); }
.stat.bad b { color: var(--danger); }

.admin-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.admin-card-head h2 { font-size: 0.95rem; font-weight: 600; }

.admin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; margin-bottom: 12px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.admin-form > input[type=text], .admin-form > input[type=email], .admin-form > input[type=password], .admin-form > select { flex: 1 1 200px; }
.admin-form .hint, .admin-form .status-line { flex-basis: 100%; margin-top: 0; }
.inline-label { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }

input[type=email], input[type=date], select {
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 0.85rem; font-family: inherit;
}
.auth-box input[type=email] { width: 100%; }
input[type=date] { color-scheme: dark; }
.admin-form > input[type=password] { font-family: var(--font-mono); }

.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.admin-table th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 8px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.admin-table td.actions { text-align: right; white-space: nowrap; }
.admin-table td.actions button { margin-left: 4px; }
.admin-table select, .admin-table input[type=date] { padding: 5px 7px; font-size: 0.8rem; max-width: 190px; }
.admin-table .muted { color: var(--muted); font-size: 0.76rem; }
.admin-table .empty { color: var(--muted); text-align: center; padding: 18px; }
.status-pill.bad { background: var(--danger-dim); color: var(--danger); }
.status-line.warn { color: var(--warn); }
.status-pill.ok { background: var(--ok-dim); color: var(--ok); }
.status-pill.warn { background: var(--warn-dim); color: var(--warn); }

.admin-overlay { position: fixed; inset: 0; background: rgba(11, 13, 18, 0.92); display: flex; align-items: center; justify-content: center; z-index: 3000; padding: 16px; }
.modal-box { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 10px; right: 10px; }
.modal-box h3 { font-size: 1rem; margin-bottom: 8px; }
.modal-box p { font-size: 0.84rem; color: var(--text-dim); line-height: 1.5; margin-top: 8px; }
.modal-box input[type=password] { width: 100%; font-family: var(--font-mono); margin-top: 10px; }
.link-box { display: flex; gap: 6px; margin-top: 10px; }
.link-box input { flex: 1; font-family: var(--font-mono); font-size: 0.74rem; }
.qr { background: #fff; border-radius: var(--radius-sm); padding: 8px; width: 180px; margin: 14px auto 0; }
.qr svg { display: block; width: 100%; height: auto; }

/* Claim card: what gets printed and handed to the client with the tracker. */
.claim-card { background: #fff; color: #111; border-radius: var(--radius); padding: 20px; margin-top: 12px; }
.claim-card h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #555; margin: 0; }
.claim-card .claim-name { font-size: 1.05rem; font-weight: 650; margin-top: 4px; }
.claim-card .claim-code { font-family: var(--font-mono); font-size: 1.45rem; font-weight: 700; letter-spacing: 0.06em; margin: 14px 0; text-align: center; padding: 10px; border: 2px dashed #999; border-radius: 8px; }
.claim-card .claim-scan { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.claim-card .qr { margin: 0; width: 120px; padding: 0; flex-shrink: 0; }
.claim-card ol { margin: 0; padding-left: 18px; font-size: 0.82rem; line-height: 1.55; color: #222; }
.claim-card .claim-manual { font-size: 0.74rem; color: #555; margin-top: 14px; }
.claim-card .claim-manual a { color: #1a56db; font-weight: 600; text-decoration: underline; }
.claim-card .claim-code { font-size: 1.2rem; margin: 6px 0 10px; padding: 7px; }
.claim-card .claim-note { display: block; font-size: 0.68rem; color: #666; line-height: 1.4; }

@media print {
  body * { visibility: hidden; }
  .claim-card, .claim-card * { visibility: visible; }
  .claim-card { position: absolute; left: 0; top: 0; width: 90mm; border: 1px solid #999; margin: 0; }
}

@media (max-width: 640px) {
  .admin-table thead { display: none; }
  .admin-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .admin-table td { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: none; padding: 4px 4px; }
  .admin-table td::before { content: attr(data-label); color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
  .admin-table td.actions { flex-wrap: wrap; justify-content: flex-end; }
  .admin-table td.actions::before { content: none; }
  .admin-table td.actions button { margin: 4px 0 0 4px; }
  .topbar .account-email { display: none; }
}

/* Two-factor step on the sign-in box */
.mfa-step { margin-top: 14px; text-align: center; }
.mfa-step[hidden], #adminMfaSetup[hidden] { display: none; }
.mfa-qr { display: block; width: 180px; height: 180px; margin: 12px auto; background: #fff; border-radius: 8px; padding: 8px; }
.mfa-secret { display: block; word-break: break-all; font-size: 0.85rem; padding: 8px; margin: 6px 0 12px; }
#adminMfaCode { letter-spacing: 0.3em; text-align: center; font-size: 1.15rem; }
#adminMfaForm button { width: 100%; padding: 11px; margin-top: 12px; }

/* ---------- Website: page views ---------- */
.views-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { background: transparent; border: 0; border-radius: 0; color: var(--text-dim); padding: 5px 10px; font-size: 0.76rem; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent-dim); color: var(--text); }
.views-chart { position: relative; margin: 14px 0 4px; }
.views-caption { font-size: 0.76rem; color: var(--muted); margin-bottom: 6px; }
.views-plot { position: relative; height: 190px; }
.views-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.views-plot .grid { stroke: var(--border-soft); stroke-width: 1; }
.views-plot .base { stroke: var(--border); stroke-width: 1; }
.views-plot .tick { fill: var(--muted); font-size: 10px; }
.views-plot .peak { fill: var(--text-dim); font-size: 10.5px; font-weight: 600; }
.views-plot .empty-note { fill: var(--muted); font-size: 12px; }
.views-plot .bar { fill: var(--accent); }
.views-plot .hit { fill: transparent; cursor: default; outline: none; }
.views-plot .on .bar { fill: #7ea9ff; }
.views-plot .on .hit { fill: rgba(79, 140, 255, 0.07); }
.views-tip { position: absolute; top: 0; pointer-events: none; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 9px; font-size: 0.76rem; color: var(--text-dim); box-shadow: var(--shadow); white-space: nowrap; transform: translateX(-50%); }
.views-tip b { display: block; color: var(--text); font-size: 0.95rem; font-weight: 650; }
.views-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 12px; }
.views-lists h3 { font-size: 0.78rem; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.views-days { margin-top: 10px; font-size: 0.8rem; color: var(--text-dim); }
.views-days summary { cursor: pointer; }
.views-days table { margin-top: 6px; max-width: 360px; }

/* ---------- Health and activity ---------- */
.health-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 0.84rem; }
.health-row:last-of-type { border-bottom: 0; }
.health-row .status-pill { flex: 0 0 auto; min-width: 74px; text-align: center; margin-top: 1px; }
.health-row .muted { color: var(--text-dim); }
.health-row div > .muted:last-child:not(:empty) { margin-top: 3px; font-size: 0.78rem; color: var(--muted); }
.silent-list { margin: 6px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 0.8rem; }
.silent-list li { margin: 2px 0; }
.silent-list:empty { display: none; }
#activityMore { margin-top: 8px; }
.admin-table td.when { white-space: nowrap; color: var(--muted); font-size: 0.76rem; }
