/* Quản trị (public/admin.js) */
.adm-tabs { margin: 4px 0 16px; }
.adm-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: var(--surface); font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; }
.adm-intro { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; }
.adm-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.adm-toolbar .search { flex: 1 1 240px; margin: 0; max-width: 420px; }
.adm-toolbar > .btn { margin-left: auto; }
.adm-filter { margin: 0 0 12px; }
.adm-toolbar .adm-filter { margin: 0; }
.seg button.warn[aria-pressed=false] { color: var(--warn); }
.adm-callout { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.adm-callout span { flex: 1; }

/* avatar: initials on a soft tint (6 hues, both themes) */
.adm-avatar { --c: var(--brand); width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.adm-avatar.c1 { --c: #0a95a5; } .adm-avatar.c2 { --c: #8a3ffc; } .adm-avatar.c3 { --c: #d9480f; }
.adm-avatar.c4 { --c: #2f9e44; } .adm-avatar.c5 { --c: #c2255c; }

/* people list */
.adm-list { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.adm-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 260px) auto; gap: 14px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); }
.adm-row:first-child { border-top: 0; }
.adm-row:hover { background: var(--surface-2); }
.adm-who { display: grid; gap: 3px; min-width: 0; }
.adm-email { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.adm-sub .chip { padding: 0 8px; line-height: 19px; font-size: 11.5px; }
.adm-admob { display: inline-flex; align-items: center; gap: 5px; }
.adm-admob::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.adm-admob.on::before { background: var(--ok); }
.adm-nets { display: grid; gap: 1px; min-width: 0; }
.adm-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.adm-nets-val { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-nets-val.none { color: var(--muted); }
.adm-row:has(.adm-nets-val) { cursor: default; }
@media (max-width: 720px) {
  .adm-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .adm-row .adm-nets { grid-column: 2 / 4; grid-row: 2; }
}

/* dialogs */
.adm-dlg-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.adm-dlg-head > div { display: grid; gap: 2px; min-width: 0; }
.adm-dlg-head h3 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-dlg-head .adm-avatar { width: 40px; height: 40px; font-size: 14px; }
.adm-field { display: grid; gap: 8px; }
.adm-field-label { font-size: 13px; font-weight: 600; }
.adm-team-seg { margin: 0; justify-self: start; }
.adm-team-seg button { padding: 5px 14px; }
.adm-feature-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.warn-text { color: var(--warn); }
.adm-net-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.adm-net-pick { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; font-size: 13.5px; min-width: 0; flex-wrap: wrap; }
.adm-net-pick:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.adm-net-pick.locked { cursor: default; border-style: dashed; background: none; }
.adm-net-pick input { margin: 0; }
.adm-net-pick .adm-net-name { font-weight: 500; }
.adm-net-pick .muted { flex-basis: 100%; padding-left: 24px; margin-top: -2px; }
.adm-dlg-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.adm-dlg-danger { display: flex; gap: 6px; }
.adm-dlg-foot .actions { margin-left: auto; }
.adm-radio { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.adm-radio input { margin: 3px 0 0; }
.adm-cred-fields { display: grid; gap: 12px; }
.adm-net-row { grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); }

/* matrices (features × teams, people × networks) */
table.adm-matrix { border-collapse: separate; border-spacing: 0; }
table.adm-matrix th, table.adm-matrix td { vertical-align: middle; }
table.adm-matrix th.c, table.adm-matrix td.c { text-align: center; }
table.adm-matrix tbody tr:hover td { background: var(--surface-2); }
.adm-col { display: inline-grid; gap: 3px; justify-items: center; color: var(--text); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.adm-col-sub { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.adm-feat { display: block; font-weight: 500; font-size: 13.5px; }
.adm-feat-desc { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.adm-cell { display: inline-flex; padding: 6px; cursor: pointer; border-radius: 6px; }
.adm-cell input { margin: 0; width: 16px; height: 16px; cursor: pointer; }
.adm-cell input:disabled { cursor: default; opacity: .45; }
table.adm-matrix td.changed, table.adm-matrix th.changed { background: var(--brand-soft) !important; }
.adm-mode { font: inherit; font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); }
.adm-mode:hover { border-color: var(--muted); }
.adm-mode.open { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
table.adm-grid th.c, table.adm-grid td.c { min-width: 84px; }
table.adm-grid .adm-all { border-left: 1px solid var(--line); }
table.adm-grid tr.adm-divider td { background: var(--surface-2); padding: 7px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--line); }
table.adm-grid tr.adm-divider td.sticky { background: var(--surface-2); }
table.adm-grid .adm-sub { flex-wrap: nowrap; }
.adm-head { padding-top: 8px; padding-bottom: 8px; background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 500; }
.adm-head:hover { background: var(--surface-2); }
@media (max-width: 720px) { .adm-head { display: none; } }
.adm-grid-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); }
table.adm-grid th { border-radius: 0; padding: 10px 8px; }
table.adm-grid th.sticky, table.adm-grid td.sticky { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 220px; max-width: 280px; }
@media (max-width: 640px) { table.adm-grid th.sticky, table.adm-grid td.sticky { min-width: 150px; max-width: 170px; } table.adm-grid .adm-person .adm-avatar { display: none; } }
table.adm-grid td.sticky { background: var(--surface); }
table.adm-grid th.sticky { background: var(--surface-2); }
table.adm-grid tbody tr:hover td.sticky { background: var(--surface-2); }
table.adm-grid tr.adm-bulk td { background: var(--surface-2); border-bottom: 1px solid var(--line-strong); padding: 4px 8px; }
table.adm-grid tr.adm-bulk input { width: 15px; height: 15px; }
table.adm-grid tbody tr:last-child td { border-bottom: 0; }
table.adm-grid tr.dim .adm-email { color: var(--muted); }
.adm-person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.adm-person .adm-avatar { width: 28px; height: 28px; font-size: 11px; }
.adm-grants { position: relative; }
.adm-savebar { position: sticky; bottom: 12px; z-index: 3; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px 10px 16px;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 8px 28px rgba(16, 24, 40, .14); font-size: 13px; }
.adm-savebar .grow { flex: 1; }

/* network accounts */
.adm-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.adm-account { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); min-width: 0; }
.adm-account .adm-who { flex: 1; }
.adm-account-actions { display: flex; gap: 4px; flex: none; }
.adm-net-tile { width: 34px; height: 34px; border-radius: 9px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  background: var(--surface-2); color: var(--text-2); }
.adm-net-tile.n-pangle { background: #111827; color: #fff; }
.adm-net-tile.n-liftoff { background: #5b2bd8; color: #fff; }
.adm-net-tile.n-applovin { background: #0f7cff; color: #fff; }
.adm-net-tile.n-mintegral { background: #00a0e9; color: #fff; }
.adm-net-tile.n-unity { background: #222; color: #fff; }
.adm-net-tile.n-ironsource { background: #e63b2e; color: #fff; }
@media (max-width: 640px) {
  .adm-divider-note { display: none; }
  .adm-row .adm-nets:has(.none) { display: none; }
  .adm-toolbar .search { flex-basis: 100%; max-width: none; }
  .adm-toolbar > .btn { margin-left: 0; }
}
