/* Estilos básicos (versão pública) - inspirado no mockup */
:root {
  --bg: #0f172a;
  --panel: #111827;
  --muted: #94a3b8;
  --text: #e2e8f0;
  --primary: #22d3ee;
  --accent: #a78bfa;
  --danger: #ef4444;
  --success: #22c55e;
  --border: #1f2937;
}
/* Estilo específico para os botões da Home (igual ao 'Pesquisar') */
.home .btn {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(34,211,238,0.12), rgba(34,211,238,0.06));
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
}
.home .btn.primary { border-color: rgba(34,211,238,0.3); }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
.container { max-width: 1040px; margin: 0 auto; padding: 24px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0 24px; }
.logo { font-weight: 700; letter-spacing: 0.2px; }
.brand { display:flex; align-items:center; gap:10px; }
.brand img { height:28px; width:auto; display:block; }
.badge { font-size: 12px; color: var(--muted); border: 1px solid var(--border); padding: 4px 8px; border-radius: 999px; }
.panel { 
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.16);
}
.contract-box {
  height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #0b1220;
  white-space: pre-wrap;
  word-break: break-word;
}
.panel .panel-header { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.panel .panel-body { padding: 20px; }
.panel .panel-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) { 
  .grid-2 { 
    grid-template-columns: 1fr; 
  }
  .contract-box { height: 240px; }
  .panel .panel-body { padding: 16px; }
  
  /* Ajustes para o seletor em telas menores */
  .select-container {
    width: 100%;
    min-width: 0;
  }
  
  /* Ajustes para os botões em telas menores */
  .actions {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }
  
  .actions .btn {
    width: 100%;
    justify-content: center;
  }
  .actions .small { text-align: center; width: 100%; display: block; }
}
/* Estilo para inputs, selects e textareas */
.input, textarea { 
  width: 100%; 
  background: #0b1220; 
  color: var(--text); 
  padding: 12px 14px; 
  border: 1px solid var(--border); 
  border-radius: 10px; 
  font-family: inherit;
  font-size: 11px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Estilo personalizado para selects */
.select-container {
  position: relative;
  width: 100%;
  margin-bottom: 0;
  min-width: 180px; /* Largura mínima para melhor usabilidade */
}

.select-container select {
  width: 100%;
  background-color: #0f172a;
  color: var(--text);
  padding: 10px 40px 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.5;
  height: 42px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

/* Estilo para quando o select está focado */
.select-container select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Seta personalizada */
.select-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

/* Efeito de foco no container do select */
.select-container:focus-within .select-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: var(--primary);
}

/* Efeito de hover no select */
.select-container:hover select {
  border-color: #4b5563;
}

/* Efeito de foco no select */
.select-container select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

/* Estilo para o select quando aberto */
.select-container select:focus ~ .select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Estilo para as opções do select */
select option {
  background-color: #0f172a;
  color: var(--text);
  padding: 8px 16px;
  border: none;
  font-size: 12px;
  transition: background-color 0.1s ease, color 0.1s ease;
}

/* Estilo para o hover nas opções */
select option:hover {
  background-color: rgba(34, 211, 238, 0.1);
  color: var(--primary);
}

/* Estilo para a opção selecionada */
select option:checked,
select option[selected] {
  background-color: rgba(34, 211, 238, 0.15);
  color: var(--primary);
  font-weight: 500;
  position: relative;
}

/* Estilo para o foco nas opções */
select option:focus {
  background-color: rgba(34, 211, 238, 0.2);
  color: var(--primary);
  outline: none;
}

/* Estilo para o grupo de filtros */
.grid-2 {
  gap: 16px;
  align-items: flex-start;
}

/* Ajuste para os itens do formulário */
.grid-2 > div {
  margin-bottom: 0;
}

/* Estilo para os labels dos filtros */
.label {
  font-weight: 500;
  margin-bottom: 6px;
  color: #d1d5db;
  font-size: 12px;
  letter-spacing: 0.3px;
  display: block;
  transition: color 0.2s ease;
}

/* Efeito de foco no label quando o input/select está focado */
.select-container:focus-within + .label,
.input:focus + .label,
select:focus + .label {
  color: var(--primary);
}

/* Efeito de foco aprimorado */
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2), 0 0 0 1px rgba(34, 211, 238, 0.3);
  outline: none;
}

/* Estilo para o estado desabilitado */
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: rgba(11, 18, 32, 0.5);
}

/* Efeito de foco para inputs e textareas */
.input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
  background-color: #0c1427;
}

/* Efeito de hover para inputs e textareas */
.input:hover, textarea:hover {
  border-color: #374151;
}

/* Estilo para placeholders */
::placeholder {
  color: #6b7280;
  opacity: 1;
}

/* Estilo para inputs desabilitados e somente leitura */
.input:disabled, textarea:disabled,
.input[readonly], textarea[readonly] {
  background-color: rgba(11, 18, 32, 0.5);
  cursor: not-allowed;
  opacity: 0.8;
}
.label { 
  color: var(--muted); 
  font-size: 12px; 
  margin-bottom: 8px; 
  display: block; 
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Estilo para o label do payload canônico */
.label + pre.canonical-payload {
  margin-top: 4px;
}
.helper { color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.actions.compact { gap: 8px; }
/* Estilo base para botões */
.btn { 
  border: 1px solid var(--border); 
  background: transparent;
  color: var(--text); 
  padding: 10px 16px; 
  border-radius: 8px; 
  cursor: pointer; 
  white-space: nowrap; 
  display: inline-flex; 
  align-items: center; 
  gap: 6px; 
  text-decoration: none; 
  transition: all 0.2s ease; 
  line-height: 1.5;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  text-align: center;
  justify-content: center;
  min-height: 42px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.btn.sm { padding: 8px 12px; font-size: 11px; min-height: 32px; line-height: 1.3; }
/* Garantir consistência entre variantes sm */
.btn.sm.primary,
.btn.sm.accent,
.btn.sm.danger { font-size: 11px; padding: 8px 12px; min-height: 32px; line-height: 1.3; }
/* Estilo para botão primário */
.btn.primary { 
  border-color: rgba(34, 211, 238, 0.3);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.14), rgba(34, 211, 238, 0.07));
  color: #22d3ee;
  font-weight: 500;
  font-size: 11px;
}

/* Efeito de hover no botão primário */
.btn.primary:hover {
  border-color: rgba(34, 211, 238, 0.5);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.22), rgba(34, 211, 238, 0.14));
  color: #67e8f9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Efeito de ativo no botão primário */
.btn.primary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Efeito de foco no botão primário */
.btn.primary:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.4);
  outline-offset: 2px;
}

/* Estilo para o ícone dentro dos botões */
.btn .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

/* Estilo para o botão secundário */
.btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
}

/* Remover sublinhado de botões (links e buttons) em todos os estados */
.btn,
.btn:hover,
.btn:focus,
.btn:active,
a.btn,
a.btn:link,
a.btn:visited,
a.btn:hover,
a.btn:active { text-decoration: none !important; }

/* Efeito de hover no botão secundário */
.btn:not(.primary):hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #4b5563;
  color: #e5e7eb;
}

/* Efeito de ativo no botão */
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.btn.accent { background: linear-gradient(180deg, rgba(167,139,250,0.14), rgba(167,139,250,0.07)); border-color: rgba(167,139,250,0.35); font-size: 11px; }
.btn.danger { background: linear-gradient(180deg, rgba(239,68,68,0.12), rgba(239,68,68,0.05)); border-color: rgba(239,68,68,0.45); font-size: 11px; }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.danger.ghost { background: transparent; border-color: rgba(239,68,68,0.45); }
.btn:hover { 
  border-color: rgba(34,211,238,0.5); 
  background: linear-gradient(180deg, rgba(34,211,238,0.22), rgba(34,211,238,0.11));
  color: #67e8f9;
}
.btn.accent:hover { border-color: rgba(167,139,250,0.5); }
.btn.danger:hover { border-color: rgba(239,68,68,0.6); background: linear-gradient(180deg, rgba(239,68,68,0.18), rgba(239,68,68,0.10)); }
.btn.ghost:hover { background: rgba(255,255,255,0.04); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid rgba(34,211,238,0.4); outline-offset: 2px; }
.btn .icon { width: 14px; height: 14px; display: inline-block; }
.btn .icon svg { width: 14px; height: 14px; display: block; fill: currentColor; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
.table { min-width: 720px; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 6px 6px; text-align: left; vertical-align: middle; }
.table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.table tbody tr:hover { background: rgba(255,255,255,0.04); }
.table th { color: var(--muted); font-weight: 600; }
.table td .actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
/* Botão circular minimalista para ações na tabela */
.btn.icon-btn { width: 26px; height: 26px; padding: 0; border-radius: 999px; justify-content: center; }
.btn.icon-btn .icon, .btn.icon-btn .icon svg { width: 14px; height: 14px; }
/* Text labels visíveis nas ações da tabela */
/* (sem ocultar .text para combinar com o botão 'Pesquisar') */
.table th.col-actions, .table td.col-actions { text-align: right; white-space: nowrap; }
.table td.col-actions .actions { justify-content: flex-end; gap: 6px; }
.btn .text { display: inline; }
.inline-form { display: inline; margin: 0; padding: 0; }
.header .actions { flex-wrap: wrap; }

/* Flat, compacto, harmônico dentro de tabelas */
.table td .btn {
  padding: 4px 8px;
  font-size: 11px; /* base para botões na tabela */
  margin: 0 2px;
  line-height: 1.2;
  border-radius: 4px;
  text-decoration: none;
}

/* Ajustes de tamanho para primary/danger na tabela (12px) */
.table td .btn.primary { font-size: 11px; padding: 4px 8px; min-height: auto; }
.table td .btn.danger { font-size: 11px; padding: 4px 8px; min-height: auto; }

.table td .btn .icon {
  display: none;
}

.table td.col-actions {
  white-space: nowrap;
  padding: 8px 4px !important;
}

.table td .actions {
  gap: 4px;
  display: flex;
  flex-wrap: nowrap;
}

.inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.inline-form button {
  margin: 0;
}

/* Estilo dos botões primário (Abrir) e perigo (Excluir) na tabela com o mesmo visual do 'Pesquisar' */
.table td .btn { border-radius: 10px; padding: 4px 10px; }
.table td .btn.primary { 
  border-color: rgba(34,211,238,0.3);
  background: linear-gradient(180deg, rgba(34,211,238,0.12), rgba(34,211,238,0.06));
  color: var(--text);
}

.table td .btn.danger { 
  border-color: rgba(239,68,68,0.45); 
  background: linear-gradient(180deg, rgba(239,68,68,0.12), rgba(239,68,68,0.06)); 
  color: var(--text);
}

/* Hover consistente sem apagar o gradiente */
.table td .btn.primary:hover { 
  border-color: rgba(34,211,238,0.5);
  background: linear-gradient(180deg, rgba(34,211,238,0.18), rgba(34,211,238,0.10));
}
.table td .btn.danger:hover { 
  border-color: rgba(239,68,68,0.6);
  background: linear-gradient(180deg, rgba(239,68,68,0.18), rgba(239,68,68,0.10));
}

@media (max-width: 640px) {
  .btn { padding: 8px 12px; font-size: 11px; gap: 6px; }
  .btn .icon, .btn .icon svg { width: 12px; height: 12px; }
  .actions { gap: 8px; }
  .actions.compact { gap: 6px; }
  /* Em telas muito estreitas, empilha os botões para evitar quebra feia */
  .actions.compact .btn { flex: 1 1 auto; }
  .actions.compact { width: 100%; }
  .contract-box { height: 200px; }
}

@media (max-width: 480px) {
  /* Na tabela, mostre só ícones para economizar espaço */
  .table td .btn { padding: 6px; }
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 4px 10px; border-radius: 999px; background: #0b1220; border: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: var(--muted); }
.footer { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }
hr.soft { border: none; border-top: 1px solid var(--border); margin: 8px 0 16px; }
.small { font-size: 12px; color: var(--muted); }
.checkbox { display: flex; align-items: center; gap: 10px; }

