/* ── SplitWeekly · bubbly bright theme ─────────────────────────────────────── */
:root {
  --primary: #ff4d8d;
  --secondary: #7c4dff;
  --accent: #00d2b8;
  --bg: #fff5fb;
  --ink: #2b2b3a;
  --muted: #8a8197;
  --card: #ffffff;
  --line: #f1e6f4;
  --good: #18b471;
  --bad: #ef3e6d;
  --warn: #f5a524;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(124, 77, 255, 0.12);
  --shadow-sm: 0 4px 14px rgba(124, 77, 255, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(circle at 12% -10%, rgba(255, 77, 141, 0.12), transparent 40%),
    radial-gradient(circle at 92% 0%, rgba(124, 77, 255, 0.12), transparent 38%);
  line-height: 1.55;
}

h1, h2, h3, .brand { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; }
a { color: var(--secondary); }
img { max-width: 100%; display: block; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 540px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand {
  font-weight: 800; font-size: 24px; text-decoration: none; color: var(--ink);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.brand .dot { color: var(--primary); }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 700; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--bg); }
.nav a.active { color: var(--primary); }
.badge-count {
  background: var(--primary); color: #fff; border-radius: 999px;
  font-size: 12px; padding: 1px 7px; margin-left: 4px; font-weight: 800;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; text-decoration: none;
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--secondary); }
.btn.accent { background: var(--accent); color: #06302b; }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.block { display: flex; width: 100%; }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  margin: 26px 0 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; border-radius: 28px; padding: 48px 40px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 260px; height: 260px; background: rgba(255,255,255,.14); border-radius: 50%;
}
.hero h1 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 10px; max-width: 16ch; }
.hero p { font-size: 18px; max-width: 46ch; opacity: .96; margin: 0 0 22px; }
.hero .btn { background: #fff; color: var(--primary); }

/* ── Sections / cards ───────────────────────────────────────────────────── */
.section { margin: 34px 0; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 26px; }
.section-head .spacer { margin-left: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  text-decoration: none; background: #fff; border: 2px solid var(--line);
  color: var(--ink); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.chip.active, .chip:hover { border-color: var(--primary); color: var(--primary); }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.product-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .1s ease, box-shadow .2s ease; text-decoration: none; color: inherit;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-card .thumb { aspect-ratio: 1/1; background: var(--bg); overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .cat { font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.product-card .name { font-weight: 800; font-size: 16px; line-height: 1.3; }
.product-card .price { margin-top: auto; font-weight: 800; font-size: 18px; color: var(--secondary); }
.product-card .price small { color: var(--muted); font-weight: 700; }
.price-locked { color: var(--muted); font-weight: 800; display: inline-flex; gap: 6px; align-items: center; }

.tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.tag.out { background: #ffe2ea; color: var(--bad); }
.tag.low { background: #fff1d9; color: #9a6b00; }

/* ── Panels / generic card ──────────────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card h2, .card h3 { margin-top: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.product-detail .media { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.big-price { font-size: 34px; font-weight: 800; color: var(--secondary); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
label { font-weight: 700; display: block; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 15px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--secondary); }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { background: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fffafd; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.status { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.status.placed { background: #e7e0ff; color: var(--secondary); }
.status.exported { background: #d9f7ef; color: #067a63; }
.status.fulfilled { background: #defbe6; color: var(--good); }
.status.cancelled { background: #ffe2ea; color: var(--bad); }
.status.active, .status.redeemed { background: #defbe6; color: var(--good); }
.status.void, .status.expired { background: #f0eef2; color: var(--muted); }

/* ── Flash ──────────────────────────────────────────────────────────────── */
.flash { border-radius: 14px; padding: 13px 18px; margin: 18px 0; font-weight: 700; box-shadow: var(--shadow-sm); }
.flash.success { background: #defbe6; color: #0b7a45; }
.flash.error { background: #ffe2ea; color: #b3123f; }
.flash.info { background: #e7e0ff; color: #4b2bbf; }

/* ── Balance card ───────────────────────────────────────────────────────── */
.balance-card {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.balance-card .amount { font-size: 40px; font-weight: 800; font-family: 'Baloo 2', sans-serif; }
.balance-card .label { opacity: .9; font-weight: 700; }

.code-pill { font-family: 'Courier New', monospace; font-weight: 800; background: #fff; border: 2px dashed var(--secondary); color: var(--secondary); padding: 6px 12px; border-radius: 10px; display: inline-block; }

/* ── Layout helpers ─────────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.line-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-item img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--bg); }
.line-item .grow { flex: 1; }
.totals { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; padding-top: 14px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { margin-top: 50px; padding: 30px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Admin ──────────────────────────────────────────────────────────────── */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side { background: #221833; color: #fff; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.admin-side .brand { color: #fff; font-size: 20px; margin: 6px 10px 18px; }
.admin-side a { display: block; color: #d8cfe6; text-decoration: none; padding: 10px 14px; border-radius: 12px; font-weight: 700; margin-bottom: 2px; }
.admin-side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-side a.active { background: var(--primary); color: #fff; }
.admin-side .group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8d80a6; margin: 16px 14px 6px; }
.admin-main { padding: 26px 30px; }
.admin-topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.admin-topbar h1 { margin: 0; font-size: 28px; }
.admin-topbar .spacer { margin-left: auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.stat .n { font-size: 32px; font-weight: 800; font-family: 'Baloo 2', sans-serif; color: var(--secondary); }
.stat .l { color: var(--muted); font-weight: 700; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { margin-left: auto; }
.inline-form { display: inline; }

.admin-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.admin-login .card { width: 100%; max-width: 380px; }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-side .group-label { width: 100%; }
  .two-col, .product-detail { grid-template-columns: 1fr; }
  .nav a.hide-sm { display: none; }
}
