/* admin-shell.css — chrome shared by every admin sub-page (banner, secondary
   nav, page layout). Loaded alongside app.css, which provides the design tokens,
   header, and buttons. Only admin-specific styling lives here. */

/* Danger tokens are not defined in app.css; the admin surface needs them for the
   banner and destructive controls. Fixed across themes (a red wash reads as
   "danger" regardless of palette). */
:root {
  --danger:        var(--error);
  --danger-bg:     rgba(224, 92, 92, 0.10);
  --danger-border: rgba(224, 92, 92, 0.35);
  --danger-solid:  #c0392b; /* solid danger: white text passes AA */
}

/* ── Destructive buttons + spinner (shared across admin pages) ──
   app.css carries .btn / .btn-neutral; the destructive variants and the small
   size live here because only the admin surface uses them. */
.btn-destructive-outline {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-destructive-outline:hover:not(:disabled) { background: var(--danger-bg); }

.btn-destructive-solid {
  background: var(--danger-solid);
  border-color: var(--danger-solid);
  color: #fff;
  font-weight: 600;
}
.btn-destructive-solid:hover:not(:disabled) { filter: brightness(1.1); }

.btn-sm { padding: var(--space-1) var(--space-3); font-size: 13px; }

.row-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .row-spinner { animation-duration: 2s; } }

/* ── Preview-player controls ──
   The admin player (Library scopes) is a single-context preview player with no
   playlist, so Shuffle and Repeat do nothing — hide them. This sheet loads only
   on admin pages, so the public shell player keeps them. (Like/Queue are already
   hidden via the player-bar partial's {{if ne .Page "admin"}}.) */
#btnShuffle,
#btnRepeat { display: none; }

/* ── Persistent admin banner ── */
.admin-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  font-size: 13px;
  color: var(--text);
  background: var(--danger-bg);
  border-bottom: 1px solid var(--danger-border);
  border-left: 3px solid var(--danger);
}
.admin-banner-icon { font-size: 14px; line-height: 1; }

/* ── Secondary section nav ── */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.admin-nav-link {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius, 6px);
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.admin-nav-link:hover { color: var(--text); background: var(--surface-hover); }
.admin-nav-link--active {
  color: var(--accent);
  background: var(--accent-glow);
}
.admin-nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Page layout ── */
/* Higher specificity than app.css `main`, so these win where they overlap. */
.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-5);
  display: grid;
  gap: var(--space-7);
}

/* ── Section headings + copy (base .section-title is in app.css;
      .section-title--files moved to file-view.css with the component chrome) ── */
.section-title--danger { color: var(--danger); }
.section-copy {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 64ch;
  margin: 0 0 var(--space-4);
}
.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── Shared form controls + cards (used by Files, Users, Access) ── */
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-3);
}
.inline-form input[type="text"],
.inline-form input[type="password"] {
  flex: 1 1 180px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
}
.license-select,
.grant-input {
  padding: var(--space-1) var(--space-2);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 13px;
}
.grant-input[hidden] { display: none; }

.groups-list,
.users-list {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
}
.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.group-name { margin: 0; font-size: 1.05rem; }
.group-sub {
  margin: var(--space-4) 0 var(--space-2);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ── File-management component chrome moved to file-view.css ──
   The .files-table / .bulk-toolbar / inline-confirm / .trash-actions /
   .table-state-row / .state-badge / responsive-collapse / .section-title--files
   rules now live in file-view.css, the single source for the file-list
   component (loaded by the admin Library page and the Upload page). These three
   rules stay here because OTHER admin pages (users, settings) use them and don't
   load file-view.css. (docs/architecture/file-management-view.md, cleanup.) */
.cell-muted { color: var(--text-muted); }

/* Destructive warning line inside admin modals (Library delete/merge/discard). */
.modal-danger { color: var(--error); font-weight: 500; }

/* Empty-state block (users / settings empty lists). */
.empty-state { color: var(--text-muted); }
.empty-state .drop-icon { font-size: 40px; }
.empty-state p { margin-top: var(--space-2); font-size: 14px; }

/* ── Placeholder card (scaffold; replaced as each page is built out) ── */
.admin-placeholder {
  padding: var(--space-6);
  border: 1px dashed var(--border);
  border-radius: var(--radius, 8px);
  background: var(--surface);
  color: var(--text-muted);
  text-align: center;
}
.admin-placeholder h2 { margin: 0 0 var(--space-2); color: var(--text); }
.admin-placeholder p  { margin: 0; }
