/* ===== BUNKER 0.2.0: configurações do servidor e janela de canal ===== */

.sset { display: flex; flex-direction: column; gap: 14px; }
.sset .row .input { flex: 1; }
.danger-zone { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }

.sset-group { display: flex; flex-direction: column; gap: 2px; }
.sset-ghead { display: flex; align-items: center; gap: 2px; padding: 8px 0 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sset-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; border-radius: 8px; }
.sset-row:hover { background: var(--panel-2); }
.sset-ico { display: inline-flex; color: var(--faint); }
.sset-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sset-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--faint); }
.sset-empty { padding: 4px 8px; }
.icon-btn.danger-ico:hover { color: var(--bad-text); background: var(--danger-soft); }
.sset-members { display: flex; flex-direction: column; gap: 2px; }
.sset-mname { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sset-mname b, .sset-mname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sset-roles { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }

/* Cargos: lista à esquerda, editor à direita */
.roles-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.roles-list { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.roles-list .btn { margin-bottom: 8px; }
.role-item {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer; text-align: left; font-weight: 600;
}
.role-item:hover { background: var(--panel-2); color: var(--text); }
.role-item.on { background: var(--active-bg); color: var(--text); }
.role-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-editor { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.role-editor .note { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.role-editor .savebar { position: sticky; left: auto; right: auto; bottom: 0; }

.perm-list { display: flex; flex-direction: column; }
.perm-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.perm-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }

/* Interruptor (checkbox com cara de chave) */
.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; margin: 0;
  width: 40px; height: 24px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line-2);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--muted); transition: transform .15s, background .15s;
}
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(16px); background: var(--accent-ink); }
.switch:disabled { opacity: .45; cursor: not-allowed; }

/* Janela de criar/editar canal */
.chan-dialog .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.chan-dialog .field { margin-bottom: 0; }
.role-checks { display: flex; flex-direction: column; gap: 8px; max-height: 180px; overflow-y: auto; padding: 10px; border-radius: 10px; background: var(--panel-2); }

@media (max-width: 860px) {
  .roles-wrap { grid-template-columns: 1fr; }
  .roles-list { position: static; }
}

/* O conteúdo rola dentro da janela (a barra de abas fica parada) */
.sset-modal .uset-main { min-height: 0; overflow: hidden; }
.sset-modal .uset-body { min-height: 0; }
