/* ══════════ RESET & BASE ══════════ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
:root {
  --bg:#0d0d0f;
  --surface:#15151a;
  --surface-2:#1a1a20;
  --surface-elev:#1f1f27;
  --border:#28282f;
  --border-2:#32323c;
  --text-1:#f4f4f6;
  --text-2:#a6a6b0;
  --text-3:#6b6b78;
  --blue:#3b82f6;
  --blue-2:#2563eb;
  --green:#22c55e;
  --red:#ef4444;
  --amber:#f59e0b;
  --purple:#a855f7;
  --pink:#ec4899;
  --cyan:#06b6d4;
  --radius:14px;
  --radius-sm:10px;
  --radius-lg:20px;
  --shadow:0 8px 32px rgba(0,0,0,.4);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --focus-ring: 0 0 0 3px rgba(59,130,246,.45);
}
html, body { height:100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow: hidden;
}
/* Evita que el teclado virtual rompa el layout en iOS/Android */
@supports (height: 100dvh) {
  body { overflow: hidden; }
  .app { height: 100dvh; }
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { outline: none; }
a { color: inherit; text-decoration: none; }

/* ══════════ FOCUS VISIBLE (accesibilidad teclado) ══════════ */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 8px;
}
.btn:focus-visible,
.icon-btn:focus-visible,
.chip:focus-visible,
.nav-item:focus-visible,
.quick-card:focus-visible,
.list-item:focus-visible,
.cta:focus-visible,
.toggle:focus-visible,
.section-head .link:focus-visible {
  box-shadow: var(--focus-ring);
}
/* En inputs el borde azul ya indica foco; evitamos doble anillo */
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.search:focus-within input:focus-visible {
  box-shadow: none;
}

/* ══════════ GLOWS (optimizados) ══════════ */
.glow {
  position: fixed; width: 420px; height: 420px; border-radius: 50%;
  opacity: .10; pointer-events: none; z-index: 0;
  /* En vez de filter: blur(120px), usamos radial-gradient: mismo look, mucho más barato */
  background: radial-gradient(circle at center, currentColor 0%, transparent 70%);
  color: var(--blue);
  transform: translateZ(0);
  will-change: auto;
}
.glow.blue { top: -180px; left: -140px; color: var(--blue); }
.glow.purple { bottom: -180px; right: -140px; color: var(--purple); }
/* Fallback: si el navegador soporta filter bien, mantenemos el gradiente */
@supports not (background: radial-gradient(circle, red, blue)) {
  .glow { background: var(--blue); filter: blur(120px); }
}

/* ══════════ LAYOUT ══════════ */
.app {
  position: relative; display: flex; flex-direction: column; z-index: 1;
  height: 100vh;
}
@supports (height: 100dvh) {
  .app { height: 100dvh; }
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + var(--safe-top)) 20px 12px;
  background: linear-gradient(180deg, rgba(13,13,15,.65) 0%, rgba(13,13,15,.55) 70%, rgba(13,13,15,.10) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 10; flex-shrink: 0;
}
.topbar h1 { font-size: 23px; font-weight: 700; letter-spacing: -.6px; line-height: 1.1; }
.topbar .subtitle { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.screen {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(96px + var(--safe-bottom));
  scroll-behavior: smooth;
  /* Permite scroll dentro sin romper el layout con teclado */
  overscroll-behavior-y: contain;
}
.screen::-webkit-scrollbar { display: none; }
.content { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 18px; }

/* flush: simplificado y predecible */
.content.flush {
  padding: 0 20px 20px; gap: 0;
}
.content.flush > * { padding-left: 0; padding-right: 0; }
.content.flush > .list-item,
.content.flush > .card-box {
  padding-left: 16px; padding-right: 16px;
}
.content.flush > .section-head,
.content.flush > .stats-grid,
.content.flush > .empty { padding-left: 0; padding-right: 0; }

/* ══════════ BOTTOM NAV ══════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(13,13,15,.52);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border-radius: 12px; position: relative;
  color: var(--text-3); transition: color .15s, background .15s;
  font-size: 10.5px; font-weight: 500; user-select: none;
}
.nav-item.active { color: var(--blue); background: rgba(59,130,246,.08); }
.nav-item:active { background: rgba(255,255,255,.04); }
.nav-badge {
  position: absolute; top: 3px; right: calc(50% - 22px);
  min-width: 17px; height: 17px; padding: 0 5px;
  background: var(--red); color: #fff; border-radius: 9px;
  font-size: 10px; font-weight: 700; display: flex;
  align-items: center; justify-content: center;
  border: 2px solid var(--bg); line-height: 1;
}

/* ══════════ ICON BUTTONS ══════════ */
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-elev); color: var(--text-2);
  transition: background .15s, color .15s, transform .1s;
  flex-shrink: 0;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.accent { background: var(--blue); color: #fff; }
.icon-btn.accent:active { background: var(--blue-2); }

/* ══════════ SEARCH ══════════ */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-elev); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 14px; color: var(--text-3);
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--blue); }
.search input {
  flex: 1; background: transparent; border: none; color: var(--text-1);
  font-size: 14px; min-width: 0;
}
.search input::placeholder { color: var(--text-3); }

/* ══════════ CHIPS ══════════ */
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px 4px;
  scrollbar-width: none; flex-shrink: 0;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 7px 14px; border-radius: 20px; background: var(--surface-elev);
  color: var(--text-2); font-size: 12.5px; font-weight: 500;
  white-space: nowrap; border: 1px solid transparent;
  transition: all .15s; user-select: none; cursor: pointer;
}
.chip.active {
  background: rgba(59,130,246,.15); color: var(--blue);
  border-color: rgba(59,130,246,.3); font-weight: 600;
}
.chip:active { transform: scale(.96); }

/* ══════════ SECTION HEAD ══════════ */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 12px;
}
.section-head h2 {
  font-size: 14px; font-weight: 600; color: var(--text-2);
  letter-spacing: -.1px;
}
.section-head .link {
  font-size: 12.5px; color: var(--blue); font-weight: 500;
  cursor: pointer; padding: 4px 8px; border-radius: 8px;
  transition: background .15s;
}
.section-head .link:active { background: rgba(59,130,246,.1); }

/* ══════════ CARDS & STATS ══════════ */
.card-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats-grid.three { grid-template-columns: repeat(3, 1fr); }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.stat-card .top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
}
.stat-card .label {
  font-size: 11px; color: var(--text-3); font-weight: 500;
  text-transform: uppercase; letter-spacing: .4px;
}
.stat-card .ic { display: flex; align-items: center; opacity: .85; }
.stat-card .value {
  font-size: 20px; font-weight: 700; letter-spacing: -.4px;
  line-height: 1.1; word-break: break-word;
}
.stat-card .sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.stat-card .sub.ok { color: var(--green); }
.stat-card .sub.warn { color: var(--amber); }
.stat-card .sub.danger { color: var(--red); }

/* ══════════ LIST ITEMS ══════════ */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px;
  cursor: pointer; transition: background .15s, transform .1s, opacity .2s;
  overflow: hidden; position: relative;
}
.list-item:active { background: var(--surface-2); }
.list-item[dragging="1"] { transition: none; will-change: transform; }
.list-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-elev); color: var(--text-2);
}
.list-icon.blue { background: rgba(59,130,246,.14); color: var(--blue); }
.list-icon.green { background: rgba(34,197,94,.14); color: var(--green); }
.list-icon.red { background: rgba(239,68,68,.14); color: var(--red); }
.list-icon.amber { background: rgba(245,158,11,.14); color: var(--amber); }
.list-icon.purple { background: rgba(168,85,247,.14); color: var(--purple); }
.list-info { flex: 1; min-width: 0; }
.list-info h3 {
  font-size: 13.5px; font-weight: 600; color: var(--text-1);
  line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.list-info p {
  font-size: 11.5px; color: var(--text-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ══════════ BADGES ══════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .1px;
  background: var(--surface-elev); color: var(--text-2);
  white-space: nowrap; flex-shrink: 0;
}
.badge.ok { background: rgba(34,197,94,.14); color: var(--green); }
.badge.warn { background: rgba(245,158,11,.14); color: var(--amber); }
.badge.danger { background: rgba(239,68,68,.14); color: var(--red); }
.badge.info { background: rgba(59,130,246,.14); color: var(--blue); }

/* ══════════ BUTTONS ══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; letter-spacing: -.1px;
  transition: background .15s, transform .1s, opacity .15s;
  white-space: nowrap; min-height: 44px;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-2); }
.btn-ghost { background: var(--surface-elev); color: var(--text-1); border: 1px solid var(--border); }
.btn-ghost:active { background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:active { background: #dc2626; }

/* ══════════ AVATAR ══════════ */
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
  letter-spacing: -.3px;
}
.avatar.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.avatar.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.avatar.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.avatar.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.avatar.purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.avatar.lg { width: 78px; height: 78px; font-size: 26px; }

/* ══════════ FIELDS ══════════ */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .5px;
}
.field input, .field select, .field textarea {
  background: var(--surface-elev); border: 1px solid var(--border);
  border-radius: 11px; padding: 12px 13px; color: var(--text-1);
  font-size: 14px; width: 100%; transition: border-color .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b78' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 36px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); background: var(--surface-2);
}
.field textarea { resize: none; min-height: 60px; font-family: inherit; }
.field input[type="date"] { color-scheme: dark; }

/* ══════════ SHEET / MODAL ══════════ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000; animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  background: var(--surface); border: 1px solid var(--border);
  border-bottom: none; border-radius: 22px 22px 0 0;
  width: 100%; max-width: 520px; max-height: 92dvh;
  display: flex; flex-direction: column;
  animation: slideUp .28s cubic-bezier(.32,.72,0,1);
  overflow: hidden;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grip {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--text-3); opacity: .35; margin: 10px auto 4px;
  flex-shrink: 0;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 20px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sheet-header h3 { font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
.sheet-body {
  padding: 18px 20px; overflow-y: auto; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.sheet-body::-webkit-scrollbar { width: 4px; }
.sheet-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
.sheet-footer {
  display: flex; gap: 8px; padding: 12px 20px calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.sheet-footer .btn { flex: 1; }

/* ══════════ DETAIL GRID ══════════ */
.detail-grid { display: flex; flex-direction: column; gap: 0; }
.detail-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; gap: 16px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--text-3); flex-shrink: 0; }
.detail-row .v { color: var(--text-1); font-weight: 500; text-align: right; word-break: break-word; }
.hero-icon {
  width: 68px; height: 68px; margin: 4px auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-elev); border-radius: 20px;
}

/* ══════════ PROGRESS ══════════ */
.progress {
  height: 5px; background: var(--surface-elev);
  border-radius: 3px; overflow: hidden;
}
.progress .fill {
  height: 100%; background: var(--green);
  border-radius: 3px; transition: width .4s ease;
}
.progress .fill.warn { background: var(--amber); }
.progress .fill.danger { background: var(--red); }

/* ══════════ EMPTY STATE ══════════ */
.empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 48px 20px;
  color: var(--text-3); text-align: center;
}
.empty p { font-size: 13.5px; color: var(--text-3); }
.empty svg { opacity: .35; }
.cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px;
  background: var(--blue); color: #fff;
  font-size: 13px; font-weight: 600; margin-top: 4px;
  cursor: pointer; transition: background .15s, transform .1s;
}
.cta:active { transform: scale(.97); background: var(--blue-2); }

/* ══════════ QUICK CARDS ══════════ */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: background .15s, transform .1s;
}
.quick-card:active { transform: scale(.98); background: var(--surface-2); }
.quick-card .icon-box {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(59,130,246,.14); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.quick-card h3 { font-size: 13px; font-weight: 600; }
.quick-card p { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ══════════ TOAST ══════════ */
.toast {
  position: fixed; bottom: calc(100px + var(--safe-bottom));
  left: 50%; transform: translateX(-50%);
  background: rgba(28,28,35,.97); color: var(--text-1);
  padding: 12px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  border: 1px solid var(--border-2);
  z-index: 2000; max-width: calc(100% - 40px);
  animation: toastIn .25s cubic-bezier(.34,1.56,.64,1);
  display: flex; align-items: center; gap: 12px;
}
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.warn { border-left: 3px solid var(--amber); }
.toast button {
  background: none; color: var(--blue); font-weight: 700;
  font-size: 12px; text-decoration: underline;
  padding: 2px 6px; border-radius: 6px; flex-shrink: 0;
}
@keyframes toastIn {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ══════════ EVENT TIMELINE ══════════ */
.event-day { margin-bottom: 20px; }
.event-day-title {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 10px; padding-left: 4px;
}
.event-item { display: flex; gap: 12px; padding: 9px 0; }
.event-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--surface-elev); color: var(--text-2);
}
.event-dot.blue { background: rgba(59,130,246,.14); color: var(--blue); }
.event-dot.green { background: rgba(34,197,94,.14); color: var(--green); }
.event-dot.red { background: rgba(239,68,68,.14); color: var(--red); }
.event-dot.amber { background: rgba(245,158,11,.14); color: var(--amber); }
.event-dot.purple { background: rgba(168,85,247,.14); color: var(--purple); }
.event-info { flex: 1; min-width: 0; padding-top: 3px; }
.event-info h4 { font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--text-1); }
.event-info p { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.event-info p span { color: var(--text-2); }

/* ══════════ CHART ══════════ */
.chart {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 6px; height: 140px; padding: 8px 0;
}
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bars { flex: 1; display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; }
.bar { width: 40%; border-radius: 3px 3px 0 0; transition: height .4s ease; min-height: 2px; }
.bar.in { background: var(--green); }
.bar.out { background: var(--red); opacity: .85; }
.bar-label { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.chart-legend {
  display: flex; gap: 16px; justify-content: center;
  margin-top: 12px; font-size: 11.5px; color: var(--text-2);
}
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 50%; }
.chart-legend .dot.in { background: var(--green); }
.chart-legend .dot.out { background: var(--red); }

/* ══════════ STATEMENT ROWS ══════════ */
.stmt-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; font-size: 13px;
  border-bottom: 1px dashed var(--border);
}
.stmt-row:last-child { border-bottom: none; }
.stmt-row.total {
  border-top: 1px solid var(--border-2); border-bottom: none;
  margin-top: 4px; padding-top: 12px; font-weight: 700;
  font-size: 14px;
}
.stmt-row .k { color: var(--text-3); }
.stmt-row .v { font-weight: 600; color: var(--text-1); }
.stmt-row .v.ok { color: var(--green); }
.stmt-row .v.danger { color: var(--red); }
.stmt-row .v.warn { color: var(--amber); }

/* ══════════ PERMISSIONS ══════════ */
.perm-group { margin-bottom: 16px; }
.perm-group-title {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 8px;
}
.perm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  cursor: pointer; transition: background .15s;
}
.perm-row:active { background: var(--surface-elev); }
.perm-row input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--blue);
  cursor: pointer; flex-shrink: 0;
}

/* ══════════ TOGGLE ══════════ */
.toggle {
  width: 42px; height: 25px; border-radius: 13px;
  background: var(--surface-elev); position: relative;
  cursor: pointer; transition: background .2s;
  flex-shrink: 0; border: 1px solid var(--border);
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--text-3); transition: transform .2s, background .2s;
}
.toggle.on { background: rgba(59,130,246,.3); border-color: rgba(59,130,246,.5); }
.toggle.on::after { transform: translateX(17px); background: var(--blue); }

/* ══════════ SUCCESS OVERLAY ══════════ */
.success-overlay {
  position: fixed; inset: 0; background: rgba(13,13,15,.88);
  backdrop-filter: blur(8px); display: flex;
  align-items: center; justify-content: center;
  z-index: 3000; opacity: 0; transition: opacity .22s;
  pointer-events: none;
}
.success-overlay.show { opacity: 1; pointer-events: auto; }
.success-inner { text-align: center; }
.success-circle {
  width: 76px; height: 76px; border-radius: 50%;
  background: rgba(34,197,94,.15); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  animation: pop .45s cubic-bezier(.34,1.56,.64,1);
}
.success-inner p.title { color: #fff; font-size: 15px; font-weight: 600; }
.success-inner p.sub { color: var(--text-3); font-size: 12px; margin-top: 4px; }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* ══════════ SWIPE INDICATOR ══════════ */
.swipe-hint {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 80px; background: var(--red);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 0 var(--radius) var(--radius) 0;
  z-index: 0;
}

/* ══════════ ONBOARD CARD ══════════ */
.onboard-card {
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  padding: 28px 22px; text-align: center;
  position: relative; overflow: hidden;
}
.onboard-card::before {
  content: ""; position: absolute; top: -60px; right: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.22), transparent 70%);
}
.onboard-icon {
  width: 62px; height: 62px; border-radius: 18px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; position: relative;
  box-shadow: 0 8px 24px rgba(59,130,246,.35);
}

/* ══════════ RESPONSIVE ══════════ */
@media (min-width: 640px) {
  .app { max-width: 560px; margin: 0 auto; }
  .bottom-nav { max-width: 560px; left: 50%; transform: translateX(-50%); }
  .modal-backdrop { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--border); }
  .sheet-body { max-height: 60vh; }
}

/* ══════════ MISC ══════════ */
.divider { height: 1px; background: var(--border); margin: 8px 0; }
.muted { color: var(--text-3); font-size: 12px; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* ══════════ PREFERS-REDUCED-MOTION ══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .glow { animation: none !important; }
}

/* ══════════ PREFERS-CONTRAST (opcional, mejora accesibilidad) ══════════ */
@media (prefers-contrast: more) {
  :root {
    --text-2:#c8c8d0;
    --text-3:#9a9aa6;
    --border:#3a3a46;
    --border-2:#4a4a56;
  }
  .list-item, .card-box, .stat-card { border-width: 1.5px; }
}

