/* public/design-system.css
 * DataBroker Enterprise V37 — Antigravity Design Engineering System
 * Direção A: Executive Intelligence & Editorial Minimal (Stripe / Linear / Vercel)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Light Mode (Workspace Default) */
  --bg-canvas: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --bg-subtle: #E2E8F0;
  --bg-glass: rgba(255, 255, 255, 0.88);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-on-brand: #FFFFFF;

  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;

  --brand-primary: #2563EB;
  --brand-hover: #1D4ED8;
  --brand-soft: rgba(37, 99, 235, 0.08);
  --brand-border: rgba(37, 99, 235, 0.25);

  --accent-indigo: #4F46E5;
  --accent-violet: #7C3AED;
  --accent-cyan: #0284C7;

  --status-success: #059669;
  --status-success-soft: rgba(5, 150, 105, 0.10);
  --status-warning: #D97706;
  --status-warning-soft: rgba(217, 119, 6, 0.12);
  --status-danger: #DC2626;
  --status-danger-soft: rgba(220, 38, 38, 0.10);

  /* Sidebar Dark Fixa (App Shell) */
  --sidebar-bg: #0A0E17;
  --sidebar-surface: #111827;
  --sidebar-border: #1E293B;
  --sidebar-text: #F8FAFC;
  --sidebar-muted: #94A3B8;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.14);
}

[data-theme="dark"] {
  --bg-canvas: #090D16;
  --bg-surface: #111827;
  --bg-elevated: #1E293B;
  --bg-subtle: #0F172A;
  --bg-glass: rgba(17, 24, 39, 0.88);

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --border-subtle: #1E293B;
  --border-strong: #334155;

  --brand-primary: #3B82F6;
  --brand-hover: #60A5FA;
  --brand-soft: rgba(59, 130, 246, 0.15);
  --brand-border: rgba(59, 130, 246, 0.35);

  --status-success: #10B981;
  --status-success-soft: rgba(16, 185, 129, 0.15);
  --status-warning: #F59E0B;
  --status-warning-soft: rgba(245, 158, 11, 0.15);
  --status-danger: #EF4444;
  --status-danger-soft: rgba(239, 68, 68, 0.15);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100vw;
  overflow-x: hidden;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

/* Badges de Método HTTP */
.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.method-GET {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.25);
}
[data-theme="dark"] .method-GET {
  color: #34D399;
}
.method-POST {
  background: rgba(37, 99, 235, 0.12);
  color: #2563EB;
  border: 1px solid rgba(37, 99, 235, 0.25);
}
[data-theme="dark"] .method-POST {
  color: #60A5FA;
}
.method-PUT {
  background: rgba(217, 119, 6, 0.12);
  color: #D97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
}
.method-DELETE {
  background: rgba(220, 38, 38, 0.12);
  color: #DC2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* Botões Padronizados */
.ag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 140ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.ag-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.ag-btn-primary {
  background: var(--brand-primary);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}
.ag-btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}
.ag-btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.ag-btn-secondary:hover {
  background: var(--bg-elevated);
}
.ag-btn-success {
  background: var(--status-success);
  color: #FFFFFF;
}
.ag-btn-success:hover {
  filter: brightness(1.06);
}
.ag-btn-danger {
  background: var(--status-danger-soft);
  color: var(--status-danger);
  border-color: rgba(220, 38, 38, 0.25);
}
.ag-btn-danger:hover {
  background: var(--status-danger);
  color: #FFFFFF;
}

/* Inputs e Selects */
.ag-input, .ag-select {
  min-height: 38px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.ag-input:focus, .ag-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ── Painéis, Barras de Segmento e Tabelas Compartilhadas ── */
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
  overflow: hidden;
}
.panel-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.panel-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 3px 0 0;
}

.segment-bar {
  padding: 14px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.seg-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all 120ms ease;
  white-space: nowrap;
}
.seg-chip:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
}
.seg-chip.active {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table.ag-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
table.ag-table th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
table.ag-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  vertical-align: middle;
}
table.ag-table tr:hover td {
  background: var(--brand-soft);
}

.form-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

