/* R7 Workbench, accounts and administration. Uses the dashboard's own theme tokens only. */

.wb-page { padding: 20px 24px; max-width: 1500px; }
.wb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.wb-title { font-size: 18px; font-weight: 600; color: var(--text-primary); margin: 0; }
.wb-status { font-size: 12px; color: var(--text-secondary); }
.wb-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.wb-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer;
  color: var(--text-secondary); font: inherit; font-size: 13px; }
.wb-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }
.wb-panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.wb-panel h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.wb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.wb-inline { display: inline-flex; gap: 6px; align-items: center; }
.wb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 14px; margin: 8px 0; }
.wb-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-secondary); }
.wb-sel, .wb-text, .wb-num, .wb-json { background: var(--bg-inset); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 7px; font: inherit; font-size: 13px; }
.wb-num { width: 90px; }
.wb-text { min-width: 160px; }
.wb-json { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.wb-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; margin: 4px 0;
  background: var(--bg-inset); border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.wb-cid { font-weight: 600; color: var(--accent-text); min-width: 26px; }
.wb-tag { font-size: 11px; color: var(--text-secondary); border: 1px dashed var(--border); border-radius: 10px; padding: 1px 7px; }
.wb-muted { color: var(--text-secondary); font-size: 12px; }
.wb-ok { color: var(--success); font-size: 12px; }
.wb-bad { color: var(--danger); font-size: 13px; padding: 4px 0; }
.wb-warn { background: var(--warning-bg); color: var(--text-primary); border-left: 3px solid var(--warning);
  padding: 7px 10px; border-radius: var(--radius-sm); font-size: 13px; margin: 6px 0; }
.wb-empty { padding: 18px; text-align: center; color: var(--text-secondary); background: var(--bg-inset);
  border-radius: var(--radius-sm); }
.wb-result-head { margin: 4px 0 10px; display: flex; flex-direction: column; gap: 3px; }
.wb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wb-table th { text-align: left; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border);
  padding: 6px 8px; position: sticky; top: 0; background: var(--bg-surface); }
.wb-table td { padding: 5px 8px; border-bottom: 1px solid var(--border-light); color: var(--text-primary); }
.wb-table tbody tr:nth-child(even) td { background: var(--table-stripe); }
.wb-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wb-table a, .wb-link { color: var(--accent-text); text-decoration: none; }
.wb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.wb-card { background: var(--bg-inset); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 8px 10px; }
.wb-card-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; }
.wb-card-value { font-size: 17px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.wb-chart { height: 300px; margin: 8px 0; }
.wb-chart-sm { height: 120px; margin: 2px 0 6px; }
.wb-disclosures { margin: 6px 0; padding-left: 18px; font-size: 12px; color: var(--text-secondary); }
.wb-pre { background: var(--bg-inset); padding: 8px; border-radius: var(--radius-sm); font-size: 12px; overflow: auto; max-height: 300px; }
.wb-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.wb-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-subtle); color: var(--accent-text);
  border-radius: 12px; padding: 2px 9px; font-size: 12px; text-decoration: none; }
.wb-chip-x { background: none; border: none; color: inherit; cursor: pointer; font-size: 11px; padding: 0; }
.wb-wl { border-top: 1px solid var(--border-light); padding: 8px 0; }
.wb-dialog { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .55); display: flex;
  align-items: flex-start; justify-content: center; overflow: auto; padding: 30px 12px; }
.wb-dialog-body { background: var(--bg-surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: min(1100px, 100%); padding: 14px 18px; }

/* accounts */
.acct-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary); padding: 16px; }
.acct-card { width: min(380px, 100%); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.acct-card label { font-size: 12px; color: var(--text-secondary); }
.acct-card input { background: var(--bg-inset); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; font: inherit; }
.acct-brand { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.acct-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.acct-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.acct-secret { display: block; font-size: 16px; padding: 10px; background: var(--bg-inset); border-radius: var(--radius-sm);
  user-select: all; word-break: break-all; }
.user-menu { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.user-chip { font-size: 12px; color: var(--text-secondary); }
.admin-create { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.admin-create input, .admin-create select { background: var(--bg-inset); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 7px; font: inherit; font-size: 13px; }
.admin-actions { white-space: nowrap; }

@media (max-width: 700px) {
  .wb-page { padding: 12px; }
  .wb-num { width: 70px; }
}

/* R7REV-14: .nav-item sets display:flex, which would override the hidden attribute for non-admins. */
#nav-admin[hidden] { display: none; }
.wb-preset-status { font-weight: 600; }
/* R7 closeout: sortable tables (Key Values spreadsheet, results, rankings) and the wide spreadsheet. */
.wb-sortable th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.wb-sortable th[data-sort]:hover, .wb-sortable th[data-sort]:focus { color: var(--accent-text); outline: none; }
.wb-sortable th[data-sort="asc"]::after { content: " \25B2"; font-size: 9px; }
.wb-sortable th[data-sort="desc"]::after { content: " \25BC"; font-size: 9px; }
#kv-grid-host { overflow-x: auto; }
#kv-grid td { white-space: nowrap; }
/* R7F2 batch 2 item 5: Print (Key Values sheet, Power Rankings). The printed copy lives in #wb-print-root; on screen
   it and the print-only lines are never shown, and printing from anywhere else is unchanged */
#wb-print-root, .wb-print-only { display: none; }
@media print {
  body.wb-printing > *:not(#wb-print-root) { display: none !important; }
  body.wb-printing #wb-print-root { display: block; color: #000; background: #fff; font: 9pt/1.3 Arial, Helvetica, sans-serif; }
  #wb-print-root .wb-print-only { display: block; }
  #wb-print-root .wb-print-head { margin: 0 0 8pt; }
  #wb-print-root .wb-print-head h2 { margin: 0 0 2pt; font-size: 13pt; }
  #wb-print-root button, #wb-print-root input, #wb-print-root select, #wb-print-root .btn, #wb-print-root .wb-btn,
  #wb-print-root .wb-no-print { display: none !important; }
  #wb-print-root .wb-panel { border: 0; padding: 0; margin: 0 0 6pt; background: #fff; box-shadow: none; }
  #wb-print-root .wb-panel h3, #wb-print-root .wb-muted, #wb-print-root .wb-warn, #wb-print-root .wb-bad,
  #wb-print-root .wb-ok, #wb-print-root a { color: #000; }
  #wb-print-root a { text-decoration: none; }
  #wb-print-root div { overflow: visible !important; }
  #wb-print-root table { border-collapse: collapse; width: 100%; font-size: 8pt; }
  #wb-print-root th, #wb-print-root td { border: 1px solid #888; padding: 1pt 3pt; background: #fff; color: #000; white-space: normal; }
  #wb-print-root thead { display: table-header-group; }
  #wb-print-root tr { break-inside: avoid; page-break-inside: avoid; }
}
