:root {
  color-scheme: light;
  --ink: #06133d;
  --ink-soft: #53607e;
  --muted: #6f7894;
  --line: #dfe6f5;
  --line-strong: #c8d4eb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --field: #f1f6ff;
  --blue: #126feb;
  --blue-deep: #071944;
  --blue-soft: #dcecff;
  --gold: #e5ab2f;
  --silver: #aeb8c7;
  --green: #15865f;
  --red: #c2413f;
  --purple: #6d4fc4;
  --shadow: 0 22px 55px rgba(10, 32, 78, 0.16);
  --shadow-soft: 0 18px 45px rgba(10, 32, 78, 0.1);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 0%, rgba(18, 111, 235, 0.16), transparent 20rem),
    radial-gradient(circle at 96% 8%, rgba(229, 171, 47, 0.12), transparent 20rem),
    linear-gradient(135deg, #f8fafc 0%, #eef4fb 48%, #f8fafc 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(28rem, 1.1fr);
  align-items: stretch;
}

.brand-panel {
  padding: clamp(2rem, 5vw, 4.5rem);
  color: var(--blue-deep);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(230, 242, 255, 0.94)),
    linear-gradient(45deg, rgba(18, 111, 235, 0.18), transparent);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(18, 111, 235, 0.2);
  transform: rotate(-18deg);
}

.brand-panel::before {
  width: 36rem;
  height: 36rem;
  left: -16rem;
  top: -14rem;
  border-radius: 50%;
}

.brand-panel::after {
  width: 24rem;
  height: 24rem;
  right: -9rem;
  bottom: -10rem;
  border-radius: 42%;
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-weight: 900;
  letter-spacing: 0;
  font-size: 1.2rem;
}

.hero-brand {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.55rem;
}

.sidebar-brand {
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.mark {
  width: 3.1rem;
  aspect-ratio: 1;
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff 0%, #cfe4ff 48%, #4da0ff 100%);
  color: var(--blue-deep);
  display: grid;
  place-items: center;
  font-weight: 950;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.brand-logo {
  width: 3.8rem;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 30px rgba(18, 111, 235, 0.18);
}

.hero-brand .brand-logo {
  width: clamp(6.5rem, 14vw, 9rem);
  border-radius: 14px;
}

.sidebar-brand .brand-logo {
  width: 4.6rem;
  background: transparent;
  box-shadow: none;
}

.brand-copy {
  position: relative;
  max-width: 34rem;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.brand-copy p {
  max-width: 31rem;
  margin: 1.35rem 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.65;
}

.portal-status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.2rem;
  border: 1px solid rgba(21, 134, 95, 0.22);
  border-radius: 999px;
  background: rgba(21, 134, 95, 0.1);
  padding: 0.55rem 0.8rem;
  box-shadow: var(--shadow-soft);
  color: #0d6b4a;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
}

.portal-status.maintenance {
  border-color: rgba(194, 65, 63, 0.28);
  background: rgba(194, 65, 63, 0.12);
  color: #a83232;
}

.status-light {
  width: 0.75rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(21, 134, 95, 0.12);
}

.portal-status.maintenance .status-light {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(194, 65, 63, 0.12);
}

.brand-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.mini-stat {
  border: 1px solid rgba(18, 111, 235, 0.16);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.mini-stat strong {
  display: block;
  font-size: 1.35rem;
}

.mini-stat span {
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-panel {
  padding: clamp(1.25rem, 4vw, 4rem);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(100%, 31rem);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--blue);
  font-weight: 850;
  font-size: 0.78rem;
  text-transform: uppercase;
}

h2,
h3,
p {
  letter-spacing: 0;
}

.auth-card h2,
.modal-card h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.05;
}

.helper-text {
  margin: 0 0 1.35rem;
  color: var(--muted);
  line-height: 1.55;
}

.field-grid {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.82rem 0.9rem;
  background: var(--surface);
  color: var(--ink);
  min-height: 2.75rem;
}

.field textarea {
  resize: vertical;
  min-height: 5rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(18, 111, 235, 0.18);
  border-color: var(--blue);
}

.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.btn {
  border: 0;
  min-height: 2.65rem;
  border-radius: var(--radius);
  padding: 0.68rem 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 850;
  color: var(--ink);
  background: var(--field);
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, #0e5fe0, #1a85ff);
  box-shadow: 0 10px 24px rgba(18, 111, 235, 0.24);
}

.btn.dark {
  color: white;
  background: var(--blue-deep);
}

.btn.warning {
  color: var(--ink);
  background: #ffe3a2;
}

.btn.danger {
  color: white;
  background: var(--red);
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.demo-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.demo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  background: var(--surface-soft);
  font-size: 0.9rem;
}

.demo-card strong {
  display: block;
  margin-bottom: 0.2rem;
}

.error {
  color: var(--red);
  font-weight: 800;
  min-height: 1.3rem;
  margin: 0.7rem 0 0;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 16.5rem 1fr;
}

.sidebar {
  background: transparent;
  border-right: 0;
  padding: 1.1rem;
  position: sticky;
  top: 0;
  min-height: 100vh;
  align-self: start;
}

.nav-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.nav-button {
  border: 1px solid transparent;
  width: 100%;
  min-height: 2.7rem;
  border-radius: var(--radius);
  padding: 0.72rem 0.8rem;
  display: flex;
  gap: 0.7rem;
  align-items: center;
  text-align: left;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink-soft);
  font-weight: 850;
}

.nav-button.active {
  color: white;
  background: linear-gradient(135deg, var(--blue), #59a4ff);
  box-shadow: 0 12px 24px rgba(18, 111, 235, 0.24);
}

.nav-icon {
  width: 1.35rem;
  text-align: center;
}

.main {
  min-width: 0;
  padding: 1.1rem clamp(1rem, 3vw, 2rem) 2rem;
  background:
    radial-gradient(circle at 8% 2%, rgba(18, 111, 235, 0.08), transparent 17rem),
    rgba(248, 250, 252, 0.72);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.9rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(10px);
}

.identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.avatar {
  width: 2.7rem;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-weight: 950;
  border: 1px solid var(--line-strong);
}

.page-title {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  line-height: 1.08;
}

.subtle {
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 19rem);
  gap: 1rem;
  align-items: start;
}

.dashboard-main {
  min-width: 0;
}

.dashboard-side {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}

.section {
  margin-top: 1rem;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.panel-pad {
  padding: 1rem;
}

.points-hero {
  min-height: 10.5rem;
  padding: clamp(1rem, 3vw, 1.4rem);
  color: var(--blue-deep);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 247, 255, 0.98) 46%, rgba(209, 232, 255, 0.94) 100%);
  border: 1px solid #cfe2ff;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.points-hero::after {
  content: "";
  position: absolute;
  width: 13rem;
  height: 13rem;
  right: -2rem;
  top: -2.5rem;
  background: linear-gradient(135deg, rgba(18, 111, 235, 0.13), rgba(255, 255, 255, 0.18));
  transform: rotate(45deg);
}

.points-hero::before {
  content: "";
  position: absolute;
  inset: auto 2rem 1rem auto;
  width: 8.5rem;
  height: 2.2rem;
  border-top: 1px solid rgba(18, 111, 235, 0.2);
  border-bottom: 1px solid rgba(18, 111, 235, 0.12);
  transform: skewX(-18deg);
}

.points-hero > * {
  position: relative;
}

.points-copy {
  display: grid;
  gap: 0.38rem;
}

.hero-referral-card {
  width: min(19rem, 38%);
  min-height: 7rem;
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 0.28rem;
  border: 1px solid rgba(18, 111, 235, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(238, 246, 255, 0.35));
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.hero-referral-card span,
.hero-referral-card small {
  color: #5b6a8d;
  font-size: 0.78rem;
  font-weight: 850;
}

.hero-referral-card strong {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1;
  letter-spacing: 0;
}

.points-balance {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  line-height: 0.95;
}

.points-value {
  font-size: clamp(3rem, 6vw, 4.25rem);
  line-height: 0.95;
  font-weight: 950;
  color: var(--blue);
}

.points-unit {
  color: var(--blue);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 950;
}

.points-meta {
  color: #18315e;
  font-size: 0.96rem;
}

.tier-chip,
.status,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.tier-chip {
  color: white;
  background: var(--blue);
}

.tier-SILVER {
  background: #edf1f7;
  color: #596477;
}

.tier-GOLD {
  background: #fff2c6;
  color: #755218;
}

.tier-VIP {
  background: #e5dcff;
  color: #3b257e;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.metric {
  padding: 1rem;
  min-height: 7rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 0.45rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.05;
}

.tier-track {
  display: grid;
  gap: 0.8rem;
}

.tier-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.tier-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  background: var(--surface);
}

.tier-card.active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 2px rgba(18, 111, 235, 0.16);
}

.tier-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.tier-badge {
  width: 2.9rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  font-size: 1.1rem;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.16);
  background: linear-gradient(145deg, #cbd2de, #788497);
  clip-path: polygon(50% 0%, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0% 50%, 15% 15%);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.14), 0 8px 18px rgba(10, 32, 78, 0.12);
}

.tier-badge-SILVER {
  background: linear-gradient(145deg, #f7f9fd, #aab4c4 52%, #727c8d);
}

.tier-badge-GOLD {
  background: linear-gradient(145deg, #fff4ad, #f1b825 52%, #b6780c);
}

.tier-badge-VIP {
  background: linear-gradient(145deg, #efe8ff, #8b6bff 52%, #4d33a9);
}

.tier-card h3,
.panel h3 {
  margin: 0;
  font-size: 1rem;
}

.progress-wrap {
  margin-top: 0.85rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #e7edf8;
  overflow: hidden;
}

.progress {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--blue));
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.reward-card {
  display: grid;
  gap: 0.85rem;
  min-height: 13rem;
  padding: 1rem;
}

.compact-ranking h3 {
  font-size: 1rem;
}

.compact-ranking,
.quest-panel,
.weekly-goal-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96)),
    linear-gradient(135deg, rgba(18, 111, 235, 0.08), transparent 62%);
  overflow: hidden;
  position: relative;
}

.compact-ranking::before,
.quest-panel::before,
.weekly-goal-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), #67b7ff, var(--gold));
}

.rank-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.rank-item {
  min-height: 2.8rem;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.58rem;
}

.rank-item.active {
  border-color: var(--blue);
  background: #eef6ff;
}

.rank-item span,
.rank-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-item small {
  color: var(--muted);
  font-weight: 850;
}

.rank-separator {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.rank-separator::before,
.rank-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line-strong);
}

.weekly-goal-panel h3 {
  font-size: 1rem;
}

.goal-meter {
  height: 0.55rem;
  margin-top: 0.8rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf8;
}

.goal-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #62b4ff, var(--gold));
  box-shadow: 0 0 18px rgba(18, 111, 235, 0.28);
}

.goal-numbers {
  margin-top: 0.65rem;
  font-size: 0.86rem;
}

.goal-numbers div {
  display: grid;
  gap: 0.12rem;
}

.goal-numbers span {
  color: var(--muted);
  font-weight: 850;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.quest-panel h3 {
  font-size: 1rem;
}

.quest-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.quest-item {
  display: grid;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #ffffff, #f4f8ff),
    var(--surface-soft);
  padding: 0.78rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.quest-item strong {
  display: block;
  font-size: 0.92rem;
}

.quest-item p {
  margin: 0.24rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.quest-item small {
  color: var(--blue);
  font-weight: 850;
}

.quest-link {
  display: inline-flex;
  margin-top: 0.45rem;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.quest-link:hover {
  text-decoration: underline;
}

.quest-proof-input {
  display: grid;
  gap: 0.35rem;
  border: 1px dashed #b8c9e8;
  border-radius: var(--radius);
  padding: 0.62rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 850;
}

.quest-proof-input input {
  width: 100%;
  font-size: 0.78rem;
}

.quest-item .btn {
  width: 100%;
}

.reward-art {
  height: 4.6rem;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--field), #ffffff);
  border: 1px solid var(--line);
  font-size: 1.5rem;
  font-weight: 950;
  color: var(--blue);
}

.reward-art::before,
.reward-art::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.reward-art span {
  position: relative;
  z-index: 1;
}

.reward-art-ticket {
  color: #07346d;
  background: linear-gradient(135deg, #28a7ff, #126feb);
  border-color: #0c68d6;
  transform: rotate(-1deg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.reward-art-ticket::before,
.reward-art-ticket::after {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  top: 50%;
  background: white;
  transform: translateY(-50%);
}

.reward-art-ticket::before {
  left: -0.52rem;
}

.reward-art-ticket::after {
  right: -0.52rem;
}

.reward-art-ticket span {
  width: 72%;
  min-height: 2.35rem;
  display: grid;
  place-items: center;
  border: 2px solid rgba(3, 20, 58, 0.66);
  border-left-style: dashed;
  border-right-style: dashed;
  border-radius: 6px;
  color: #041840;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.28);
}

.reward-art-shirt {
  color: white;
  background: linear-gradient(145deg, #071944, #1b60c9);
}

.reward-art-shirt::before {
  width: 3.7rem;
  height: 3.05rem;
  background: #0f2f76;
  clip-path: polygon(21% 0, 36% 14%, 64% 14%, 79% 0, 100% 21%, 83% 43%, 83% 100%, 17% 100%, 17% 43%, 0 21%);
  border: 2px solid rgba(255, 255, 255, 0.36);
}

.reward-art-crown {
  color: #0c3c86;
  background: linear-gradient(145deg, #f2f8ff, #d9ecff);
}

.reward-art-crown::before {
  width: 4.2rem;
  height: 3rem;
  background: #1681ff;
  clip-path: polygon(4% 86%, 14% 30%, 35% 60%, 50% 12%, 65% 60%, 86% 30%, 96% 86%);
  box-shadow: inset 0 -8px 0 rgba(7, 25, 68, 0.18);
}

.reward-art-gift {
  color: #123f8c;
  background: linear-gradient(145deg, #eef6ff, #dcecff);
}

.reward-art-gift::before {
  width: 3.5rem;
  height: 3.05rem;
  border-radius: 7px;
  background: linear-gradient(145deg, #2d8cff, #146feb);
  box-shadow: inset 0 1.1rem 0 rgba(255, 255, 255, 0.18);
}

.reward-art-gift::after {
  width: 0.55rem;
  height: 3.2rem;
  background: white;
  opacity: 0.78;
}

.reward-card h3 {
  margin: 0;
  font-size: 1rem;
}

.reward-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 46rem;
  background: white;
}

th,
td {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.status.pending {
  color: #7a5414;
  background: #fff2ca;
}

.status.confirmed,
.status.completed,
.quest-activity .status.approved,
.quest-activity .status.auto_approved {
  color: #075a3c;
  background: #dff7ed;
}

.status.rejected,
.status.cancelled {
  color: #8a2522;
  background: #ffe1df;
}

.tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.tab {
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
  font-weight: 850;
  color: var(--ink-soft);
  white-space: nowrap;
}

.tab.active {
  color: white;
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.6fr) minmax(0, 1.4fr);
  gap: 1rem;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(19rem, 0.75fr) minmax(0, 1.65fr);
  gap: 1rem;
  align-items: start;
}

.account-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.badges-panel {
  overflow: hidden;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.badge-card {
  min-height: 7.4rem;
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  background: linear-gradient(145deg, white, #f6f9ff);
}

.badge-card.locked {
  opacity: 0.58;
  filter: grayscale(0.35);
}

.badge-medal {
  width: 3.1rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-size: 1.35rem;
  font-weight: 950;
  background: linear-gradient(145deg, #9aa8bc, #c7d0dc);
  box-shadow: inset 0 -0.35rem 0 rgba(5, 20, 55, 0.12);
  overflow: hidden;
}

.badge-medal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-blue .badge-medal {
  background: linear-gradient(145deg, #329cff, #126feb);
}

.badge-medal.badge-blue {
  background: linear-gradient(145deg, #329cff, #126feb);
}

.badge-gold .badge-medal {
  background: linear-gradient(145deg, #ffd35b, #d8a01f);
}

.badge-medal.badge-gold {
  background: linear-gradient(145deg, #ffd35b, #d8a01f);
}

.badge-medal.badge-silver {
  background: linear-gradient(145deg, #9aa8bc, #c7d0dc);
}

.badge-card strong {
  display: block;
}

.badge-card p {
  margin: 0.18rem 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.32;
}

.badge-card small {
  color: var(--blue);
  font-weight: 900;
}

.admin-badge-cell {
  display: grid;
  grid-template-columns: 2.65rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  min-width: 16rem;
}

.admin-badge-cell .badge-medal {
  width: 2.45rem;
  border-radius: 12px;
  font-size: 1rem;
}

.customer-badge-admin {
  display: grid;
  gap: 0.45rem;
  min-width: 11rem;
}

.customer-badge-admin span {
  color: var(--ink);
  font-weight: 850;
  font-size: 0.82rem;
}

.customer-badge-admin select {
  min-height: 2.25rem;
}

.admin-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.admin-section-head .page-title {
  margin-bottom: 0.35rem;
}

.admin-search {
  width: min(100%, 22rem);
  display: grid;
  gap: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 900;
}

.quest-activity {
  min-width: 0;
}

.admin-layout > .sidebar {
  min-width: 0;
}

.quest-activity .page-title {
  font-size: 1.5rem;
}

.activity-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
}

.activity-filters .field {
  min-width: 0;
}

.activity-filters input,
.activity-filters select {
  width: 100%;
  min-width: 0;
}

.activity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.activity-actions .btn {
  min-height: 2.75rem;
}

.activity-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.activity-summary dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.activity-summary dd {
  margin: 0.4rem 0 0;
  font-size: 1.5rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.activity-table {
  min-width: 50rem;
}

.activity-history {
  min-width: 76rem;
}

.activity-history td {
  vertical-align: top;
  max-width: 18rem;
  overflow-wrap: anywhere;
}

.activity-note {
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
}

.activity-pagination {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 700px) {
  .activity-filters,
  .activity-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .activity-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-search input {
  min-height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  background: linear-gradient(180deg, white, #f8fbff);
  color: var(--ink);
}

.weekly-admin-form {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) minmax(12rem, 0.6fr) minmax(14rem, 0.8fr) minmax(14rem, 1fr) auto;
  gap: 0.9rem;
  align-items: end;
}

.maintenance-form {
  display: grid;
  grid-template-columns: minmax(16rem, 0.8fr) minmax(18rem, 1fr) auto;
  gap: 0.9rem;
  align-items: end;
}

.toggle-row {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.72rem 0.8rem;
  font-weight: 850;
  color: var(--ink-soft);
}

.toggle-row input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--blue);
}

.proof-preview {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  min-width: 9rem;
}

.proof-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-thumb {
  width: 3.2rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.discord-connect-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.96)),
    linear-gradient(135deg, rgba(88, 101, 242, 0.12), transparent);
}

.referral-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96)),
    linear-gradient(135deg, rgba(229, 171, 47, 0.12), transparent);
}

.referral-code-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 0.7rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.8rem;
}

.referral-code-box span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.referral-code-box strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.45rem;
}

.discord-status {
  display: grid;
  gap: 0.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.75rem;
}

.discord-status.connected {
  border-color: #b9c4ff;
  background: #f1f4ff;
}

.discord-status strong {
  color: var(--blue-deep);
}

.discord-status span {
  color: var(--muted);
  font-size: 0.84rem;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.notice {
  border: 1px solid #c9d9f5;
  background: #eef6ff;
  border-radius: var(--radius);
  padding: 0.8rem;
  color: #1f4477;
  line-height: 1.45;
}

.empty {
  padding: 1.25rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 31, 0.62);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 20;
}

.modal-card {
  width: min(100%, 39rem);
  max-height: min(92vh, 48rem);
  overflow-y: auto;
  background: white;
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.loading-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 14, 40, 0.42);
  backdrop-filter: blur(4px);
}

.loading-card {
  width: min(100%, 24rem);
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.loading-card strong {
  display: block;
  font-size: 1rem;
}

.loading-card p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.loading-spinner {
  width: 2.4rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid #d9e8ff;
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  background: var(--blue-deep);
  color: white;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  font-weight: 800;
  max-width: min(26rem, calc(100vw - 2rem));
}

.hide {
  display: none !important;
}

@media (max-width: 1080px) {
  .login-layout,
  .layout,
  .dashboard-grid,
  .admin-grid,
  .account-layout,
  .weekly-admin-form,
  .maintenance-form {
    grid-template-columns: 1fr;
  }

  .dashboard-side {
    position: static;
  }

  .sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(8rem, 1fr));
    overflow-x: auto;
  }

  .reward-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tier-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .brand-stats,
  .metric-grid,
  .reward-grid,
  .tier-overview-grid,
  .badge-grid,
  .split-grid,
  .demo-grid {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 34rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-search {
    width: 100%;
  }

  .points-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-referral-card {
    width: 100%;
    min-height: auto;
  }
}

/* ---------------------------------------------------------------------------
   Monthly Pot
   ------------------------------------------------------------------------- */
.pot-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.4rem);
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(245, 196, 81, 0.45), transparent 14rem),
    radial-gradient(circle at 4% 100%, rgba(18, 111, 235, 0.55), transparent 16rem),
    linear-gradient(135deg, #071944 0%, #0b2766 55%, #0e3485 100%);
  border: 1px solid rgba(245, 196, 81, 0.55);
  box-shadow: 0 20px 48px rgba(7, 25, 68, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pot-card > *:not(.pot-shine) { position: relative; }

.pot-shine {
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: skewX(-18deg);
  animation: pot-shine 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pot-shine {
  0%, 55% { left: -40%; }
  100% { left: 130%; }
}

.pot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pot-eyebrow {
  color: #f5c451;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pot-countdown {
  border: 1px solid rgba(245, 196, 81, 0.45);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: rgba(245, 196, 81, 0.12);
  color: #ffe7a8;
  font-size: 0.8rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.pot-amount {
  display: block;
  margin: 0.45rem 0 0.2rem;
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  line-height: 1;
  font-weight: 950;
  color: #ffd76a;
  text-shadow: 0 4px 22px rgba(245, 196, 81, 0.35);
  font-variant-numeric: tabular-nums;
}

.pot-rules {
  margin: 0.55rem 0 0;
  color: #d9e6ff;
  font-size: 0.9rem;
  line-height: 1.5;
}

.pot-note,
.pot-winner {
  margin: 0.55rem 0 0;
  color: #b8c9ee;
  font-size: 0.82rem;
}

.pot-winner strong { color: #ffd76a; }

.pot-card-login {
  max-width: 34rem;
  margin-top: -1.2rem;
}

.pot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(14rem, 0.75fr);
  gap: 1rem;
  align-items: stretch;
}

.pot-entries {
  display: grid;
  align-content: center;
  gap: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.07);
}

.pot-entries-label,
.pot-month-total {
  color: #b8c9ee;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.pot-month-total { text-transform: none; font-weight: 700; }

.pot-entries-count {
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 950;
}

.pot-entries-count small {
  color: #8fa6d6;
  font-size: 1.1rem;
}

.pot-pips {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.28rem;
}

.pot-pip {
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.pot-pip.on {
  background: linear-gradient(90deg, #f5c451, #ffd76a);
  box-shadow: 0 0 10px rgba(245, 196, 81, 0.55);
}

.pot-next {
  margin: 0;
  color: #eaf1ff;
  font-size: 0.88rem;
  line-height: 1.45;
}

.pot-next strong { color: #ffd76a; }

.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--blue);
  font-weight: 850;
  text-align: left;
}

.link-button:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------------
   Announcements slideshow
   ------------------------------------------------------------------------- */
.announce-backdrop { z-index: 30; }

.announce-card {
  position: relative;
  width: min(100%, 34rem);
  max-height: 94vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.announce-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 19, 61, 0.65);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
}

.announce-stage {
  position: relative;
  aspect-ratio: 1;
  max-height: calc(94vh - 8.5rem);
  background: #071944;
}

.announce-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.announce-slide.active { opacity: 1; pointer-events: auto; }

.announce-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.announce-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: -1.25rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: var(--shadow-soft);
}

.announce-nav.prev { left: 0.6rem; }
.announce-nav.next { right: 0.6rem; }

.announce-footer {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem 1rem 1rem;
}

.announce-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  min-height: 0.55rem;
}

.announce-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: width 0.2s ease;
}

.announce-dot.active { width: 1.4rem; background: var(--blue); }

.announce-cta:empty { display: none; }
.announce-button { width: 100%; }

.announce-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.announce-snooze {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.announce-admin-list {
  display: grid;
  gap: 0.8rem;
}

.announce-admin-item {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: var(--surface);
}

.announce-admin-item.is-hidden { opacity: 0.6; }

.announce-admin-item > img {
  width: 6.5rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--field);
}

.announce-admin-body {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.announce-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.announce-edit-form {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

/* ---------------------------------------------------------------------------
   Admin Monthly Pot + draw animation
   ------------------------------------------------------------------------- */
.pot-winner-box {
  display: grid;
  gap: 0.25rem;
  margin: 0.6rem 0 0.9rem;
  border: 1px solid rgba(229, 171, 47, 0.5);
  border-radius: var(--radius);
  padding: 0.9rem;
  background: linear-gradient(135deg, #fff8e6, #fff);
}

.pot-winner-box span,
.pot-winner-box small { color: var(--ink-soft); font-size: 0.82rem; }
.pot-winner-box strong { font-size: 1.35rem; }

.pot-draw-button {
  width: 100%;
  padding-block: 0.9rem;
  font-size: 1.05rem;
}

.draw-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(14, 52, 133, 0.92), rgba(3, 10, 31, 0.96));
}

.draw-card {
  position: relative;
  z-index: 2;
  width: min(100%, 34rem);
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  text-align: center;
  color: #fff;
}

.draw-amount {
  font-size: clamp(2.6rem, 9vw, 4.4rem);
  line-height: 1;
  font-weight: 950;
  color: #ffd76a;
  text-shadow: 0 6px 30px rgba(245, 196, 81, 0.45);
}

.draw-reel {
  width: 100%;
  min-height: 6rem;
  display: grid;
  place-items: center;
  border: 2px solid rgba(245, 196, 81, 0.6);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), 0 0 40px rgba(245, 196, 81, 0.15);
  overflow: hidden;
}

.draw-name {
  font-size: clamp(1.4rem, 5vw, 2.1rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.draw-name.flip { animation: draw-flip 0.12s ease-out; }

.draw-name.winner {
  color: #ffd76a;
  animation: draw-win 0.7s cubic-bezier(.2, 1.6, .4, 1) both;
}

@keyframes draw-flip {
  from { transform: translateY(-55%); opacity: 0.2; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes draw-win {
  0% { transform: scale(0.6); }
  100% { transform: scale(1.12); }
}

.draw-caption { margin: 0; color: #cfdcff; }
.draw-caption strong { color: #ffd76a; }
.draw-actions { min-height: 2.6rem; }

.confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -5%;
  border-radius: 2px;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  to { top: 105%; transform: translateX(3rem) rotate(720deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pot-shine, .confetti i, .draw-name.flip, .draw-name.winner { animation: none; }
}

@media (max-width: 700px) {
  .pot-grid { grid-template-columns: 1fr; }
  .pot-card-login { margin-top: 0; }
  .announce-admin-item { grid-template-columns: 1fr; }
  .announce-admin-item > img { width: 100%; max-width: 14rem; }
  .announce-actions { flex-direction: column; align-items: stretch; }
}

/* Respect the hidden attribute even on grid/flex components. */
[hidden] { display: none !important; }
.admin-side-form { align-self: start; align-content: start; }

/* ---------------------------------------------------------------------------
   Tier-priced rewards
   ------------------------------------------------------------------------- */
.reward-price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
}

.reward-price strong { font-size: 1.15rem; }

.reward-price s {
  color: var(--muted);
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.reward-tier-tag {
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  background: rgba(229, 171, 47, 0.16);
  color: #8a5a00;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reward-locked {
  color: var(--ink-soft);
  font-weight: 850;
  font-size: 0.9rem;
}

.tier-price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.tier-price-input {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 850;
  color: var(--ink-soft);
}

.reward-tier-prices span {
  display: block;
  white-space: nowrap;
  font-size: 0.88rem;
}

.reward-tier-prices b { display: inline-block; min-width: 3.4rem; }
.reward-tier-prices em { color: var(--muted); font-style: normal; }
.reward-edit-row td { background: var(--surface-soft, #f6f8fc); }

/* Admin: Books */
.books-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.books-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.books-waiting {
  margin-top: 0.35rem;
  color: #a15c00;
  font-weight: 800;
}

.books-metrics .metric small {
  display: block;
  margin-top: 0.4rem;
}

.books-negative {
  color: #c0392b;
}

.books-strong td {
  font-weight: 800;
}

.books-table td,
.books-table th {
  white-space: nowrap;
}

.books-count-form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.books-count-form input {
  width: 8.5rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.btn.small {
  min-height: 2.1rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

.books-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .books-two {
    grid-template-columns: 1fr;
  }
}

.books-lock {
  max-width: 34rem;
}

.books-inv-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.books-inv-total {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.books-inv-total span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.books-inv-total strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.35rem;
}

.books-muted td {
  opacity: 0.6;
}

.books-inv-edit summary {
  list-style: none;
  cursor: pointer;
}

.books-inv-edit summary::-webkit-details-marker {
  display: none;
}

.books-inv-edit[open] form {
  min-width: 15rem;
  margin-top: 0.5rem;
  white-space: normal;
}

.books-inv-pending {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
}

.books-inv-form {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  align-items: end;
}

.books-inv-form h4 {
  grid-column: 1 / -1;
  margin: 0;
}

.books-inv-form [hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .books-inv-totals {
    grid-template-columns: 1fr;
  }
}

.books-detailed > summary {
  cursor: pointer;
  padding: 0.25rem 0;
}

.books-net strong {
  color: #0e5fe0;
}

.books-type {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.books-type-credit { background: #d9f0d9; }
.books-type-debt { background: #fadada; }
.books-type-funds { background: #d9e6fa; }
.books-type-expense { background: #ffedcc; }
.books-type-investment { background: #ebdefa; }

.books-note {
  white-space: normal !important;
  min-width: 14rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.books-checklist {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.4rem;
}

.books-checklist li label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.books-checklist input {
  width: 1.15rem;
  height: 1.15rem;
}

.books-check-done label {
  color: var(--muted);
  background: #f4f6fb;
}

.books-check-overdue label {
  border-color: #e8a5a5;
  background: #fdf1f1;
}

.books-part {
  margin: 1.6rem 0 0.25rem;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.books-type-salary { background: #fff7bf; }

.books-sales-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .books-sales-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.books-delete {
  color: #c0392b;
}

.books-unsynced {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #fff1d6;
  color: #8a5300;
  font-size: 0.72rem;
  font-weight: 800;
}

.books-removed td {
  text-decoration: line-through;
  opacity: 0.55;
}

.books-removed td .btn {
  text-decoration: none;
}

.books-head-unsynced {
  border: 2px solid #f0b54a;
}

/* Books: spreadsheet-style grids */
.books-grid,
.books-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.86rem;
}

.books-grid th,
.books-grid td {
  border: 1px solid #dfe3eb;
  padding: 0.3rem 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}

.books-grid th {
  background: #f1f3f6;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #5f6b7a;
  text-align: left;
}

.books-grid .books-rownum {
  background: #f8f9fb;
  color: #8a94a6;
  font-size: 0.72rem;
  text-align: center;
  width: 2.6rem;
}

.books-grid .books-num {
  text-align: right;
}

.books-grid .books-note {
  white-space: normal !important;
  min-width: 16rem;
  font-size: 0.8rem;
}

.books-grid tr.books-auto td {
  background: #f6f7f9;
}

.books-grid tr.books-row-unsynced td:first-child {
  box-shadow: inset 3px 0 0 #f0b54a;
}

.books-cell-input {
  width: 100%;
  min-width: 7rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 0.2rem 0.35rem;
  font: inherit;
  text-align: inherit;
}

.books-cell-input:hover {
  border-color: #c8d4eb;
}

.books-cell-input:focus {
  outline: none;
  border-color: #1a73e8;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.books-cell-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.books-cell-btn:hover {
  background: #eef1f6;
}

.books-table th,
.books-table td {
  border: 1px solid #dfe3eb;
  padding: 0.35rem 0.55rem;
}

.books-table th {
  background: #f1f3f6;
}

.books-sales-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .books-sales-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.books-grid td:last-child,
.books-grid th:last-child {
  width: 4.5rem;
  min-width: 4.5rem;
  text-align: center;
}

/* ---------------------------------------------------------------------------
   Admin MIR4 calculator
   ------------------------------------------------------------------------- */
.calc-hero strong { font-size: 2rem; }
.calc-hero small, .calc-admin .metric small { display: block; margin-top: 0.2rem; color: var(--muted); font-weight: 700; }
.calc-good { border-color: rgba(21, 134, 95, 0.45); background: linear-gradient(135deg, #effaf5, #fff); }
.calc-good strong { color: #15865f; }
.calc-bad { border-color: rgba(205, 52, 52, 0.45); background: linear-gradient(135deg, #fff1f1, #fff); }
.calc-bad strong { color: #c23434; }
.calc-good-text { color: #15865f; }
.calc-bad-text { color: #c23434; }

.calc-steps {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.calc-steps li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.98rem;
}

.calc-steps li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-steps li.calc-total { border-bottom: 0; border-top: 2px solid var(--line-strong); margin-top: 0.2rem; font-weight: 850; }
.calc-steps li.calc-total b { font-size: 1.15rem; }
.calc-line { margin: 0.6rem 0 0; line-height: 1.55; }

/* ---------------------------------------------------------------------------
   Grouped admin menu
   ------------------------------------------------------------------------- */
.nav-list.nav-grouped { display: grid; gap: 0.55rem; }
.nav-group { display: grid; gap: 0.3rem; }
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: none;
  padding: 0.35rem 0.4rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}
.nav-group-toggle:hover { color: var(--ink); }
.nav-group.has-active > .nav-group-toggle { color: var(--blue); }
.nav-chevron { transition: transform 0.18s ease; transform: rotate(-90deg); }
.nav-group.open .nav-chevron { transform: rotate(0deg); }
.nav-group-items { display: grid; gap: 0.3rem; }

.calc-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin-bottom: 0.5rem; }
.calc-mode label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 850;
  text-align: center;
  cursor: pointer;
}
.calc-mode input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; border: 0; }
.calc-mode label:has(input:checked) { border-color: var(--blue); background: rgba(18, 111, 235, 0.1); color: var(--blue); }
.calc-mode label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.calc-empty { border: 2px dashed var(--line-strong); }

@media (max-width: 1080px) {
  .nav-list.nav-grouped { grid-template-columns: 1fr; overflow-x: visible; }
  .nav-group-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.calc-two { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.calc-big { padding: 1.4rem 1.5rem; display: grid; gap: 0.35rem; }
.calc-big span { color: var(--muted); font-weight: 900; letter-spacing: 0.1em; font-size: 0.85rem; }
.calc-big strong { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; font-variant-numeric: tabular-nums; }
.calc-cost { border-color: rgba(18, 111, 235, 0.45); background: linear-gradient(135deg, #eef5ff, #fff); }
.calc-cost strong { color: var(--blue); }
@media (max-width: 700px) { .calc-two { grid-template-columns: 1fr; } }
#mir4-calc-results { align-self: start; }
.calc-sell { border-color: rgba(21, 134, 95, 0.45); background: linear-gradient(135deg, #effaf5, #fff); }
.calc-sell strong { color: #15865f; }
@media (max-width: 1180px) { .calc-two { grid-template-columns: 1fr; } }
