/* Manage users. Tokens come from app.css; nothing here restates the design
   system. Classes are prefixed usr- so they cannot collide with an existing
   rule -- the prototype lost an hour to a chat label classed .tomo matching a
   page-layout rule of the same name. */

.usr-page { padding-bottom: 3rem; }

.usr-table-wrap { overflow-x: auto; }

.usr-table { width: 100%; border-collapse: collapse; }
.usr-table th {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ab-text-muted);
  border-bottom: 1px solid var(--ab-border);
  padding: 0.5rem 1rem;
  white-space: nowrap;
}
.usr-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ab-border-light);
  vertical-align: middle;
}
.usr-table tbody tr:last-child td { border-bottom: 0; }
.usr-table tbody tr:hover { background: var(--ab-hover-bg); }

.usr-person { display: flex; align-items: center; gap: 0.75rem; }
.usr-avatar {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: #2c5f4a; color: #fff;
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 700; flex: none;
}
.usr-name { display: block; font-weight: 600; color: var(--ab-text); }
.usr-email { display: block; font-size: 0.8rem; color: var(--ab-text-muted); }
.usr-you {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #2c5f4a; background: #e8f0ec;
  padding: 0.1rem 0.4rem; border-radius: 3px; vertical-align: 1px;
}
.usr-since { font-size: 0.85rem; color: var(--ab-text-muted); white-space: nowrap; }

.usr-select {
  font-family: var(--ab-font-body); font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--ab-border); border-radius: 6px;
  background: var(--ab-surface); color: var(--ab-text);
}
.usr-select:focus {
  outline: none; border-color: #2c5f4a; box-shadow: 0 0 0 3px #e8f0ec;
}
.usr-select:disabled { opacity: 0.55; cursor: not-allowed; }
.usr-locked {
  display: block; font-size: 0.75rem; color: var(--ab-text-muted); margin-top: 0.2rem;
}

.usr-notice {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem;
  font-size: 0.9rem; line-height: 1.5;
}
.usr-notice-ok    { background: #eef5f1; border: 1px solid #cfe0d6; color: #1d4d3a; }
.usr-notice-error { background: #fbeaea; border: 1px solid #f0d2d2; color: #8f2020; }

.usr-legend { margin-top: 2rem; }
.usr-legend h3 { font-size: 0.95rem; margin: 0 0 0.75rem; }
.usr-legend dl {
  display: grid; grid-template-columns: auto 1fr; gap: 0.6rem 1rem;
  margin: 0; align-items: start;
}
.usr-legend dt { margin: 0; }
.usr-legend dd {
  margin: 0; font-size: 0.85rem; line-height: 1.5; color: var(--ab-text-secondary);
}
.usr-role {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 4px;
  white-space: nowrap;
}
.usr-role-member   { background: var(--ab-border-light); color: var(--ab-text-secondary); }
.usr-role-approver { background: #e8f0ec; color: #2c5f4a; }
.usr-role-admin    { background: #ece9fb; color: #5833F1; }

.usr-denied {
  background: var(--ab-surface); border: 1px solid var(--ab-border);
  border-radius: 10px; padding: 1.5rem; max-width: 34rem;
}
.usr-denied h3 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.usr-denied p { margin: 0 0 0.6rem; font-size: 0.9rem; line-height: 1.55;
  color: var(--ab-text-secondary); }
.usr-denied-you { color: var(--ab-text-muted); }

@media (max-width: 640px) {
  .usr-legend dl { grid-template-columns: 1fr; gap: 0.25rem 0; }
  .usr-legend dd { margin-bottom: 0.75rem; }
}

/* ── Account menu in the nav ───────────────────────────────────────────────
   Admin tools and Logout live behind the name rather than in the row. The tab
   row is at its width ceiling: measured at 1280px, a tenth nav item pushed the
   bar to three rows and clipped Logout off the right edge. A menu costs no
   width at all. */
#main-nav li.acct { position: relative; display: flex; align-items: center; gap: 0.5rem; }

.acct-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: none; border: 0; cursor: pointer;
  font-family: var(--ab-font-body); font-size: 0.85rem; font-weight: 500;
  color: var(--ab-text-secondary);
  padding: 0.35rem 0.5rem; border-radius: 6px; white-space: nowrap;
}
.acct-btn:hover { color: var(--ab-text); background: rgba(0, 0, 0, 0.04); }
.acct-btn:focus-visible { outline: 2px solid #2c5f4a; outline-offset: 2px; }
.acct-caret { font-size: 0.7rem; opacity: 0.6; }

.acct-menu {
  position: absolute; top: calc(100% + 0.4rem); right: 0; z-index: 30;
  min-width: 11rem; padding: 0.35rem;
  background: var(--ab-surface); border: 1px solid var(--ab-border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(27, 40, 50, 0.14);
  display: flex; flex-direction: column;
}
.acct-menu[hidden] { display: none; }
.acct-menu a {
  display: block; padding: 0.5rem 0.7rem; border-radius: 6px;
  font-size: 0.85rem; font-weight: 500; color: var(--ab-text-secondary);
  text-decoration: none; white-space: nowrap;
}
.acct-menu a:hover { background: var(--ab-hover-bg); color: var(--ab-text); }
.acct-menu a[hidden] { display: none; }

/* ── Review group in the nav (LTA-134) ─────────────────────────────────────
   Two "waiting for a human" queues under one tab: Proposals and Answer
   feedback. The nav was full at eight tabs (see the account-menu note above
   for the measurement), so grouping them buys back a slot AND puts the two
   queues that have the same job in the same place.

   Styled here rather than in data-tomo-feedback.css because this is the NAV,
   and `.acct-*` directly above is the same kind of menu — one file owns the
   nav's dropdowns so the two cannot drift apart. */
#main-nav li.review { position: relative; display: flex; align-items: center; }

.review-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: none; border: 0; cursor: pointer;
  font-family: var(--ab-font-body); font-size: 0.85rem; font-weight: 600;
  color: var(--ab-text-secondary);
  padding: 0.5rem 0.5rem; border-radius: 6px; white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.review-btn:hover { color: var(--ab-text); background: rgba(0, 0, 0, 0.04); }
.review-btn:focus-visible { outline: 2px solid #2c5f4a; outline-offset: 2px; }
/* Matches #main-nav a[data-nav].active exactly: the group button carries the
   current state for either page underneath it. */
.review-btn.active { color: #2c5f4a; background: #e8f0ec; }

/* The COMBINED count. One number, because the tab's question is "how much is
   waiting for a human" and two badges side by side make the reader add them
   up themselves. The per-queue breakdown is inside the menu. */
.review-count {
  min-width: 1rem; padding: 0 0.3rem; border-radius: 99px;
  background: #2c5f4a; color: #fff;
  font-size: 0.6rem; font-weight: 700; line-height: 1rem; text-align: center;
}
.review-count[hidden] { display: none; }

.review-menu {
  position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 30;
  min-width: 13rem; padding: 0.35rem;
  background: var(--ab-surface); border: 1px solid var(--ab-border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(27, 40, 50, 0.14);
  display: flex; flex-direction: column;
}
.review-menu[hidden] { display: none; }
/* The items are `a[data-nav]`, so app.css's tab rule applies to them too --
   overridden to a menu row, not a tab. */
#main-nav .review-menu a[data-nav] {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.5rem 0.7rem; border-radius: 6px;
  font-size: 0.85rem; font-weight: 500; color: var(--ab-text-secondary);
}
#main-nav .review-menu a[data-nav]:hover {
  background: var(--ab-hover-bg); color: var(--ab-text);
}
#main-nav .review-menu a[data-nav][hidden] { display: none; }

.review-item-count {
  margin-left: auto;
  font-family: var(--ins-font-mono, monospace); font-size: 0.6rem; font-weight: 700;
  background: #e8f0ec; color: #2c5f4a;
  padding: 0 0.45rem; border-radius: 99px;
}
