/* RGG Global — Interfaz profesional */
:root {
  --bg: #f4f6fb; --panel: #ffffff; --panel-2: #f8fafc; --line: #e6e9f2; --line-2: #eef1f7;
  --text: #0f172a; --muted: #64748b; --faint: #94a3b8;
  --brand: #e8452a; --brand-2: #d2361c; --brand-soft: #fff0eb; --rgg-a: #ff354b; --rgg-b: #ff6d22; --rgg-grad: linear-gradient(90deg, #ff354b, #ff6d22);
  --gold: #ff7a33; --ok: #059669; --ok-soft: #e7f8f1; --warn: #d97706; --warn-soft: #fff6e6;
  --err: #dc2626; --err-soft: #fdecec; --violet: #7c3aed;
  --side: #0f0f13; --side-2: #17171c; --side-text: #b8b2ae; --side-active: #2a2226;
  --radius: 14px; --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 64px rgba(2, 6, 23, .28);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
[data-theme="dark"] {
  --bg: #0a0f1c; --panel: #111827; --panel-2: #0f1626; --line: #1f2a3f; --line-2: #18223a;
  --text: #e6ebf5; --muted: #8b98b1; --faint: #5d6b85; --brand-soft: #2a1712;
  --ok-soft: #0c2a22; --warn-soft: #2d220c; --err-soft: #2e1216;
  --side: #0a0a0d; --side-2: #121216; --side-active: #2a2226; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; flex: none; }
#print-frame { position: absolute; width: 0; height: 0; border: 0; visibility: hidden; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c5cbd8; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2a3550; background-clip: content-box; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.side { background: linear-gradient(180deg, var(--side), var(--side-2)); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.06); margin-bottom: 14px; }
.logo-mark { display: block; flex: none; border-radius: 22%; box-shadow: 0 6px 18px rgba(255,90,40,.22), 0 0 0 1px rgba(255,255,255,.06); }
.brand b { color: #fff; font-size: 16px; letter-spacing: .3px; display: block; }
.brand small { color: var(--gold); font-size: 10.5px; letter-spacing: 2.2px; text-transform: uppercase; }
.co-chip { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; }
.co-chip .n { color: #fff; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-chip .t { font-size: 11.5px; color: var(--side-text); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.6px; color: #77706c; padding: 12px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9.5px 11px; border-radius: 10px; color: var(--side-text); text-decoration: none; cursor: pointer; font-weight: 500; transition: .15s; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.on { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--rgg-b); }
.nav a .badge { margin-left: auto; background: var(--err); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 20px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.me { display: flex; gap: 10px; align-items: center; padding: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--violet)); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.me .n { color: #fff; font-weight: 600; font-size: 13px; }
.me .r { font-size: 11.5px; }
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.top { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.top h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
.top .sub { color: var(--muted); font-size: 12.5px; }
.top .grow { flex: 1; }
.clock { color: var(--muted); font-size: 12.5px; text-align: right; line-height: 1.3; }
.content { flex: 1; overflow: auto; padding: 24px 28px 40px; }

/* ---------- Componentes ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-h .grow { flex: 1; }
.card-b { padding: 18px 20px; }
.grid { display: grid; gap: 18px; }
.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)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .grow { flex: 1; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; } .mt-s { margin-top: 8px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .right { text-align: right; } .center { text-align: center; }
.b { font-weight: 650; } .ok { color: var(--ok); } .err { color: var(--err); } .warn { color: var(--warn); } .brand-c { color: var(--brand); }
.mono { font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); padding: 9px 15px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: #c9d1e2; background: var(--panel-2); }
.btn.primary { background: linear-gradient(100deg, #f2364d, #f2611c); border-color: #e2401f; color: #fff; box-shadow: 0 3px 10px rgba(240,74,46,.30); text-shadow: 0 1px 1px rgba(0,0,0,.15); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.success { background: linear-gradient(180deg, #10b981, #059669); border-color: #059669; color: #fff; box-shadow: 0 2px 8px rgba(5,150,105,.25); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { background: transparent; }
.btn.gold { background: linear-gradient(180deg, #e2c35b, #c49a26); border-color: #b88e1d; color: #1a1405; }
.btn.quit { color: var(--err); border-color: #f3c7c7; background: var(--err-soft); margin-left: 10px; }
.btn.quit:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn.lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.del:hover { color: var(--err); background: var(--err-soft); }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
label.f .hint { font-weight: 400; color: var(--faint); font-size: 11.5px; }
.inp, input.inp, select.inp, textarea.inp { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; outline: none; transition: .15s; color: var(--text); font-size: 14px; font-weight: 500; }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(240,74,46,.16); }
.inp.sm { padding: 6px 8px; font-size: 13px; border-radius: 8px; }
.inp.bad { border-color: var(--err); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .inp { padding-left: 38px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--text); }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 650; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:hover td { background: var(--panel-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-wrap { overflow: auto; }
.empty { text-align: center; color: var(--faint); padding: 44px 20px; }
.empty .ic { width: 42px; height: 42px; opacity: .5; margin-bottom: 8px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 650; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.pill.blue { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.pill.gold { background: #fbf3d7; color: #8a6a0c; border-color: transparent; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .v { font-size: 25px; font-weight: 750; margin-top: 8px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi .ico { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.kpi .ico .ic { width: 20px; height: 20px; }
.tone-blue .ico { background: var(--brand-soft); color: var(--brand); }
.tone-green .ico { background: var(--ok-soft); color: var(--ok); }
.tone-amber .ico { background: var(--warn-soft); color: var(--warn); }
.tone-red .ico { background: var(--err-soft); color: var(--err); }
.tone-violet .ico { background: #f1eafe; color: var(--violet); }
[data-theme="dark"] .tone-violet .ico { background: #221a3d; }
.kpi.hero { background: radial-gradient(300px 160px at 100% 0%, rgba(255,90,40,.35), transparent 70%), linear-gradient(135deg, #121216 0%, #24191a 100%); color: #fff; border: 0; }
.kpi.hero .l, .kpi.hero .s { color: #c9c3c0; } .kpi.hero .ico { background: rgba(255,109,34,.16); color: var(--gold); }

.tabs { display: flex; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); padding: 4px; border-radius: 12px; width: fit-content; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

.progress { height: 7px; background: var(--line-2); border-radius: 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #10b981); border-radius: 10px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(2,6,23,.55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; animation: fade .15s; padding: 20px; }
.modal-bg.out { opacity: 0; transition: .15s; }
.modal { background: var(--panel); border-radius: 18px; width: min(540px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; border: 1px solid var(--line); }
.modal.wide { width: min(820px, 100%); } .modal.xl { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; flex: 1; font-size: 17px; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: var(--panel-2); border-radius: 0 0 18px 18px; }
.confirm-text { font-size: 15px; line-height: 1.5; margin: 0; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }

#toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { display: flex; gap: 10px; align-items: center; background: #17171c; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 420px; animation: pop .2s; border-left: 4px solid var(--ok); }
.toast.error { border-left-color: var(--err); } .toast.warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .4s; }

/* ---------- Bienvenida / Asistente / Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { background: radial-gradient(900px 520px at 8% 6%, rgba(255,53,75,.28) 0%, transparent 60%), radial-gradient(800px 500px at 95% 95%, rgba(255,109,34,.22) 0%, transparent 60%), #0c0c10; color: #fff; padding: 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h2 { font-size: 44px; line-height: 1.08; margin: auto 0 18px; letter-spacing: -1.2px; font-weight: 750; max-width: 520px; }
.auth-art h2 span { background: var(--rgg-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: #b8b2ae; font-size: 16px; max-width: 470px; line-height: 1.6; }
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; max-width: 520px; }
.feat div { display: flex; gap: 9px; align-items: center; color: #ddd6d2; font-size: 13.5px; }
.feat .ic { color: var(--gold); }
.auth-form { display: grid; place-items: center; padding: 40px; background: var(--panel); }
.auth-box { width: min(440px, 100%); }
.auth-box h3 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.4px; }
.co-list { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.co-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: .15s; }
.co-item:hover, .co-item.on { border-color: var(--brand); background: var(--brand-soft); }
.type-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }

.wizard { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.wiz-top { display: flex; align-items: center; gap: 14px; padding: 18px 36px; background: var(--side); color: #fff; }
.steps { display: flex; gap: 8px; margin-left: auto; }
.step { display: flex; align-items: center; gap: 8px; color: #8a837f; font-size: 13px; font-weight: 600; }
.step i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid #3a3436; font-style: normal; font-size: 12px; }
.step.on { color: #fff; } .step.on i { background: var(--brand); border-color: var(--brand); }
.step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.step + .step::before { content: ""; width: 26px; height: 1.5px; background: #3a3436; }
.wiz-body { flex: 1; width: min(1080px, 100%); margin: 0 auto; padding: 34px 24px; }
.wiz-body h2 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.5px; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 24px; }
.type-card { background: var(--panel); border: 1.5px solid var(--line); border-radius: 16px; padding: 18px; cursor: pointer; transition: .18s; display: flex; flex-direction: column; gap: 10px; }
.type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c9d1e2; }
.type-card.on { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(240,74,46,.14); }
.type-card b { font-size: 15px; } .type-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.wiz-foot { display: flex; justify-content: space-between; padding: 18px 36px; background: var(--panel); border-top: 1px solid var(--line); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 18px; height: calc(100vh - 64px - 64px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; flex: none; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 12.5px; white-space: nowrap; color: var(--muted); }
.cats button.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; overflow-y: auto; padding-bottom: 10px; align-content: start; }
.prod { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; transition: .15s; display: flex; flex-direction: column; gap: 6px; position: relative; }
.prod:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(240,74,46,.14); transform: translateY(-1px); }
.prod .nm { font-weight: 650; font-size: 13.5px; line-height: 1.3; min-height: 35px; }
.prod .pr { font-size: 17px; font-weight: 750; color: var(--brand); font-variant-numeric: tabular-nums; }
.prod .meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.prod .min { font-size: 11px; color: var(--warn); font-weight: 600; }
.prod.out { opacity: .5; }
.prod .cat-dot { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); font-weight: 700; }
.cart { display: flex; flex-direction: column; min-height: 0; }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 14px; }
.line { padding: 12px 4px; border-bottom: 1px dashed var(--line); }
.line-top { display: flex; gap: 8px; align-items: flex-start; }
.line-top .nm { flex: 1; font-weight: 650; font-size: 13.5px; }
.line-ctrl { display: grid; grid-template-columns: 96px 1fr 92px 60px; gap: 6px; margin-top: 8px; align-items: end; }
.line-ctrl label { font-size: 10.5px; color: var(--faint); font-weight: 650; text-transform: uppercase; letter-spacing: .4px; display: flex; flex-direction: column; gap: 3px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { border: 0; background: var(--panel-2); width: 28px; height: 31px; cursor: pointer; display: grid; place-items: center; }
.qty input { width: 38px; border: 0; text-align: center; outline: none; background: var(--panel); height: 31px; }
.line-foot { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12px; }
.line .lt { font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums; }
.price-tabs { display: flex; gap: 3px; }
.price-tabs button { flex: 1; border: 1px solid var(--line); background: var(--panel); border-radius: 7px; padding: 6px 4px; font-size: 11.5px; font-weight: 650; cursor: pointer; color: var(--muted); }
.price-tabs button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.price-tabs button:disabled { opacity: .35; cursor: not-allowed; }
.cart-sum { padding: 14px 18px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }
.sum-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); font-size: 13px; }
.sum-row.total { color: var(--text); font-size: 24px; font-weight: 800; padding-top: 8px; letter-spacing: -.5px; }
.client-box { padding: 12px 18px; border-bottom: 1px solid var(--line-2); display: flex; gap: 8px; align-items: center; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pay-opt { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; gap: 9px; align-items: center; font-weight: 600; font-size: 13px; background: var(--panel); }
.pay-opt.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.pay-line { display: grid; grid-template-columns: 170px 1fr 1fr 34px; gap: 8px; align-items: center; margin-top: 8px; }
.big-total { text-align: center; padding: 16px; border-radius: 14px; background: radial-gradient(260px 120px at 100% 0%, rgba(255,90,40,.35), transparent 70%), linear-gradient(135deg, #121216, #24191a); color: #fff; margin-bottom: 16px; }
.big-total small { color: #cfc8c4; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; }
.big-total div { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.info-box { background: var(--brand-soft); border: 1px solid #ffd3c4; color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
[data-theme="dark"] .info-box { border-color: #4a2a20; }
.info-box.warn { background: var(--warn-soft); border-color: #f6dfb2; }
.info-box.ok { background: var(--ok-soft); border-color: #bfe9d7; }
[data-theme="dark"] .info-box.warn, [data-theme="dark"] .info-box.ok { border-color: transparent; }

/* ---------- Calendario de ganancias ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: 11px; text-transform: uppercase; color: var(--faint); font-weight: 700; text-align: center; padding: 4px; letter-spacing: .6px; }
.cal .day { border: 1px solid var(--line); border-radius: 10px; min-height: 76px; padding: 7px 8px; cursor: pointer; display: flex; flex-direction: column; transition: .12s; background: var(--panel); }
.cal .day:hover { border-color: var(--brand); }
.cal .day.blank { visibility: hidden; }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal .day.sel { background: var(--brand-soft); border-color: var(--brand); }
.cal .d { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal .p { margin-top: auto; font-size: 12.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cal .c { font-size: 10.5px; color: var(--faint); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i { width: 100%; max-width: 38px; background: linear-gradient(180deg, #3b82f6, #1d4ed8); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.bars .bar i.neg { background: var(--err); }
.bars .bar span { font-size: 10px; color: var(--faint); white-space: nowrap; }
.bars .bar:hover i { filter: brightness(1.2); }
.hbar { display: grid; grid-template-columns: 130px 1fr 110px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .track { height: 9px; background: var(--line-2); border-radius: 10px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 10px; }

.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--faint); font-weight: 700; margin: 22px 0 10px; }
.section-t:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv .k { color: var(--muted); }

@media (max-width: 1200px) { .pos { grid-template-columns: 1fr 420px; } .g4 { grid-template-columns: repeat(2, 1fr); } }
.lic-code { font-family: Consolas, 'Cascadia Mono', monospace; font-size: 26px; font-weight: 800; letter-spacing: 3px; text-align: center; padding: 14px; border-radius: 14px; background: var(--brand-soft); border: 1.5px dashed var(--brand); color: var(--text); user-select: all; }

/* ---------- Panel ---------- */
:root { --s1: #2a78d6; --s2: #1baf7a; --up: #006300; --down: #d03b3b; }
[data-theme="dark"] { --s1: #3987e5; --s2: #199e70; --up: #0ca30c; --down: #e66767; }
.dash-hero { display: flex; gap: 24px; align-items: stretch; justify-content: space-between; flex-wrap: wrap; padding: 26px 28px; border-radius: 20px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(700px 320px at 0% 0%, rgba(255,53,75,.30), transparent 60%), radial-gradient(600px 300px at 100% 100%, rgba(255,109,34,.26), transparent 60%), linear-gradient(135deg, #0f0f13, #1d1718); box-shadow: 0 14px 40px rgba(11,18,32,.25); }
.dash-hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(90deg, transparent, #000 70%); pointer-events: none; }
.dash-hero > * { position: relative; z-index: 1; }
.dh-hello { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.dh-sub { color: #b8b2ae; font-size: 13px; margin-top: 2px; }
.dh-sub::first-letter { text-transform: uppercase; }
.dh-fig { margin-top: 18px; display: flex; flex-direction: column; }
.dh-fig span { color: #cfc8c4; font-size: 12.5px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; }
.dh-fig b { font-size: 38px; letter-spacing: -1px; line-height: 1.15; }
.dh-fig em { font-style: normal; color: #b8b2ae; font-size: 13px; }
.dh-qa { display: grid; grid-template-columns: repeat(3, minmax(108px, 1fr)); gap: 10px; align-content: center; }
.qa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; font-weight: 600; font-size: 12.5px; transition: .15s; backdrop-filter: blur(4px); }
.qa:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); border-color: rgba(255,109,34,.6); }
.qa .ic { width: 22px; height: 22px; color: var(--gold); }
.delta { font-size: 12px; font-weight: 650; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--muted); }
.dash-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.legend i, .tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--text); margin-left: 4px; }
.chart-box { position: relative; }
.trend .grid-l { stroke: var(--line); stroke-width: 1; }
.trend .ax { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.trend .xh-l { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.trend .xh circle { stroke: var(--panel); stroke-width: 2; }
.tip { position: absolute; top: 8px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; pointer-events: none; min-width: 160px; z-index: 3; }
.tip div { margin-top: 2px; }
.insights { display: flex; flex-direction: column; padding: 6px; max-height: 360px; overflow: auto; }
.ins { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; }
.ins[role=button] { cursor: pointer; } .ins[role=button]:hover { background: var(--panel-2); }
.ins > .ic:last-child { color: var(--faint); }
.ins-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ins.err .ins-ic { background: var(--err-soft); color: var(--err); }
.ins.warn .ins-ic { background: var(--warn-soft); color: var(--warn); }
.ins.ok .ins-ic { background: var(--ok-soft); color: var(--ok); }
.hb { margin-bottom: 14px; } .hb:last-child { margin-bottom: 0; }
.hb-t { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.hb-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 8px; background: var(--line-2); border-radius: 8px; margin: 6px 0 3px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
@media (max-width: 980px) { .dash-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .dash-hero { padding: 18px 16px; border-radius: 16px; gap: 16px; }
  .dh-hello { font-size: 18px; } .dh-fig b { font-size: 30px; }
  .dh-qa { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .qa { padding: 12px 6px; font-size: 11.5px; }
}

/* ---------- Facturador rápido ---------- */
.qb-grid { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.qb-side { position: sticky; top: 0; }

/* ---------- Elementos solo para teléfono (ocultos en PC) ---------- */
.menu-btn, .bottom-nav, .side-ov { display: none; }
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 120; display: flex; align-items: center; gap: 12px; background: #0b1220; color: #fff; padding: 10px 14px; border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,109,34,.5); max-width: calc(100% - 24px); }

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .qb-grid { grid-template-columns: 1fr; } .qb-side { position: static; }
}

/* ---------- Teléfonos y tabletas ---------- */
@media (max-width: 900px) {
  html, body { overscroll-behavior-y: contain; }
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; height: 100dvh; }
  /* Menú lateral deslizable */
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-105%); transition: transform .22s ease; padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .side-ov { display: block; position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side-ov.open { opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 12px; font-size: 15px; }
  /* Barra superior */
  .top { height: auto; min-height: 56px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 20; }
  .menu-btn { display: inline-grid; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; }
  .menu-btn .ic { width: 22px; height: 22px; }
  .top-t { min-width: 0; flex: 1; }
  .top h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .sub { display: none; }
  .top > .grow { display: none; }
  .clock { display: none; }
  .btn.quit { display: none; }
  #top-actions { order: 5; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  #top-actions::-webkit-scrollbar { display: none; }
  /* Contenido: deja espacio para la barra inferior */
  .content { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .content.is-pos { padding: 0 12px calc(84px + env(safe-area-inset-bottom)) !important; }
  /* Barra inferior */
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(15,23,42,.08); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; border-radius: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .bottom-nav a .ic { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--brand); background: var(--brand-soft); }
  /* Rejillas */
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { gap: 12px; }
  .span2, .span3 { grid-column: auto; }
  .kpi { padding: 14px; } .kpi .v { font-size: 19px; } .kpi .ico { width: 32px; height: 32px; right: 10px; top: 10px; } .kpi .ico .ic { width: 16px; height: 16px; }
  .card-h { padding: 12px 14px; flex-wrap: wrap; } .card-b { padding: 14px; }
  .card-h .search, .card-h .inp, .row > .search { width: 100% !important; }
  .card-h .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs button { white-space: nowrap; }
  .row label.f { width: 100% !important; }
  /* Tablas: se deslizan de lado */
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 640px; }
  .tbl td, .tbl th { padding: 10px 10px; }
  /* Formularios cómodos (16px evita el zoom automático del iPhone) */
  .inp, input.inp, select.inp, textarea.inp { font-size: 16px; padding: 11px 12px; }
  .inp.sm { font-size: 16px; padding: 8px 8px; }
  .btn { min-height: 42px; } .btn.sm { min-height: 36px; }
  .icon-btn { padding: 9px; }
  /* Ventanas a pantalla completa */
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal, .modal.wide, .modal.xl { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .modal-head { padding: calc(14px + env(safe-area-inset-top)) 16px 14px; position: sticky; top: 0; background: var(--panel); z-index: 2; }
  .modal-body { padding: 16px; flex: 1; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; border-radius: 0; }
  .modal-foot .btn { flex: 1 1 auto; }
  .pay-line { grid-template-columns: 1fr 1fr; } .pay-line input[data-f=ref] { grid-column: 1 / -1; order: 3; }
  .perm-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .hbar { grid-template-columns: 90px 1fr 90px; font-size: 12px; }
  #toasts { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); } .toast { max-width: none; }
  /* Punto de venta */
  .pos { gap: 12px; padding-top: 12px !important; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 46vh; }
  .cart { min-height: 0; }
  .cart-items { max-height: none; overflow: visible; }
  .cart-sum { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 0 -8px 20px rgba(15,23,42,.08); }
  .line-ctrl { grid-template-columns: 1fr 1fr; }
  .client-box { flex-wrap: wrap; } .client-box #pcdoc { width: 100% !important; }
  .cal .day { min-height: 54px; padding: 4px; } .cal .p { font-size: 10px; } .cal .c { display: none; }
  /* Bienvenida, asistente y login */
  .auth-form { padding: calc(24px + env(safe-area-inset-top)) 18px 24px; align-items: start; }
  .wiz-top { padding: calc(12px + env(safe-area-inset-top)) 14px 12px; flex-wrap: wrap; }
  .steps { margin-left: 0; width: 100%; overflow-x: auto; }
  .step { font-size: 0; } .step i { font-size: 12px; } .step.on { font-size: 12.5px; }
  .wiz-body { padding: 18px 14px; } .wiz-body h2 { font-size: 22px; }
  .types { grid-template-columns: 1fr 1fr; gap: 10px; } .type-card { padding: 12px; } .type-card p { display: none; }
  .wiz-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; }
  .update-bar { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .kpi .v { font-size: 17px; }
  .types { grid-template-columns: 1fr; }
}
/* App instalada (sin barra del navegador) */
@media (display-mode: standalone) { body { -webkit-user-select: none; user-select: none; } input, textarea, .tbl td { -webkit-user-select: text; user-select: text; } }


/* ---------- Marca RGG GLOBAL ---------- */
.brand-wm { font-family: "Segoe UI Black", "Arial Black", "Segoe UI", system-ui, sans-serif; font-weight: 900; font-style: italic; letter-spacing: -.2px; line-height: 1; font-size: 19px; white-space: nowrap; display: inline-block; }
.wm-r { background: var(--rgg-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
.wm-g { color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.wm-lg { font-size: 32px; }
.wm-dark .wm-g { color: #121216; text-shadow: 0 2px 6px rgba(0,0,0,.12); }
.wm-tag { color: #ff8a4c; font-size: 10.5px; letter-spacing: 2.6px; margin-top: 5px; font-weight: 600; }
.brand small { color: #ff8a4c; }
.brand-c { color: var(--brand); }
/* Pantalla de entrada animada */
#splash { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: radial-gradient(520px 380px at 50% 42%, rgba(255,77,46,.22), transparent 70%), #0c0c10; transition: opacity .45s ease, visibility .45s; }
#splash.out { opacity: 0; visibility: hidden; }
.sp-in { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.sp-in .logo-mark { animation: spPop .75s cubic-bezier(.2, 1.35, .4, 1) both; box-shadow: 0 18px 50px rgba(255,90,40,.35); }
.sp-in .brand-wm { font-size: 46px; animation: spUp .6s .28s cubic-bezier(.2, .9, .3, 1) both; }
.sp-in .wm-r { background-size: 220% 100%; animation: spShine 2.2s .6s ease-in-out infinite; background-image: linear-gradient(90deg, #ff354b, #ff6d22, #ffb27a, #ff6d22, #ff354b); }
.sp-bar { width: 170px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; animation: spUp .5s .45s both; }
.sp-bar i { display: block; height: 100%; width: 40%; border-radius: 3px; background: var(--rgg-grad); animation: spLoad 1.1s ease-in-out infinite; }
.sp-tag { color: #8c8580; font-size: 11px; letter-spacing: 3px; font-weight: 600; animation: spUp .5s .5s both; }
@keyframes spPop { from { transform: scale(.55) rotate(-8deg); opacity: 0; } }
@keyframes spUp { from { transform: translateY(14px); opacity: 0; } }
@keyframes spShine { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
@keyframes spLoad { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@media (max-width: 600px) { .sp-in .brand-wm { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { #splash *, .sp-in .wm-r { animation: none !important; } }
