:root {
  --bg: #0f172a;
  --panel: #111827;
  --line: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #0ea5e9;
  --accent2: #0369a1;
  --ok: #16a34a;
  --err: #dc2626;
  --warn: #d97706;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1e3a5f 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}
.brand { font-weight: 700; letter-spacing: 0.04em; font-size: 1.1rem; }
main { max-width: 980px; margin: 1.5rem auto; padding: 0 1rem 3rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
}
h1, h2 { margin-top: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
input, select, button, textarea {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  background: #0b1220;
  color: var(--text);
}
button {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border: none;
  cursor: pointer;
  font-weight: 600;
}
button.secondary { background: #334155; }
button.btn-reenviar {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
button.btn-reenviar:disabled { opacity: 0.6; cursor: wait; }
button.ghost { background: transparent; border: 1px solid var(--line); }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.grid-2 .full { grid-column: 1 / -1; }
.tabs { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.tab {
  background: #1e293b;
  border: 1px solid var(--line);
}
.tab.active { background: var(--accent2); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge.pendiente, .badge.procesando { background: #78350f; color: #fde68a; }
.badge.exito { background: #14532d; color: #bbf7d0; }
.badge.error { background: #7f1d1d; color: #fecaca; }
.result {
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  overflow: auto;
  white-space: pre-wrap;
}
.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #0f766e;
  color: white;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  max-width: 360px;
  z-index: 50;
}
.toast.err { background: var(--err); }
code { color: #7dd3fc; }
a { color: #38bdf8; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.25rem 0; }
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
}
