/* ============================================================
   Admin Permissões — tabela + modal (LG-21)
   ============================================================ */

.perm-table { width: 100%; }
.perm-row-name { font-weight: 600; color: var(--text); }
.perm-fixo {
  font-size: 10px;
  color: var(--mute);
  margin-left: 6px;
  font-family: var(--font-mono);
}
.perm-col-num { text-align: center; width: 120px; }
.perm-col-actions { text-align: right; width: 140px; }

.perm-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
}
.perm-count.full { color: var(--gold-light); border-color: rgba(198,202,208,0.3); }

.perm-badge-full {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  background: var(--gold-soft);
  border: 1px solid rgba(198,202,208,0.3);
  border-radius: 12px;
  padding: 4px 12px;
}

.perm-icon-btn {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.perm-icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-2);
  color: var(--gold-light);
}

/* ─── Modal ─────────────────────────────────────────────── */
.perm-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
}
.perm-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  z-index: 1001;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  overflow: hidden;
}
.perm-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.perm-modal-title { font-size: 18px; font-weight: 700; color: var(--text); font-family: var(--font-display); }
.perm-modal-sub { font-size: 12px; color: var(--mute); margin-top: 3px; }
.perm-modal-body { overflow-y: auto; padding: 4px 20px; }
.perm-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.perm-group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.perm-group:last-child { border-bottom: none; }
.perm-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  font-weight: 700;
  margin-bottom: 8px;
}
.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  cursor: pointer;
}
.perm-flag-label { font-size: 13px; color: var(--text-2); flex: 1; line-height: 1.3; }
.perm-row:hover .perm-flag-label { color: var(--text); }

@media (max-width: 768px) {
  .perm-modal { width: calc(100vw - 24px); }
  .perm-col-num { width: auto; }
  .perm-col-actions { width: auto; }
}

/* ─── Fase B: escopo + campos de criação ─────────────────── */
.perm-col-scope { width: 110px; }
.perm-scope {
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
}
.perm-scope.global { color: var(--gold-light); border-color: rgba(198,202,208,0.3); }

.perm-name-field { padding: 14px 0 0; }
.perm-name-field .lg-label { display: block; margin-bottom: 6px; }
.perm-name-field + .perm-name-field { padding-top: 12px; }
