@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
:root {
  color-scheme: light;
  --bg: #F6F8FB;
  --panel: #FFFFFF;
  --line: #E5EAF2;
  --text: #273142;
  --muted: #6B7788;
  --accent: #4A7DFF;
  --good: #16A34A;
  --warn: #D97706;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: #F6F8FB;
}
.wrapper { width: min(1200px, calc(100% - 28px)); margin: 22px auto 50px; }
.top {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.top h1 { margin: 0; font-size: 1.2rem; }
.top p { margin: 6px 0 0; color: var(--muted); }
.button { border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 10px 14px; text-decoration: none; background: #FFFFFF; }
.grid { margin-top: 16px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 1rem; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 10px; font-size: 0.74rem; font-weight: 700; }
.badge.ok { background: rgba(22, 163, 74, 0.08); color: var(--good); }
.badge.pending { background: rgba(217, 119, 6, 0.08); color: var(--warn); }
.meta { margin: 10px 0; color: var(--muted); font-size: 0.86rem; }
.endpoints { font-family: ui-monospace, monospace; font-size: 0.75rem; color: #273142; line-height: 1.5; max-height: 110px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #F6F8FB; }
.actions { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; }

/* ── Renombrador v2 alert buttons ── */
.rename-alert-btn {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid #dc2626;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  animation: renameAlertPulse 1.2s ease-in-out infinite;
}
.rename-alert-btn.rename-alert-error {
  border-color: #d97706;
  color: #d97706;
  background: rgba(217, 119, 6, 0.08);
}
.rename-alert-btn.active {
  animation: none;
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}
.rename-alert-btn.rename-alert-error.active {
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.25);
}
@keyframes renameAlertPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.03); }
}
tr.rename-row-dup { background: rgba(220, 38, 38, 0.06) !important; }
tr.rename-row-near-dup { background: rgba(234, 88, 12, 0.06) !important; border-left: 3px solid #ea580c; }
tr.rename-row-err { background: rgba(217, 119, 6, 0.06) !important; }
.rename-inline-input {
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.85em;
  width: 100%;
  font-family: inherit;
}

/* ── Dark Mode variables ── */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a10;
  --panel: #111118;
  --line: #2a2a3a;
  --text: #e8e8f0;
  --muted: #8888a0;
  --accent: #74b9ff;
  --good: #55efc4;
  --warn: #ffeaa7;
}

[data-theme="dark"] body {
  background: var(--bg);
}

[data-theme="dark"] .button {
  background: #1a1a24;
  border-color: #2a2a3a;
  color: var(--text);
}

[data-theme="dark"] .button:hover {
  background: #22222e;
  border-color: var(--accent);
}

[data-theme="dark"] .endpoints {
  background: #0a0a10;
  border-color: #2a2a3a;
  color: #e8e8f0;
}

[data-theme="dark"] .theme-toggle {
  background: #1a1a24;
  border: 1px solid #2a2a3a;
  color: #8888a0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
  flex-shrink: 0;
}

[data-theme="dark"] .theme-toggle:hover {
  color: #ffeaa7;
  border-color: #ffeaa7;
  transform: rotate(20deg);
}

/* Base style for theme toggle when in light mode */
.theme-toggle {
  background: #ffffff;
  border: 1px solid #E5EAF2;
  color: #6B7788;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: #D97706;
  border-color: #D97706;
  transform: rotate(20deg);
}
