/* Admin presentation only. Native controls and authorization stay in their modules. */
@media screen {
  .admin-navigation { margin-bottom: 16px; border-radius: 12px; box-shadow: none; }
  .admin-navigation-heading { padding: 10px 14px; }
  .admin-navigation-caption { font-size: 13px; }
  .admin-navigation-toggle { min-height: 44px; padding: 11px 14px; cursor: pointer; font-weight: 700; color: var(--brand); }
  .admin-navigation-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
  .admin-navigation-group summary { min-height: 48px; padding: 8px; }
  .admin-navigation-words small { font-size: 12px; }
  .admin-navigation-links a { min-height: 40px; padding: 9px; font-size: 13px; }
  .admin-navigation :is(a, summary):focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

  body.admin-workspace .page { max-width: 1320px; }
  body.admin-workspace #app > .profile:not([id]) { padding: 16px; margin: 12px 0; border-radius: 12px; }
  body.admin-workspace .admin-pane { margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
  body.admin-workspace .admin-pane > summary { padding: 16px 18px; min-height: 56px; cursor: pointer; font-size: 17px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
  body.admin-workspace .admin-pane > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 10px; }
  body.admin-workspace .admin-pane[open] > summary { border-bottom: 1px solid var(--line); background: var(--brand-soft); border-radius: 11px 11px 0 0; }
  body.admin-workspace .admin-pane > section { margin: 0; padding: 18px; border: 0; border-radius: 0 0 12px 12px; box-shadow: none; }
  body.admin-workspace .admin-pane > section > h2:first-child { font-size: 20px; margin-top: 0; }
  body.admin-workspace #app > div:has(> .admin-pane) > .profile { padding: 16px; }
  body.admin-workspace :is(#publish, #approval, #companies, #menu, #admins, #sources, #resources, #research, #activity, #security-access, #triage-rules, [id^=sec-]) { scroll-margin-top: 100px; }
  body.admin-workspace [hidden] { display: none !important; }

  body :is(.refresh-heading, .social-hero) { padding: 20px 24px; border-radius: 14px; }
  body :is(.refresh-heading, .social-hero) h1 { font-size: 30px; line-height: 1.2; margin-block: 6px 10px; }
  body :is(.refresh-card, .refresh-run, .social-panel) { padding: 16px; border-radius: 12px; }
  body :is(.refresh-grid, .social-grid, .discovery-columns) { gap: 16px; }
  :is(.baseline-toolbar, .baseline-layout, .discovery-columns, .social-grid) > * { min-width: 0; max-width: 100%; }
  body .users-none { color: var(--muted); }
  body :is(.users-sub, .users-table th, .jobs-table th, .refresh-card dt, .jobs-table code) { font-size: 12px; }
  body :is(.users-table, .jobs-table, .baseline-evidence) { font-size: 14px; }
  body .baseline-evidence { background: var(--brand-soft); color: var(--ink); overflow-wrap: anywhere; }
  body .st-table-wrap { min-width: 0; max-width: 100%; }
  body .st-table-wrap :is(.error, .hint) { overflow-wrap: anywhere; }
  body .users-dialog :is(input, select) { min-height: 42px; }
  @media (max-width: 700px) {
    .admin-navigation-heading { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
    .admin-navigation-group summary { min-height: 48px; }
    body.admin-workspace .admin-pane > section { padding: 14px; }
    body :is(.refresh-heading, .social-hero) { padding: 16px; }
  }
  /* dark theme: html[data-theme=dark], or the device setting when nothing is saved */
    :where([data-theme="dark"]) body :is(.users-metric, .users-table, .users-filters, .users-dialog,
      .refresh-card, .refresh-run, .refresh-metrics > div, .jobs-table,
      .social-panel, .discovery-card, .discovery-form) {
      background: var(--panel); color: var(--ink); border-color: var(--line);
    }
    :where([data-theme="dark"]) body :is(.users-table, .jobs-table) th { background: var(--brand-soft); color: var(--ink); }
    :where([data-theme="dark"]) body :is(.users-sub, .users-none, .refresh-card dt) { color: var(--muted); }
    :where([data-theme="dark"]) body :is(.users-metric strong, .refresh-metrics strong) { color: var(--brand); }
    :where([data-theme="dark"]) body :is(.users-metric span, .refresh-metrics span, .refresh-card > p,
      .jobs-what, .jobs-table code, .pipeline-controls dt, #users-message) { color: var(--muted); }
    :where([data-theme="dark"]) body .users-filters label { color: var(--ink); }
    :where([data-theme="dark"]) body .users-metric[aria-pressed=true] { background: var(--brand-soft); border-color: var(--brand); }
    :where([data-theme="dark"]) body .users-table tbody tr:hover { background: var(--brand-soft); }
    :where([data-theme="dark"]) body .users-table th > button, :where([data-theme="dark"]) body .users-table th:last-child { color: var(--muted); }
    :where([data-theme="dark"]) body .users-table th:is([aria-sort=ascending], [aria-sort=descending]) > button { color: var(--brand); }
    :where([data-theme="dark"]) body :is(.users-table, .jobs-table) td[data-label]:not(:first-child)::before { color: var(--muted); }
    :where([data-theme="dark"]) body :is(.social-preview, .users-secret, .pipeline-controls, .refresh-note) { background: var(--brand-soft); color: var(--ink); }
    :where([data-theme="dark"]) body :is(.users-filters input, .users-filters select, .users-password,
      .users-dialog input, .users-dialog select, .refresh-card select, .pipeline-controls select) { background: var(--panel); color: var(--ink); }
    :where([data-theme="dark"]) body .refresh-tabs button { color: var(--muted); }
    :where([data-theme="dark"]) body .refresh-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
  @media (prefers-color-scheme: dark){
    :where(:not([data-theme])) body :is(.users-metric, .users-table, .users-filters, .users-dialog,
      .refresh-card, .refresh-run, .refresh-metrics > div, .jobs-table,
      .social-panel, .discovery-card, .discovery-form) {
      background: var(--panel); color: var(--ink); border-color: var(--line);
    }
    :where(:not([data-theme])) body :is(.users-table, .jobs-table) th { background: var(--brand-soft); color: var(--ink); }
    :where(:not([data-theme])) body :is(.users-sub, .users-none, .refresh-card dt) { color: var(--muted); }
    :where(:not([data-theme])) body :is(.users-metric strong, .refresh-metrics strong) { color: var(--brand); }
    :where(:not([data-theme])) body :is(.users-metric span, .refresh-metrics span, .refresh-card > p,
      .jobs-what, .jobs-table code, .pipeline-controls dt, #users-message) { color: var(--muted); }
    :where(:not([data-theme])) body .users-filters label { color: var(--ink); }
    :where(:not([data-theme])) body .users-metric[aria-pressed=true] { background: var(--brand-soft); border-color: var(--brand); }
    :where(:not([data-theme])) body .users-table tbody tr:hover { background: var(--brand-soft); }
    :where(:not([data-theme])) body .users-table th > button, :where(:not([data-theme])) body .users-table th:last-child { color: var(--muted); }
    :where(:not([data-theme])) body .users-table th:is([aria-sort=ascending], [aria-sort=descending]) > button { color: var(--brand); }
    :where(:not([data-theme])) body :is(.users-table, .jobs-table) td[data-label]:not(:first-child)::before { color: var(--muted); }
    :where(:not([data-theme])) body :is(.social-preview, .users-secret, .pipeline-controls, .refresh-note) { background: var(--brand-soft); color: var(--ink); }
    :where(:not([data-theme])) body :is(.users-filters input, .users-filters select, .users-password,
      .users-dialog input, .users-dialog select, .refresh-card select, .pipeline-controls select) { background: var(--panel); color: var(--ink); }
    :where(:not([data-theme])) body .refresh-tabs button { color: var(--muted); }
    :where(:not([data-theme])) body .refresh-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
  }
}
@media print {
  .admin-navigation { display: none; }
  .admin-pane { break-inside: avoid; }
}
