:root {
  color-scheme: dark;
  --bg: #0a0e18;
  --surface: #121827;
  --surface-2: #182034;
  --border: #273149;
  --text: #f3f6ff;
  --muted: #97a3bb;
  --blue: #5e8cff;
  --violet: #a979ff;
  --teal: #32d3ba;
  --orange: #ffab5d;
  --danger: #ff7185;
  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(--text); background: radial-gradient(circle at 20% -10%, #172849 0, transparent 34rem), var(--bg); }
a { color: inherit; text-decoration: none; }
button, .button, input, select { font: inherit; }
button, .button { border: 0; border-radius: 10px; padding: .72rem 1rem; color: #fff; background: var(--blue); cursor: pointer; font-weight: 700; }
button:hover, .button:hover { filter: brightness(1.08); }
.secondary { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.compact { padding: .48rem .76rem; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 .4rem; color: #7893c9; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.15rem; }

.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--border); background: rgba(10, 14, 24, .86); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10; }
.brand, .top-actions { display: flex; align-items: center; gap: .7rem; font-weight: 800; }
.brand-mark { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg, var(--blue), var(--violet)); box-shadow: 0 14px 38px rgba(94, 140, 255, .25); font-weight: 900; font-size: 1.35rem; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(50, 211, 186, .11); }
.top-actions form { margin: 0; }

.container { width: min(1440px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 4rem; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.8rem; }
.page-heading p:last-child { margin-bottom: 0; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: .7rem; }
.filters label { display: grid; gap: .35rem; color: var(--muted); font-size: .75rem; font-weight: 700; }
input, select { min-height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: .65rem .78rem; color: var(--text); background: var(--surface); outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(94, 140, 255, .15); }

.cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.card, .panel { background: linear-gradient(145deg, rgba(24, 32, 52, .92), rgba(18, 24, 39, .92)); border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 18px 55px rgba(0, 0, 0, .15); }
.card { min-height: 145px; display: flex; flex-direction: column; justify-content: space-between; padding: 1.1rem; border-top: 3px solid #39445d; }
.card span, .card small { color: var(--muted); }
.card strong { font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.05em; }
.accent-blue { border-top-color: var(--blue); }
.accent-violet { border-top-color: var(--violet); }
.accent-teal { border-top-color: var(--teal); }
.accent-orange { border-top-color: var(--orange); }

.grid-two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1rem; margin-bottom: 1rem; }
.panel { padding: 1.25rem; }
.panel-title { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.tag { color: #b8c8e8; background: #202a40; border: 1px solid #33405c; border-radius: 999px; padding: .35rem .6rem; font-size: .72rem; }
.bar-chart { display: grid; gap: .68rem; }
.bar-row { display: grid; grid-template-columns: 58px 1fr 90px; gap: .7rem; align-items: center; font-size: .8rem; }
.bar-row time { color: var(--muted); }
.bar-row strong { text-align: right; }
.bar-track { height: 9px; background: #222b3f; border-radius: 999px; overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--violet)); }
.w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; }
.w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; }
.w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; }
.w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }
.rank-list { display: grid; gap: .65rem; }
.rank-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem; border-radius: 11px; background: rgba(8, 12, 21, .45); }
.rank-item div { min-width: 0; display: grid; gap: .2rem; }
.rank-item strong, .rank-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item small { color: var(--muted); }
.rank-item > span { min-width: 34px; text-align: center; border-radius: 9px; padding: .4rem; background: rgba(169, 121, 255, .16); color: #d6bdff; font-weight: 800; }

.table-panel { padding-bottom: .5rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: .78rem .7rem; border-top: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
td { color: #d9e0ef; }
.empty { padding: 2rem; color: var(--muted); text-align: center; }
footer { padding: 1.5rem; color: #64718a; text-align: center; font-size: .78rem; }

.login-page { display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(430px, 100%); padding: 2rem; border: 1px solid var(--border); border-radius: 22px; background: rgba(18, 24, 39, .92); box-shadow: 0 30px 90px rgba(0, 0, 0, .35); }
.login-card .brand-mark { margin-bottom: 1.5rem; }
.login-form { display: grid; gap: .7rem; margin-top: 1.5rem; }
.login-form label { margin-top: .35rem; color: #c3cce0; font-size: .82rem; font-weight: 700; }
.login-form button { margin-top: .7rem; }
.alert { margin-top: 1rem; padding: .75rem; border: 1px solid rgba(255, 113, 133, .4); border-radius: 10px; color: #ffc0c9; background: rgba(255, 113, 133, .1); }

@media (max-width: 1180px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px) {
  .desktop-only { display: none; }
  .container { width: min(100% - 1rem, 1440px); padding-top: 1.3rem; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 1rem; }
  .filters > * { flex: 1 1 130px; }
  .cards, .grid-two { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card { min-height: 128px; }
}
@media (max-width: 460px) {
  .cards { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 52px 1fr; }
  .bar-row strong { grid-column: 2; text-align: left; }
}
