/* Recargas · Administrador — sistema visual */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-regular.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-medium.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-semibold.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-bold.woff") format("woff"); }

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --surface-3: #e8ebf3;
  --border: #e2e6ef;
  --border-strong: #cdd3e0;
  --text: #141a2e;
  --text-2: #4a536b;
  --text-3: #7a8399;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --primary-text: #3730a3;
  --ok: #15803d; --ok-soft: #e7f6ec; --ok-text: #166534;
  --warn: #b45309; --warn-soft: #fff4e0; --warn-text: #92400e;
  --bad: #c62828; --bad-soft: #fdecec; --bad-text: #9f1c1c;
  --info: #0369a1; --info-soft: #e6f3fb; --info-text: #075985;
  --neutral-soft: #eef0f4; --neutral-text: #4a536b;
  --shadow-sm: 0 1px 2px rgba(20, 26, 46, .06);
  --shadow: 0 1px 3px rgba(20, 26, 46, .06), 0 6px 18px rgba(20, 26, 46, .06);
  --shadow-lg: 0 18px 48px rgba(20, 26, 46, .18);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1220; --surface: #161b2c; --surface-2: #1c2236; --surface-3: #252c44;
    --border: #2a3150; --border-strong: #39416a; --text: #eef1fa; --text-2: #b5bdd4; --text-3: #8790ab;
    --primary: #7c7bff; --primary-hover: #8f8eff; --primary-soft: #262b55; --primary-text: #c9c8ff;
    --ok: #4ade80; --ok-soft: #13301f; --ok-text: #86efac;
    --warn: #fbbf24; --warn-soft: #36290c; --warn-text: #fcd34d;
    --bad: #f87171; --bad-soft: #3a1717; --bad-text: #fca5a5;
    --info: #38bdf8; --info-soft: #0f2a3a; --info-text: #7dd3fc;
    --neutral-soft: #232a40; --neutral-text: #b5bdd4;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03); --shadow-lg: 0 18px 48px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: minmax(0, 1fr); } }

/* --- Estructura --------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--surface) 0 247px, var(--border) 247px 248px, transparent 248px); }
.sidebar { position: sticky; top: 0; height: 100vh; align-self: start; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-weight: 700; font-size: 17px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; color: #fff; }
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-text); }
.nav-item .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); padding: 10px 28px; display: flex; align-items: center; gap: 12px; min-height: 58px; }
.content { padding: 24px 28px 64px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; color: var(--text-2); max-width: 680px; }
.btn.menu-btn { display: none; }
.demo-banner { background: repeating-linear-gradient(45deg, #fff4e0, #fff4e0 12px, #ffecc7 12px, #ffecc7 24px); color: #7a4a00;
  font-weight: 600; font-size: 13px; text-align: center; padding: 6px 12px; border-bottom: 1px solid #f3d38d; }
@media (prefers-color-scheme: dark) { .demo-banner { background: #36290c; color: #fcd34d; border-color: #5b4413; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(10, 14, 30, .35); z-index: 40; }
  .btn.menu-btn { display: inline-flex; }
  .shell { background: none; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 72px; }
}

/* --- Componentes -------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

.btn { --bc: var(--border-strong); display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--bc); background: var(--surface); color: var(--text); font: inherit; font-weight: 550;
  font-size: 14px; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; min-height: 38px; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, .input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 1px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-soft { background: var(--bad-soft); border-color: transparent; color: var(--bad-text); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 13px; min-height: 30px; border-radius: 8px; }
.btn.lg { padding: 11px 18px; font-size: 15px; min-height: 46px; }
.btn.icon { padding: 7px; min-width: 38px; }
.btn.block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--neutral-soft); color: var(--neutral-text); white-space: nowrap; line-height: 1.35; }
.badge.ok { background: var(--ok-soft); color: var(--ok-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.badge.bad { background: var(--bad-soft); color: var(--bad-text); }
.badge.info { background: var(--info-soft); color: var(--info-text); }
.badge.primary { background: var(--primary-soft); color: var(--primary-text); }
.badge .dot { width: 7px; height: 7px; border-radius: 99px; background: currentColor; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text); }
.help { font-size: 12.5px; color: var(--text-3); }
.error-text { font-size: 12.5px; color: var(--bad-text); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 14.5px; min-height: 40px; }
textarea.input { min-height: 84px; resize: vertical; line-height: 1.45; }
.input::placeholder { color: var(--text-3); }
.input-group { display: flex; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--primary); flex-shrink: 0; }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background .15s; flex-shrink: 0; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 99px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + .track { background: var(--ok); border-color: var(--ok); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:disabled + .track { opacity: .5; }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font: inherit; font-size: 13.5px; font-weight: 550; color: var(--text-2); cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented button:disabled { opacity: .5; cursor: not-allowed; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; font: inherit; font-weight: 550; font-size: 14px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--primary-text); border-bottom-color: var(--primary); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; font-size: 14px; }
.alert .ico { flex-shrink: 0; margin-top: 1px; }
.alert.info { background: var(--info-soft); color: var(--info-text); }
.alert.ok { background: var(--ok-soft); color: var(--ok-text); }
.alert.warn { background: var(--warn-soft); color: var(--warn-text); }
.alert.bad { background: var(--bad-soft); color: var(--bad-text); }
.alert b { font-weight: 650; }

.stat { padding: 16px 18px; }
.stat .k { font-size: 13px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.list-item.click { cursor: pointer; }
.list-item.click:hover { background: var(--surface-2); }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
table.table tr.click { cursor: pointer; }
table.table tr.click:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
@media (max-width: 720px) {
  table.table.responsive thead { display: none; }
  table.table.responsive tr { display: block; border-bottom: 1px solid var(--border); padding: 10px 14px; }
  table.table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; }
  table.table.responsive td::before { content: attr(data-label); color: var(--text-3); font-size: 12.5px; }
}

.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .ico { width: 46px; height: 46px; border-radius: 14px; background: var(--surface-2); display: inline-grid; place-items: center; color: var(--text-3); margin-bottom: 10px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

.spinner { width: 18px; height: 18px; border: 2.5px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s ease infinite; border-radius: 8px; min-height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

.modal-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(10, 14, 30, .45); display: grid; place-items: center; padding: 16px; animation: fade .12s ease; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { max-width: 860px; }
.modal-head { padding: 18px 22px 12px; display: flex; align-items: flex-start; gap: 12px; }
.modal-body { padding: 4px 22px 18px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; background: var(--surface-2); }
.drawer-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(10, 14, 30, .35); animation: fade .12s ease; }
.drawer { position: fixed; z-index: 71; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .16s ease; }
.drawer-head { padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.drawer-body { padding: 18px 20px 40px; overflow-y: auto; flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { transform: translateX(40px); opacity: .6; } }

.toasts { position: fixed; z-index: 100; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; animation: fade .15s ease; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

.kv { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 8px; } }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 99px; background: var(--surface); border: 2px solid var(--primary); }
.tl-item.sys::before { border-color: var(--border-strong); }

.money { font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -0.01em; }
.money.big { font-size: 28px; font-weight: 750; }

.copy { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 6px 6px 12px; font-family: var(--mono); font-size: 13px; }
.copy span { flex: 1; overflow-wrap: anywhere; }

.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.step .num { width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.step.done .num { background: var(--ok); color: #fff; }
.step.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }

.slot { border-radius: 16px; border: 1px solid var(--border); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 168px; position: relative; overflow: hidden; }
.slot .bar { position: absolute; left: 0; top: 0; right: 0; height: 5px; }
.slot.empty-slot { border-style: dashed; border-width: 2px; align-items: center; justify-content: center; color: var(--text-3); cursor: pointer; background: transparent; }
.slot.empty-slot:hover { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.slot .badge { align-self: flex-start; }
.slot .pos { position: absolute; top: 12px; right: 14px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.panel-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }

.cap { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.cap:first-child { border-top: 0; }

.screen-wrap { position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #000; }
.screen-wrap img { display: block; width: 100%; height: auto; cursor: crosshair; }
.screen-mark { position: absolute; border: 2px solid #f59e0b; background: rgba(245, 158, 11, .15); pointer-events: none; border-radius: 4px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); padding: 5px 11px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 550; color: var(--text-2); cursor: pointer; }
.chip.on { background: var(--primary-soft); border-color: transparent; color: var(--primary-text); }

.scroll-list { max-height: 560px; overflow-y: auto; }
.newbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: center; padding: 8px; }
.newbar button { box-shadow: var(--shadow); }

.mode-pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); }
.mode-pill .dot { width: 8px; height: 8px; border-radius: 99px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, var(--primary-soft), transparent), var(--bg); }
.login-card { width: 100%; max-width: 400px; }

.hide-sm { }
@media (max-width: 720px) { .hide-sm { display: none !important; } }
.only-sm { display: none; }
@media (max-width: 720px) { .only-sm { display: initial; } }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr); } }
details > summary { cursor: pointer; }
