/* ═══════════════════════════════════════════════════════════════════════════
   AxiAPIS UI v5 "ATLAS" — modules.css
   Módulos herdados re-tematizados: documentação (docs-*), logs de chaves
   (log-*, logs-*), gráficos do painel (chart-*, area-*, top-api-bar-*) e
   painéis de rotação de custom APIs (custom-*). Mesmos seletores do markup
   legado, novo idioma visual.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ DOCUMENTAÇÃO ═════════════════════════════════════════════════════════ */
.docs-page { max-width: 1180px; margin: 0 auto; }
.docs-hero { margin-bottom: var(--sp-10); }
.docs-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-0);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: var(--sp-4);
}
.docs-body {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: var(--sp-10);
  align-items: start;
}
.docs-sidebar-wrap {
  position: sticky;
  top: 88px;
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  padding-right: var(--sp-2);
}
.docs-sidebar-nav { display: flex; flex-direction: column; gap: var(--sp-1); }
.docs-sidebar-group-label {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: var(--sp-3) 0 var(--sp-1) 10px;
}
.docs-sidebar-nav a {
  display: block;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  font-size: var(--fs-md);
  color: var(--text-2);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  transition: all var(--dur) var(--ease-out);
}
.docs-sidebar-nav a:hover { color: var(--text-0); background: var(--bg-3); }
.docs-sidebar-nav a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.docs-content { min-width: 0; }

.docs-section { margin-bottom: var(--sp-12); scroll-margin-top: 90px; }
.docs-section-header { margin-bottom: var(--sp-5); }
.docs-section-icon { color: var(--text-3); margin-bottom: var(--sp-2); }
.docs-section-icon svg { width: 20px; height: 20px; }
.docs-section-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-0);
  margin-bottom: 4px;
}
.docs-section-subtitle { font-size: var(--fs-md); color: var(--text-2); max-width: 60ch; }
.docs-lead { font-size: var(--fs-lg); line-height: 1.55; color: var(--text-1); max-width: 62ch; }

.docs-callout {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-0);
  background: var(--bg-2);
  margin: var(--sp-5) 0;
  font-size: var(--fs-md);
}
.docs-callout-icon { color: var(--accent); flex: none; }
.docs-callout-icon svg { width: 18px; height: 18px; }
.docs-callout-body { color: var(--text-1); }
.docs-callout-body strong { color: var(--text-0); }

.docs-param-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); margin: var(--sp-4) 0; }
.docs-param-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: lowercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-1);
}
.docs-param-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-0);
  color: var(--text-1);
  vertical-align: top;
}
.param-name { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; color: var(--text-0); }
.param-type { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--accent); }
.param-opt { font-size: var(--fs-2xs); color: var(--text-3); font-style: italic; }
.param-req { font-size: var(--fs-2xs); color: var(--danger); font-weight: 600; }
.docs-response-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-4); }

.docs-status-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-0);
}
.docs-status-row:last-child { border-bottom: 0; }
.docs-status-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  min-width: 46px;
  text-align: center;
  padding: 4px 0;
  border-radius: var(--r-xs);
  background: var(--bg-3);
  border: 1px solid var(--border-0);
  flex: none;
}
.docs-status-badge.s2 { color: var(--success); }
.docs-status-badge.s4 { color: var(--warning); }
.docs-status-badge.s5 { color: var(--danger); }
.docs-status-info strong { display: block; font-size: var(--fs-md); color: var(--text-0); font-weight: 600; }
.docs-status-info span { font-size: var(--fs-sm); color: var(--text-2); }

@media (max-width: 920px) {
  .docs-body { grid-template-columns: 1fr; gap: var(--sp-6); }
  .docs-sidebar-wrap {
    position: static;
    max-height: none;
    border: 1px solid var(--border-0);
    border-radius: var(--r-md);
    background: var(--bg-2);
    padding: var(--sp-3);
  }
  .docs-sidebar-group-label { display: none; }
  .docs-sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .docs-sidebar-nav a { border-left: 0; border-radius: var(--r-full); padding: 6px 12px; font-size: var(--fs-sm); }
  .docs-sidebar-nav a.active { background: var(--accent-dim); }
}

/* ═══ LOGS DE CHAVES (admin) ═══════════════════════════════════════════════ */
.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.logs-title-section { display: flex; flex-direction: column; gap: 3px; }
.logs-key-badge { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-1); }
.logs-stats { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.logs-stat-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 10px 16px;
  min-width: 110px;
}
.logs-stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}
.logs-stat-label { font-size: var(--fs-2xs); color: var(--text-3); font-weight: 500; }

.log-entry {
  display: grid;
  grid-template-columns: 150px 68px minmax(0, 1fr) 110px;
  gap: var(--sp-3);
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-0);
  font-size: var(--fs-sm);
  transition: background var(--dur) var(--ease-out);
}
.log-entry:hover { background: var(--bg-3); }
.log-entry:last-child { border-bottom: 0; }
.log-timestamp { display: flex; gap: 8px; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); }
.log-date { color: var(--text-3); }
.log-time { color: var(--text-2); }
.log-method {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--text-2);
}
.log-endpoint {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-ip { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); text-align: right; }

.logs-empty { text-align: center; padding: var(--sp-10) var(--sp-6); color: var(--text-3); }
.logs-empty-icon { margin-bottom: var(--sp-3); }
.logs-empty-icon svg { width: 34px; height: 34px; color: var(--border-2); }

@media (max-width: 760px) {
  .log-entry { grid-template-columns: 60px minmax(0, 1fr) 84px; }
  .log-timestamp { display: none; }
}

/* ═══ GRÁFICOS (admin) ═════════════════════════════════════════════════════ */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-4); }
.chart-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--card-shadow);
  padding: var(--sp-5);
}
.chart-header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.chart-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text-0);
}
.area-chart-svg { width: 100%; height: auto; display: block; }
.area-fill { fill: var(--accent); opacity: 0.08; }
.area-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top-api-bar-track {
  height: 6px;
  background: var(--bg-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.top-api-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--accent);
  transition: width var(--dur-slow) var(--ease-out);
}

/* ═══ ROTAÇÃO DE CUSTOM APIS (admin) ═══════════════════════════════════════ */
.custom-rotation-panel {
  border: 1px solid var(--border-0);
  border-radius: var(--r-md);
  background: var(--bg-2);
  padding: var(--sp-5);
  margin-top: var(--sp-4);
}
.custom-rotation-heading {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: var(--sp-2);
}
.custom-rotation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.custom-rotation-hint { font-size: var(--fs-xs); color: var(--text-3); margin-top: var(--sp-2); }
.custom-key-textarea { font-family: var(--font-mono); font-size: var(--fs-xs) !important; }
.custom-param-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  background: var(--bg-3);
  border: 1px solid var(--border-0);
  color: var(--text-2);
  border-radius: var(--r-full);
  padding: 3px 10px;
  margin: 2px 4px 2px 0;
}
.custom-api-param-summary { margin-top: var(--sp-2); }
.custom-api-key-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: var(--success-light);
  color: var(--success);
}
.custom-parameter-preview {
  border: 1px solid var(--border-0);
  border-radius: var(--r-md);
  background: var(--bg-2);
  padding: var(--sp-4);
  margin-top: var(--sp-4);
}
.custom-parameter-preview-head {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: var(--sp-2);
}
.custom-parameter-list { display: flex; flex-wrap: wrap; gap: 4px; }
.custom-parameter-empty { font-size: var(--fs-sm); color: var(--text-3); font-style: italic; }
