/* ==========================================================
   📌 CONTAINER CONFIGURAÇÕES
   ========================================================== */
.cfg-container {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================
   📌 CARDS
   ========================================================== */
.cfg-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.cfg-card h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

/* ==========================================================
   📌 FORMULÁRIOS
   ========================================================== */
.cfg-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
}

.field input,
.field select {
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0,199,212,0.25);
  outline: none;
}

/* spans */
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: 1 / -1; }

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 1 / -1;
  margin-top: 10px;
}

.actions button {
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .2s;
}

/* Botões */
.actions .btn-primary { background: var(--brand); color: #031a1f; }
.actions .btn-primary:hover { transform: scale(1.05); background: #00a9b3; }
.actions .btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--ink); }
.actions .btn-secondary:hover { background: rgba(255,255,255,0.05); }
.actions button:hover { transform: scale(1.03); background: #00a9b3; }

/* ==========================================================
   📌 LISTA DE USUÁRIOS
   ========================================================== */
.table-style {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Header e Linhas: grade ÚNICA e IGUAL */
.user-row.header,
.user-table-header,
.user-row.line {
  display: grid;
  align-items: center;
  gap: 0;
  box-sizing: border-box;
}

/* Header */
.user-row.header,
.user-table-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 6px;
}

/* Linhas */
.user-row.line {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  transition: background .2s, transform .2s;
}
.user-row.line:hover { background: rgba(255,255,255,0.04); transform: translateY(-1px); }

/* Colunas de texto (sem padding extra) */
.user-row.line .nome { font-weight: 600; color: var(--brand); }
.user-row.line .login { font-size: 13px; color: var(--muted); }

/* Selects como antes (sem width 100%) */
.user-row.line select {
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}
.user-row.line select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0,199,212,0.25);
  outline: none;
}

/* Ações (sem largura fixa) */
.user-row.line .acoes {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.user-row.line .acoes button {
  height: 38px;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.user-row.line .acoes button svg { width: 16px; height: 16px; }

/* Botões de linha */
.user-row.line .btn-edit { background: transparent; border: 1px solid var(--brand); color: var(--brand); }
.user-row.line .btn-edit:hover { background: rgba(0,199,212,0.12); }
.user-row.line .btn-warning, .user-row.line .btn-reset { background: transparent; border: 1px solid var(--warn); color: var(--warn); }
.user-row.line .btn-warning:hover, .user-row.line .btn-reset:hover { background: rgba(245,165,36,0.12); }
.user-row.line .btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.user-row.line .btn-danger:hover { background: rgba(239,71,111,0.12); }

/* ==========================================================
   📌 REGRAS
   ========================================================== */
.rule-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.rule-row input, .rule-row select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}
.rule-save {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--brand);
  color: #031a1f;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease;
}
.rule-save:hover { transform: scale(1.03); }

/* ==========================================================
   📌 TABS
   ========================================================== */
.tabs-header { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tab { background: transparent; border: none; padding: 10px 16px; color: var(--muted); cursor: pointer; font-weight: 500; border-bottom: 2px solid transparent; transition: all 0.2s ease; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom: 2px solid var(--brand); }

/* cabeçalho + botão */
.cfg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* Botão Criar Usuário */
.cfg-header button {
  background: var(--brand);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  color: #031a1f;
  cursor: pointer;
  transition: transform .15s ease, background .2s;
}
.cfg-header button:hover { transform: scale(1.05); background: #00a9b3; }




/* Header e linhas com a MESMA grade */
.table-style .user-table-header,
.table-style .user-row.line {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.6fr 1fr 0.8fr; /* NOME | LOGIN | FUNÇÃO | STATUS | AÇÕES */
  align-items: center;
  gap: 0;
  box-sizing: border-box;
}

/* NOME */
.table-style .user-table-header > div:nth-child(1),
.table-style .user-row.line > div:nth-child(1) {
  text-align: left;
  padding-left: 8px;
}

/* LOGIN */
.table-style .user-table-header > div:nth-child(2),
.table-style .user-row.line > div:nth-child(2) {
  text-align: left;
  padding-left: 8px;
}

/* FUNÇÃO */
.table-style .user-table-header > div:nth-child(3),
.table-style .user-row.line > div:nth-child(3) {
  text-align: left;
  padding-left: 8px;
}

/* STATUS */
.table-style .user-table-header > div:nth-child(4),
.table-style .user-row.line > div:nth-child(4) {
  text-align: left;
  padding-left: 8px;
}

/* AÇÕES centralizado */
.table-style .user-table-header > div:nth-child(5),
.table-style .user-row.line > div:nth-child(5),
.table-style .user-row.line .acoes {
  text-align: center;
  justify-content: center;
}



/* dá mais respiro à tabela (afasta da borda direita) */
.table-style .user-table-header,
.table-style .user-row.line {
  padding-right: 24px; /* antes era 12px, aumentei para soltar mais da direita */
  padding-left: 12px;  /* mantém alinhamento suave à esquerda */
}

/* Função e Status: selects sem borda/fundo */
.user-row.line select {
  background: transparent !important;
  border: none !important;
  padding: 0 4px !important;
  height: 32px;
  font-size: 13px;
  color: var(--ink);
  appearance: none;
}

.user-row.line select:focus {
  outline: none !important;

  box-shadow: 0 2px 0 0 var(--brand) !important; /* apenas sublinhado */
}
