/* ============================================================
   STORYTIME COINSHOP — Admin Panel styles
   Builds on /colors_and_type.css (imported globally in index.html).
   ============================================================ */

html, body, #root { height: 100%; }
body { overflow-x: hidden; }

/* ---------- Background orbs ---------- */
.orbs-bg {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}
.orb-lila  { width: 520px; height: 520px; left: -160px; top: -120px; background: radial-gradient(circle, rgba(169,114,244,0.9), transparent 70%); animation: drift1 38s var(--ease-in-out) infinite; }
.orb-coral { width: 460px; height: 460px; right: -120px; top: 30%;  background: radial-gradient(circle, rgba(255,126,139,0.85), transparent 70%); animation: drift2 46s var(--ease-in-out) infinite; }
.orb-aqua  { width: 380px; height: 380px; left: 35%; bottom: -160px; background: radial-gradient(circle, rgba(110,224,210,0.7), transparent 70%); animation: drift3 52s var(--ease-in-out) infinite; }

@keyframes drift1 {
  0%,100% { transform: translate3d(0,0,0); }
  50%     { transform: translate3d(60px,40px,0); }
}
@keyframes drift2 {
  0%,100% { transform: translate3d(0,0,0); }
  50%     { transform: translate3d(-80px,30px,0); }
}
@keyframes drift3 {
  0%,100% { transform: translate3d(0,0,0); }
  50%     { transform: translate3d(40px,-60px,0); }
}

/* ============================================================
   App shell
   ============================================================ */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-content {
  flex: 1;
  padding: 24px 32px 64px;
  min-width: 0;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(25, 12, 50, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 20px;
  gap: 24px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--border-hairline);
}
.brand-mark {
  width: 40px; height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(169,114,244,0.55));
}
.brand-text { display: flex; flex-direction: column; gap: 0; line-height: 1; }
.brand-wordmark {
  font-family: var(--font-display);
  font-size: 24px;
  background: var(--grad-sunset);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.brand-sub {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding: 8px 12px 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav-item:hover {
  background: rgba(196,154,255,0.06);
  color: var(--fg-1);
}
.nav-item.is-active {
  background: linear-gradient(135deg, rgba(169,114,244,0.22), rgba(138,79,226,0.12));
  border-color: rgba(196,154,255,0.32);
  color: var(--fg-1);
  box-shadow: 0 0 24px rgba(169,114,244,0.18);
}
.nav-item .nav-icon { width: 18px; font-size: 15px; color: var(--fg-3); }
.nav-item.is-active .nav-icon { color: var(--lila-300); }
.nav-label { flex: 1; }
.nav-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(20,10,40,0.6);
  color: var(--fg-3);
  border: 1px solid var(--border-hairline);
}
.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.nav-dot-aqua { background: var(--aqua); box-shadow: 0 0 10px var(--aqua); }

.sidebar-foot { padding-top: 14px; border-top: 1px solid var(--border-hairline); }
.server-card {
  background: rgba(20, 10, 40, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
}
.server-card-row { display: flex; align-items: center; gap: 10px; }
.server-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}
.server-name { font-size: 13px; font-weight: 600; }
.server-card-meta {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--fg-3);
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  background: rgba(21, 8, 40, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-hairline);
}
.topbar-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 0 0 auto; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-3); }
.crumb {}
.crumb-current { color: var(--fg-1); font-weight: 600; }
.crumb-sep { font-size: 9px; color: var(--fg-4); }
.topbar-title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.015em;
  color: var(--fg-1);
}

.topbar-right { display: flex; align-items: center; gap: 14px; flex: 1 1 auto; min-width: 0; justify-content: flex-end; }

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 0 12px 0 38px;
  width: 320px;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 320px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.topbar-search:focus-within {
  border-color: var(--border-bright);
  box-shadow: var(--glow-lila);
}
.topbar-search > i { position: absolute; left: 14px; top: 13px; color: var(--fg-3); font-size: 13px; }
.topbar-search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 14px;
}
.topbar-search input::placeholder { color: var(--fg-4); }
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255,247,236,0.06);
  border: 1px solid var(--border-hairline);
  color: var(--fg-3);
}

.notif-btn { position: relative; }
.notif-pip {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 10px var(--coral);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  background: rgba(35,18,65,0.6);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  color: rgba(20, 10, 40, 0.85);
  font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,247,236,0.12);
  position: relative;
}
.user-avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.user-avatar.xl { width: 64px; height: 64px; font-size: 26px; }
.online-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 8px var(--success);
}
.user-info { line-height: 1.15; }
.user-name { font-size: 13px; font-weight: 600; color: var(--fg-1); }
.user-role { font-size: 11px; color: var(--fg-3); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  border-radius: 14px;
  padding: 0 18px;
  height: 40px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out),
              filter var(--dur-fast) var(--ease-out),
              transform 80ms var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  color: inherit;
}
.btn:active:not(:disabled) { transform: scale(0.97); filter: brightness(0.92); }
.btn:disabled, .btn.is-disabled { cursor: not-allowed; opacity: 0.5; }
.btn i { font-size: 13px; }

.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 12px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }

.btn-primary {
  color: #fff;
  background: var(--grad-lila);
  border-color: rgba(255,247,236,0.08);
  box-shadow: var(--glow-lila);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-reward {
  color: #fff;
  background: var(--grad-sunset);
  box-shadow: var(--glow-coral);
  font-weight: 700;
}
.btn-reward:hover:not(:disabled) { filter: brightness(1.06); }

.btn-secondary {
  color: var(--fg-1);
  background: rgba(45,22,80,0.55);
  border-color: var(--border-medium);
}
.btn-secondary:hover:not(:disabled) { background: rgba(50, 26, 90, 0.75); border-color: var(--border-bright); }

.btn-ghost {
  color: var(--fg-2);
  background: transparent;
  border-color: var(--border-soft);
}
.btn-ghost:hover:not(:disabled) { background: rgba(196,154,255,0.06); color: var(--fg-1); border-color: var(--border-bright); }

.btn-danger {
  color: var(--danger);
  background: rgba(255,110,138,0.08);
  border-color: rgba(255,110,138,0.4);
}
.btn-danger:hover:not(:disabled) { background: rgba(255,110,138,0.16); }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  position: relative;
}
.icon-btn:hover { background: rgba(196,154,255,0.1); color: var(--fg-1); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn-frosted {
  background: rgba(35,18,65,0.55);
  border-color: var(--border-soft);
}

/* ============================================================
   Cards & layout primitives
   ============================================================ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  position: relative;
}

/* ============================================================
   Pills / badges
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill i { font-size: 10px; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pill-success { background: rgba(95,216,166,0.12);  color: var(--success); border-color: rgba(95,216,166,0.4); }
.pill-warning { background: rgba(255,194,103,0.14); color: var(--warning); border-color: rgba(255,194,103,0.4); }
.pill-danger  { background: rgba(255,110,138,0.14); color: var(--danger);  border-color: rgba(255,110,138,0.4); }
.pill-info    { background: rgba(143,183,255,0.14); color: var(--info);    border-color: rgba(143,183,255,0.4); }
.pill-aqua    { background: rgba(110,224,210,0.14); color: var(--aqua);    border-color: rgba(110,224,210,0.4); }
.pill-lila    { background: rgba(169,114,244,0.16); color: var(--lila-200);border-color: rgba(196,154,255,0.4); }
.pill-coral   { background: rgba(255,126,139,0.16); color: var(--coral);   border-color: rgba(255,126,139,0.4); }
.pill-muted   { background: rgba(167,141,200,0.1);  color: var(--fg-3);    border-color: var(--border-hairline); }

/* ============================================================
   Inputs / fields
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
}
.field-req { color: var(--coral); margin-left: 3px; }
.field-hint { font-size: 11px; color: var(--fg-3); }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap.has-leading .input { padding-left: 38px; }
.input-leading {
  position: absolute;
  left: 14px;
  color: var(--fg-3);
  pointer-events: none;
  font-size: 13px;
}
.input-trailing {
  position: absolute;
  right: 12px;
  color: var(--fg-3);
  font-size: 12px;
}
.suffix { color: var(--fg-3); font-size: 13px; }
.input {
  width: 100%;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-1);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input:focus { border-color: var(--border-bright); box-shadow: var(--glow-lila); }
.input.is-numeric { font-variant-numeric: tabular-nums; }
.input.textarea { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input.select { appearance: none; padding-right: 36px; cursor: pointer; }
.select-chev { position: absolute; right: 14px; color: var(--fg-3); pointer-events: none; font-size: 11px; }

/* ============================================================
   Toggle
   ============================================================ */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--fg-2);
}
.toggle input { display: none; }
.toggle-slider {
  position: relative;
  width: 36px; height: 20px;
  background: rgba(20, 10, 40, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  transition: background var(--dur-fast) var(--ease-out);
}
.toggle-slider::after {
  content: "";
  position: absolute;
  left: 2px; top: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--fg-3);
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.toggle input:checked + .toggle-slider {
  background: rgba(169,114,244,0.6);
  border-color: rgba(196,154,255,0.6);
  box-shadow: var(--glow-lila);
}
.toggle input:checked + .toggle-slider::after {
  transform: translateX(16px);
  background: var(--fg-1);
}

/* ============================================================
   Seg control
   ============================================================ */
.seg-control {
  display: inline-flex;
  background: rgba(20, 10, 40, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  background: transparent;
  border: none;
  color: var(--fg-3);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.seg-btn:hover { color: var(--fg-1); }
.seg-btn.is-active {
  background: var(--grad-lila);
  color: #fff;
  box-shadow: 0 0 12px rgba(169,114,244,0.4);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-scrim {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: scrim-in var(--dur-base) var(--ease-out);
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: rgba(30, 14, 60, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-medium);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modal-in var(--dur-base) var(--ease-out);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-hairline);
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--fg-1); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot { padding: 18px 24px; border-top: 1px solid var(--border-hairline); }
.modal-footer-inner { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   Toasts
   ============================================================ */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  min-width: 280px;
  max-width: 380px;
  background: rgba(35, 18, 65, 0.92);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  animation: toast-in var(--dur-base) var(--ease-spring);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast-icon { font-size: 16px; }
.toast-msg { flex: 1; font-size: 13px; color: var(--fg-1); font-weight: 500; }
.toast-success { border-color: rgba(95,216,166,0.5); box-shadow: var(--shadow-card), 0 0 20px rgba(95,216,166,0.18); }
.toast-success .toast-icon { color: var(--success); }
.toast-danger  { border-color: rgba(255,110,138,0.5); box-shadow: var(--shadow-card), 0 0 20px rgba(255,110,138,0.18); }
.toast-danger  .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--info); }

/* ============================================================
   Type helpers used across pages
   ============================================================ */
.mu { color: var(--fg-3); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.caption { font-size: 12px; color: var(--fg-3); }
.link, .link-btn { color: var(--lila-300); cursor: pointer; background: none; border: none; font-size: 13px; font-weight: 600; padding: 0; }
.link-btn:hover { color: var(--lila-200); }

/* ============================================================
   Dashboard
   ============================================================ */
.welcome-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 4px 24px;
}
.welcome-title { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 4px; }
.welcome-sub { color: var(--fg-2); font-size: 15px; max-width: 640px; }
.welcome-actions { display: flex; gap: 10px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card {}
.stat-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.stat-card-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 14px;
}
.stat-card-value {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--fg-1);
}
.stat-card-delta {
  font-size: 11px;
  margin-top: 8px;
  font-weight: 600;
}
.tone-success { color: var(--success); }
.tone-warning { color: var(--warning); }
.tone-danger  { color: var(--danger); }
.tone-muted   { color: var(--fg-3); }

.dash-2col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
.dash-right { display: flex; flex-direction: column; gap: 16px; }

.dash-card {}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 14px;
}
.card-head h3, .card-head h4 { margin: 4px 0 0; }
.card-title { font-size: 18px; font-weight: 700; margin: 4px 0 0; }

.tx-list { padding: 0 8px 8px; }
.tx-row {
  display: grid;
  grid-template-columns: 100px 1fr 100px 130px 90px;
  gap: 12px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 10px;
  transition: background var(--dur-fast) var(--ease-out);
}
.tx-row:hover { background: rgba(196,154,255,0.06); }
.tx-row + .tx-row { border-top: 1px solid var(--border-hairline); border-radius: 0; }
.tx-row:first-child { border-radius: 10px 10px 0 0; }
.tx-row:last-child { border-radius: 0 0 10px 10px; }
.tx-id { font-size: 12px; color: var(--fg-3); }
.tx-product { font-size: 14px; font-weight: 600; color: var(--fg-1); }
.tx-customer { font-size: 12px; color: var(--fg-3); }
.tx-price { font-size: 14px; font-weight: 700; color: var(--fg-1); display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.tx-ago { font-size: 11px; color: var(--fg-4); text-align: right; }

.hero-cta {
  background:
    linear-gradient(135deg, rgba(255,210,122,0.08), rgba(233,76,208,0.08) 50%, rgba(138,79,226,0.08)),
    var(--bg-card);
  border-color: var(--border-warm);
}
.hero-cta-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 8px 0 14px; }
.hero-cta-meta {
  display: flex; gap: 24px;
  font-size: 12px; color: var(--fg-3);
  margin-bottom: 14px;
}
.hero-cta-meta strong { display: block; font-size: 18px; color: var(--fg-1); margin-top: 2px; }
.hero-cta-bar {
  height: 6px;
  background: rgba(20, 10, 40, 0.6);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.hero-cta-bar-fill {
  height: 100%;
  background: var(--grad-sunset);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(255,126,139,0.6);
}
.hero-cta-foot { display: flex; align-items: center; justify-content: space-between; }

.top-items { display: flex; flex-direction: column; gap: 2px; }
.top-item {
  display: grid;
  grid-template-columns: 28px 1fr 50px 90px;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 8px;
  transition: background var(--dur-fast) var(--ease-out);
}
.top-item:hover { background: rgba(196,154,255,0.06); }
.top-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--lila-300);
  font-weight: 700;
}
.top-name { font-size: 13px; font-weight: 600; }
.top-units { font-size: 11px; color: var(--fg-3); text-align: right; }
.top-val { font-size: 13px; font-weight: 700; text-align: right; }

/* Sparkline */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding-top: 8px;
}
.spark-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--lila-400), var(--lila-600));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  transition: filter var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.spark-bar:hover { filter: brightness(1.2); }
.spark-tip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
  padding: 2px 6px;
  background: rgba(20, 10, 40, 0.9);
  border-radius: 4px;
  color: var(--fg-1);
}
.spark-bar:hover .spark-tip { display: block; }

/* ============================================================
   Filter bar / data table
   ============================================================ */
.filter-bar { margin-bottom: 16px; }
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-row > .input-wrap { width: 280px; }
.filter-row > .input-wrap.has-leading { width: 280px; }
.filter-row .seg-control + .seg-control { margin-left: 4px; }
.filter-toggles { display: flex; gap: 16px; margin-left: 6px; }

.bulk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(169,114,244,0.12);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
}
.bulk-count { font-size: 13px; font-weight: 600; color: var(--fg-1); margin-right: 6px; }

.data-table-card { overflow: hidden; }
.data-table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: left;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border-hairline);
  background: rgba(20, 10, 40, 0.35);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background var(--dur-fast) var(--ease-out);
}
.data-table tbody tr:nth-child(even) { background: rgba(255,247,236,0.015); }
.data-table tbody tr:hover { background: rgba(196,154,255,0.06); }
.data-table tbody tr.is-selected { background: rgba(169,114,244,0.14); }
.data-table tbody tr:last-child td { border-bottom: none; }
.th-num, .td-num { text-align: right; }
.th-sort { cursor: pointer; user-select: none; }
.sort-icon { color: var(--fg-4); font-size: 11px; margin-left: 6px; }
.sort-icon.is-active { color: var(--lila-300); }
.td-name { color: var(--fg-1); font-weight: 600; }
.td-rank { color: var(--lila-300); font-family: var(--font-mono); font-weight: 700; }
input[type="checkbox"] {
  appearance: none;
  width: 16px; height: 16px;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
}
input[type="checkbox"]:checked {
  background: var(--grad-lila);
  border-color: transparent;
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.row-actions { display: inline-flex; gap: 2px; }
.row-actions .icon-btn { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }

.type-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 9px;
  background: rgba(20, 10, 40, 0.45);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  color: var(--fg-2);
}
.type-tag i { color: var(--lila-300); font-size: 11px; }

.rarity-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
}

.strike-price {
  text-decoration: line-through;
  color: var(--fg-4);
  font-size: 11px;
  margin-right: 8px;
}
.price-now {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg-1);
}

.empty-row {
  padding: 60px 20px !important;
  text-align: center;
  color: var(--fg-3);
}
.empty-row i { font-size: 32px; color: var(--fg-4); display: block; margin-bottom: 10px; }

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border-hairline);
}
.pagination { display: inline-flex; align-items: center; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}
.page-btn:hover { background: rgba(196,154,255,0.06); }
.page-btn.is-active {
  background: var(--grad-lila);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow-lila);
}

/* ============================================================
   Item editor modal
   ============================================================ */
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.preview-strip {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-hairline);
}
.item-preview {
  display: flex; gap: 14px; align-items: center;
  padding: 14px;
  background: rgba(20, 10, 40, 0.4);
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
}
.item-preview-img {
  width: 64px; height: 64px;
  border-radius: 12px;
  background: var(--grad-lila);
  display: grid; place-items: center;
  color: #fff; font-size: 22px;
  box-shadow: var(--glow-lila);
}
.item-preview-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.item-preview-name { font-size: 14px; font-weight: 700; }
.item-preview-price { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* ============================================================
   Categories
   ============================================================ */
.drag-cell { cursor: grab; color: var(--fg-4); }
.nest-arrow { margin-right: 8px; font-size: 11px; opacity: 0.7; }
.cat-style-swatch {
  width: 56px; height: 24px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

/* ============================================================
   Rarities
   ============================================================ */
.rarity-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.rarity-tile {
  position: relative;
  padding: 20px 16px 14px;
  border-radius: 18px;
  border: 1px solid;
  overflow: hidden;
}
.rarity-glow {
  position: absolute;
  top: -40px; right: -40px;
  width: 110px; height: 110px;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.32;
}
.rarity-name { font-size: 18px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; margin: 6px 0 12px; }
.rarity-chance { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; color: var(--fg-1); }
.rarity-pct { font-size: 14px; font-weight: 700; color: var(--fg-3); margin-left: 3px; }
.rarity-tile-foot { display: flex; gap: 4px; margin-top: 14px; }

.chance-bar {
  display: flex;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: rgba(20, 10, 40, 0.6);
}
.chance-bar-seg {
  position: relative;
  display: grid; place-items: center;
  transition: filter var(--dur-fast) var(--ease-out);
}
.chance-bar-seg:hover { filter: brightness(1.15); }
.chance-bar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: rgba(20, 8, 40, 0.85);
}
.chance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--fg-2);
}
.chance-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chance-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ============================================================
   Packages
   ============================================================ */
.package-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.package-card {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.package-hero {
  position: relative;
  height: 140px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px;
  overflow: hidden;
}
.package-hero-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 120%, rgba(255,255,255,0.15), transparent 40%),
    linear-gradient(180deg, transparent 0%, rgba(17,7,36,0.3) 100%);
}
.package-tier {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,247,236,0.95);
  background: rgba(20, 10, 40, 0.4);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,247,236,0.16);
}
.package-deco {
  position: absolute;
  right: -10px;
  bottom: -30px;
  font-size: 120px;
  color: rgba(255,255,255,0.12);
  z-index: 1;
}
.package-body { padding: 18px; }
.package-name { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.package-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.package-meta > div { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.package-meta .caption { text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; }
.package-meta strong, .package-meta .num { color: var(--fg-1); font-weight: 600; }
.package-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border-hairline); }
.package-price { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; }
.package-price .num { font-variant-numeric: tabular-nums; }

/* ============================================================
   Statistics
   ============================================================ */
.stats-2col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.chart-legend { display: flex; gap: 12px; align-items: center; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.big-chart {
  position: relative;
  height: 240px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 0 0 24px 50px;
}
.big-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}
.big-bar {
  background: linear-gradient(180deg, var(--lila-300), var(--lila-600));
  border-radius: 4px 4px 0 0;
  transition: filter var(--dur-fast) var(--ease-out);
  min-height: 6px;
  box-shadow: 0 0 12px rgba(169,114,244,0.25);
}
.big-bar-wrap:hover .big-bar { filter: brightness(1.18); }
.big-bar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
.big-chart-grid {
  position: absolute;
  inset: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.big-chart-grid span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-4);
  width: 46px;
  text-align: right;
  border-bottom: 1px dashed var(--border-hairline);
  padding-right: 8px;
}

.cat-breakdown { display: flex; flex-direction: column; gap: 12px; }
.cat-bd-row {
  display: grid;
  grid-template-columns: 110px 1fr 40px 90px;
  align-items: center;
  gap: 10px;
}
.cat-bd-name { font-size: 13px; font-weight: 600; }
.cat-bd-bar-wrap {
  height: 6px;
  background: rgba(20, 10, 40, 0.6);
  border-radius: 999px;
  overflow: hidden;
}
.cat-bd-bar { height: 100%; border-radius: 999px; }
.cat-bd-pct { text-align: right; }
.cat-bd-val { font-size: 13px; font-weight: 700; text-align: right; }

.share-bar {
  position: relative;
  height: 8px;
  background: rgba(20, 10, 40, 0.6);
  border-radius: 999px;
  overflow: visible;
  width: 140px;
}
.share-bar-fill {
  height: 100%;
  background: var(--grad-lila);
  border-radius: 999px;
}
.share-bar-pct {
  position: absolute;
  right: -36px;
  top: -4px;
  font-size: 11px;
  color: var(--fg-2);
}

/* ============================================================
   Notifications
   ============================================================ */
.notif-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.notif-card {}
.notif-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.discord-channel { display: flex; align-items: center; gap: 8px; color: var(--info); font-size: 13px; }
.discord-channel i { font-size: 16px; }
.notif-card-title { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.notif-card-mentions { margin-bottom: 14px; }
.mention-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(143,183,255,0.14);
  color: var(--info);
  border: 1px solid rgba(143,183,255,0.3);
  border-radius: 6px;
}
.notif-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border-hairline); }
.notif-card-time { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-3); }

/* ============================================================
   Users
   ============================================================ */
.users-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.user-card-large {}
.user-card-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.user-card-meta-block { flex: 1; }
.user-card-username { font-size: 17px; font-weight: 700; color: var(--fg-1); }
.user-card-discord { font-size: 11px; color: var(--fg-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.user-card-discord i { color: var(--info); }

.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.perm-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(20, 10, 40, 0.4);
  border: 1px solid var(--border-hairline);
  font-size: 12px;
  color: var(--fg-4);
  position: relative;
}
.perm-chip i { font-size: 12px; }
.perm-chip.is-on {
  background: rgba(169,114,244,0.12);
  border-color: var(--border-medium);
  color: var(--fg-1);
}
.perm-chip.is-on i { color: var(--lila-300); }
.perm-check { position: absolute; right: 10px; color: var(--success) !important; font-size: 10px !important; }

/* ============================================================
   Settings
   ============================================================ */
.settings-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.settings-2col .field + .field { margin-top: 14px; }
.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: rgba(20, 10, 40, 0.4);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
}
.danger-row.is-danger { border-color: rgba(255,110,138,0.3); background: rgba(255,110,138,0.05); }

/* ============================================================
   Login
   ============================================================ */
.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.login-photo { position: relative; overflow: hidden; }
.login-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-photo-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 40%, rgba(17,7,36,0.7) 100%),
    linear-gradient(180deg, rgba(17,7,36,0.2), rgba(17,7,36,0.5));
}
.login-panel { display: grid; place-items: center; padding: 40px; position: relative; }
.login-mark { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 8px 20px rgba(169,114,244,0.55)); margin-bottom: 12px; }
.login-wordmark {
  font-family: var(--font-display);
  font-size: 42px;
  background: var(--grad-sunset);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.login-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-top: 6px;
}
.discord-btn {
  width: 100%;
  display: flex; align-items: center; gap: 12px; justify-content: center;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 0 22px;
  height: 52px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(88,101,242,0.45);
  transition: filter var(--dur-fast) var(--ease-out), transform 80ms;
}
.discord-btn i:first-child { font-size: 20px; }
.discord-btn:hover { filter: brightness(1.08); }
.discord-btn:active { transform: scale(0.97); filter: brightness(0.92); }
.login-foot { margin-top: 20px; text-align: center; }
.login-credits {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}

/* ============================================================
   Layout-tightening for smaller widths
   ============================================================ */
@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .package-grid { grid-template-columns: repeat(2, 1fr); }
  .rarity-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .dash-2col, .stats-2col, .settings-2col, .notif-grid, .users-grid { grid-template-columns: 1fr; }
  .filter-row > .input-wrap { width: 100%; }
}
