:root {
  color-scheme: dark;
  --lime: #c8ff3d;
  --lime-bright: #e4ff80;
  --lime-deep: #6b9818;
  --lime-glow: rgba(200, 255, 61, .2);
  --bg: #0b1008;
  --surface: rgba(20, 27, 17, .88);
  --surface-hover: #202b1b;
  --line: rgba(206, 244, 132, .16);
  --line-strong: rgba(216, 255, 135, .36);
  --removed: #ff947f;
  --removed-line: rgba(255, 148, 127, .3);
  --removed-bg: rgba(75, 33, 27, .48);
  --text: #f5f8ee;
  --muted: #9ea996;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 7% -10%, rgba(173, 255, 49, .16), transparent 30rem),
    radial-gradient(circle at 98% 16%, rgba(111, 159, 13, .14), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: .32;
  background-image: linear-gradient(rgba(208, 255, 139, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(208, 255, 139, .025) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }

.dashboard-shell { width: min(1180px, calc(100% - 40px)); margin: auto; padding: 42px 0 72px; }

.hero {
  position: relative;
  display: flex;
  min-height: 248px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(122deg, rgba(31, 46, 18, .98), rgba(14, 20, 11, .94));
  box-shadow: 0 22px 70px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .035);
}

.hero::before, .hero::after { position: absolute; content: ""; pointer-events: none; }
.hero::before { width: 350px; height: 350px; right: -110px; top: -160px; border: 1px solid rgba(210, 255, 119, .24); border-radius: 50%; box-shadow: 0 0 0 34px rgba(203, 255, 84, .04), 0 0 0 69px rgba(203, 255, 84, .026); }
.hero::after { width: 270px; height: 270px; right: 34px; bottom: -205px; border-radius: 50%; background: var(--lime); filter: blur(82px); opacity: .16; }
.hero-copy, .hero-actions { position: relative; z-index: 1; }
.brand-line { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.brand-mark { display: inline-grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(234, 255, 174, .7); border-radius: 10px; background: var(--lime); color: #1a260f; font-size: .67rem; font-weight: 900; letter-spacing: -.04em; box-shadow: 0 0 24px var(--lime-glow); }
.eyebrow, .section-kicker { margin: 0; color: var(--lime); font-size: .7rem; font-weight: 850; letter-spacing: .15em; }
.eyebrow span, .live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 11px var(--lime); }
.hero h1 { max-width: 720px; margin: 0; font-size: clamp(2.35rem, 5.3vw, 4.9rem); letter-spacing: -.07em; line-height: .95; }
.hero h1 em { color: var(--lime); font-style: normal; }
.subtitle { max-width: 570px; margin: 17px 0 0; color: #c2cab9; font-size: 1rem; }
.hero-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 12px; }
.refresh-button, .export-button { border: 1px solid rgba(226, 255, 149, .55); border-radius: 9px; background: var(--lime); color: #18210e; font-size: .82rem; font-weight: 800; transition: transform .18s, background .18s, box-shadow .18s; }
.refresh-button { padding: 10px 13px; }
.refresh-button span { display: inline-block; margin-right: 3px; font-size: 1rem; }
.refresh-button:hover, .export-button:hover { transform: translateY(-1px); background: var(--lime-bright); box-shadow: 0 7px 20px var(--lime-glow); }
.refresh-button.is-loading span { animation: spin .7s linear infinite; }
.updated { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(8, 12, 7, .42); color: var(--muted); font-size: .77rem; white-space: nowrap; }
.live-dot { width: 6px; height: 6px; margin-bottom: 1px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card, .panel, .item-card { border: 1px solid var(--line); background: var(--surface); box-shadow: inset 0 1px rgba(255, 255, 255, .025); }
.stat-card { position: relative; display: flex; min-width: 0; min-height: 146px; flex-direction: column; overflow: hidden; padding: 20px; border-radius: 14px; }
.stat-card::before { position: absolute; top: 0; left: 20px; width: 36px; height: 2px; content: ""; background: var(--lime); box-shadow: 0 0 13px var(--lime); }
.stat-label, .stat-note { color: var(--muted); font-size: .79rem; }
.stat-card strong { margin: auto 0 6px; overflow: hidden; font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -.055em; text-overflow: ellipsis; white-space: nowrap; }
.top-item strong { color: var(--lime-bright); font-size: clamp(1.02rem, 1.65vw, 1.27rem); letter-spacing: -.03em; }

.panel { margin: 14px 0 48px; padding: 25px; border-radius: 16px; background: linear-gradient(130deg, rgba(28, 38, 21, .93), rgba(18, 24, 15, .88)); }
.panel-heading, .catalog-toolbar, .item-title, .item-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading h2, .catalog-toolbar h2 { margin: 5px 0 0; font-size: 1.35rem; letter-spacing: -.035em; }
.panel-heading p:not(.section-kicker), .catalog-toolbar p:not(.section-kicker) { margin: 5px 0 0; color: var(--muted); font-size: .83rem; }
.count-pill { flex: none; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--lime); background: rgba(190, 255, 61, .08); font-size: .75rem; font-weight: 800; }

.top-products-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 34px; margin: 24px 0 0; padding: 0; list-style: none; }
.top-products-list li { display: grid; min-width: 0; grid-template-columns: 31px minmax(0, 1fr) auto; gap: 8px; padding: 13px 0; border-bottom: 1px solid rgba(216, 255, 135, .105); }
.top-products-list .top-products-empty { display: block; grid-column: 1 / -1; color: var(--muted); }
.rank { align-self: start; color: var(--lime); font-size: .72rem; font-weight: 900; letter-spacing: .04em; }
.product-name { overflow: hidden; font-size: .9rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.top-products-list strong { color: var(--lime-bright); font-size: .78rem; white-space: nowrap; }
.product-meter { grid-column: 2 / 4; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(230, 255, 183, .1); }
.product-meter-fill, .progress-fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--lime-deep), var(--lime)); box-shadow: 0 0 12px rgba(200, 255, 61, .33); transition: width .55s cubic-bezier(.2, .8, .2, 1); }

.catalog-toolbar { margin-bottom: 19px; }
.catalog-toolbar h2 { font-size: 1.52rem; }
.catalog-actions { display: flex; align-items: center; gap: 9px; }
.search, .sort-control { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(17, 24, 14, .78); }
.search { gap: 8px; padding: 0 11px; }
.search span { color: var(--lime); font-size: 1.25rem; transform: rotate(-20deg); }
.search input { width: 170px; padding: 11px 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .85rem; }
.search input::placeholder { color: #718069; }
.sort-control { gap: 7px; padding-left: 10px; color: var(--muted); font-size: .74rem; }
.sort-control select { padding: 10px 28px 10px 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .82rem; }
.sort-control option { background: #192115; }
.export-button { padding: 10px 12px; white-space: nowrap; }
.export-button:disabled { border-color: var(--line); background: #273022; color: var(--muted); box-shadow: none; }

.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.item-card { display: flex; min-width: 0; min-height: 164px; flex-direction: column; padding: 18px; border-radius: 13px; transition: transform .18s, background .18s, border-color .18s, box-shadow .18s; }
.item-card:hover { transform: translateY(-3px); border-color: var(--line-strong); background: var(--surface-hover); box-shadow: 0 14px 27px rgba(0, 0, 0, .16); }
.item-title { justify-content: flex-start; }
.item-title h3 { overflow: hidden; margin: 0; font-size: .96rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.item-emoji { flex: none; font-size: 1.33rem; }
.item-sales { margin: auto 0 12px; font-size: 1.52rem; letter-spacing: -.05em; }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(230, 255, 183, .1); }
.item-footer { justify-content: flex-end; margin-top: 13px; font-size: .76rem; }
.roblox-link { color: #c2cfad; text-decoration: none; transition: color .18s; }
.roblox-link:hover { color: var(--lime); }
.empty-state { grid-column: 1 / -1; margin: 0; padding: 32px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; }

.removed-section { margin-top: 58px; padding: 25px; border: 1px solid var(--removed-line); border-radius: 16px; background: linear-gradient(130deg, var(--removed-bg), rgba(29, 19, 15, .82)); box-shadow: inset 0 1px rgba(255, 255, 255, .025); }
.removed-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.removed-heading .section-kicker { color: var(--removed); }
.removed-heading h2 { margin: 5px 0 0; font-size: 1.35rem; letter-spacing: -.035em; }
.removed-heading p:not(.section-kicker) { max-width: 640px; margin: 5px 0 0; color: #c9aaa2; font-size: .83rem; }
.removed-count { flex: none; padding: 6px 10px; border: 1px solid var(--removed-line); border-radius: 99px; color: var(--removed); background: rgba(255, 148, 127, .08); font-size: .75rem; font-weight: 800; }
.removed-item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.removed-item-card { display: flex; min-width: 0; min-height: 158px; flex-direction: column; padding: 17px; border: 1px solid rgba(255, 159, 139, .17); border-radius: 12px; background: rgba(24, 17, 14, .5); transition: transform .18s, border-color .18s, background .18s; }
.removed-item-card:hover { transform: translateY(-3px); border-color: var(--removed-line); background: rgba(55, 28, 22, .6); }
.removed-item-title { display: flex; min-width: 0; align-items: center; gap: 8px; }
.removed-item-title h3 { overflow: hidden; margin: 0; font-size: .94rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.removed-badge { flex: none; margin-left: auto; padding: 3px 6px; border: 1px solid var(--removed-line); border-radius: 5px; color: var(--removed); font-size: .63rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.removed-item-sales { margin: auto 0 1px; color: #ffd0c7; font-size: 1.46rem; letter-spacing: -.05em; }
.removed-item-card p { margin: 0; color: #bd978e; font-size: .76rem; }
.removed-empty-state { grid-column: 1 / -1; margin: 0; padding: 25px; border: 1px dashed var(--removed-line); border-radius: 10px; color: #c9aaa2; text-align: center; }

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

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .item-grid, .removed-item-grid { grid-template-columns: repeat(2, 1fr); }
  .catalog-toolbar { align-items: flex-end; }
  .catalog-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 700px) {
  .dashboard-shell { width: min(100% - 28px, 600px); padding-top: 26px; }
  .hero { display: block; min-height: 0; padding: 27px 23px; }
  .hero::before { right: -200px; top: -200px; }
  .hero-actions { align-items: flex-start; margin-top: 25px; }
  .top-products-list { grid-template-columns: 1fr; gap: 0; }
  .catalog-toolbar { display: block; }
  .catalog-actions { justify-content: flex-start; margin-top: 17px; }
}

@media (max-width: 500px) {
  .stats-grid, .item-grid, .removed-item-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(2.15rem, 11vw, 3.5rem); }
  .panel { padding: 20px 17px; }
  .removed-section { padding: 20px 17px; }
  .catalog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .search { grid-column: 1 / -1; }
  .search input { width: 100%; }
  .export-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
