/* The Manager: the side for the people who run this InternBoard
   (manager-shell.js). Laid out like YouTube Studio - a sidebar of pages on
   the left, the page beside it - so it is obvious at a glance that this is
   neither the student side nor the employer workspace. Every colour is a
   token from styles.css, so both themes come for free.

   Three widths:
   - 960px and up: a 240px sidebar with icons and names, kept in view while
     the page scrolls;
   - 760-959px: a 76px rail, each icon over a short name;
   - below 760px: one row of pages under the top bar, scrolling sideways. */

/* ---- Top bar ---- */
/* Two classes: `.brand span` would otherwise paint it the student green. */
.brand .brand-manager {
  display: inline-block; margin-left: 8px; padding: 3px 9px; vertical-align: 2px;
  border-radius: var(--radius-pill); background: var(--ink); color: var(--surface);
  font-family: 'Inter', sans-serif; font-size: 11.5px; font-weight: 600; letter-spacing: 0;
}
.brand .brand-manager[hidden] { display: none; }

/* While the Manager is open the top bar spans the page, so the brand sits
   above the sidebar as Studio's does, instead of centring on the student
   side's 1280px. */
body.manager-open .topbar-inner { max-width: none; padding: 0 24px; }

/* ---- The shell ---- */
.manager-wrap { background: var(--bg); }
.mgr-layout {
  display: grid; grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 61px);
}
.mgr-sidebar {
  position: sticky; top: 61px; align-self: start;
  height: calc(100vh - 61px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: 20px 12px 16px;
  background: var(--surface); border-right: 1px solid var(--border);
}

/* Who this is the Manager of, at the top - where Studio shows the channel. */
.mgr-identity { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 18px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.mgr-identity-mark {
  width: 72px; height: 72px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #FFFFFF;
  font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700;
}
.mgr-identity-text { text-align: center; }
.mgr-identity-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.mgr-identity-role { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---- Sidebar pages ---- */
.mgr-nav-btn {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 44px; margin: 0;
  padding: 10px 14px; border: none; border-radius: var(--radius-sm); background: none;
  font-size: 14px; font-weight: 500; color: var(--text); text-align: left; cursor: pointer;
}
.mgr-nav-btn svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.mgr-nav-btn:hover { background: var(--surface-soft); color: var(--ink); opacity: 1; }
.mgr-nav-btn.active { background: var(--neutral-bg); color: var(--ink); font-weight: 600; }
.mgr-nav-btn.active svg { color: var(--accent); }
.mgr-nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mgr-nav-label { flex: 1; min-width: 0; }
.mgr-nav-btn .tab-badge { margin-left: auto; }
.mgr-sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.mgr-leave-btn { color: var(--muted); }

/* ---- A page ---- */
.mgr-main { padding: 32px 40px 96px; min-width: 0; max-width: 1240px; }

/* ---- Companies and Moderation: the approval queue's cards (manager-approvals.js) ---- */
.dev-approvals-intro { font-size: 13px; color: var(--muted); line-height: 1.55; margin: -6px 0 16px; max-width: 70ch; }
.dev-approval-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
  background: var(--surface);
}
.dev-approval-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dev-approval-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.dev-approval-who, .dev-approval-facts { font-size: 13px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.dev-approval-about { font-size: 13.5px; color: var(--text); line-height: 1.55; margin: 10px 0 0; white-space: pre-line; }
.dev-approval-checks { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dev-approval-checks li { font-size: 13px; padding-left: 20px; position: relative; }
.dev-approval-checks li::before { position: absolute; left: 0; font-weight: 700; }
.dev-approval-checks .is-ok { color: var(--muted-strong); }
.dev-approval-checks .is-ok::before { content: '✓'; color: var(--good); }
.dev-approval-checks .is-warn { color: var(--warn); }
.dev-approval-checks .is-warn::before { content: '!'; }
.dev-approval-old-note { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 8px; }
.dev-approval-decision { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.dev-approval-note-label { font-weight: 600; }
.dev-approval-note { margin-top: 5px; min-height: 56px; }
.dev-approval-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dev-approval-actions button { margin: 0; padding: 8px 16px; }
.dev-approval-error { font-size: 12.5px; color: var(--danger); margin-top: 6px; }
.dev-approval-error:empty { display: none; }
.dev-report-count {
  flex: none; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--warn-bg); border: 1px solid var(--warn-border);
  color: var(--warn); font-size: 12px; font-weight: 700;
}
.dev-approval-actions .dev-suspend { color: var(--danger); border-color: var(--danger-border); }
.dev-report-message {
  margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--warn-border); background: var(--surface-soft);
  font-size: 13.5px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---- A rail of icons on a tablet ---- */
@media (max-width: 959px) {
  .mgr-layout { grid-template-columns: 76px minmax(0, 1fr); }
  .mgr-sidebar { padding: 12px 6px; }
  .mgr-identity { padding: 4px 0 12px; }
  .mgr-identity-mark { width: 40px; height: 40px; font-size: 15px; }
  .mgr-identity-text { display: none; }
  .mgr-nav-btn {
    position: relative; flex-direction: column; gap: 4px; padding: 10px 2px;
    font-size: 10.5px; text-align: center;
  }
  .mgr-nav-label { flex: none; line-height: 1.2; }
  .mgr-nav-btn .tab-badge { position: absolute; top: 4px; right: 8px; margin: 0; }
  .mgr-main { padding: 28px 24px 80px; }
}

/* ---- One row of pages on a phone ---- */
@media (max-width: 759px) {
  .mgr-layout { display: block; min-height: 0; }
  .mgr-sidebar {
    position: static; height: auto; flex-direction: row; gap: 4px; overflow-x: auto;
    padding: 8px 12px; border-right: none; border-bottom: 1px solid var(--border);
  }
  .mgr-identity { display: none; }
  .mgr-nav-btn {
    flex: none; width: auto; flex-direction: row; gap: 8px; padding: 8px 12px;
    font-size: 13.5px; white-space: nowrap;
  }
  .mgr-nav-btn svg { width: 18px; height: 18px; }
  .mgr-nav-btn .tab-badge { position: static; margin-left: 2px; }
  .mgr-sidebar-foot { margin: 0; padding: 0 0 0 4px; border-top: none; border-left: 1px solid var(--border); }
  .mgr-main { padding: 24px 16px 64px; }
  .dev-approval-head { flex-direction: column; }
  body.manager-open .topbar-inner { padding: 0 16px; }
  /* The row of pages under the top bar already says where this is. */
  .brand .brand-manager { display: none; }
}

/* ---- People: invite codes and password reset codes (manager-people.js) ---- */
.mgr-invite-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.mgr-invite-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted-strong); margin: 0; }
.mgr-invite-form input, .mgr-invite-form select { margin: 0; }
.mgr-invite-note { flex: 1 1 220px; }
.mgr-invite-uses { flex: 0 0 110px; }
.mgr-invite-expiry { flex: 0 0 150px; }
.mgr-invite-form button { margin: 0; }
.mgr-people-status { font-size: 13px; color: var(--accent-dark); min-height: 18px; margin: 4px 0 10px; overflow-wrap: anywhere; }
.mgr-people-status.is-error { color: var(--danger); }
.mgr-people-empty { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.mgr-invite-list, .mgr-person-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.mgr-invite-row, .mgr-person-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.mgr-invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 700; letter-spacing: 0.06em;
  padding: 4px 8px; border-radius: 6px; background: var(--surface-soft); border: 1px solid var(--border); color: var(--ink);
}
.mgr-invite-about, .mgr-person-about { flex: 1 1 220px; min-width: 0; }
.mgr-invite-for, .mgr-person-email { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.mgr-invite-facts { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.mgr-invite-state {
  flex: none; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface-soft);
}
.mgr-invite-state.is-active { background: var(--good-bg); border-color: var(--accent-border); color: var(--accent-dark); }
.mgr-invite-actions { display: flex; gap: 6px; flex: none; }
.mgr-invite-actions button, .mgr-person-row > button { margin: 0; padding: 6px 12px; }
.mgr-people-search { display: flex; gap: 8px; max-width: 520px; margin-bottom: 4px; }
.mgr-people-search input { margin: 0; flex: 1; }
.mgr-people-search button { margin: 0; }
.mgr-reset-result:empty { display: none; }
.mgr-reset-result {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px;
  border-radius: 8px; background: var(--good-bg); border: 1px solid var(--accent-border); font-size: 13px; color: var(--text);
}
@media (max-width: 759px) {
  .mgr-invite-uses, .mgr-invite-expiry { flex: 1 1 120px; }
}
