/* ==========================================================================
   Admin panel (admin.html). Builds on dashboard.css: same sidebar, top bar,
   panels, lists and messenger. Everything here is solid white, like the rest.
   ========================================================================== */

.admin .sidebar .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.admin-badge {
  padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-family: var(--body, inherit); font-size: 11px; font-weight: 600; letter-spacing: .06em; font-stretch: 100%;
}
.side-label { margin: 18px 16px 4px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.side-star { display: block; width: 30px; height: 30px; margin-bottom: 12px; color: var(--pink); }

.block { display: block; margin-top: 0; } /* not the homepage's .block section spacing (styles.css) */
.loading { padding: 40px 0; }
.empty-note { margin: 0; padding: 6px 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 -8px; font-size: 14px; color: var(--muted); }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 18px; height: 18px; }
.panel h2 .muted { font-weight: 400; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn.danger:hover { border-color: #ff7a6b; color: #ff7a6b; }

/* Status pills: open (pink) and done (green, from dashboard.css) */
.status { background: var(--card-2); color: var(--ink-2); }
.status.open { background: rgba(255, 176, 32, .14); color: #ffb020; }
.plan-chip { display: inline-block; padding: 3px 10px; white-space: nowrap; border-radius: 999px; background: var(--card-2); font-size: 12px; font-weight: 600; }
.plan-chip.plan-pro { background: var(--accent); color: var(--on-accent); }
.plan-chip.plan-elite { background: linear-gradient(135deg, #111, #7a5410); color: #fff; }
.plan-chip.plan-fec { background: var(--ink); color: var(--bg); }
.plan-chip.plan-admin { background: var(--accent); color: var(--on-accent); }
.rate-auto-tag { padding: 4px 10px; border-radius: 999px; background: rgba(255, 176, 32, .14); color: #ffb020; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* Small round avatar with initials or the profile picture */
.avatar-sm {
  display: grid; place-items: center; flex: none; overflow: hidden;
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #1a1a1a, #3d2c0c); color: #fff;
  font-size: 13px; font-weight: 600;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.app-tile.mini { width: 26px; height: 26px; border-radius: 7px; font-size: 10px; }
.tiles { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Overview ---------- */

.kpis a.kpi { display: block; transition: transform .15s, border-color .15s; }
.kpis a.kpi:hover { transform: translateY(-2px); border-color: rgba(243, 239, 230, .2); }
/* Grid items may shrink below their longest line (long messages are cut off with "…") */
.admin .two-col > * { min-width: 0; }
.attention a, .rows a { display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0; }
.attention .grow, .rows .grow, .events .grow { min-width: 0; }
.attention .muted:not(small):not(time), .rows .grow > .muted, .events .grow > .muted {
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px;
}
.attention a:hover b, .rows a:hover b { text-decoration: underline; }
.attention .tag { width: 72px; text-align: center; flex: none; }
.events li { padding: 11px 0; }
.see-more { display: block; width: fit-content; margin: 14px auto 0; }
.is-new-row { animation: fade-up .35s ease both; }
.events time, .attention time { flex: none; white-space: nowrap; }
.all-clear { display: grid; justify-items: center; gap: 6px; padding: 24px 0; color: var(--muted); font-size: 14px; }
.all-clear svg { width: 36px; height: 36px; color: var(--pink); }
.all-clear p { margin: 0; }

/* ---------- Brand inbox ---------- */

.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.message-body { margin: 0 0 20px; padding: 16px 18px; border-radius: 12px; background: var(--card-2); font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Key/value lists (request details, creator profile) */
.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 14.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts a { text-decoration: underline; }
.facts code.json { display: block; white-space: pre-wrap; font-size: 12.5px; }

/* Team notes */
.notes { margin: 0 0 16px; padding: 0; list-style: none; }
.notes li { padding: 12px 0; border-top: 1px solid var(--panel-line); }
.notes li:first-child { border-top: 0; padding-top: 0; }
.notes p { margin: 0 0 4px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-form textarea { margin-top: 0 !important; min-height: 70px; }
.note-form .form-actions { margin-top: 10px; }

/* ---------- Creators ---------- */

.filter-bar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding: 18px 20px; }
.filter-bar label { margin: 0; min-width: 160px; }
.filter-bar .grow { flex: 1; min-width: 220px; }
.table-panel { padding: 8px 8px 12px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { padding: 12px 14px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.admin-table td { padding: 12px 14px; border-top: 1px solid var(--panel-line); vertical-align: middle; }
.admin-table .num { text-align: right; }
.admin-table tbody tr[data-href] { cursor: pointer; }
.admin-table tbody tr[data-href]:hover td { background: var(--card-2); }
/* A talent's platforms open their stats (/admin/creators/<talent>/<platform>) */
.list li.platform-row { cursor: pointer; margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 10px; transition: background .15s; }
.list li.platform-row:hover { background: var(--card-2); }
.platform-row b a { color: inherit; text-decoration: none; }
.row-chevron { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.creator-head > .app-tile { width: 64px; height: 64px; border-radius: 14px; }
.admin-table .who { display: flex; align-items: center; gap: 12px; }
.admin-table .who b { display: block; }
.table-foot { margin: 10px 14px 0; }
.table-actions { display: flex; justify-content: flex-end; padding: 12px 14px 4px; }

.creator-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; }
.creator-head h1 { margin: 0; font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: 30px; letter-spacing: -.02em; }
.creator-head p { margin: 4px 0 0; }
.creator-head p a { text-decoration: underline; }
.head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.plan-form { display: flex; align-items: center; gap: 8px; }
.plan-form label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.plan-form select { height: 38px; padding: 0 10px; border: 1px solid rgba(243, 239, 230, .16); border-radius: 9px; background: var(--card); font: inherit; font-size: 14px; }
.head-actions .check-row { font-size: 14px; }
.mfa-line { margin: 0; }
.detail-grid .status { margin-left: 6px; font-size: 11px; font-weight: 500; vertical-align: 1px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.detail-grid > .panel { margin: 0; }
.answers summary { cursor: pointer; list-style: none; }
.answers summary::-webkit-details-marker { display: none; }
.answers summary h2 { display: inline; margin: 0; }
.answers summary::after { content: "Show"; float: right; font-size: 13px; color: var(--muted); text-decoration: underline; }
.answers[open] summary::after { content: "Hide"; }
.answers[open] summary { margin-bottom: 18px; }

/* ---------- Messages ---------- */

.admin .thread-list b .muted { font-weight: 400; }
.convo-head a { text-decoration: underline; }

/* ---------- Team ---------- */

.row-actions { display: flex; gap: 8px; flex: none; }
.invite-link { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--card-2); font-size: 14px; }
.invite-link p { margin: 0 0 8px; }
.copy-row { display: flex; align-items: center; gap: 10px; }
.copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; }
.invite-link .mt-xs { margin: 8px 0 0; }
.temp-password { margin: 0 0 18px; }
.temp-password code { font-size: 15px; letter-spacing: .04em; }

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .head-actions { align-items: flex-start; width: 100%; }
}
@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .row-actions { width: 100%; }
  .admin-table th, .admin-table td { padding: 10px 8px; }
  .admin-table .block { white-space: nowrap; }
  .filter-bar label, .filter-bar .grow { flex: 1 1 100%; min-width: 0; }
  .creator-head h1 { font-size: 24px; }
  .copy-row { flex-direction: column; align-items: stretch; }
}
/* Tools: the sign-up link under "Give access" */
.tools-signup-note { margin: 20px 0 8px; }

/* Tools: roles and expenses per person (renderTools) */
.plan-chip.role-admin { background: var(--accent); color: var(--on-accent); }
.plan-chip.role-frites_player { background: var(--ink); color: var(--bg); }
.plan-chip[class*="role-"] { margin-left: 6px; vertical-align: 1px; font-size: 11px; }
.role-select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; }
.table-title { margin: 12px 14px 4px; }
.person-table .person-row { cursor: pointer; }
.person-table .person-row:hover td, .person-table .person-row[aria-expanded="true"] td { background: var(--card-2); }
.person-table .person-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.person-table .person-detail td { padding: 4px 14px 14px 58px; border-top: 0; background: var(--card-2); }
.person-table .person-detail .list li { flex-wrap: wrap; }
/* People with access: the role, reset and remove go under the name when it gets tight */
.tools-people li { flex-wrap: wrap; row-gap: 10px; }
.tools-people .grow { flex: 1 1 220px; min-width: 0; }
.tools-people .row-actions { flex-wrap: wrap; margin-left: auto; }
