/* ============================================================
   API Beep Lab — Tema BeePay (portal corporativo)
   Sidebar navy + acento dorado, contenido claro, tarjetas blancas.
   ============================================================ */

:root {
  --navy-900: #0b1526;
  --navy-800: #0f1e38;
  --navy-700: #16294a;
  --navy-600: #1f3660;
  --gold: #f2a71b;
  --gold-soft: #ffc94d;
  --gold-deep: #d18f00;

  --bg: #f2f5f9;
  --card: #ffffff;
  --ink: #1b2a41;
  --muted: #67748c;
  --line: #e3e9f2;
  --line-soft: #eef2f8;

  --green: #15905f;
  --green-bg: #e7f6ef;
  --red: #cf3f3f;
  --red-bg: #faebeb;
  --amber: #b57900;
  --amber-bg: #fdf3e0;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 30, 54, .06), 0 6px 24px -8px rgba(16, 30, 54, .10);
  --shadow-lg: 0 24px 60px -24px rgba(11, 21, 38, .45);
  --font: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
.btn-reset { background: none; border: none; padding: 0; }

svg { display: block; }

/* ============================ LOGIN ============================ */

.login-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(242, 167, 27, .14), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(31, 54, 96, .9), transparent 65%),
    var(--navy-900);
  padding: 24px;
}
.login-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 50% 0%, rgba(242, 167, 27, .07), transparent 70%);
}
.login-card {
  position: relative; width: min(420px, 100%);
  background: var(--card); border-radius: 20px;
  padding: 36px 34px 30px;
  box-shadow: var(--shadow-lg);
  animation: rise .45s cubic-bezier(.2, .8, .25, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.brand-img { height: 42px; width: auto; display: block; }
.login-brand strong, .brand strong {
  display: block; font-size: 22px; font-weight: 800; letter-spacing: -.3px; color: var(--ink);
}
.login-brand span, .brand span { font-size: 12px; color: var(--muted); font-weight: 500; }
.login-note { color: var(--muted); font-size: 13px; margin: 10px 0 22px; }
.login-error {
  background: var(--red-bg); color: var(--red);
  border: 1px solid #f0cccc; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; padding: 10px 12px; margin-top: 12px;
}
.login-foot { margin-top: 26px; color: rgba(255, 255, 255, .38); font-size: 12px; letter-spacing: .04em; }

/* ============================ LAYOUT ============================ */

.layout { display: flex; height: 100vh; overflow: hidden; }

/* ---------- Sidebar ---------- */

.sidebar {
  width: 292px; flex: none;
  display: flex; flex-direction: column;
  background: linear-gradient(175deg, var(--navy-800) 0%, var(--navy-900) 90%);
  color: #cdd7e6;
}
.brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand .brand-img { height: 44px; }
.brand strong { color: #fff; font-size: 15px; letter-spacing: .02em; }
.brand span { color: #7f90ab; }

.nav-label {
  padding: 18px 22px 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #5f7191;
}
.tree { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
.tree::-webkit-scrollbar { width: 6px; }
.tree::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

.tree-folder { margin-bottom: 2px; }
.folder-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 10px;
  background: none; border: none; border-radius: 8px;
  color: #93a5c0; font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  text-align: left; transition: color .15s;
}
.folder-head:hover { color: #d4deed; }
.folder-head .chev {
  font-size: 10px; transition: transform .2s; transform: rotate(90deg);
  color: var(--gold);
}
.folder-head.closed .chev { transform: rotate(0); }

.folder-items { overflow: hidden; }
.folder-items.closed { display: none; }

.op-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px 9px 14px;
  margin: 1px 0;
  background: none; border: none; border-radius: 9px;
  border-left: 3px solid transparent;
  color: #b9c6da; font-size: 13.5px; text-align: left;
  transition: background .15s, color .15s, border-color .15s;
}
.op-item svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.op-item:hover { background: rgba(255, 255, 255, .05); color: #eef3fa; }
.op-item:hover svg { opacity: 1; }
.op-item.active {
  background: linear-gradient(90deg, rgba(242, 167, 27, .16), rgba(242, 167, 27, .05));
  border-left-color: var(--gold);
  color: var(--gold-soft); font-weight: 600;
}
.op-item.active svg { opacity: 1; color: var(--gold); }

.sidebar-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  display: flex; flex-direction: column; gap: 10px;
}
.conn-pill {
  display: flex; align-items: center; gap: 10px; flex: none;
  border: 1.5px solid var(--line); border-radius: 14px;
  padding: 10px 17px; font-size: 13.5px; font-weight: 700; color: var(--muted);
  background: #fff; letter-spacing: -.1px;
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s;
}
.conn-pill.ok {
  background: #edf8f2; border-color: #bfe3d0; color: #17694a;
  box-shadow: 0 2px 8px rgba(30, 158, 106, .12);
}
.conn-pill.ok .conn-dot { color: #1e9e6a; }
.conn-pill.warn {
  background: #fdf6e7; border-color: #ead9ac; color: #7d5a14;
  box-shadow: 0 2px 8px rgba(242, 167, 27, .14);
}
.conn-pill.warn .conn-dot { color: var(--gold-deep); }
.conn-pill.bad {
  background: #fbeeee; border-color: #e8bcbc; color: #8f3533;
  box-shadow: 0 2px 8px rgba(194, 65, 65, .13);
}
.conn-pill.bad .conn-dot { color: #c24141; }
.conn-dot {
  font-size: 11px; line-height: 1;
  animation: connPulse 2.2s ease-in-out infinite;
}
@keyframes connPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.conn-stack { display: flex; flex-direction: column; gap: 2px; }
.conn-sub { font-size: 10.5px; font-weight: 600; opacity: .75; line-height: 1.25; max-width: 260px; letter-spacing: 0; }

.footer-links { display: flex; flex-direction: column; gap: 4px; }
.foot-link {
  color: #7f90ab; font-size: 12.5px; text-decoration: none;
  padding: 4px 2px; text-align: left; transition: color .15s;
}
.foot-link:hover { color: var(--gold-soft); }

/* ---------- Contenido ---------- */

.content { flex: 1; overflow-y: auto; padding: 0 30px 36px; }
.page-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 0 16px; margin-bottom: 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}
.page-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

.workspace-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr);
  gap: 20px; align-items: start;
}
/* El panel de resultado acompaña el scroll — la zona derecha nunca queda
   como espacio muerto tras un formulario largo */
.monitor { position: sticky; top: 92px; }
@media (max-width: 1100px) { .workspace-grid { grid-template-columns: 1fr; } }

/* ---------- Tarjetas ---------- */

.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.card-head.split { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-body { padding: 22px; }

/* ---------- Formulario ---------- */

.form-host .empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 280px; text-align: center; color: var(--muted);
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
  padding: 32px 26px;
}
.empty-icon { width: 54px; height: 54px; color: #b8c4d8; margin-bottom: 16px; }
.empty-state h3 { color: var(--ink); font-size: 17px; margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; max-width: 400px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
.field > span {
  font-size: 12px; font-weight: 700; color: var(--navy-700);
  letter-spacing: .02em;
}
.field > span em { color: var(--muted); font-weight: 500; }
.field input, .field select {
  height: 44px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfcfe; color: var(--ink);
  font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  width: 100%;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--gold); background: #fff;
  box-shadow: 0 0 0 3.5px rgba(242, 167, 27, .18);
}
.field input::placeholder { color: #aab6c8; }
.field input.is-fixed { background: #f4f7fb; color: var(--muted); border-style: dashed; }
.field input.is-locked { background: #f4f7fb; color: var(--muted); cursor: not-allowed; }

/* ---------- Actividad de la sesión ---------- */

.activity-card { margin-top: 20px; }
.activity-body { padding: 10px 14px; }
.act-empty {
  padding: 26px 18px; text-align: center; color: var(--muted);
  font-size: 13px; line-height: 1.6;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: #fbfcfe;
}
/* Columnas equidistantes: misma simetría que "Detalles de la operación" */
.act-head, .act-row {
  display: grid;
  grid-template-columns: 1.4fr .55fr .8fr 1.3fr 1.1fr 1.3fr .85fr .85fr .8fr;
  gap: 0 14px; align-items: center;
  min-width: 1120px;
}
.activity-body { overflow-x: auto; }
.act-head {
  padding: 6px 12px 10px; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  border-bottom: 1.5px solid var(--line);
}
.act-row {
  padding: 10px 12px; font-size: 12.5px; color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.act-row:last-child { border-bottom: none; }
.act-row:hover { background: #f7f9fc; }
.act-mono { font-family: var(--mono); font-size: 11.5px; color: #41557a; }
.act-label { font-weight: 600; color: var(--ink); }
.act-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; display: inline-block;
}
.act-row.ok .act-tag { background: rgba(30, 158, 106, .1); color: #1e9e6a; }
.act-row.no .act-tag { background: rgba(194, 65, 65, .1); color: #c24141; }
.act-row.err .act-tag { background: rgba(176, 114, 8, .12); color: #b07208; }
.activity-actions { display: flex; gap: 14px; }
.act-more {
  padding: 10px 12px; font-size: 11.5px; color: var(--muted);
  font-style: italic; text-align: center;
}

/* ---------- Accesibilidad (WCAG) ---------- */

:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.field input.is-masked { letter-spacing: .12em; font-family: var(--mono); font-size: 13px; }
.field input[type="password"] { letter-spacing: .18em; }
.field .help { font-size: 11.5px; color: var(--muted); }
.field.invalid input { border-color: var(--red); box-shadow: 0 0 0 3.5px rgba(207, 63, 63, .12); }

.secret-wrap { position: relative; display: block; }
.secret-wrap input { padding-right: 42px; }
.secret-wrap .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: none; border-radius: 7px;
  background: none; color: var(--muted); font-size: 14px;
}
.secret-wrap .eye:hover { background: var(--line-soft); color: var(--ink); }

.autofill-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 8px 14px;
  background: var(--amber-bg); color: var(--amber);
  border: 1px solid #f0ddb0; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  transition: background .15s, transform .1s;
}
.autofill-chip svg { width: 14px; height: 14px; }
.autofill-chip:hover { background: #fceccb; }
.autofill-chip:active { transform: scale(.98); }

/* ---------- Selector de operaciones recientes (desplegable) ---------- */

.history-pick { margin-bottom: 18px; }
.hp-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.hp-dd { position: relative; }
.hp-select {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; height: 42px; padding: 0 14px;
  background: #f8fafd; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--navy-700); text-align: left;
  transition: border-color .15s, background .15s;
}
.hp-select:hover { border-color: #c9d3e2; background: #fff; }
.hp-select svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.hp-select.chosen { border-color: var(--gold); background: var(--amber-bg); }
.hp-menu {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  display: flex; flex-direction: column; gap: 5px;
  max-height: 260px; overflow-y: auto; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 44px -14px rgba(16, 30, 54, .28);
  animation: menuIn .18s cubic-bezier(.2, .8, .25, 1);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.hp-menu::-webkit-scrollbar { width: 5px; }
.hp-menu::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.hp-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  background: #f8fafd; border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-sm); text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.hp-row:hover { border-color: #cfd9e8; background: #fff; }
.hp-row.selected {
  border-color: var(--gold); background: var(--amber-bg);
  box-shadow: 0 0 0 3px rgba(242, 167, 27, .12);
}
.hp-op { font-size: 12.5px; font-weight: 700; color: var(--navy-700); flex: none; }
.hp-vals {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin-left: auto; text-align: right;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.hp-row.hp-disabled {
  opacity: .55; cursor: not-allowed;
  border-style: dashed;
}
.hp-row.hp-disabled:hover { border-color: var(--line-soft); background: #f8fafd; }
.hp-sep {
  padding: 10px 4px 4px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.hp-vals em {
  font-style: normal; font-weight: 700; color: #9aa7bb;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em;
  margin-right: 4px;
}
.hp-legend {
  padding: 9px 12px; margin-bottom: 6px;
  font-size: 11px; line-height: 1.45; color: var(--muted);
  background: #f1f5fb; border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}
.hp-empty {
  padding: 11px 14px; margin-bottom: 16px;
  font-size: 12px; line-height: 1.5; color: var(--muted);
  background: #f8fafd; border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}
.ref-context {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 10px 14px;
  background: var(--navy-800); color: #cdd7e6;
  border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 13px;
}
.ref-context svg { width: 15px; height: 15px; color: var(--gold); flex: none; }
.ref-context .ref-tag {
  font-family: var(--sans); font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--gold); flex: none;
}
.ref-context span b {
  font-weight: 700; color: #7f90ab; font-size: 10px;
  text-transform: uppercase; letter-spacing: .05em; margin-right: 5px;
}
.hp-note {
  background: var(--amber-bg); border: 1px solid #f0ddb0;
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: 12.5px; color: var(--amber); margin-bottom: 16px;
}
.hp-note strong { color: #8a5c00; }

.launch-zone { margin-top: 22px; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; letter-spacing: .01em;
  transition: transform .1s, box-shadow .15s, filter .15s, background .15s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .65; cursor: default; }
.btn-block { width: 100%; }

.btn.primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 55%, var(--gold-deep));
  color: var(--navy-900);
  box-shadow: 0 6px 18px -6px rgba(209, 143, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:hover { filter: brightness(1.04); box-shadow: 0 8px 22px -6px rgba(209, 143, 0, .6), inset 0 1px 0 rgba(255,255,255,.35); }

.btn.ghost {
  background: #fff; color: var(--navy-700);
  border: 1.5px solid var(--line);
}
.btn.ghost:hover { border-color: #c9d3e2; background: #f8fafd; }
.btn.small { height: 36px; padding: 0 14px; font-size: 12.5px; }

/* ---------- Spinner ---------- */

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite; flex: none;
}
.spinner.dark { border-color: rgba(11, 21, 38, .25); border-top-color: var(--navy-900); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ MONITOR / RESULTADO ============================ */

.monitor-body { padding-top: 18px; }
.monitor-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; min-height: 260px; text-align: center;
  color: var(--muted); font-size: 13.5px;
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: #fafbfd; padding: 30px;
}
.monitor-empty svg { width: 44px; height: 44px; color: #b8c4d8; }

.monitor-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; min-height: 260px; color: var(--muted); font-size: 13.5px;
}
.pulse-ring {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
  position: relative;
}
.pulse-ring::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50%;
  border: 1.5px solid rgba(242, 167, 27, .3);
}

.result-banner {
  display: flex; gap: 14px; align-items: flex-start;
  border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid transparent;
  animation: rise .35s ease;
}
.result-banner svg { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.result-banner h3 { font-size: 15.5px; margin-bottom: 3px; }
.result-banner p { font-size: 13px; opacity: .85; }
.result-banner.ok { background: var(--green-bg); border-color: #bfe6d4; color: var(--green); }
.result-banner.declined { background: var(--red-bg); border-color: #f0cccc; color: var(--red); }
.result-banner.error { background: var(--amber-bg); border-color: #f0ddb0; color: var(--amber); }

.refs-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  margin: 18px 0 10px;
}
.refs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ref-tile {
  background: #f8fafd; border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.rt-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rt-value { font-family: var(--mono); font-size: 13px; font-weight: 600; margin-top: 3px; word-break: break-all; }

/* ============================ ADMIN PAGE ============================ */

.admin-page { background: var(--bg); min-height: 100vh; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(90deg, var(--navy-800), var(--navy-900));
  color: #cdd7e6;
}
.admin-topbar .brand { padding: 0; border: none; flex-direction: row; align-items: center; }
.admin-topbar .brand .brand-img { height: 30px; }
.admin-topbar .brand strong { font-size: 15px; }
.admin-topbar-actions { display: flex; gap: 18px; align-items: center; }
.admin-topbar .foot-link { color: #93a5c0; }
.admin-topbar .foot-link:hover { color: var(--gold-soft); }

.admin-content { max-width: 980px; margin: 0 auto; padding: 30px 24px 60px; display: flex; flex-direction: column; gap: 20px; }

.admin-lock { display: flex; justify-content: center; padding-top: 8vh; }
.pin-card { width: min(400px, 100%); text-align: center; }
.pin-icon { width: 40px; height: 40px; color: var(--gold); margin: 0 auto 12px; }
.pin-card h3 { font-size: 18px; }
.pin-card .field { text-align: left; margin-top: 14px; }
.pin-card .btn { margin-top: 18px; }

.admin-status {
  display: flex; align-items: center; gap: 9px;
  border-radius: var(--radius); padding: 13px 16px;
  font-size: 13.5px; font-weight: 600; border: 1px solid;
}
.admin-status.ok { background: var(--green-bg); border-color: #bfe6d4; color: var(--green); }
.admin-status.bad { background: var(--amber-bg); border-color: #f0ddb0; color: var(--amber); }
.admin-status .dot { font-size: 9px; }

.panel-a-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.validate-msg { font-size: 13px; font-weight: 600; }
.validate-msg.ok { color: var(--green); }
.validate-msg.bad { color: var(--red); }

/* ---------- Vista técnica ---------- */

.tech-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .tech-panes { grid-template-columns: 1fr; } }
.pane {
  background: var(--navy-900); border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid #223455;
}
.pane-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; background: var(--navy-800);
  color: #93a5c0; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.pane pre {
  padding: 14px; overflow: auto; max-height: 380px;
  font-family: var(--mono); font-size: 12px; line-height: 1.55; color: #d5e1f2;
}
.copy-btn {
  background: rgba(255, 255, 255, .07); color: #b9c6da;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 7px; padding: 4px 10px; font-size: 11px; font-weight: 600;
  transition: background .15s, color .15s;
}
.copy-btn:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.copy-btn.copied { color: #3ddc97; border-color: rgba(61, 220, 151, .4); }

/* JSON highlight */
.j-key { color: #8fb8ff; }
.j-str { color: #ffd58a; }
.j-num { color: #7ce3b1; }
.j-bool { color: #f2a7c3; }
.j-null { color: #8d99b0; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; top: 20px; right: 20px; z-index: 100;
  background: var(--navy-800); color: #e8eef7;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-sm); padding: 12px 18px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s cubic-bezier(.2, .8, .25, 1);
}
.toast.ok { border-left: 4px solid #3ddc97; }
.toast.bad { border-left: 4px solid #ff7d7d; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } }

/* ======================= PULIDO GLOBAL (estándar UX) ======================= */

/* Marca también en la selección de texto */
::selection { background: rgba(242, 167, 27, .25); }

/* Scroll elegante en el contenido */
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: #ccd5e3; border-radius: 4px; }
.content::-webkit-scrollbar-thumb:hover { background: #aebbd0; }

/* Transición suave de los elementos interactivos */
.card { transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: #d5deeb; }

/* Campos: pista visual al pasar el cursor antes del foco */
.field input:hover:not(:focus):not(.is-locked):not(.is-fixed),
.field select:hover:not(:focus) { border-color: #c9d3e2; }
.field input::placeholder { font-style: normal; color: #a8b4c7; }

/* Entradas de las tarjetas con elevación sutil al montar */
.workspace-grid > .card, .activity-card { animation: cardIn .3s ease both; }
.activity-card { animation-delay: .06s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Botón primario: foco visible coherente con la marca */
.btn.primary:focus-visible { outline: 3px solid rgba(242, 167, 27, .45); outline-offset: 2px; }

/* Resultado: respiración y jerarquía clara */
.monitor .card-head { position: sticky; top: 0; background: var(--card); z-index: 5; }

/* Toast con entrada animada */
.toast { animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Filas de actividad con borde de estado a la izquierda (ley del color) */
.act-row { border-left: 3px solid transparent; border-radius: 6px; }
.act-row.ok { border-left-color: rgba(30, 158, 106, .45); }
.act-row.no { border-left-color: rgba(194, 65, 65, .45); }
.act-row.err { border-left-color: rgba(176, 114, 8, .45); }

/* ======================= UX2: funcional ======================= */

/* Buscador del catálogo */
.tree-search {
  margin: 10px 14px 4px; width: calc(100% - 28px); height: 34px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; color: #dfe7f3; font-size: 12.5px; padding: 0 11px;
}
.tree-search::placeholder { color: #5f7191; }
.tree-search:focus { outline: none; border-color: var(--gold); }

/* Skeleton loading del resultado */
.skel { padding: 8px 2px; }
.skel-banner { height: 74px; border-radius: var(--radius-sm); background: linear-gradient(90deg,#eef2f8 25%,#f7f9fc 50%,#eef2f8 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skel-line { height: 16px; width: 42%; margin: 20px 0 12px; border-radius: 6px; background: #eef2f8; }
.skel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skel-tile { height: 58px; border-radius: var(--radius-sm); background: linear-gradient(90deg,#eef2f8 25%,#f7f9fc 50%,#eef2f8 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skel-text { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--muted); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Refs clic-para-copiar */
.ref-tile.copyable { cursor: copy; transition: border-color .15s, background .15s; }
.ref-tile.copyable:hover { border-color: var(--gold); background: #fffcf5; }
.ref-tile.copyable.copied { border-color: var(--green); background: var(--green-bg); }

/* Acciones del resultado */
.result-actions { margin-top: 14px; display: flex; justify-content: flex-end; }

/* Franquicia de tarjeta + Luhn */
.card-badge { font-size: 11px; font-weight: 700; color: var(--green); margin-top: 2px; min-height: 13px; }
.card-badge.warn { color: var(--amber); }

/* Confirmación de acción destructiva */
.confirm-strip {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; padding: 11px 14px;
  background: #fdf6e7; border: 1.5px solid #ead9ac; border-radius: var(--radius-sm);
  font-size: 13px; color: #7d5a14;
}
.confirm-strip svg { width: 18px; height: 18px; flex: none; color: var(--gold-deep); }
.confirm-strip span { flex: 1; }
.confirm-strip .cs-btns, .confirm-strip button { flex: none; margin-left: 8px; }

/* Estadísticas de sesión */
.act-stats { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.act-stats span {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  background: #eef3fa; color: var(--navy-700); border-radius: 999px;
}
.act-cta { margin-top: 12px; }

/* Campos opcionales colapsados */
.opt-group { margin-top: 16px; }
.opt-group summary {
  cursor: pointer; list-style: none; user-select: none;
  font-size: 12.5px; font-weight: 700; color: var(--navy-700);
  padding: 10px 2px; display: flex; align-items: center; gap: 6px;
}
.opt-group summary::before { content: '▸'; color: var(--gold); font-size: 11px; transition: transform .15s; }
.opt-group[open] summary::before { transform: rotate(90deg); }
.opt-group summary em { color: var(--muted); font-weight: 500; font-style: normal; }
.opt-group .field-grid { margin-top: 8px; }

/* Insignia de franquicia */
.brand-ico { width: 34px; height: 12px; display: inline-block; vertical-align: middle; }
.card-badge { display: inline-flex; align-items: center; gap: 6px; }
.card-badge span { font-weight: 600; }
.ref-tile .brand-ico { width: 36px; height: 13px; margin-left: 6px; }
