:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --surface-2: #1b1b1e;
  --line: #2a2a2f;
  --text: #ededef;
  --muted: #9a9aa3;
  --silver: linear-gradient(120deg, #fafafa 0%, #a9a9b1 38%, #f1f1f3 55%, #8e8e96 80%, #d9d9dd 100%);
  --ok: #7ee2a8;
  --warn: #f2c66d;
  --bad: #f08a8a;
  --info: #9ec3ff;
  --radius: 16px;
  --display: "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -200px, #1c1c21 0%, transparent 70%);
  color: var(--text);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); }
img { max-width: 100%; }

/* ---------- Estructura ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 10, 11, .85); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 8px; object-fit: cover; }
.brand span { font: 900 15px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.brand small { display: block; font: 600 10px/1.6 var(--body); letter-spacing: .25em; color: var(--muted); }
.topbar nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topbar nav a { text-decoration: none; color: var(--muted); }
.topbar nav a:hover { color: var(--text); }
.topbar form { margin: 0; }

.wrap { max-width: 880px; margin: 0 auto; padding: 28px 16px 64px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .08em; padding: 28px 16px 40px; border-top: 1px solid var(--line); }

/* ---------- Tipografía ---------- */
h1, h2, h3 { margin: 0 0 10px; line-height: 1.05; }
h1 { font: 900 clamp(38px, 8vw, 68px)/0.98 var(--display); text-transform: uppercase; letter-spacing: -.01em; }
h2 { font: 900 clamp(22px, 4vw, 28px)/1.1 var(--display); text-transform: uppercase; }
h3 { font-size: 15px; margin-top: 28px; text-transform: uppercase; letter-spacing: .08em; }
.silver { background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 18px; color: #c8c8ce; max-width: 34ch; margin: 14px 0 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.empty { color: var(--muted); padding: 18px 0; margin: 0; }
small { color: var(--muted); }
code { font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }

/* ---------- Bloques ---------- */
.hero, .hello { padding: 28px 0 26px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin: 0 0 18px; scroll-margin-top: 80px;
}
.card.center { text-align: center; max-width: 460px; margin-inline: auto; }
.card.invite { border-color: #4a4a52; background: linear-gradient(180deg, #1d1d21, var(--surface)); }
.card.invite p:last-child, .card.sent p { margin: 0 0 12px; color: #d4d4d9; }

.flash { padding: 12px 16px; border-radius: 12px; margin: 0 0 18px; font-size: 14px; border: 1px solid; }
.flash-ok { border-color: rgba(126, 226, 168, .35); background: rgba(126, 226, 168, .08); }
.flash-error { border-color: rgba(240, 138, 138, .4); background: rgba(240, 138, 138, .08); }

/* ---------- Formularios y botones ---------- */
.login { max-width: 460px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
input[type=email], input[type=text] {
  width: 100%; padding: 14px 16px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; outline: none;
}
input:focus { border-color: #8d8d96; }
.login .btn { width: 100%; margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 12px; border: 1px solid transparent;
  background: var(--silver); color: #0a0a0b; font: 800 14px/1 var(--body);
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, opacity .15s ease; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: #8d8d96; }
.btn.sm { padding: 8px 12px; font-size: 12px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.inline { display: flex; gap: 10px; }
.inline input { flex: 1; min-width: 0; }
.wrap-row { flex-wrap: wrap; }
.wrap-row input { flex: 1 1 180px; }

/* ---------- Home ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.feature { border-top: 1px solid var(--line); padding-top: 16px; }
.feature .num { font: 900 12px/1 var(--display); color: var(--muted); letter-spacing: .1em; }
.feature h3 { margin: 10px 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Panel ---------- */
.stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.stat span { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat strong { display: block; font: 900 24px/1.2 var(--display); margin-top: 6px; overflow-wrap: anywhere; }
.stat-main { background: linear-gradient(160deg, #222227, var(--surface)); border-color: #3a3a41; }
.stat-main strong { font-size: 30px; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-main a { font-size: 13px; color: var(--muted); text-decoration: none; }

.tabs { display: flex; gap: 8px; margin: 0 0 18px; overflow-x: auto; padding-bottom: 2px; position: sticky; top: 63px; z-index: 5; background: var(--bg); padding-top: 6px; }
.tabs a { flex: 0 0 auto; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 13px; color: var(--muted); }
.tabs a:hover { color: var(--text); border-color: #8d8d96; }

.linkbox { display: flex; gap: 10px; margin: 18px 0 10px; }
.linkbox input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
.share { display: flex; gap: 10px; flex-wrap: wrap; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.steps li { counter-increment: s; background: var(--surface-2); border-radius: 12px; padding: 14px; font-size: 14px; color: #c8c8ce; }
.steps li::before { content: "0" counter(s); display: block; font: 900 12px/1 var(--display); color: var(--muted); margin-bottom: 8px; }
.steps strong { color: var(--text); }

.list, .orders, .items { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.list li > div:first-child { min-width: 0; }
.list small, .order small { display: block; }
.right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; flex-shrink: 0; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 4px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--bad); }
.badge.info { color: var(--info); }

.order { border-top: 1px solid var(--line); padding: 16px 0; }
.order-head { display: flex; justify-content: space-between; gap: 12px; }
.items { margin-top: 10px; background: var(--surface-2); border-radius: 10px; padding: 6px 12px; }
.items li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; color: #c8c8ce; }
.items li + li { border-top: 1px solid var(--line); }
.tracking { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

.balance { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.balance strong { display: block; font: 900 40px/1 var(--display); background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.balance form { margin: 0; }

/* ---------- Admin ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .1em; border-top: 0; }
td.actions { display: flex; gap: 6px; }
td.actions form { margin: 0; }

/* ---------- Móvil ---------- */
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-main { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .features { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .tabs { top: 61px; }
}
@media (max-width: 420px) {
  .linkbox, .inline { flex-direction: column; }
  .steps { grid-template-columns: 1fr; }
  .topbar nav { gap: 12px; }
}
