:root {
  --bg: #0f1115;
  --bg-card: #171a21;
  --bg-card-hover: #1d2129;
  --border: #262b35;
  --text: #e7e9ee;
  --text-mut: #8b93a3;
  --accent: #f2b84b;
  --green: #3ecf8e;
  --red: #f2545b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.nav .brand { font-weight: 700; font-size: 1.05rem; margin-right: auto; color: var(--text); }
.nav a { color: var(--text-mut); font-weight: 600; font-size: 0.92rem; }
.nav a.active, .nav a:hover { color: var(--accent); }

.wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }

h1 { font-size: 1.4rem; margin: 0 0 20px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; color: var(--text); }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .label { font-size: 0.78rem; color: var(--text-mut); text-transform: uppercase; letter-spacing: 0.04em; }
.stat .value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.stat .value.green { color: var(--green); }
.stat .value.red { color: var(--red); }
.stat .value.accent { color: var(--accent); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--text-mut); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #262b35;
  color: var(--text-mut);
}
.badge.magic { background: #2a2140; color: #b79cf0; }
.badge.pokemon { background: #3a3320; color: #f0d060; }
.badge.cartas { background: #26303a; color: #8fb8d8; }
.badge.lego { background: #402020; color: #f0a09c; }
.badge.hotwheels { background: #1f3040; color: #7fc3e8; }
.badge.otro { background: #262b35; color: var(--text-mut); }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #1a1305;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.88rem;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn.secondary { background: var(--border); color: var(--text); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { padding: 5px 11px; font-size: 0.8rem; }

form.inline { display: inline; }

input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0c0e12;
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
}
label { display: block; font-size: 0.82rem; color: var(--text-mut); margin-bottom: 5px; margin-top: 12px; }
.field { margin-bottom: 4px; }

.actions-row { display: flex; gap: 10px; margin-top: 20px; }

.empty { color: var(--text-mut); font-style: italic; padding: 20px 0; }

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 320px;
}
.login-box h1 { text-align: center; }
.error { color: var(--red); font-size: 0.85rem; margin-top: 8px; }

.margin-pill {
  font-weight: 700;
}
.margin-pill.green { color: var(--green); }
.margin-pill.red { color: var(--red); }
