:root {
  --bg: #0a0a0b; --panel: #111113; --panel2: #0d0d0f; --line: #1f1f23; --line2: #27272a;
  --text: #f4f4f5; --muted: #a1a1aa; --accent: #5eead4; --accent-ink: #042f2e;
  --common: #a1a1aa; --rare: #60a5fa; --epic: #c084fc; --legendary: #fbbf24;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #99f6e4; }
.mono { white-space: nowrap; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 100%; padding: 28px 20px; border-right: 1px solid var(--line); background: var(--panel2); display: flex; flex-direction: column; gap: 4px; }
.side a { padding: 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.side a.on { background: #18181b; color: var(--text); font-weight: 600; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 20px; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); }
.brand div { display: flex; flex-direction: column; }
.brand span { font-size: 12px; color: var(--muted); }
.sync { margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--muted); }
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 24px; outline: none; }
@media (max-width: 700px) { .main { padding: 20px 16px 40px; } .side { flex-direction: row; flex-wrap: wrap; } .sync { margin-top: 8px; width: 100%; } }
h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 17px; font-weight: 700; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.head p { margin: 6px 0 0; color: var(--muted); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
button, select, input { font: inherit; }
.pill { height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--muted); cursor: pointer; }
.pill.on { border-color: var(--accent); background: #0f2624; color: var(--accent); font-weight: 600; }
.btn { height: 40px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
.btn.ghost { background: transparent; border: 1px solid var(--line2); color: var(--text); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }
.field input { height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); min-width: 180px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi b { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel .sub { margin: -8px 0 0; font-size: 12px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.bar-row { display: flex; flex-direction: column; gap: 5px; }
.bar-row .lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 6px; background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid; }
.chip small { font-weight: 500; opacity: .8; margin-left: 4px; }
.r-common { color: var(--common); background: #18181b; border-color: #a1a1aa33; }
.r-rare { color: var(--rare); background: #0c1a2e; border-color: #60a5fa33; }
.r-epic { color: var(--epic); background: #1e0f33; border-color: #c084fc33; }
.r-legendary { color: var(--legendary); background: #2a1f06; border-color: #fbbf2455; }
.r-unknown { color: var(--muted); background: #18181b; border-color: var(--line2); }
.tier { padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.t-jackpot { background: #3f2d0a; color: #fcd34d; }
.t-lucky { background: #3f2d0a; color: #fde68a; }
.t-legendary { background: #2a1f06; color: var(--legendary); }
.t-epic { background: #2e1065; color: #d8b4fe; }
.lucky-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pack { padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 12px; }
.pack.hot { border-color: #4a3a12; background: #14110a; }
.pack .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pack .meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.pack .actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; padding: 12px; }
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 20px; }
.right { text-align: right; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 14px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px; font-weight: 700; }

/* Dropdowns: label + chevron grouped and centred; the native <select> sits invisibly on top */
.select { position: relative; height: 40px; min-width: 180px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.select span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select svg { flex: none; color: var(--muted); }
.select select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.select:hover { border-color: #3f3f46; }
.select:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #5eead433; }

/* Desktop: sidebar and content scroll separately */
@media (min-width: 701px) {
  html, body { height: 100%; overflow: hidden; }
  .shell { height: 100vh; min-height: 0; flex-wrap: nowrap; }
  .side { flex: 0 0 220px; overflow-y: auto; }
  .main { flex: 1 1 auto; overflow-y: auto; }
  .main > * { flex-shrink: 0; }
}
