/* ============================================================================
   JOIN' ID — identidade única + membros & permissões (montado por /brand/join-id.js)
   Theme-aware via /brand/tokens.css (--bg/--fg/--s/--rule/--muted/--j/--radius).
   ============================================================================ */

/* ── Painel Membros & permissões (modal) ──────────────────────────────────── */
.jid-bg { position: fixed; inset: 0; z-index: 10050; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.jid { width: min(880px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--s, #141414); color: var(--fg, #f5f4f0); border: 1px solid var(--rule, rgba(128,128,128,.2));
  border-radius: var(--radius, 14px); box-shadow: var(--shadow, 0 8px 40px rgba(0,0,0,.5)); font-family: var(--j, sans-serif); }
.jid-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid var(--rule, rgba(128,128,128,.2)); }
.jid-h .jid-t { font-size: 15px; font-weight: 600; flex: 1; }
.jid-h .jid-sub { font-size: 11.5px; color: var(--muted, #999); }
.jid-x { background: none; border: none; color: var(--muted, #999); font-size: 18px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.jid-x:hover { color: var(--fg, #fff); background: var(--faint, rgba(128,128,128,.15)); }
.jid-tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--rule, rgba(128,128,128,.2)); }
.jid-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted, #999); font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 8px 10px; cursor: pointer; }
.jid-tab.on { color: var(--fg, #fff); border-bottom-color: var(--fg, #fff); }
.jid-body { flex: 1; overflow: auto; padding: 12px 18px 16px; }
.jid-tools { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.jid-in, .jid-sel { padding: 8px 10px; border: 1px solid var(--rule, rgba(128,128,128,.2)); border-radius: 8px; background: var(--bg, #0a0a0a); color: var(--fg, #fff); font-family: inherit; font-size: 12.5px; }
.jid-in { flex: 1; min-width: 160px; }
.jid-sel { cursor: pointer; }
.jid-sel.dirty { border-color: #e5a73a; }
.jid-btn, .jid-btn2 { padding: 8px 14px; border-radius: 8px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.jid-btn { background: var(--fg, #f5f4f0); color: var(--bg, #0a0a0a); border: none; }
.jid-btn2 { background: none; color: var(--fg, #fff); border: 1px solid var(--rule, rgba(128,128,128,.25)); }
.jid-btn[disabled], .jid-btn2[disabled] { opacity: .45; cursor: default; }
.jid-count { font-size: 11.5px; color: var(--muted, #999); margin-left: auto; }

.jid-row { display: grid; grid-template-columns: 34px 1fr auto auto auto; gap: 10px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--rule, rgba(128,128,128,.12)); }
.jid-row:last-child { border-bottom: none; }
.jid-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; overflow: hidden; position: relative; }
.jid-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jid-who { min-width: 0; }
.jid-nm { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jid-em { font-size: 11.5px; color: var(--muted, #999); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jid-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--rule, rgba(128,128,128,.25)); color: var(--muted, #999); margin-left: 6px; vertical-align: middle; }
.jid-tag.on { color: #0a0a0a; background: #7bd88f; border-color: #7bd88f; }
.jid-tag.pend { color: #0a0a0a; background: #e5a73a; border-color: #e5a73a; }
.jid-mini { background: none; border: 1px solid var(--rule, rgba(128,128,128,.25)); color: var(--fg, #fff); font-family: inherit; font-size: 11.5px; padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.jid-mini:hover { border-color: var(--fg, #fff); }
.jid-mini.danger:hover { border-color: #e5484d; color: #e5484d; }

.jid-apps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; padding: 6px 0 8px 44px; }
.jid-app { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid var(--rule, rgba(128,128,128,.15)); border-radius: 8px; font-size: 12px; }
.jid-app .jid-sel { padding: 4px 6px; font-size: 11.5px; }
.jid-app .jid-eff { font-size: 10.5px; color: var(--muted, #999); }

.jid-empty { padding: 26px 8px; text-align: center; color: var(--muted, #999); font-size: 12.5px; }
.jid-msg { min-height: 16px; font-size: 11.5px; color: var(--muted, #999); padding: 8px 18px; border-top: 1px solid var(--rule, rgba(128,128,128,.15)); }
.jid-msg.err { color: #e5484d; }
.jid-msg.ok { color: #7bd88f; }

.jid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 560px; }
.jid-form .full { grid-column: 1 / -1; }
.jid-lb { font-size: 11px; color: var(--muted, #999); margin-bottom: 4px; display: block; }
.jid-help { font-size: 11.5px; color: var(--muted, #999); line-height: 1.5; margin: 8px 0 14px; }
.jid-help b { color: var(--fg, #fff); font-weight: 600; }

.jid-org { padding: 10px 6px; border-bottom: 1px solid var(--rule, rgba(128,128,128,.12)); }
.jid-org-h { display: flex; align-items: center; gap: 8px; }
.jid-org-h .jid-nm { flex: 1; }
.jid-org-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin-top: 8px; }

.jid-me { display: grid; gap: 6px; font-size: 13px; }
.jid-me .k { color: var(--muted, #999); font-size: 11.5px; }

@media (max-width: 640px) {
  .jid-row { grid-template-columns: 34px 1fr; }
  .jid-row .jid-sel, .jid-row .jid-mini { grid-column: 2; }
  .jid-apps { padding-left: 0; }
  .jid-form { grid-template-columns: 1fr; }
}
