/* Mentor Admin — list (search/filter/sort) + per-mentor review & edit.
   Builds on /shared/tokens.css; mirrors the ops/assignments console styling. */

/* Use most of the viewport — the edit form (esp. the long Expertise lists)
   benefits from the extra width. */
.ma { padding-top: 2rem; padding-bottom: 3rem; max-width: min(1480px, 96vw); }
.ma__header h1 { color: var(--cbm-navy); font-family: var(--cbm-font-serif); margin-bottom: 0.25rem; }
.ma__sub { color: var(--cbm-text); margin-top: 0; }

.ma__login { max-width: 420px; margin: 2rem auto; background: var(--cbm-surface);
  padding: 2rem; border-radius: var(--cbm-radius); border: 1px solid var(--cbm-border); }
.ma__login h2 { color: var(--cbm-navy); margin-top: 0; }

.ma__toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin: 1rem 0; padding-bottom: 1rem; border-bottom: 1px solid var(--cbm-border); }
.ma__who { color: var(--cbm-slate-700); }
.ma__actions { display: flex; gap: 0.5rem; }

.ma__controls { display: flex; gap: 0.6rem; margin-bottom: 0.85rem; flex-wrap: wrap; }
.ma__search { flex: 1 1 240px; min-width: 200px; padding: 0.5rem 0.7rem;
  border: 1px solid var(--cbm-border); border-radius: var(--cbm-radius); font-family: var(--cbm-font-body); }
.ma__controls select { padding: 0.5rem; border: 1px solid var(--cbm-border);
  border-radius: var(--cbm-radius); font-family: var(--cbm-font-body); }
.ma__count { color: var(--cbm-slate-700); font-size: var(--cbm-text-sm); margin: 0 0 0.6rem; }

.ma__notice { padding: 0.75rem 1rem; border-radius: var(--cbm-radius); margin: 0 0 1rem; }
.ma__notice.is-success { background: #eafaef; color: #2f7a3f; border: 1px solid var(--cbm-success); }
.ma__notice.is-error { background: #fdeaea; color: #a23b38; border: 1px solid var(--cbm-danger); }
.form-error { color: var(--cbm-danger); margin: 0.5rem 0; }

/* list table */
.ma__table { width: 100%; border-collapse: collapse; background: var(--cbm-white); }
.ma__table th, .ma__table td { text-align: left; padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--cbm-border); vertical-align: middle; font-size: var(--cbm-text-sm); }
.ma__table thead th { color: var(--cbm-navy); background: var(--cbm-surface); font-weight: var(--cbm-fw-heading); }
.ma__table th.num, .ma__table td.num { text-align: right; }
.ma__table th.is-sortable { cursor: pointer; user-select: none; }
.ma__table th.is-sortable:hover { color: var(--cbm-blue); }
.ma__table th[data-dir="asc"]::after { content: " ▲"; font-size: 10px; }
.ma__table th[data-dir="desc"]::after { content: " ▼"; font-size: 10px; }
.ma-row:hover { background: var(--cbm-surface); }
.ma__empty, .ma__loading { color: var(--cbm-text); padding: 1.25rem 0; }

.name-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--cbm-blue); cursor: pointer; text-align: left; }
.name-link:hover { text-decoration: underline; }
.email-link { color: var(--cbm-blue); text-decoration: none; font-weight: 600; }
.email-link:hover { text-decoration: underline; }

/* status badge */
.status-badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--cbm-border);
  background: var(--cbm-surface); color: var(--cbm-slate-700); white-space: nowrap; }
.status-Active { background: #eafaef; color: #2f7a3f; border-color: var(--cbm-success); }
.status-Candidate, .status-Pending { background: #fff6e6; color: #8a5a00; border-color: var(--cbm-warning); }
.status-Inactive, .status-Departed, .status-Suspended, .status-Declined {
  background: #fdeaea; color: #a23b38; border-color: var(--cbm-danger); }

/* detail / edit */
.ma__detail-name { color: var(--cbm-navy); font-family: var(--cbm-font-serif); margin: 0.5rem 0 0.75rem; }
.ma__readonly { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 1.25rem;
  padding: 0.9rem 1.1rem; background: var(--cbm-surface); border: 1px solid var(--cbm-border);
  border-radius: var(--cbm-radius); }
.ro-item { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 110px; }
.ro-item--wide { min-width: 200px; }
.ro-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cbm-slate-700); }
.ro-value { font-weight: 600; color: var(--cbm-navy); }
.ro-link { color: var(--cbm-blue); text-decoration: none; font-weight: 600; }
.ro-link:hover { text-decoration: underline; }
.ro-address { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }

/* data-structure completeness badge (click for the reasons) */
.complete-badge { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px;
  font-size: 12px; font-weight: 700; border: 1px solid var(--cbm-border); cursor: pointer; }
.complete-badge:hover { filter: brightness(0.96); }
.complete-badge:focus-visible { outline: 2px solid var(--cbm-blue); outline-offset: 2px; }
.complete-complete { background: #eafaef; color: #2f7a3f; border-color: var(--cbm-success); }
.complete-incomplete { background: #fdeaea; color: #a23b38; border-color: var(--cbm-danger); }
.complete-duplicate { background: #fff6e6; color: #8a5a00; border-color: var(--cbm-warning); }
/* the badge is a status indicator in the grid (not the clickable detail one) */
.ma__table .complete-badge { cursor: default; }
.ro-muted { color: var(--cbm-slate-700); }

/* completeness detail popup */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; padding: 1rem;
  background: rgba(23, 59, 96, 0.55); display: flex; align-items: center; justify-content: center; }
.modal-card { background: var(--cbm-white); border-radius: var(--cbm-radius); width: 100%;
  max-width: 460px; padding: 1.5rem 1.6rem; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3); }
.modal-card h3 { margin: 0 0 0.6rem; color: var(--cbm-navy); font-family: var(--cbm-font-serif); }
.modal-card p { margin: 0 0 0.6rem; color: var(--cbm-text); }
.modal-card ul { margin: 0.3rem 0 1.1rem; padding-left: 1.2rem; }
.modal-card li { margin: 0.3rem 0; color: var(--cbm-text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.4rem; }

/* live provisioning status window */
.prov-steps { list-style: none; margin: 0.4rem 0 1rem; padding: 0; }
.prov-step { display: flex; gap: 0.55rem; align-items: flex-start; padding: 0.35rem 0;
  color: var(--cbm-text); border-bottom: 1px solid var(--cbm-border); }
.prov-step:last-child { border-bottom: 0; }
.prov-step__icon { flex: none; width: 1.3rem; text-align: center; font-weight: 700; }
.prov-step.is-running .prov-step__icon { color: var(--cbm-blue); }
.prov-step.is-done .prov-step__icon { color: #2f7a3f; }
.prov-step.is-error { color: #a23b38; }
.prov-step.is-error .prov-step__icon { color: var(--cbm-danger); }
.prov-creds { margin: 0.3rem 0 1rem; padding: 0.75rem 0.9rem; background: #fff6e6;
  border: 1px solid var(--cbm-warning); border-radius: var(--cbm-radius); font-size: var(--cbm-text-sm); }
.prov-creds code { background: var(--cbm-white); padding: 0.05rem 0.35rem; border-radius: 4px;
  border: 1px solid var(--cbm-border); }

/* email setup */
.ma__setup { padding-top: 0.5rem; }
.ma__setup .cbm-help code { background: var(--cbm-surface); padding: 0.05rem 0.3rem; border-radius: 4px; }
.ma__setup-status { margin: 0.5rem 0 1rem; color: var(--cbm-slate-700); font-size: var(--cbm-text-sm); }
.ma__setup #su_json { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.ma__setup .ma__form { display: flex; flex-direction: column; gap: 1rem; }
.ma__setup .cbm-field .cbm-help { font-weight: 400; margin: 0; }
.ma__setup-toggles { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* two-column layout: form left, step-by-step guide right */
.ma__setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.75rem; align-items: start; }
.ma__setup-main { min-width: 0; }
@media (max-width: 960px) { .ma__setup-grid { grid-template-columns: 1fr; } }

.ma__setup-guide { background: var(--cbm-surface); border: 1px solid var(--cbm-border);
  border-radius: var(--cbm-radius); padding: 1.1rem 1.25rem; position: sticky; top: 1rem;
  font-size: var(--cbm-text-sm); color: var(--cbm-text); }
.ma__setup-guide h3 { margin: 0 0 0.5rem; color: var(--cbm-navy); font-family: var(--cbm-font-serif); }
.ma__setup-guide h4 { margin: 1.1rem 0 0.4rem; color: var(--cbm-navy); font-size: var(--cbm-text-sm);
  text-transform: uppercase; letter-spacing: 0.03em; }
.ma__guide-sub { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--cbm-slate-700); }
.ma__guide-note { margin: 0 0 0.6rem; color: var(--cbm-slate-700); }
.ma__guide-steps { margin: 0.2rem 0 0; padding-left: 1.25rem; }
.ma__guide-steps li { margin: 0.45rem 0; line-height: 1.45; }
.ma__guide-steps em { color: var(--cbm-slate-700); font-style: normal; }
.ma__guide-hint { display: block; margin-top: 0.3rem; color: var(--cbm-slate-700); font-size: 12px; line-height: 1.4; }
.ma__guide-scopes { display: flex; align-items: center; gap: 0.4rem; margin: 0.35rem 0; }
.ma__guide-scopes code { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; background: var(--cbm-white);
  border: 1px solid var(--cbm-border); border-radius: 4px; padding: 0.2rem 0.4rem; font-size: 11px; }
.ma__copy { flex: none; border: 1px solid var(--cbm-border); background: var(--cbm-white); cursor: pointer;
  border-radius: 4px; padding: 0.1rem 0.4rem; color: var(--cbm-navy); line-height: 1.4; }
.ma__copy:hover { background: var(--cbm-surface); border-color: var(--cbm-blue); }
.ma__copy.is-copied { color: #2f7a3f; border-color: var(--cbm-success); }

/* edit tabs */
.ma__tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 2px solid var(--cbm-border);
  margin-bottom: 1.25rem; }
.ma__tab { border: 0; background: none; padding: 0.6rem 1rem; font: inherit; font-weight: 600;
  color: var(--cbm-slate-700); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.ma__tab:hover { color: var(--cbm-blue); }
.ma__tab.is-active { color: var(--cbm-navy); border-bottom-color: var(--cbm-blue); }

.ma__form { display: block; }
.tab-panel { display: flex; flex-direction: column; gap: 1rem; }
.tab-panel[hidden] { display: none; }
/* a row of fields within a tab; default is a responsive grid */
.tab-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.9rem 1.25rem; }
/* the checks sub-row packs checkboxes together instead of one-per-grid-cell */
.tab-row--checks { display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; align-items: center; }
.tab-row--checks .cbm-field { flex: 0 0 auto; }

.cbm-field { display: flex; flex-direction: column; gap: 0.3rem; }
.cbm-field label { font-size: var(--cbm-text-sm); font-weight: 600; color: var(--cbm-slate-700); }
.cbm-field input[type="text"], .cbm-field input[type="number"], .cbm-field input[type="date"],
.cbm-field select, .cbm-field textarea { padding: 0.5rem 0.6rem; border: 1px solid var(--cbm-border);
  border-radius: var(--cbm-radius); font-family: var(--cbm-font-body); font-size: var(--cbm-text-sm);
  width: 100%; box-sizing: border-box; }
.cbm-field textarea { resize: vertical; }

/* WYSIWYG editor (contenteditable + toolbar) */
.wysiwyg { border: 1px solid var(--cbm-border); border-radius: var(--cbm-radius); background: var(--cbm-white); }
.wysiwyg__toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--cbm-border); background: var(--cbm-surface);
  border-radius: var(--cbm-radius) var(--cbm-radius) 0 0; }
.wysiwyg__btn { border: 1px solid var(--cbm-border); background: var(--cbm-white); border-radius: var(--cbm-radius);
  padding: 0.1rem 0.5rem; min-width: 1.9rem; font-size: var(--cbm-text-sm); line-height: 1.5;
  color: var(--cbm-navy); cursor: pointer; }
.wysiwyg__btn:hover { background: var(--cbm-surface); border-color: var(--cbm-blue); }
.wysiwyg__area { min-height: 7rem; max-height: 24rem; overflow: auto; padding: 0.6rem 0.7rem;
  font-size: var(--cbm-text-sm); line-height: 1.5; color: var(--cbm-text); }
.wysiwyg__area:focus { outline: 2px solid var(--cbm-blue); outline-offset: -2px; }
.wysiwyg__area p:first-child { margin-top: 0; }
.wysiwyg__area p:last-child { margin-bottom: 0; }
.cbm-field select[multiple] { padding: 0.2rem; }
.cbm-field--check { flex-direction: row; align-items: center; }
.cbm-field--check label { flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--cbm-navy); }
.cbm-field--check input { width: auto; }
/* full-width inputs for long text + the multi-select checkbox grids */
.field-text, .field-wysiwyg, .field-multiEnum { grid-column: 1 / -1; }

/* multiEnum as a compact checkbox grid that flows across the full width */
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.1rem 0.9rem; margin-top: 0.1rem; padding: 0.5rem 0.7rem;
  border: 1px solid var(--cbm-border); border-radius: var(--cbm-radius); background: var(--cbm-white); }
.checkgrid__opt { display: flex; align-items: center; gap: 0.4rem; font-weight: 400;
  font-size: var(--cbm-text-sm); color: var(--cbm-text); cursor: pointer; padding: 0.15rem 0; }
.checkgrid__opt input { width: auto; margin: 0; flex: none; }
