/* ===== API Vanti · estilos compartidos ===== */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --brand: #1d4ed8;
  --brand-hover: #1e40af;
  --brand-tint: #eef2ff;
  --ok: #067647;      --ok-tint: #ecfdf3;
  --warn: #b54708;    --warn-tint: #fffaeb;
  --bad: #b42318;     --bad-tint: #fef3f2;
  --cache: #3538cd;   --cache-tint: #eef4ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -20px rgba(16, 24, 40, .28);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
       color: var(--ink); background: var(--bg); }
::selection { background: #dbe4ff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none;
        stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 56px; }

/* ---------- Cabecera y navegación ---------- */
.top { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-tint);
              color: var(--brand); display: grid; place-items: center; }
.brand-mark .icon { width: 24px; height: 24px; }
.brand h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; }
.brand p { margin: 0; font-size: 13px; color: var(--muted); }
.nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 10px; color: #475467; text-decoration: none;
         font-size: 13.5px; font-weight: 600; }
.nav a:hover { background: #f2f4f7; }
.nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px;
        font-weight: 600; color: var(--ok); background: var(--ok-tint);
        border: 1px solid #abefc6; padding: 6px 12px; border-radius: 999px; }
.chip.iniciando { color: var(--warn); background: var(--warn-tint); border-color: #fedf89; }
.chip.pausado { color: var(--warn); background: var(--warn-tint); border-color: #fedf89; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Paneles ---------- */
.grid { display: grid; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line);
         border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.panel-head .icon { color: var(--brand); }
.panel h2 { font-size: 16px; margin: 0; letter-spacing: -0.01em; }
.panel .hint { margin: 0 0 16px; font-size: 13px; color: var(--muted); }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="search"], input[type="password"], input[type="number"], select {
  width: 100%; height: 42px; padding: 0 12px;
  font: inherit; font-size: 14.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
}
input::placeholder { color: #98a2b3; }
input:hover, select:hover { border-color: #98a2b3; }
.row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1.2fr .8fr 1fr; gap: 14px; }

.check { display: flex; align-items: center; gap: 8px; margin: 14px 0 16px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check label { margin: 0; font-weight: 500; font-size: 13.5px; color: #344054; }

button, .btn {
  font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px; min-height: 44px;
  padding: 0 18px; transition: background-color .15s ease, border-color .15s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { width: 100%; background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:disabled { background: #b2c7f7; cursor: progress; }
.btn-ghost { background: transparent; color: #344054; border-color: var(--line-strong);
             min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-ghost:hover { background: #f9fafb; }
.btn-danger { background: #fff; color: var(--bad); border-color: #fecdca; }
.btn-danger:hover { background: var(--bad-tint); }

/* ---------- Resultado ---------- */
.result { display: none; margin-top: 18px; padding: 18px;
          border: 1px solid var(--line); border-radius: 12px; background: #fcfcfd; }
.result.show { display: block; animation: rise .18s cubic-bezier(.2, .7, .2, 1); }
.result.s-ok { background: var(--ok-tint); border-color: #abefc6; }
.result.s-warn { background: var(--warn-tint); border-color: #fedf89; }
.result.s-bad { background: var(--bad-tint); border-color: #fecdca; }
.result.s-cache { background: var(--cache-tint); border-color: #c7d7fe; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .result.show { animation: none; } }
.result-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.amount { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.result dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
             gap: 10px 18px; margin: 14px 0 0; }
.result dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.result dd { margin: 2px 0 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---------- Pills / estados ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px;
        font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.pill-ok { background: #dcfae6; color: var(--ok); }
.pill-warn { background: #fef0c7; color: var(--warn); }
.pill-bad { background: #fee4e2; color: var(--bad); }
.pill-cache { background: #e0e7ff; color: var(--cache); }
.pill-neutral { background: #eef0f3; color: #475467; }

/* ---------- Tablas ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto;
              max-height: 420px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
           padding: 10px 14px; background: #f9fafb; border-bottom: 1px solid var(--line);
           font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody td { padding: 10px 14px; border-bottom: 1px solid #f2f4f7; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
.num { font-variant-numeric: tabular-nums; }
.origen { max-width: 290px; overflow: hidden; text-overflow: ellipsis; }
.empty td { text-align: center; color: #98a2b3; padding: 28px 14px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type="search"] { flex: 1; min-width: 220px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line-strong); background: #fff; color: #344054;
          border-radius: 999px; min-height: 34px; padding: 0 14px; font-size: 12.5px; font-weight: 600; }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.meta { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* ---------- Sembrador ---------- */
.progress { height: 8px; background: #eaecf0; border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; width: 0; background: var(--brand); transition: width .3s ease; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Acceso ---------- */
.gate-card { max-width: 420px; margin: 10vh auto; }
.gate-card .panel { padding: 28px; }
.gate-lock { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-tint);
             color: var(--brand); display: grid; place-items: center; margin-bottom: 16px; }
.gate-error { min-height: 20px; margin: 10px 0 0; font-size: 13px; color: var(--bad); }
.gate-help { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px;
       background: #f2f4f7; padding: 1px 5px; border-radius: 4px; }

footer { margin-top: 26px; display: flex; gap: 16px; flex-wrap: wrap;
         font-size: 12.5px; color: var(--muted); }
footer a { color: #475467; text-underline-offset: 3px; }
[hidden] { display: none !important; }
.desliza { display: none; margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Documentación (página API) ---------- */
.docs p { font-size: 14px; color: #344054; margin: 10px 0; }
.docs strong { color: var(--ink); }
.docs pre { background: #101828; color: #e4e7ec; border-radius: 12px; padding: 16px;
            overflow: auto; font-size: 12.5px; line-height: 1.55; margin: 8px 0 14px; }
.docs pre code { background: none; padding: 0; font-size: inherit; color: inherit;
                 font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.docs .table-wrap { max-height: none; margin: 8px 0 10px; }
.docs table th, .docs table td { white-space: normal; }

/* ---------- Móvil ---------- */
@media (max-width: 700px) {
  .wrap { padding: 18px 14px 40px; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .top-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .nav { width: 100%; order: 3; overflow-x: auto; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .amount { font-size: 26px; }
  .table-wrap { max-height: 360px; }
  .origen { max-width: 160px; }
  thead th, tbody td { padding-left: 10px; padding-right: 10px; font-size: 13px; }
  .desliza { display: block; }
}
