/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: #0f172a;
  background: #f8fafc;
}

/* ── Sideload message ──────────────────────────────── */
.cog-sideload {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #64748b;
}

/* ── Header ────────────────────────────────────────── */
.cog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #060e1c 0%, #0b1e3a 55%, #071428 100%);
  position: sticky;
  top: 0;
  z-index: 10;
}

.cog-header-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: contain;
  /* sem border-radius — o SVG/PNG já tem sua própria forma */
}

.cog-header-text { display: flex; flex-direction: column; gap: 1px; }

.cog-header-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.cog-header-sub {
  font-size: 10px;
  color: #22c55e;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Login view ────────────────────────────────────── */
.cog-login-wrap { padding: 28px 20px; }

.cog-login-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #22c55e;
  margin-bottom: 4px;
}

.cog-login-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}

.cog-field { margin-bottom: 14px; }

.cog-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cog-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cog-input:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.cog-btn-primary {
  width: 100%;
  padding: 11px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.cog-btn-primary:hover { background: #16a34a; }
.cog-btn-primary:disabled { background: #86efac; cursor: not-allowed; }

.cog-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.cog-status--ok    { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.cog-status--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.cog-status--info  { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── User banner ───────────────────────────────────── */
.cog-user-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 14px 8px;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}

.cog-user-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.2);
}

.cog-user-info { flex: 1; min-width: 0; }

.cog-user-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.cog-user-email {
  font-size: 11.5px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cog-btn-logout {
  padding: 5px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.cog-btn-logout:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }

/* ── Section header ────────────────────────────────── */
.cog-section-header {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 12px 16px 5px;
}

/* ── Function cards ────────────────────────────────── */
.cog-fn-card {
  margin: 0 14px 6px;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
  transition: box-shadow 0.15s;
}

.cog-fn-card:hover { box-shadow: 0 2px 6px rgba(15,23,42,0.09); }

.cog-fn-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.cog-fn-toggle:hover { background: #f8fafc; }

.cog-fn-name {
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
  letter-spacing: -0.01em;
}

.cog-fn-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cog-fn-tag--blue   { background: rgba(59, 130, 246, 0.1); color: #1d4ed8; }
.cog-fn-tag--purple { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.cog-fn-tag--orange { background: rgba(249, 115, 22, 0.1); color: #c2410c; }

.cog-fn-arrow {
  margin-left: auto;
  font-size: 12px;
  color: #cbd5e1;
  transition: transform 0.2s;
}

.cog-fn-arrow.open { transform: rotate(180deg); }

.cog-fn-body {
  padding: 0 14px 14px;
  border-top: 1px solid #f1f5f9;
}

.cog-fn-desc {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.6;
  padding: 10px 0 10px;
}

.cog-fn-return {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
  font-size: 11px;
  color: #166534;
  line-height: 1.5;
}

.cog-return-icon {
  color: #22c55e;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Params table ──────────────────────────────────── */
.cog-params {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 14px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #f1f5f9;
}

.cog-params thead th {
  text-align: left;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.cog-params tbody tr:hover td { background: #fafbfc; }

.cog-params td {
  padding: 5px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
}

.cog-params tbody tr:last-child td { border-bottom: none; }
.cog-params td:last-child { color: #64748b; }

.cog-params td.req {
  font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.cog-params td.opt {
  font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
  color: #94a3b8;
  white-space: nowrap;
}

/* ── Examples ──────────────────────────────────────── */
.cog-examples-title {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 8px;
}

.cog-example { margin-bottom: 8px; }

.cog-example-label {
  font-size: 10px;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 500;
}

.cog-example-row {
  display: flex;
  align-items: stretch;
  gap: 5px;
}

.cog-example-row code {
  flex: 1;
  display: block;
  padding: 7px 9px;
  background: #0d1521;
  color: #4ade80;
  border-radius: 6px;
  font-size: 10px;
  font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
  line-height: 1.5;
  word-break: break-all;
}

.cog-insert {
  flex-shrink: 0;
  width: 30px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.cog-insert:hover { background: #16a34a; }
.cog-insert:active { transform: scale(0.93); }

/* ── Product types ─────────────────────────────────── */
.cog-tipos-section { margin: 4px 0 24px; }

.cog-tipos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 16px 10px;
}

.cog-tipo-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 130px;
  min-width: 120px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 10px;
  color: #475569;
  cursor: default;
  transition: background 0.12s, border-color 0.12s;
}

.cog-tipo-chip strong {
  font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
  font-size: 10px;
  font-weight: 800;
  color: #0f172a;
}

.cog-tipo-chip span {
  font-size: 9.5px;
  line-height: 1.25;
  color: #64748b;
}

.cog-tipo-chip:hover { background: #e2e8f0; border-color: #cbd5e1; }

.cog-tipos-note {
  font-size: 10px;
  color: #94a3b8;
  padding: 0 16px;
  line-height: 1.5;
}
