/* =====================================================================
   Recarga Pro — sistema visual
   ===================================================================== */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --ink: #0b1426;
  --ink-2: #33415c;
  --muted: #6b7a93;
  --line: #e5eaf3;
  --line-2: #eef2f8;

  --brand: #3355ff;
  --brand-2: #00b8ff;
  --brand-ink: #1f3ad6;
  --brand-soft: #eef1ff;
  --grad: linear-gradient(135deg, #3355ff 0%, #2a8bff 55%, #00c2ff 100%);
  --navy: #0a1430;
  --navy-2: #13235a;

  --green: #0f9f63;  --green-soft: #e7f8f0;
  --amber: #c27803;  --amber-soft: #fff5de;
  --red:   #d93a3a;  --red-soft:   #fdeceb;
  --blue:  #2463eb;  --blue-soft:  #e8f0ff;
  --gray:  #64748b;  --gray-soft:  #f0f3f7;

  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 26px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --sh-2: 0 4px 16px -4px rgba(16, 24, 40, .08), 0 2px 6px -2px rgba(16, 24, 40, .04);
  --sh-3: 0 24px 48px -12px rgba(16, 24, 40, .22);
  --sh-brand: 0 10px 24px -8px rgba(51, 85, 255, .55);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --side: 260px;
}

*, *::before, *::after { 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); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.num, .money { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace; font-size: .93em; letter-spacing: 0; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pos { color: var(--green); }
.neg { color: var(--ink); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(194, 120, 3, .45); } 50% { box-shadow: 0 0 0 6px rgba(194, 120, 3, 0); } }

/* ---------------- Layout ---------------- */
.shell { min-height: 100vh; }
.main { padding: 28px 32px 64px; max-width: 1240px; margin: 0 auto; animation: rise .35s var(--ease) both; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.spacer { flex: 1; }

/* Admin: barra lateral */
.admin .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); background: linear-gradient(90deg, var(--navy) var(--side), transparent var(--side)); }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--navy); color: #c9d3ee;
  display: flex; flex-direction: column; padding: 22px 16px; overflow-y: auto;
  background-image: radial-gradient(600px 300px at -20% -10%, rgba(51, 85, 255, .35), transparent 60%),
                    radial-gradient(400px 260px at 120% 110%, rgba(0, 184, 255, .18), transparent 60%);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.02em; padding: 4px 8px 22px; }
.brand:hover { text-decoration: none; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center;
  color: #fff; box-shadow: var(--sh-brand);
}
.logo .ic { width: 19px; height: 19px; }
.brand small { white-space: nowrap; display: block; font-size: 11px; font-weight: 600; color: #8193c4; letter-spacing: .04em; text-transform: uppercase; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6c7db0; padding: 14px 12px 8px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: #c9d3ee;
  font-weight: 600; font-size: 14.5px; transition: background .2s, color .2s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.nav a.on .ic { color: #7fb4ff; }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: linear-gradient(135deg, #e6ebff, #d4f3ff); color: var(--brand-ink); flex: none;
}
.sidebar .avatar { background: rgba(255, 255, 255, .12); color: #fff; }
.me .who { min-width: 0; }
.me .who b { display: block; color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font-size: 12px; color: #8193c4; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.side-foot .nav a, .side-foot .linkbtn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: #c9d3ee; font-weight: 600; font-size: 14.5px; }
.side-foot .linkbtn:hover { background: rgba(255, 255, 255, .06); color: #fff; }

/* Barra superior (cliente, y admin en móvil) */
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line);
}
.topbar .in { max-width: 1240px; margin: 0 auto; padding: 12px 32px; display: flex; align-items: center; gap: 16px; }
.topbar .brand { color: var(--ink); padding: 0; }
.topbar .brand small { color: var(--muted); }
.topnav { display: flex; gap: 4px; margin-left: 20px; }
.topnav a { white-space: nowrap; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 650; font-size: 14.5px; }
.topnav a:hover { background: var(--gray-soft); text-decoration: none; }
.topnav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.balance-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--navy);
  color: #fff; font-weight: 700; box-shadow: var(--sh-2);
}
.balance-chip small { color: #9fb0dd; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.balance-chip .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.menu-btn { display: none; }
.admin .topbar { display: none; }

/* Barra inferior móvil */
.tabbar { display: none; }

/* ---------------- Tarjetas ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 16px; }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* KPIs */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 650; }
.kpi .k-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.kpi .k-val { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tone-blue  { background: var(--blue-soft);  color: var(--blue); }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-red   { background: var(--red-soft);   color: var(--red); }
.tone-gray  { background: var(--gray-soft);  color: var(--gray); }
.tone-brand { background: var(--brand-soft); color: var(--brand); }
.kpi.hot { border-color: #f6d58f; background: linear-gradient(180deg, #fffaf0, #fff); }

/* Tarjeta de saldo destacada */
.balance-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 28px; color: #fff;
  background: radial-gradient(520px 260px at 100% 0%, rgba(0, 194, 255, .45), transparent 60%),
              radial-gradient(420px 260px at 0% 120%, rgba(51, 85, 255, .7), transparent 60%),
              linear-gradient(135deg, #0a1430 0%, #13235a 100%);
  box-shadow: var(--sh-3);
}
.balance-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px); background-size: 18px 18px;
  mask-image: linear-gradient(120deg, transparent 40%, #000);
  -webkit-mask-image: linear-gradient(120deg, transparent 40%, #000);
}
.balance-hero > * { position: relative; z-index: 1; }
.balance-hero .lbl { display: flex; align-items: center; gap: 8px; color: #aebde8; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.balance-hero .amt { font-size: 48px; font-weight: 800; letter-spacing: -.04em; margin: 8px 0 4px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.balance-hero .amt .cents { font-size: .5em; opacity: .75; letter-spacing: -.02em; }
.balance-hero .meta { color: #aebde8; font-size: 13.5px; }
.balance-hero .hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 22px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); flex-wrap: wrap; }
.hero-stats div { font-size: 12.5px; color: #aebde8; }
.hero-stats b { display: block; font-size: 20px; color: #fff; font-weight: 800; }

/* ---------------- Botones ---------------- */
.btn {
  --h: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer;
  text-decoration: none !important; white-space: nowrap; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover:not([disabled]) { box-shadow: 0 14px 28px -10px rgba(51, 85, 255, .7); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-white { background: #fff; color: var(--navy); box-shadow: var(--sh-2); }
.btn-glass { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .18); }
.btn-glass:hover { background: rgba(255, 255, 255, .2); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); box-shadow: var(--sh-1); }
.btn-ghost:hover { background: var(--surface-2); border-color: #d6deeb; }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 8px 18px -8px rgba(15, 159, 99, .6); }
.btn-danger { background: var(--red); color: #fff; }
.btn-soft-danger { background: var(--red-soft); color: var(--red); }
.btn-soft-blue { background: var(--blue-soft); color: var(--blue); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-sm { --h: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-xs { --h: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn-lg { --h: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn .ic { width: 18px; height: 18px; }
.btn.loading { pointer-events: none; opacity: .8; }

/* ---------------- Estados / badges ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12.5px;
  font-weight: 700; white-space: nowrap; line-height: 1.3;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-amber::before { animation: pulse 2s infinite; }
.pill-blue  { background: var(--blue-soft);  color: var(--blue); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red   { background: var(--red-soft);   color: var(--red); }
.pill-gray  { background: var(--gray-soft);  color: var(--gray); }
.pill.plain::before { display: none; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #ff9f1c; color: #1b1200; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--gray-soft); color: var(--ink-2); font-size: 12px; font-weight: 650; }
.tag-brand { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------------- Formularios ---------------- */
.field { display: block; }
.field + .field { margin-top: 16px; }
.label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 15.5px; transition: border-color .15s, box-shadow .15s; outline: none;
}
.textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7a93' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(51, 85, 255, .12); }
.input.sm, .select.sm { height: 38px; font-size: 14px; border-radius: 10px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .prefix { position: absolute; left: 14px; color: var(--muted); font-weight: 700; pointer-events: none; }
.input-group .prefix + .input { padding-left: 32px; }
.input-group .suffix { position: absolute; right: 6px; }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(217, 58, 58, .1); }
.input.valid { border-color: #9fdcc0; }
.money-input { font-size: 22px; font-weight: 800; height: 56px; letter-spacing: -.02em; }
.seg { display: inline-flex; background: var(--gray-soft); padding: 4px; border-radius: 12px; gap: 2px; width: 100%; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: all .2s var(--ease); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.seg input:checked + span.s-green { color: var(--green); }
.seg input:checked + span.s-red { color: var(--red); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }

/* Filtros */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 16px; }
.filters .field { margin: 0; }
.filters .label { font-size: 12px; margin-bottom: 5px; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink-2); font-weight: 650; font-size: 13.5px;
}
.chip:hover { text-decoration: none; border-color: #cfd8e8; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .n { font-size: 12px; opacity: .7; }

/* ---------------- Tablas ---------------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .15s; }
.t tbody tr:hover { background: #fafbfe; }
.t .r { text-align: right; }
.t .c { text-align: center; }
.t tr.is-pending td:first-child { box-shadow: inset 3px 0 0 #f4b23c; }
.t tr.is-processing td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.cell-title { font-weight: 700; }
.cell-sub { font-size: 12.5px; color: var(--muted); }
.phone-num { font-weight: 800; letter-spacing: .01em; font-variant-numeric: tabular-nums; font-size: 15px; }
.copy { cursor: pointer; border: 0; background: var(--gray-soft); color: var(--muted); border-radius: 7px; width: 26px; height: 26px; display: inline-grid; place-items: center; vertical-align: middle; margin-left: 6px; transition: all .15s; }
.copy:hover { background: var(--brand-soft); color: var(--brand); }
.copy.ok { background: var(--green-soft); color: var(--green); }
.copy .ic { width: 14px; height: 14px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }

/* Lista de movimientos */
.tx { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line-2); }
.tx:last-child { border-bottom: 0; }
.tx .tx-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tx .tx-main { flex: 1; min-width: 0; }
.tx .tx-title { font-weight: 700; }
.tx .tx-sub { color: var(--muted); font-size: 12.5px; }
.tx .tx-amt { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx .tx-amt small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }

/* ---------------- Productos (cliente) ---------------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.product {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--r-lg); background: var(--surface);
  border: 1.5px solid var(--line); box-shadow: var(--sh-1); color: var(--ink); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
a.product:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--sh-2); border-color: #c9d4ff; }
.product .p-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product .p-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: var(--sh-brand); }
.product .p-amount { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.product .p-name { font-weight: 700; color: var(--ink-2); font-size: 14px; }
.product .p-desc { color: var(--muted); font-size: 13px; min-height: 2.6em; }
.product .p-price { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); }
.product .p-price b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.product .p-price span { font-size: 12px; color: var(--muted); font-weight: 600; }
/* selección en formulario */
.product-pick input { position: absolute; opacity: 0; pointer-events: none; }
.product-pick .product { height: 100%; }
.product-pick input:checked + .product { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(51, 85, 255, .12), var(--sh-2); }
.product-pick input:checked + .product .p-check { opacity: 1; transform: scale(1); }
.product-pick input:focus-visible + .product { outline: 3px solid rgba(51, 85, 255, .35); outline-offset: 2px; }
.p-check { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: all .2s var(--ease); }
.p-check .ic { width: 14px; height: 14px; stroke-width: 3; }

/* ---------------- Formulario de pedido ---------------- */
.step { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.phones { display: flex; flex-direction: column; gap: 10px; }
.phone-row { display: grid; grid-template-columns: 34px 1fr 40px; gap: 10px; align-items: center; animation: pop .25s var(--ease) both; }
.phone-row .idx { width: 34px; height: 34px; border-radius: 10px; background: var(--gray-soft); color: var(--muted); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.phone-row .input-group .prefix { color: var(--ink-2); }
.phone-row .input-group .input { padding-left: 50px; font-weight: 700; letter-spacing: .03em; font-size: 17px; height: 50px; }
.phone-row .state { position: absolute; right: 12px; display: grid; place-items: center; }
.phone-row .state .ic { width: 18px; height: 18px; }
.phone-row .ok-ic { color: var(--green); }
.phone-row .bad-ic { color: var(--red); }
.phone-row .rm { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.phone-row .rm:hover { background: var(--red-soft); color: var(--red); }
.phone-row .err { grid-column: 2 / 3; color: var(--red); font-size: 12.5px; font-weight: 600; margin-top: -4px; }
.add-row {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; margin-top: 12px; border-radius: 12px;
  border: 1.5px dashed #c5d0e6; background: var(--surface-2); color: var(--brand-ink); font: inherit; font-weight: 700; cursor: pointer; transition: all .2s;
}
.add-row:hover:not([disabled]) { border-color: var(--brand); background: var(--brand-soft); }
.add-row[disabled] { color: var(--muted); cursor: not-allowed; }
.limit-note { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); color: #8a5500; font-size: 13px; font-weight: 600; }

.summary { position: sticky; top: 88px; }
.summary .line { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; font-size: 14.5px; }
.summary .line + .line { border-top: 1px dashed var(--line); }
.summary .line b { font-variant-numeric: tabular-nums; }
.summary .total { font-size: 15px; }
.summary .total b { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.summary .after b { color: var(--green); }
.summary .after.bad b { color: var(--red); }
.meter { height: 8px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; margin: 6px 0 2px; }
.meter i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .35s var(--ease); }
.meter.warn i { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* Barra fija inferior (móvil) del pedido */
.mobile-cta { display: none; }

/* ---------------- Modal ---------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal .scrim { position: absolute; inset: 0; background: rgba(10, 20, 48, .5); backdrop-filter: blur(4px); animation: rise .2s both; }
.modal .sheet { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-3); animation: pop .25s var(--ease) both; }
.modal .sheet-head { padding: 22px 24px 8px; }
.modal .sheet-body { padding: 8px 24px 20px; }
.modal .sheet-foot { padding: 16px 24px 22px; display: flex; gap: 10px; }
.modal .sheet-foot .btn { flex: 1; }
.receipt { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; margin-top: 12px; }
.receipt .line { display: flex; justify-content: space-between; padding: 10px 0; font-size: 14.5px; }
.receipt .line + .line { border-top: 1px dashed var(--line); }
.receipt ol { margin: 0; padding: 0 0 0 20px; max-height: 180px; overflow: auto; }
.receipt ol li { padding: 3px 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------- Alertas / flash ---------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); font-size: 14.5px; font-weight: 600; border: 1px solid; animation: rise .3s var(--ease) both; }
.alert .ic { margin-top: 1px; }
.alert-success { background: var(--green-soft); color: #0b6b43; border-color: #bfe9d4; }
.alert-error { background: var(--red-soft); color: #a3201f; border-color: #f7c9c7; }
.alert-info { background: var(--blue-soft); color: #1e4fbf; border-color: #cddcff; }
.alert-warn { background: var(--amber-soft); color: #7a4b00; border-color: #f6dca5; }
.flash-wrap { margin-bottom: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 18px; border-radius: 16px; background: var(--navy); color: #fff; box-shadow: var(--sh-3); font-weight: 650; animation: pop .3s var(--ease) both;
}

/* ---------------- Vacíos ---------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .e-ic { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; background: var(--gray-soft); display: grid; place-items: center; color: #9aa7bd; }
.empty .e-ic .ic { width: 28px; height: 28px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs a { padding: 14px 12px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand-ink); border-color: var(--brand); }

/* Paginación */
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; padding: 16px; }

/* Mini gráfico de barras */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.bars .b i { display: block; width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #5b7bff, #3355ff); min-height: 3px; transition: height .5s var(--ease); position: relative; }
.bars .b i.zero { background: var(--line); }
.bars .b span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.bars .b:hover i { background: linear-gradient(180deg, #00c2ff, #3355ff); }

/* Definiciones */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }

/* Cola de pendientes */
.queue-item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line-2); }
.queue-item:last-child { border-bottom: 0; }
.queue-item .q-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); display: grid; place-items: center; flex: none; }
.queue-item.processing .q-ic { background: var(--blue-soft); color: var(--blue); }
.queue-item .q-main { flex: 1; min-width: 0; }

/* ---------------- Login ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(700px 400px at 110% -10%, rgba(0, 194, 255, .5), transparent 60%),
              radial-gradient(600px 500px at -10% 110%, rgba(51, 85, 255, .85), transparent 60%),
              linear-gradient(160deg, #0a1430, #13235a);
}
.auth-art::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(200deg, #000 20%, transparent 70%); -webkit-mask-image: linear-gradient(200deg, #000 20%, transparent 70%); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .brand { padding: 0; font-size: 20px; }
.auth-art h1 { font-size: 44px; line-height: 1.05; letter-spacing: -.04em; max-width: 480px; }
.auth-art h1 em { font-style: normal; background: linear-gradient(90deg, #7fb4ff, #00e0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: #b7c5ec; font-size: 16px; max-width: 420px; margin-top: 16px; }
.feature-list { display: grid; gap: 12px; margin-top: 32px; }
.feature-list div { display: flex; align-items: center; gap: 12px; color: #dbe4ff; font-weight: 600; }
.feature-list .f-ic { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .12); }
.float-card { position: absolute; right: 48px; top: 40px; width: 250px; padding: 18px; border-radius: 18px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(12px); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); animation: rise .6s .2s var(--ease) both; }
.float-card .lbl { font-size: 11px; color: #aebde8; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.float-card .v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.float-card .pill { margin-top: 10px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form .box { width: 100%; max-width: 400px; animation: rise .4s var(--ease) both; }
.auth-form h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.pw-toggle { position: absolute; right: 6px; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { background: var(--gray-soft); }

/* Error page */
.center-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 24px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .float-card { display: none; }
}
@media (max-width: 900px) {
  :root { --side: 0px; }
  .admin .shell { display: block; }
  .admin .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .admin.menu-open .sidebar { transform: none; box-shadow: var(--sh-3); }
  .admin.menu-open::after { content: ''; position: fixed; inset: 0; background: rgba(10, 20, 48, .45); z-index: 50; }
  .admin .topbar { display: block; }
  .menu-btn { display: inline-flex; }
  .main { padding: 20px 16px 110px; }
  .topbar .in { padding: 10px 16px; gap: 10px; }
  .topnav { display: none; }
  .g3, .g2 { grid-template-columns: minmax(0, 1fr); }
  .admin .shell { background: none; }
  .balance-hero .hero-actions .btn { flex: 1; }
  h1 { font-size: 22px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px 32px; min-height: auto; }
  .auth-art h1 { font-size: 30px; }
  .auth-art .feature-list, .auth-art .foot { display: none; }
  .auth-art p { font-size: 14.5px; }
  .auth-art .hero-copy { margin-top: 28px; }

  /* Barra inferior tipo app (cliente) */
  .client .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--muted); font-size: 11px; font-weight: 700; border-radius: 12px; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.on { color: var(--brand-ink); }
  .tabbar a.on .ic { background: var(--brand-soft); }
  .tabbar .ic { width: 44px; height: 30px; padding: 5px 12px; border-radius: 99px; transition: background .2s; }
  .tabbar a.cta .ic { background: var(--grad); color: #fff; box-shadow: var(--sh-brand); }
  .balance-chip small { display: none; }
  .balance-chip .btn { display: none; }
  .balance-chip { padding: 8px 14px; }

  .balance-hero { padding: 22px; border-radius: 22px; }
  .balance-hero .amt { font-size: 40px; }
  .card-pad, .card-body { padding: 18px; }
  .card-head { padding: 16px 18px; }
  .tx, .queue-item { padding: 14px 18px; }

  /* Tablas → tarjetas */
  table.rt, .rt tbody, .rt tr, .rt td { display: block; width: 100%; }
  .rt thead { display: none; }
  .rt tr { padding: 14px 16px; border-bottom: 1px solid var(--line); position: relative; }
  .rt tr:last-child { border-bottom: 0; }
  .rt td { padding: 3px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .rt td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; flex: none; }
  .rt td.no-label::before { display: none; }
  .rt td.full { display: block; text-align: left; }
  .rt td.full::before { display: none; }
  .rt td.actions-cell { justify-content: flex-start; padding-top: 10px; }
  .rt td.actions-cell::before { display: none; }
  .rt .actions { justify-content: flex-start; width: 100%; }
  .rt .actions .btn { flex: 1; }
  .t tr.is-pending td:first-child, .t tr.is-processing td:first-child { box-shadow: none; }
  .rt tr.is-pending { box-shadow: inset 3px 0 0 #f4b23c; }
  .rt tr.is-processing { box-shadow: inset 3px 0 0 var(--blue); }
  .rt td.sel { position: absolute; right: 14px; top: 12px; width: auto; }
  .rt td.sel::before { display: none; }

  .mobile-cta {
    display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -12px rgba(16, 24, 40, .18);
  }
  .mobile-cta .mc-total { flex: 1; }
  .mobile-cta .mc-total small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
  .mobile-cta .mc-total b { font-size: 20px; font-weight: 800; }
  .order-page .tabbar { display: none; }
  .desk-only { display: none !important; }
  .filters { padding: 12px; }
  .filters .field { flex: 1 1 140px; }
  .modal { align-items: flex-end; padding: 0; }
  .modal .sheet { max-width: none; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
@media (min-width: 901px) { .mob-only { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Ajustes adicionales */
@media (max-width: 1100px) { .split-side { order: -1; } }
@media (max-width: 900px) {
  .queue-item { flex-wrap: wrap; }
  .queue-item .actions { width: 100%; justify-content: flex-start; }
  .queue-item .actions .btn { flex: 1; }
}
@media (max-width: 900px) { [data-home-grid] { grid-template-columns: 1fr !important; } }

/* Cola y tablas: acciones compactas */
.queue-item { flex-wrap: wrap; }
.queue-item .q-main { flex: 1 1 200px; }
.queue-item > .actions { margin-left: auto; }
.t .actions { flex-wrap: nowrap; }
.t td.numcol { min-width: 190px; white-space: nowrap; }
@media (max-width: 1250px) { .topnav a { padding: 8px 10px; } .topbar .brand small { display: none; } }
@media (max-width: 900px) { .t td.numcol { white-space: normal; } .t .actions { flex-wrap: wrap; } }
.t th, .t td { padding-left: 12px; padding-right: 12px; }
.t th:first-child, .t td:first-child { padding-left: 18px; }
.t td.numcol { min-width: 0; }
.t td.sel { width: 36px; padding-right: 0; }

/* ---------------- Marca Sancurec ----------------
   Paleta: azul marino oscuro (--navy), azul eléctrico (--brand), cian (--brand-2), blanco.
   Los archivos de logo se colocan en public/brand/ (ver docs/MARCA.md). */
.logo-temp { font-weight: 800; font-size: 19px; letter-spacing: -.02em; line-height: 1; color: #fff; }
.brand-logo { display: block; height: 40px; width: auto; max-width: 100%; object-fit: contain; }
.brand-iso { display: block; width: auto; height: 34px; object-fit: contain; flex: none; }
.brand-compact { display: none; }
.brand-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.sidebar .brand { padding: 2px 8px 24px; }
.sidebar .brand small { padding-left: 2px; }
/* En barras superiores: logo y subtítulo en una sola línea (no cambia la altura de la barra) */
.topbar .brand-stack { flex-direction: row; align-items: center; gap: 12px; }
.topbar .brand-stack small { padding-left: 12px; border-left: 1px solid var(--line); line-height: 1.3; }
.topbar .brand-logo { height: 34px; }
.auth-art .brand-logo { height: 52px; }
.auth-art .brand-stack { gap: 10px; }
.demo-banner {
  position: relative; z-index: 70; padding: 6px 16px; text-align: center; font-size: 12.5px; font-weight: 800;
  letter-spacing: .06em; color: #3b2600; background: repeating-linear-gradient(45deg, #ffd166, #ffd166 12px, #ffc233 12px, #ffc233 24px);
}
@media (max-width: 900px) {
  .topbar .brand-logo { height: 30px; }
  .auth-art .brand-logo { height: 44px; }
}
/* Espacios muy pequeños: solo el isotipo S */
@media (max-width: 370px) {
  .topbar .brand-logo { display: none; }
  .topbar .brand-compact { display: block; height: 32px; }
}
.float-card .v { white-space: nowrap; font-size: 24px; }
/* En la barra superior el logo va solo (el subtítulo no cabe junto al menú) */
.topbar .brand-stack small { display: none; }
/* Menú lateral móvil por encima de cualquier franja superior */
@media (max-width: 900px) { .admin .sidebar { z-index: 80; } }

/* Vista previa del importe interpretado (campos data-money) */
.money-hint { margin-top: 4px; color: var(--muted); font-weight: 600; min-height: 0; }
.money-hint:empty { display: none; }
.money-hint.bad { color: var(--red); }

/* FIN-003: dinero cobrado de recargas fallidas/canceladas sin reembolso */
.retained-tag { color: var(--amber); font-weight: 700; }

/* Pantalla Auditoría */
.audit-changes { margin: 4px 0 0; padding-left: 16px; font-size: 13px; }
.audit-changes .from { color: var(--muted); text-decoration: line-through; }
.audit-changes .to { font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* SEC-001: 2FA */
.code-input { font-size: 20px; letter-spacing: .12em; font-weight: 700; }
.recovery-codes { columns: 2; gap: 24px; margin: 18px 0 22px; padding-left: 22px; font-size: 15px; line-height: 2; }
@media (max-width: 480px) { .recovery-codes { columns: 1; } }
