:root {
  --pink-50: #fff4f8;
  --pink-100: #ffe4ee;
  --pink-200: #ffc9dc;
  --pink-300: #ff9cbd;
  --pink-500: #ec3d7e;
  --pink-600: #d81b60;
  --pink-700: #b81050;
  --pink-900: #6f173a;
  --ink: #241820;
  --muted: #75636e;
  --line: #eadde4;
  --paper: #fffdfd;
  --danger: #b42318;
  --warning: #9a6700;
  --success: #18794e;
  --shadow: 0 24px 70px rgba(111, 23, 58, .15);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--pink-50);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled { cursor: not-allowed; opacity: .55; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d9cbd3;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  padding: .82rem .95rem;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  border-color: var(--pink-500);
  box-shadow: 0 0 0 4px rgba(236, 61, 126, .12);
}
label { font-size: .88rem; font-weight: 750; color: #56434e; }
label small, .subtle { display: block; margin-top: .35rem; color: #917f89; font-size: .73rem; font-weight: 500; line-height: 1.4; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: .72rem 1rem;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.1;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--pink-500), var(--pink-700)); box-shadow: 0 10px 24px rgba(216, 27, 96, .2); }
.button.primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--pink-600), #9f0d43); }
.button.secondary { color: var(--pink-700); background: var(--pink-50); border-color: var(--pink-200); }
.button.dark { color: #fff; background: #2b2228; }
.button.ghost { color: #695660; background: transparent; border-color: var(--line); }
.button.danger { color: #fff; background: var(--danger); }
.button.warning { color: #7a4700; background: #fff2cc; border-color: #efd58a; }
.button.small { min-height: 34px; padding: .5rem .7rem; font-size: .76rem; white-space: nowrap; }
.button.wide { width: 100%; min-height: 50px; }

.alert, .flash {
  border: 1px solid;
  border-radius: 14px;
  padding: .85rem 1rem;
  font-size: .86rem;
  line-height: 1.55;
}
.alert p { margin: .25rem 0 0; }
.alert ul { margin: .45rem 0 0; padding-left: 1.2rem; }
.alert.error, .flash.error { color: #8d2118; background: #fff3f1; border-color: #ffc9c2; }
.alert.warning, .flash.warning { color: #765100; background: #fff9e8; border-color: #f0d98d; }
.alert.success, .flash.success { color: #11633f; background: #effbf4; border-color: #b7e4ca; }
.flash { max-width: 1380px; margin: 0 auto 1rem; }

/* Public claim experience */
.public-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 156, 189, .32), transparent 24rem),
    radial-gradient(circle at 88% 78%, rgba(216, 27, 96, .12), transparent 28rem),
    linear-gradient(145deg, #fff8fb, #fde9f1);
}
.campaign-shell { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 2.5rem 1.15rem; }
.campaign-grid { width: min(1120px, 100%); display: grid; grid-template-columns: .88fr 1.12fr; gap: 1.25rem; align-items: stretch; }
.hero-panel {
  position: relative;
  isolation: isolate;
  min-height: 720px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 32px;
  padding: 2.8rem;
  color: #fff;
  background: linear-gradient(150deg, #e92d75 0%, #bb0d4d 54%, #7e123e 100%);
  box-shadow: var(--shadow);
}
.hero-panel::before, .hero-panel::after { content: ""; position: absolute; z-index: -1; border-radius: 999px; border: 1px solid rgba(255,255,255,.13); }
.hero-panel::before { width: 370px; height: 370px; right: -150px; top: -120px; box-shadow: 0 0 0 58px rgba(255,255,255,.04), 0 0 0 118px rgba(255,255,255,.025); }
.hero-panel::after { width: 240px; height: 240px; left: -115px; bottom: 75px; box-shadow: 0 0 0 48px rgba(255,255,255,.035); }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: rgba(255,255,255,.09); padding: .48rem .8rem; font-size: .72rem; font-weight: 850; letter-spacing: .15em; }
.hero-brand { display: flex; align-items: center; gap: .7rem; margin-top: 3.5rem; color: #ffe9f1; font-size: .85rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { width: 43px; height: 43px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--pink-500), var(--pink-700)); box-shadow: 0 8px 20px rgba(180,16,80,.2); font-size: .85rem; font-weight: 950; letter-spacing: -.04em; }
.brand-mark.light { color: var(--pink-700); background: #fff; box-shadow: none; }
.hero-panel h1 { max-width: 460px; margin: 1.5rem 0 0; font-size: clamp(2.65rem, 5vw, 4.25rem); line-height: .98; letter-spacing: -.055em; }
.hero-panel p { max-width: 460px; margin: 1.5rem 0 0; color: #ffe0eb; font-size: 1rem; line-height: 1.75; }
.prize-banner { display: flex; flex-direction: column; gap: .25rem; border: 1px solid rgba(255,255,255,.2); border-radius: 21px; background: rgba(52,0,21,.14); padding: 1.3rem 1.4rem; backdrop-filter: blur(12px); }
.prize-banner strong { font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.05; letter-spacing: -.035em; }
.prize-banner span { color: #ffcfe0; font-size: .83rem; }
.claim-card { border: 1px solid rgba(255,255,255,.85); border-radius: 32px; background: rgba(255,255,255,.95); padding: 2rem; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; gap: .85rem; }
.section-heading .heading-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--pink-50); font-size: 1.25rem; }
.section-heading small, .page-heading small, .panel-header small, .danger-zone small { color: var(--pink-700); font-size: .69rem; font-weight: 900; letter-spacing: .15em; }
.section-heading h2 { margin: .18rem 0 0; font-size: 1.45rem; letter-spacing: -.025em; }
.claim-card > .alert { margin-top: 1.3rem; }
.claim-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; margin-top: 1.55rem; }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field.full, .claim-form .full { grid-column: 1 / -1; }
.code-box { border: 1px solid var(--pink-200); border-radius: 18px; background: var(--pink-50); padding: 1rem; text-align: center; }
.code-input { max-width: 315px; border-color: var(--pink-200); padding: .78rem 1rem; color: var(--pink-700); text-align: center; font-family: "SFMono-Regular", Consolas, monospace; font-size: 1.75rem; font-weight: 950; letter-spacing: .48em; text-indent: .48em; }
.code-box small { display: block; margin-top: .65rem; color: #806b76; font-size: .72rem; }
.consent { display: flex; align-items: flex-start; gap: .75rem; border-radius: 15px; background: #faf7f9; padding: .9rem; cursor: pointer; }
.consent input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: .12rem; accent-color: var(--pink-600); }
.consent span { color: #6c5963; font-size: .77rem; font-weight: 500; line-height: 1.55; }
.privacy-note { margin: .7rem 0 0; color: #92818a; text-align: center; font-size: .7rem; }
.public-footer { padding: 0 1rem 1.5rem; color: #8b747f; text-align: center; font-size: .72rem; }

/* Claim result */
.result-shell { min-height: calc(100vh - 50px); display: grid; place-items: center; padding: 2rem 1rem; }
.result-card { width: min(520px, 100%); overflow: hidden; border-radius: 32px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.result-top { padding: 3rem 1.5rem 4.4rem; color: #fff; background: linear-gradient(145deg, #ed3b7d, #a20e46); }
.party-icon { width: 78px; height: 78px; display: grid; place-items: center; margin: auto; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: rgba(255,255,255,.1); font-size: 2rem; }
.result-top p { margin: 1.3rem 0 .5rem; color: #ffd9e7; font-size: .72rem; font-weight: 850; letter-spacing: .13em; }
.result-top h1 { margin: 0; font-size: 2rem; line-height: 1.1; }
.result-content { position: relative; margin-top: -2.2rem; padding: 0 1.5rem 2rem; }
.amount-card { display: flex; flex-direction: column; gap: .5rem; border: 1px solid var(--pink-200); border-radius: 22px; background: var(--pink-50); padding: 1.5rem; box-shadow: 0 12px 30px rgba(111,23,58,.1); }
.amount-card span { font-size: 1.7rem; }
.amount-card strong { color: var(--pink-700); font-size: 2.5rem; letter-spacing: -.045em; }
.result-note { display: flex; gap: .7rem; align-items: flex-start; margin-top: 1.2rem; border-radius: 16px; background: #fff7fa; padding: 1rem; color: #65515b; text-align: left; font-size: .82rem; line-height: 1.55; }
.result-note > span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 999px; color: #fff; background: var(--pink-600); font-weight: 900; }
.result-note p { margin: 0; }
.claim-code-label { margin: 1rem 0 .35rem; color: var(--pink-700); font-size: .86rem; }
.claim-id { margin: 0 0 1.2rem; color: #a08d97; font-size: .68rem; overflow-wrap: anywhere; }

/* Admin */
.admin-body { min-height: 100vh; background: #f7f3f5; }
.admin-topbar { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid #e9dfe4; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.admin-topbar-inner { width: min(1400px, calc(100% - 2rem)); min-height: 74px; display: flex; align-items: center; gap: 2rem; margin: auto; }
.admin-brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.admin-brand b, .admin-brand small { display: block; }
.admin-brand b { font-size: .88rem; }
.admin-brand small { margin-top: .12rem; color: #937f89; font-size: .66rem; }
.admin-nav { display: flex; align-self: stretch; gap: .2rem; }
.admin-nav a { display: flex; align-items: center; border-bottom: 3px solid transparent; padding: 0 .8rem; color: #6d5b65; text-decoration: none; font-size: .82rem; font-weight: 750; }
.admin-nav a:hover, .admin-nav a.active { color: var(--pink-700); border-color: var(--pink-500); }
.admin-account { display: flex; align-items: center; gap: .7rem; margin-left: auto; color: #6d5b65; font-size: .78rem; }
.admin-account a { border: 1px solid var(--line); border-radius: 9px; padding: .45rem .6rem; text-decoration: none; font-weight: 750; }
.admin-main { width: min(1400px, calc(100% - 2rem)); margin: auto; padding: 2.2rem 0 4rem; }
.page-heading { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-end; margin-bottom: 1.5rem; }
.page-heading h1 { margin: .25rem 0 .35rem; font-size: clamp(1.8rem, 3vw, 2.65rem); letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); font-size: .87rem; }
.page-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .85rem; }
.stat-card { min-height: 144px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid #eee4e9; border-radius: 18px; background: #fff; padding: 1.15rem; box-shadow: 0 8px 25px rgba(61,40,51,.045); }
.stat-card.accent { color: #fff; border-color: transparent; background: linear-gradient(145deg, #e53578, #a91048); }
.stat-card span { color: #786771; font-size: .76rem; font-weight: 750; }
.stat-card.accent span, .stat-card.accent small { color: #ffdbe8; }
.stat-card strong { font-size: clamp(1.55rem, 2.3vw, 2rem); letter-spacing: -.045em; overflow-wrap: anywhere; }
.stat-card small { color: #9a8791; font-size: .7rem; line-height: 1.35; }
.mini-stats, .code-summary { display: flex; gap: .55rem; flex-wrap: wrap; margin: .9rem 0 1.4rem; }
.mini-stats span, .code-summary span { border: 1px solid #eee3e8; border-radius: 999px; background: #fff; padding: .58rem .8rem; color: #6e5b65; font-size: .75rem; }
.code-summary { margin-top: -.6rem; }
.panel { overflow: hidden; border: 1px solid #ece1e6; border-radius: 20px; background: #fff; box-shadow: 0 10px 30px rgba(61,40,51,.05); }
.panel + .panel { margin-top: 1.2rem; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid #efe6ea; padding: 1.15rem 1.25rem; }
.panel-header h2 { margin: .18rem 0 0; font-size: 1.15rem; }
.panel-header a { color: var(--pink-700); font-size: .78rem; font-weight: 800; text-decoration: none; }
.filter-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; border-bottom: 1px solid #efe6ea; padding: 1rem; }
.filter-bar label { min-width: 150px; }
.filter-bar .search-field { flex: 1 1 280px; }
.filter-bar input, .filter-bar select { min-height: 43px; padding: .68rem .8rem; font-size: .82rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 930px; border-collapse: collapse; text-align: left; font-size: .78rem; }
.data-table.wide-table { min-width: 1370px; }
.data-table th { background: #fff7fa; color: #806d77; padding: .78rem 1rem; font-size: .65rem; font-weight: 850; letter-spacing: .075em; text-transform: uppercase; white-space: nowrap; }
.data-table td { border-top: 1px solid #f0e8ec; padding: .86rem 1rem; color: #57464f; vertical-align: top; line-height: 1.45; }
.data-table tbody tr:hover { background: #fffbfc; }
.data-table.compact { min-width: 850px; }
.wrap-cell { max-width: 220px; white-space: normal; }
.address-cell { max-width: 280px; }
.code-pill { display: inline-block; border: 1px solid var(--pink-200); border-radius: 8px; background: var(--pink-50); padding: .25rem .4rem; color: var(--pink-700); font-size: .78rem; font-weight: 900; letter-spacing: .05em; }
.code-pill.large { font-size: .9rem; }
.badge { display: inline-flex; border-radius: 999px; padding: .27rem .47rem; font-size: .61rem; font-weight: 900; letter-spacing: .05em; white-space: nowrap; }
.badge.production { color: #8d1b4e; background: #ffe4ee; }
.badge.test { color: #665100; background: #fff1b8; }
.badge.available { color: #11633f; background: #dcf8e8; }
.badge.used { color: #7c2d12; background: #ffdfd2; }
.pink-text { color: var(--pink-700); }
.empty-state { padding: 2.5rem !important; color: #98868f !important; text-align: center; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; border-top: 1px solid #efe6ea; padding: 1rem; color: #806d77; font-size: .78rem; }
.pagination a { color: var(--pink-700); font-weight: 800; text-decoration: none; }
.add-panel { margin-bottom: 1.2rem; }
.add-code-form { display: grid; grid-template-columns: 1.2fr 1fr .7fr auto; align-items: end; gap: .8rem; padding: 1.1rem 1.25rem 1.3rem; }
.add-code-form label { display: flex; flex-direction: column; gap: .42rem; }
.add-code-form .button { margin-bottom: 1.45rem; }
.muted-field { opacity: .5; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-top: 1.2rem; border: 1px solid #ffc9c2; border-radius: 20px; background: #fff8f7; padding: 1.25rem; }
.danger-zone h2 { margin: .2rem 0 .3rem; font-size: 1.05rem; }
.danger-zone p { margin: 0; color: #806761; font-size: .78rem; }

/* Login and installer */
.login-body, .install-body { min-height: 100vh; background: radial-gradient(circle at top left, #ffe0eb, transparent 34rem), linear-gradient(145deg, #fff8fb, #f7e8ee); }
.login-shell, .install-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.login-card { width: min(410px, 100%); border: 1px solid rgba(255,255,255,.9); border-radius: 26px; background: rgba(255,255,255,.95); padding: 2rem; box-shadow: var(--shadow); }
.login-kicker { margin: 1.3rem 0 .35rem !important; color: var(--pink-700) !important; font-size: .67rem !important; font-weight: 900; letter-spacing: .15em; }
.login-card h1 { margin: 0; font-size: 1.8rem; letter-spacing: -.04em; }
.login-card > p { margin: .55rem 0 0; color: var(--muted); font-size: .83rem; line-height: 1.55; }
.login-card .alert { margin-top: 1rem; }
.login-form { display: grid; gap: .55rem; margin-top: 1.35rem; }
.login-form label:not(:first-of-type) { margin-top: .55rem; }
.login-form .button { margin-top: .75rem; }
.back-link { display: block; margin-top: 1.15rem; color: var(--pink-700); text-align: center; text-decoration: none; font-size: .75rem; font-weight: 750; }
.install-card { width: min(760px, 100%); border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: rgba(255,255,255,.97); padding: clamp(1.35rem, 4vw, 2.4rem); box-shadow: var(--shadow); }
.install-brand { display: flex; align-items: center; gap: .8rem; }
.install-brand small { color: var(--pink-700); font-size: .65rem; font-weight: 900; letter-spacing: .15em; }
.install-brand h1 { margin: .16rem 0 0; font-size: 1.7rem; letter-spacing: -.035em; }
.install-intro { margin: 1.1rem 0 0; color: var(--muted); font-size: .84rem; line-height: 1.6; }
.install-form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.install-form fieldset { margin: 0; border: 1px solid var(--line); border-radius: 17px; padding: 1rem; }
.install-form legend { padding: 0 .4rem; color: var(--pink-700); font-size: .77rem; font-weight: 850; }
.install-form label { display: flex; flex-direction: column; gap: .42rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.form-grid .full { grid-column: 1 / -1; }
.install-success { margin-top: 1.5rem; border: 1px solid #b7e4ca; border-radius: 18px; background: #effbf4; padding: 1.35rem; text-align: center; }
.install-success > span { width: 44px; height: 44px; display: grid; place-items: center; margin: auto; border-radius: 999px; color: #fff; background: var(--success); font-size: 1.3rem; font-weight: 900; }
.install-success h2 { margin: .8rem 0 .35rem; }
.install-success p { margin: 0; color: #47715c; font-size: .84rem; }
.install-links { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1rem; }
.install-card > .alert { margin-top: 1rem; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .add-code-form { grid-template-columns: 1fr 1fr; }
  .add-code-form .button { margin-bottom: 0; }
}

@media (max-width: 820px) {
  .campaign-grid { grid-template-columns: 1fr; }
  .hero-panel { min-height: 510px; }
  .admin-topbar-inner { align-items: flex-start; flex-wrap: wrap; gap: .65rem 1rem; padding: .7rem 0; }
  .admin-brand .brand-mark { width: 38px; height: 38px; }
  .admin-nav { order: 3; width: 100%; overflow-x: auto; }
  .admin-nav a { min-height: 42px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .campaign-shell { padding: .7rem; }
  .hero-panel, .claim-card { border-radius: 24px; }
  .hero-panel { min-height: 460px; padding: 1.6rem; }
  .hero-brand { margin-top: 2rem; }
  .hero-panel h1 { font-size: 2.65rem; }
  .claim-card { padding: 1.25rem; }
  .claim-form { grid-template-columns: 1fr; }
  .field.full, .claim-form .full { grid-column: auto; }
  .code-input { font-size: 1.45rem; letter-spacing: .34em; text-indent: .34em; }
  .result-top h1 { font-size: 1.7rem; }
  .amount-card strong { font-size: 2rem; }
  .admin-main, .admin-topbar-inner { width: min(100% - 1rem, 1400px); }
  .admin-account span { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 125px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label, .filter-bar .search-field { min-width: 100%; flex-basis: auto; }
  .add-code-form, .form-grid, .install-links { grid-template-columns: 1fr; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-zone form, .danger-zone .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
