*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.ms {
  font-family: 'Material Symbols Outlined';
  font-weight: normal; font-style: normal;
  line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; word-wrap: normal;
  direction: ltr; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

:root {
  --primary:       #FF385C;
  --primary-dark:  #E0001F;
  --primary-light: #FFF1F2;
  --primary-mid:   #FFB3BE;
  --primary-btn-shadow: rgba(255,56,92,.22);
  --accent:        #FF5A5F;
  --text-1: #222222;
  --text-2: #717171;
  --text-3: #B0B0B0;
  --bg:      #F7F7F7;
  --surface: #FFFFFF;
  --border:  #DDDDDD;
  --border-light: #EBEBEB;
  --green:  #008A05;
  --amber:  #C45500;
  --red:    #C13515;
  --r-s:  8px; --r-m:  12px; --r-l:  16px; --r-xl: 24px; --r-f:  999px;
  --sh-s: 0 1px 2px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
  --sh-m: 0 6px 20px rgba(0,0,0,.12);
}

html, body {
  height: 100%; overflow: hidden;
  background: var(--bg);
  font-family: 'Plus Jakarta Sans', -apple-system, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text-1);
}

/* ── SHELL / PHONE — full viewport always ── */
.shell {
  position: fixed; inset: 0;
}

.phone {
  width: 100%;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
}

/* Fake status bar hidden always */
.statusbar { display: none; }
.sb-icons  { display: none; }

/* ── HEADER ── */
.app-header {
  flex-shrink: 0; background: var(--surface);
  padding: 10px 20px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 36px; height: 36px; background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon .ms { font-size: 19px; color: #fff; font-variation-settings:'FILL' 1; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: -.3px; line-height: 1.2; color: var(--text-1); }
.brand-sub  { font-size: 11px; font-weight: 500; color: var(--text-3); line-height: 1.2; }
.header-right { display: flex; align-items: center; gap: 8px; }
.next-badge {
  background: var(--primary-light); color: var(--primary);
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--r-f);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--text-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  letter-spacing: .5px; flex-shrink: 0;
  cursor: pointer; transition: opacity .15s;
}
.avatar:hover { opacity: .8; }

/* ── SCREENS ── */
.screens-wrap { flex: 1; position: relative; overflow: hidden; }
.screen {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 96px;
  opacity: 0; pointer-events: none;
  transform: translateY(7px);
  transition: opacity .18s ease, transform .18s ease;
}
.screen.active { opacity: 1; pointer-events: auto; transform: translateY(0); }
.screen::-webkit-scrollbar { width: 3px; }
.screen::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border-radius: var(--r-l);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.card-body { padding: 16px 18px; }

/* ── STATS ROW ── */
.stats3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-m); padding: 14px 14px;
}
.stat-lbl { font-size: 10px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.stat-val { font-size: 28px; font-weight: 800; letter-spacing: -2px; line-height: 1; color: var(--text-1); }
.stat-val.blue  { color: var(--primary); }
.stat-val.amber { color: var(--amber); }
.stat-val.green { color: var(--green); }

/* ── FORM ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 12px; }
label { font-size: 11px; font-weight: 700; color: var(--text-1); letter-spacing: .02em; }
input, select, textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-s);
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--text-1); background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder { color: var(--text-3); font-weight: 400; }
input:focus, select:focus, textarea:focus {
  border-color: var(--text-1);
  box-shadow: 0 0 0 3px rgba(34,34,34,.08);
}
input[readonly] { color: var(--text-2); background: var(--bg); border-color: var(--border-light); }
textarea { resize: vertical; min-height: 64px; }

/* ── ITEMS TABLE ── */
.items-cols {
  display: grid; grid-template-columns: 1fr 42px 72px 56px 28px;
  gap: 8px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light); margin-bottom: 10px;
}
.col-h { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; }
.item-row { display: grid; grid-template-columns: 1fr 42px 72px 56px 28px; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-row input { padding: 10px 12px; font-size: 13px; }
.item-sub { font-size: 12px; font-weight: 700; color: var(--text-1); text-align: right; letter-spacing: -.2px; }
.btn-del {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .15s;
}
.btn-del:hover { background: #FEE2E2; border-color: #FCA5A5; }
.btn-del .ms { font-size: 16px; color: var(--text-3); transition: color .15s; }
.btn-del:hover .ms { color: var(--red); }
.total-strip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--text-1);
  border-radius: var(--r-m); margin: 6px 0 2px;
}
.total-strip .lbl { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6); }
.total-strip .val { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -1px; }
.btn-add {
  width: 100%; padding: 12px; background: none;
  border: 1.5px dashed var(--border); border-radius: var(--r-s);
  color: var(--text-2); font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s; margin-top: 10px;
}
.btn-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-add .ms { font-size: 18px; }

/* ── ACTION BUTTONS ── */
.action-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.btn-action {
  padding: 14px 6px 12px; border-radius: var(--r-m);
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: inherit; font-size: 11px; font-weight: 700; color: var(--text-2);
  transition: all .15s;
}
.btn-action .ms { font-size: 22px; }
.btn-action:hover { border-color: var(--text-1); color: var(--text-1); transform: translateY(-2px); box-shadow: var(--sh-s); }
.btn-action.wpp:hover  { border-color: #25D366; color: #25D366; }
.btn-action.pdf:hover  { border-color: var(--red); color: var(--red); }
.btn-action.mail:hover { border-color: var(--primary); color: var(--primary); }
.btn-action.wpp  .ms  { color: #25D366; }
.btn-action.pdf  .ms  { color: var(--red); }
.btn-action.mail .ms  { color: var(--primary); }
.btn-action:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ── HISTORIAL ── */
.search-wrap { position: relative; }
.search-wrap .ms { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--text-3); pointer-events: none; }
.search-wrap input { padding-left: 40px; background: var(--surface); }
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: var(--r-f);
  border: 1.5px solid var(--border); background: var(--surface);
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--text-2); cursor: pointer; white-space: nowrap; transition: all .15s;
}
.chip.active { background: var(--text-1); border-color: var(--text-1); color: #fff; }
.q-list { overflow: hidden; }
.q-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: background .1s;
}
.q-item:last-child { border-bottom: none; }
.q-item:hover { background: var(--bg); }
.q-icon { width: 42px; height: 42px; border-radius: var(--r-m); background: var(--bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--border-light); transition: background .15s, border-color .15s; }
.q-icon .ms { font-size: 20px; color: var(--text-2); font-variation-settings:'FILL' 1; transition: color .15s; }
.q-icon[data-estado="aprobado"]  { background: #DCFCE7; border-color: #86EFAC; }
.q-icon[data-estado="aprobado"]  .ms { color: #166534; }
.q-icon[data-estado="pendiente"] { background: #FEF3C7; border-color: #FCD34D; }
.q-icon[data-estado="pendiente"] .ms { color: #92400E; }
.q-icon[data-estado="rechazado"] { background: #FEE2E2; border-color: #FCA5A5; }
.q-icon[data-estado="rechazado"] .ms { color: #991B1B; }
.q-icon[data-estado="visto"]     { background: var(--primary-light); border-color: var(--primary-mid); }
.q-icon[data-estado="visto"]     .ms { color: var(--primary-dark); }
.q-info { flex: 1; min-width: 0; }
.q-client { font-size: 13px; font-weight: 700; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.q-meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); font-weight: 500; }
.q-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.q-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.q-amount { font-size: 13px; font-weight: 700; color: var(--text-1); letter-spacing: -.3px; }
.badge { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-f); letter-spacing: .02em; }
.badge.pendiente  { background: #FEF3C7; color: #92400E; }
.badge.visto      { background: var(--primary-light); color: var(--primary-dark); }
.badge.aprobado   { background: #DCFCE7; color: #166534; }
.badge.rechazado  { background: #FEE2E2; color: #991B1B; }
.empty { display: flex; flex-direction: column; align-items: center; padding: 48px 20px; gap: 12px; text-align: center; }
.empty .ms { font-size: 48px; color: var(--text-3); }
.empty-t { font-size: 15px; font-weight: 700; color: var(--text-2); }
.empty-s { font-size: 13px; color: var(--text-3); }

/* ── DATE INPUT FIX ── */
input[type="date"] { padding-right: 10px; }
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: .4; cursor: pointer; margin-left: 4px;
}

/* ── ESTADÍSTICAS ── */
.period-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.period-tabs::-webkit-scrollbar { display: none; }
.p-tab {
  flex-shrink: 0; padding: 7px 14px; border-radius: var(--r-f);
  border: 1.5px solid var(--border); background: var(--surface);
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--text-2); cursor: pointer; white-space: nowrap; transition: all .15s;
}
.p-tab.active { background: var(--text-1); border-color: var(--text-1); color: #fff; }
.nav-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 10px 16px; }
.nav-arr { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0; }
.nav-arr:hover { background: var(--text-1); border-color: var(--text-1); }
.nav-arr:hover .ms { color: #fff; }
.nav-arr .ms { font-size: 20px; color: var(--text-2); }
.nav-label { font-size: 14px; font-weight: 700; color: var(--text-1); letter-spacing: -.3px; }
.custom-range { display: none; gap: 10px; }
.custom-range.visible { display: flex; }
.custom-range .field { flex: 1; }
.stats4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-tile2 { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 14px 16px; }
.st-lbl { font-size: 10px; font-weight: 700; color: var(--text-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.st-val { font-size: 22px; font-weight: 800; letter-spacing: -1px; color: var(--text-1); line-height: 1; }
.st-val.blue { color: var(--primary); }
.st-val.green { color: var(--green); }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 16px 18px 14px; }
.chart-head { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; }
#chart-svg { width: 100%; display: block; }
.legend-row { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--text-2); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.breakdown-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); overflow: hidden; }
.bd-row { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--border-light); }
.bd-row:last-child { border-bottom: none; }
.bd-bar-wrap { flex: 1; height: 6px; background: var(--bg); border-radius: var(--r-f); overflow: hidden; }
.bd-bar { height: 100%; border-radius: var(--r-f); transition: width .5s cubic-bezier(.4,0,.2,1); }
.bd-lbl { font-size: 12px; font-weight: 600; color: var(--text-2); min-width: 72px; }
.bd-count { font-size: 13px; font-weight: 800; color: var(--text-1); min-width: 28px; text-align: right; }
.bd-pct { font-size: 10px; font-weight: 700; color: var(--text-3); min-width: 34px; text-align: right; }
.conv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 16px 18px; display: flex; align-items: center; gap: 16px; }
.conv-ring { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.conv-ring svg { transform: rotate(-90deg); }
.conv-pct-lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--text-1); }
.conv-info { flex: 1; }
.conv-title { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.conv-val { font-size: 22px; font-weight: 800; color: var(--text-1); letter-spacing: -1px; line-height: 1; }
.conv-sub { font-size: 11px; color: var(--text-3); font-weight: 500; margin-top: 2px; }

/* ── PERFIL ── */
.plan-card {
  border-radius: var(--r-l);
  overflow: hidden;
  border: none;
  box-shadow: 0 4px 24px rgba(0,0,0,.13);
}
.plan-card-inner {
  padding: 22px 22px 20px;
  position: relative;
  overflow: hidden;
  background: #111;
}
/* gradient mesh base */
.plan-card-inner::before {
  content: '';
  position: absolute; inset: 0;
  opacity: .55;
  pointer-events: none;
}
/* glow orb top-right */
.plan-card-inner::after {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  top: -60px; right: -40px;
  pointer-events: none;
  filter: blur(52px);
  opacity: .55;
}
/* ── TRIAL — deep indigo → midnight ── */
.plan-card.trial .plan-card-inner {
  background: linear-gradient(145deg, #1a1035 0%, #0d0820 55%, #0a0614 100%);
}
.plan-card.trial .plan-card-inner::before {
  background: radial-gradient(ellipse at 0% 100%, rgba(124,58,237,.35) 0%, transparent 65%);
}
.plan-card.trial .plan-card-inner::after { background: #F59E0B; }

/* ── PRO — deep emerald ── */
.plan-card.pro .plan-card-inner {
  background: linear-gradient(145deg, #052e16 0%, #021a0e 55%, #010d07 100%);
}
.plan-card.pro .plan-card-inner::before {
  background: radial-gradient(ellipse at 0% 100%, rgba(16,185,129,.3) 0%, transparent 65%);
}
.plan-card.pro .plan-card-inner::after { background: #34D399; }

/* ── VENCIDA — crimson night ── */
.plan-card.vencida .plan-card-inner {
  background: linear-gradient(145deg, #3b0a0a 0%, #1f0505 55%, #100202 100%);
}
.plan-card.vencida .plan-card-inner::before {
  background: radial-gradient(ellipse at 0% 100%, rgba(239,68,68,.25) 0%, transparent 65%);
}
.plan-card.vencida .plan-card-inner::after { background: #F87171; }

.plan-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-f); margin-bottom: 12px;
  position: relative; z-index: 1;
  backdrop-filter: blur(8px);
}
.plan-card.trial   .plan-badge { background: rgba(245,158,11,.15); color: #FCD34D; border: 1px solid rgba(245,158,11,.25); }
.plan-card.pro     .plan-badge { background: rgba(52,211,153,.15); color: #6EE7B7; border: 1px solid rgba(52,211,153,.25); }
.plan-card.vencida .plan-badge { background: rgba(248,113,113,.15); color: #FCA5A5; border: 1px solid rgba(248,113,113,.25); }
.plan-name { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.6px; line-height: 1.15; position: relative; z-index: 1; }
.plan-sub  { font-size: 12px; color: rgba(255,255,255,.45); font-weight: 500; margin-top: 4px; position: relative; z-index: 1; }
.plan-progress-wrap { margin: 16px 0 6px; position: relative; z-index: 1; }
.plan-progress-bar {
  height: 6px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden;
}
.plan-progress-fill { height: 100%; border-radius: 99px; transition: width .7s cubic-bezier(.4,0,.2,1); }
.plan-card.trial   .plan-progress-fill { background: linear-gradient(90deg, #F59E0B, #FCD34D); }
.plan-card.pro     .plan-progress-fill { background: linear-gradient(90deg, #10B981, #6EE7B7); }
.plan-progress-labels { display: flex; justify-content: space-between; margin-top: 6px; }
.plan-progress-labels span { font-size: 10px; color: rgba(255,255,255,.35); font-weight: 600; }
.plan-price-row { display: flex; align-items: baseline; gap: 5px; margin-top: 16px; position: relative; z-index: 1; }
.plan-price { font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -1.5px; line-height: 1; }
.plan-per   { font-size: 12px; color: rgba(255,255,255,.4); font-weight: 500; }
/* features — dark panel continuous with card */
.plan-features {
  padding: 14px 22px 16px;
  display: flex; flex-direction: column; gap: 9px;
}
.plan-card.trial   .plan-features { background: #08061a; }
.plan-card.pro     .plan-features { background: #020f07; }
.plan-card.vencida .plan-features { background: #0c0101; }
.plan-feature { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: rgba(255,255,255,.75); font-weight: 500; }
.plan-feature .ms { font-size: 16px; }
.plan-card.trial   .plan-feature .ms { color: #F59E0B; }
.plan-card.pro     .plan-feature .ms { color: #34D399; }
.plan-card.vencida .plan-feature .ms { color: rgba(255,255,255,.25); }
.mp-trust { display: flex; align-items: center; justify-content: center; gap: 9px; }
.mp-trust span { font-size: 11px; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.mp-logo { height: 30px; width: auto; display: block; }
.logo-upload { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--bg); border-radius: var(--r-m); border: 1.5px dashed var(--border); cursor: pointer; transition: all .15s; }
.logo-upload:hover { border-color: var(--text-1); }
.logo-thumb { width: 52px; height: 52px; border-radius: var(--r-m); background: var(--border-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; border: 1px solid var(--border); }
.logo-thumb .ms { font-size: 24px; color: var(--text-3); }
.logo-thumb img { width: 100%; height: 100%; object-fit: contain; }
.logo-title { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 3px; }
.logo-hint  { font-size: 12px; color: var(--text-2); font-weight: 400; line-height: 1.4; }
.btn-primary {
  width: 100%; padding: 15px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--r-m);
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; letter-spacing: .01em;
  transition: background .15s, transform .1s;
}
.btn-primary:hover  { background: var(--primary-dark); }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost {
  width: 100%; padding: 14px; background: none; color: var(--text-2);
  border: 1.5px solid var(--border); border-radius: var(--r-m);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.btn-ghost:hover { border-color: var(--text-1); color: var(--text-1); }

/* ── SHARE GRID ── */
.share-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.share-opt {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 6px 12px; border-radius: var(--r-m);
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 700;
  color: var(--text-2); transition: all .15s;
}
.share-opt-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.share-opt-icon .ms { font-size: 20px; }
.share-opt-lbl { font-size: 10px; font-weight: 700; }

.share-opt.wpp  .share-opt-icon { background: #D1FAE5; }
.share-opt.wpp  .share-opt-icon .ms { color: #25D366; }
.share-opt.wpp:hover  { border-color: #25D366; color: #16a34a; }

.share-opt.pdf  .share-opt-icon { background: var(--primary-light); }
.share-opt.pdf  .share-opt-icon .ms { color: var(--primary); }
.share-opt.pdf:hover  { border-color: var(--primary); color: var(--primary); }

.share-opt.mail .share-opt-icon { background: #EDE9FE; }
.share-opt.mail .share-opt-icon .ms { color: #7C3AED; }
.share-opt.mail:hover { border-color: #7C3AED; color: #7C3AED; }

.share-opt.link .share-opt-icon { background: var(--bg); }
.share-opt.link .share-opt-icon .ms { color: var(--text-2); }
.share-opt.link:hover { border-color: var(--text-1); color: var(--text-1); }

.share-opt:disabled { opacity: .5; cursor: not-allowed; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  flex-shrink: 0; background: var(--surface);
  border-top: 1px solid var(--border-light);
  display: flex; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: relative; z-index: 10;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 10px 0 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-family: inherit;
  font-size: 10px; font-weight: 700; letter-spacing: .02em; transition: color .15s;
}
.nav-btn .ms { font-size: 23px; transition: font-variation-settings .2s; }
.nav-btn.active { color: var(--primary); }
.nav-btn.active .ms { font-variation-settings: 'FILL' 1; }
.home-ind { display: none; }
.nav-icon-wrap { position: relative; display: inline-flex; }
.nav-badge {
  position: absolute; top: -4px; right: -7px;
  min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--primary); color: #fff;
  font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}
.nav-badge[data-count="0"] { display: none; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end;
  z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  width: 100%; background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  max-height: 90%;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden; display: flex; flex-direction: column;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-1); }
.modal-body { overflow-y: auto; padding: 18px 20px; flex: 1; -webkit-overflow-scrolling: touch; }
.modal-footer { padding: 14px 20px 20px; border-top: 1px solid var(--border-light); display: flex; gap: 10px; }
.btn-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.btn-close .ms { font-size: 18px; color: var(--text-2); }
.detail-row { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.detail-row:last-child { border: none; }
.detail-lbl { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.detail-val { font-size: 13px; font-weight: 600; color: var(--text-1); text-align: right; }
.items-detail-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }
.items-detail-table th { text-align: left; padding: 7px 8px; font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; background: var(--bg); }
.items-detail-table td { padding: 9px 8px; border-top: 1px solid var(--border-light); color: var(--text-1); font-weight: 500; }
.items-detail-table td:last-child { text-align: right; font-weight: 700; }
.estado-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.estado-btn {
  padding: 6px 14px; border-radius: var(--r-f);
  border: 1.5px solid var(--border); background: var(--surface);
  font-family: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.estado-btn.active-aprobado  { background: #DCFCE7; border-color: #4ADE80; color: #166534; }
.estado-btn.active-rechazado { background: #FEE2E2; border-color: #FCA5A5; color: #991B1B; }
.estado-btn.active-pendiente { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.estado-btn.active-visto     { background: var(--primary-light); border-color: var(--primary-mid); color: var(--primary-dark); }
.btn-danger {
  flex: 1; padding: 13px; background: none; color: var(--red);
  border: 1.5px solid #FEE2E2; border-radius: var(--r-m);
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.btn-danger:hover { background: #FEE2E2; }
.del-confirm-q { font-size: 13px; font-weight: 600; color: var(--red); flex: 1; }
.btn-del-yes {
  flex: none; padding: 12px 18px; background: var(--red); color: #fff;
  border: none; border-radius: var(--r-m);
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.btn-del-yes:hover { background: #a12a10; }

/* ── TOAST ── */
.toast {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%) translateY(-70px);
  background: var(--text-1); color: #fff;
  padding: 11px 20px; border-radius: var(--r-f);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  z-index: 200; pointer-events: none;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
  opacity: 0; box-shadow: var(--sh-m);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: #166534; }
.toast.error   { background: var(--red); }

/* ── LOADING OVERLAY ── */
.loading-overlay {
  position: absolute; inset: 0;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; opacity: 1; transition: opacity .3s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 36px; height: 36px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PAYWALL ── */
.paywall-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 150;
}
.paywall-card {
  background: var(--surface); border-radius: var(--r-xl);
  padding: 32px 24px; text-align: center; width: 100%;
}
.paywall-icon { font-size: 44px; color: var(--primary); margin-bottom: 14px; font-variation-settings: 'FILL' 1; }
.paywall-title { font-size: 20px; font-weight: 800; color: var(--text-1); margin-bottom: 8px; }
.paywall-sub { font-size: 14px; color: var(--text-2); line-height: 1.5; margin-bottom: 22px; }
.paywall-price { font-size: 36px; font-weight: 800; color: var(--text-1); letter-spacing: -2px; }
.paywall-per { font-size: 13px; color: var(--text-3); margin-bottom: 22px; }

/* ── AUTH PAGES ── */
body.auth-page {
  overflow: auto;
  background: var(--bg);
  min-height: 100vh;
}
.auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%; max-width: 420px;
  box-shadow: var(--sh-m);
}
.auth-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 46px; height: 46px; background: var(--primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-icon .ms { font-size: 24px; color: #fff; font-variation-settings: 'FILL' 1; }
.auth-brand { font-size: 17px; font-weight: 800; letter-spacing: -.4px; color: var(--text-1); }
.auth-brand-sub { font-size: 11px; color: var(--text-3); font-weight: 500; margin-top: 2px; }
.auth-title { font-size: 24px; font-weight: 800; color: var(--text-1); letter-spacing: -.5px; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--text-2); margin-bottom: 28px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-1); letter-spacing: .01em; margin-bottom: 7px; }
.auth-field input {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-m);
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--text-1); background: var(--bg);
  outline: none; transition: all .15s;
}
.auth-field input:focus { border-color: var(--text-1); background: #fff; box-shadow: 0 0 0 3px rgba(34,34,34,.07); }
.auth-btn {
  width: 100%; padding: 15px;
  background: var(--primary); color: #fff;
  border: none; border-radius: var(--r-m);
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; letter-spacing: .01em; margin-top: 4px;
  transition: background .15s, transform .1s;
}
.auth-btn:hover { background: var(--primary-dark); }
.auth-btn:active { transform: scale(.99); }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.auth-link { display: block; text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-2); }
.auth-link a { color: var(--primary); font-weight: 700; text-decoration: underline; }
.auth-error { background: #FEE2E2; color: #991B1B; border-radius: var(--r-s); padding: 11px 16px; font-size: 13px; font-weight: 600; margin-bottom: 16px; display: none; }
.auth-error.show { display: block; }
.auth-success { background: #DCFCE7; color: #166534; border-radius: var(--r-s); padding: 11px 16px; font-size: 13px; font-weight: 600; margin-bottom: 16px; display: none; }
.auth-success.show { display: block; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { font-size: 11px; color: var(--text-3); font-weight: 600; }

/* ══════════════════════════════════════════════
   DESKTOP LAYOUT  (≥ 900px)
   ══════════════════════════════════════════════ */
@media (min-width: 900px) {

  .phone {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "sidebar header"
      "sidebar main";
  }

  .app-header {
    grid-area: header;
    padding: 16px 32px;
  }

  .screens-wrap {
    grid-area: main;
    overflow: hidden;
  }

  .screen {
    padding: 32px 40px 48px;
  }

  /* ── SIDEBAR ── */
  .bottom-nav {
    grid-area: sidebar;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    border-top: none;
    border-right: 1px solid var(--border-light);
    padding: 28px 16px;
    gap: 2px;
    background: var(--surface);
  }

  .nav-btn {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--r-m);
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    color: var(--text-2);
  }

  .nav-btn:hover { background: var(--bg); color: var(--text-1); }
  .nav-btn .ms { font-size: 20px; }
  .nav-btn.active { background: var(--primary-light); color: var(--primary); }
  .nav-btn.active .ms { font-variation-settings: 'FILL' 1; }
  .home-ind { display: none; }
  .nav-badge { top: -3px; right: -5px; }

  /* ── NUEVA — 2 columns ── */
  #s-nueva .stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  #s-nueva #editing-banner  { grid-column: 1 / -1; }
  #s-nueva #profile-banner  { grid-column: 1 / -1; }

  .nueva-col-left  { grid-column: 1; }
  .nueva-col-right { grid-column: 2; display: flex; flex-direction: column; gap: 14px; }

  /* ── STATS wider grid ── */
  .stats4 { grid-template-columns: repeat(4, 1fr); }

  /* ── MODAL centered ── */
  .modal-overlay { align-items: center; }
  .modal {
    width: min(580px, 90vw);
    border-radius: var(--r-xl);
    transform: translateY(16px) scale(.97);
    max-height: 85vh;
  }
  .modal-overlay.open .modal { transform: translateY(0) scale(1); }

  /* ── PERFIL max-width ── */
  #s-perfil .stack { max-width: 580px; }
}

/* ── SKELETON LOADING ── */
.skel { background: var(--bg); border-radius: 6px; animation: skel-pulse 1.3s ease-in-out infinite; }
@keyframes skel-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
.skel-icon { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; }
.skel-text { height: 11px; }
.skel-w70 { width: 65%; }
.skel-w40 { width: 38%; }
.skel-amount { width: 54px; height: 11px; }
.skel-badge { width: 66px; height: 20px; border-radius: 20px; }
.q-item.skeleton-item { pointer-events: none; cursor: default; }

/* ── FIELD VALIDATION ── */
.field.error input, .field.error textarea {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,56,92,.1);
}
.field-err { font-size: 11px; color: var(--primary); font-weight: 600; }

/* ── PROFILE INCOMPLETE BANNER ── */
.profile-banner {
  align-items: center; gap: 10px;
  background: #FFF7ED; border: 1.5px solid #FDBA74;
  border-radius: var(--r-m); padding: 11px 14px;
  font-size: 13px; color: #92400E;
}
.profile-banner .ms { font-size: 18px; color: #F97316; flex-shrink: 0; }
.profile-banner span:not(.ms) { flex: 1; font-weight: 500; }
.profile-banner button {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: #92400E; white-space: nowrap; padding: 0; text-decoration: underline;
}

/* ── EMPTY STATE FIRST-TIME CTA ── */
.empty .btn-primary { margin-top: 4px; padding: 11px 22px; font-size: 13px; }

/* ── ONBOARDING ─────────────────────────────── */
.onboarding-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease;
  transition: background .3s ease;
}
.onboarding-overlay.welcome {
  background: #fff;
  align-items: center;
  padding: 24px;
}
.onboarding-card {
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 480px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.2);
  transition: border-radius .3s ease, box-shadow .3s ease;
}
.onboarding-overlay.welcome .onboarding-card {
  border-radius: 24px;
  padding: 32px 24px 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,.1);
}
.onboarding-overlay.welcome .onboarding-icon {
  width: 72px; height: 72px; border-radius: 22px; margin-bottom: 18px;
}
.onboarding-overlay.welcome .onboarding-icon .ms { font-size: 36px; }
.onboarding-overlay.welcome .onboarding-title { font-size: 22px; margin-bottom: 10px; }
.onboarding-overlay.welcome .onboarding-body  { font-size: 14px; margin-bottom: 24px; }
.onboarding-dots {
  display: flex; gap: 5px; justify-content: center; margin-bottom: 14px;
}
.onboarding-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border); transition: all .25s;
}
.onboarding-dot.active { background: var(--primary); width: 18px; border-radius: 3px; }
.onboarding-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.onboarding-icon .ms { font-size: 22px; color: var(--primary); }
.onboarding-title {
  font-size: 16px; font-weight: 800; color: var(--text-1);
  text-align: center; margin-bottom: 6px;
}
.onboarding-body {
  font-size: 13px; color: var(--text-2); line-height: 1.5;
  text-align: center; margin-bottom: 16px;
}
.onboarding-actions { display: flex; gap: 8px; }
.onboarding-actions .btn-ghost   { flex: 1; padding: 12px; font-size: 13px; }
.onboarding-actions .btn-primary { flex: 2; padding: 12px; font-size: 13px; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* ── ONBOARDING STEP ANIMATIONS ── */
.onboarding-content { transition: none; }

@keyframes ob-out-left  { from { opacity:1; transform:translateX(0)     } to { opacity:0; transform:translateX(-28px)  } }
@keyframes ob-out-right { from { opacity:1; transform:translateX(0)     } to { opacity:0; transform:translateX(28px)   } }
@keyframes ob-in-right  { from { opacity:0; transform:translateX(28px)  } to { opacity:1; transform:translateX(0)      } }
@keyframes ob-in-left   { from { opacity:0; transform:translateX(-28px) } to { opacity:1; transform:translateX(0)      } }

.onboarding-content.ob-out-left  { animation: ob-out-left  .18s cubic-bezier(.4,0,1,1)    both; }
.onboarding-content.ob-out-right { animation: ob-out-right .18s cubic-bezier(.4,0,1,1)    both; }
.onboarding-content.ob-in-right  { animation: ob-in-right  .22s cubic-bezier(.22,.68,0,1.1) both; }
.onboarding-content.ob-in-left   { animation: ob-in-left   .22s cubic-bezier(.22,.68,0,1.1) both; }

@keyframes ob-icon-pop {
  0%   { transform: scale(.55); opacity: 0; }
  65%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}
.onboarding-icon.ob-icon-pop { animation: ob-icon-pop .32s cubic-bezier(.22,.68,0,1.2) both; }
