/* Dimacais Inventory: sistema visual compartido por la pagina de inicio y la app. */
:root {
  --ink: #0b1020;
  --ink-2: #141b33;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e5e9f2;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --brand: #12c9a0;
  --brand-ink: #058a6c;
  --brand-soft: #dcfaf1;
  --accent: #6d5dfc;
  --accent-soft: #ebe8ff;
  --sky: #22b8ee;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --ok: #10b981;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 60px rgba(11, 16, 32, 0.18);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --grad: linear-gradient(135deg, #12c9a0 0%, #22b8ee 50%, #6d5dfc 100%);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --text: #e6eaf5;
    --muted: #94a0b8;
    --line: #232c47;
    --bg: #0b1020;
    --surface: #121a30;
    --surface-2: #19223c;
    --brand-soft: rgba(18, 201, 160, 0.14);
    --accent-soft: rgba(109, 93, 252, 0.18);
    --warn-soft: rgba(245, 158, 11, 0.16);
    --danger-soft: rgba(239, 68, 68, 0.16);
    --brand-ink: #3fe3bd;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --text: #e6eaf5;
  --muted: #94a0b8;
  --line: #232c47;
  --bg: #0b1020;
  --surface: #121a30;
  --surface-2: #19223c;
  --brand-soft: rgba(18, 201, 160, 0.14);
  --accent-soft: rgba(109, 93, 252, 0.18);
  --warn-soft: rgba(245, 158, 11, 0.16);
  --danger-soft: rgba(239, 68, 68, 0.16);
  --brand-ink: #3fe3bd;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--sky) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---- Botones y formularios ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 11px 18px;
  font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none !important;
  background: var(--surface-2); color: var(--text); transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  white-space: nowrap; min-height: 44px;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(18, 201, 160, 0.3); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(34, 184, 238, 0.35); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 7px 12px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 10px; cursor: pointer; color: inherit; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
input, select, textarea {
  width: 100%; font: 16px var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; min-height: 44px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 18%, transparent); }
input[type='checkbox'] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--brand-soft); color: var(--brand-ink); }
.badge.warn { background: var(--warn-soft); color: #b45309; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------------- */
/* Pagina de inicio                                                  */
/* ---------------------------------------------------------------- */
.l-nav {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(16px, calc((100vw - 1160px) / 2)); background: rgba(11, 16, 32, 0.82);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); color: #fff;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: inherit; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(34, 184, 238, 0.35); }
.logo small { color: #9fb0d0; font-weight: 600; }
.l-nav-links { display: flex; gap: 22px; align-items: center; }
.l-nav-links a { color: #c8d3ea; font-weight: 600; font-size: 15px; }
.l-nav-links a.btn { color: #fff; }
@media (max-width: 760px) { .l-nav-links a:not(.btn) { display: none; } }

.hero { background: radial-gradient(1200px 600px at 80% -10%, rgba(109, 93, 252, 0.45), transparent 60%), radial-gradient(900px 500px at 0% 20%, rgba(18, 201, 160, 0.28), transparent 60%), var(--ink); color: #fff; overflow: hidden; }
.hero-inner { max-width: 1160px; margin: 0 auto; padding: 72px 16px 96px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; padding-top: 44px; } }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; color: #b9f5e6; background: rgba(18, 201, 160, 0.14); border: 1px solid rgba(18, 201, 160, 0.35); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(36px, 6vw, 62px); font-weight: 800; letter-spacing: -0.035em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: #c3cde3; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 22px; }
.hero-cta .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.22); }
.hero-proof { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: #9fb0d0; }
.hero-proof span { display: inline-flex; gap: 6px; align-items: center; }

.phone { position: relative; width: min(330px, 86vw); margin: 0 auto; aspect-ratio: 9 / 18.5; border-radius: 44px; padding: 12px; background: linear-gradient(160deg, #2a3352, #0d1226); box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.08); transform: rotate(-3deg); }
.phone-screen { height: 100%; border-radius: 34px; background: #f5f7fb; color: var(--text); overflow: hidden; padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.phone-notch { width: 96px; height: 22px; background: #0d1226; border-radius: 0 0 14px 14px; margin: -18px auto 4px; }
.mini-card { background: #fff; border-radius: 14px; padding: 11px 12px; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06); font-size: 12px; }
.mini-card b { font-size: 18px; display: block; letter-spacing: -0.02em; }
.mini-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid #eef1f6; font-size: 12px; }
.mini-row:last-child { border: 0; }
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin-top: 8px; }
.mini-bars i { flex: 1; border-radius: 5px 5px 2px 2px; background: var(--grad); opacity: 0.85; }
.float-chip { position: absolute; background: #fff; color: var(--text); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-lg); font-size: 12px; font-weight: 700; display: flex; gap: 8px; align-items: center; transform: rotate(3deg); }
.float-chip.one { left: -40px; top: 22%; }
.float-chip.two { right: -36px; bottom: 18%; }
@media (max-width: 480px) { .float-chip.one { left: -8px; } .float-chip.two { right: -8px; } }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); display: inline-block; }

.section { max-width: 1160px; margin: 0 auto; padding: 84px 16px; }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 18px; }
.kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 10px; }

.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.mod-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); transition: transform 0.15s; }
.mod-card:hover { transform: translateY(-3px); }
.mod-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; background: var(--brand-soft); color: var(--brand-ink); }
.mod-card:nth-child(3n + 2) .mod-icon { background: var(--accent-soft); color: var(--accent); }
.mod-card:nth-child(3n) .mod-icon { background: color-mix(in srgb, var(--sky) 15%, transparent); color: #0e8fc0; }
.mod-card h3 { font-size: 18px; margin-bottom: 6px; }
.mod-card p { color: var(--muted); font-size: 15px; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border-radius: var(--radius); padding: 26px; border: 1px solid var(--line); position: relative; }
.step::before { counter-increment: step; content: counter(step); width: 38px; height: 38px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 14px; }

.band { background: var(--ink); color: #fff; }
.band .section-head p { color: #a9b6d3; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks li::before { content: ''; flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat; margin-top: 2px; }
.glass { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 22px; padding: 26px; }
.community-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.community-row:last-child { border: 0; }
.community-row small { color: #92a1c2; }

.cta-final { text-align: center; background: var(--grad); color: #fff; border-radius: 28px; padding: 56px 24px; }
.cta-final h2 { font-size: clamp(28px, 4vw, 40px); }
.cta-final .btn { background: #fff; color: var(--ink); }
.footer { max-width: 1160px; margin: 0 auto; padding: 32px 16px 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- */
/* App                                                               */
/* ---------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar { background: var(--ink); color: #c8d3ea; padding: 18px 14px; position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.sidebar .logo { color: #fff; padding: 4px 8px 18px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #c8d3ea; font-weight: 600; font-size: 15px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.nav-item.active { background: rgba(18, 201, 160, 0.16); color: #fff; }
.nav-item.active svg { color: var(--brand); }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #6c7a99; padding: 14px 12px 4px; }
.sidebar-foot { margin-top: auto; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); font-size: 13px; }
.sidebar-foot b { color: #fff; display: block; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px; position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar h1 { font-size: 24px; margin: 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.content { padding: 4px 28px 40px; max-width: 1240px; }

.bottom-nav { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
  .topbar h1 { font-size: 20px; }
  .content { padding: 4px 16px calc(96px + var(--safe-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-bottom));
  }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 11px var(--font); color: var(--muted); background: none; border: 0; padding: 6px 0; cursor: pointer; }
  .bottom-nav a.active, .bottom-nav button.active { color: var(--brand-ink); }
  .bottom-nav .fab { width: 54px; height: 54px; margin: -24px auto 0; border-radius: 18px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(18, 201, 160, 0.4); }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 16px; }
.cards { display: grid; gap: 16px; align-content: start; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi small { font-weight: 600; font-size: 13px; }
.kpi b { display: block; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.02em; margin-top: 2px; overflow-wrap: anywhere; }
.kpi.hl { background: var(--grad); color: #fff; border: 0; }
.kpi.hl small { color: rgba(255, 255, 255, 0.85); }
.cols-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .cols-2 { grid-template-columns: 1fr; } }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar i { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: var(--grad); min-height: 3px; }
.bar small { font-size: 11px; }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row-main { min-width: 0; flex: 1; }
.row-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--surface-2); margin: 0 -10px; padding: 12px 10px; border-radius: 10px; }
.amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount.in { color: var(--brand-ink); }
.amount.out { color: var(--danger); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar .search { flex: 1 1 240px; position: relative; }
.toolbar .search input { padding-left: 40px; }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar select, .toolbar input[type='date'] { width: auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font: 600 13px var(--font); color: var(--muted); cursor: pointer; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: var(--surface-2); }
table.data tr { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
@media (max-width: 640px) { .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .p-card { padding: 12px; } .p-card .price { font-size: 16px; } }
.cart-bar { display: none; }
@media (max-width: 1000px) {
  .cart-bar {
    display: flex; position: fixed; left: 16px; right: 16px; z-index: 25; bottom: calc(16px + var(--safe-bottom));
    justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border: 0; border-radius: 16px;
    background: var(--ink); color: #fff; font: 700 15px var(--font); box-shadow: var(--shadow-lg); cursor: pointer;
  }
  .cart-bar b { font-size: 17px; }
  .cart-bar span { display: flex; gap: 8px; align-items: center; }
}
@media (max-width: 900px) { .cart-bar { bottom: calc(84px + var(--safe-bottom)); } }
.p-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: inherit; transition: border-color 0.12s, transform 0.12s; }
.p-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.p-card b { font-size: 15px; line-height: 1.25; }
.p-card .price { font-size: 17px; font-weight: 800; }
.p-card.out { opacity: 0.5; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty svg { margin: 0 auto 12px; color: var(--line); }

.pos { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.cart { position: sticky; top: 84px; }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; } .cart { position: static; } }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.qty { justify-self: start; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 34px; height: 34px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 18px; color: var(--text); }
.qty span { min-width: 34px; text-align: center; font-weight: 700; }
.total-line { display: flex; justify-content: space-between; padding: 6px 0; }
.total-line.big { font-size: 22px; font-weight: 800; padding-top: 12px; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pay-methods button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 4px; font: 600 13px var(--font); color: var(--text); cursor: pointer; }
.pay-methods button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }

/* ---- Modales / hojas ---- */
.overlay { position: fixed; inset: 0; background: rgba(11, 16, 32, 0.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade 0.15s; }
.modal { background: var(--surface); border-radius: 22px; width: min(620px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: rise 0.18s; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 20px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; width: 100%; max-height: 92dvh; padding-bottom: var(--safe-bottom); animation: sheet 0.22s; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes sheet { from { transform: translateY(100%); } }

.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-bottom)); z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); }
@media (max-width: 900px) { .toast-wrap { bottom: calc(92px + var(--safe-bottom)); } }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: rise 0.2s; }
.toast.error { background: var(--danger); }

/* ---- Autenticacion y bienvenida ---- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(800px 500px at 100% 0%, rgba(109, 93, 252, 0.5), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(18, 201, 160, 0.35), transparent 60%), var(--ink); color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { font-size: 34px; font-weight: 800; max-width: 420px; }
.auth-side p { color: #b6c2dc; max-width: 420px; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-box { width: min(420px, 100%); }
.auth-box h1 { font-size: 28px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }
.strength { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: -6px 0 14px; }
.strength i { display: block; height: 100%; width: 0; transition: width 0.2s, background 0.2s; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.mobile-logo { display: none; margin-bottom: 24px; color: var(--text); }
@media (max-width: 860px) { .mobile-logo { display: flex; } }

.wizard { max-width: 640px; margin: 0 auto; padding: 32px 16px 64px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin: 18px 0 30px; }
.progress i { display: block; height: 100%; background: var(--grad); transition: width 0.25s; }
.wizard h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.options { display: grid; gap: 10px; margin: 20px 0; }
.option { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 15px 16px; font: 600 16px var(--font); color: var(--text); cursor: pointer; text-align: left; display: flex; justify-content: space-between; align-items: center; }
.option:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.option.active { border-color: var(--brand); background: var(--brand-soft); }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.yesno .option { justify-content: center; padding: 22px; font-size: 18px; }
.wizard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; }
.module-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.detail-grid div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.detail-grid small { display: block; font-size: 12px; }
.detail-grid b { overflow-wrap: anywhere; }
.statement .total-line { border-bottom: 1px dashed var(--line); padding: 10px 0; }
.statement .total-line.big { border: 0; }
.scanner video { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; }

.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .sidebar, .bottom-nav, .topbar, .toolbar, .no-print, .overlay .modal-head, .overlay .modal-foot { display: none !important; }
  .app { display: block; }
  .overlay { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-height: none; width: 100%; }
  body { background: #fff; }
}
