:root {
  color-scheme: dark;
  font-family: "Segoe UI", Tahoma, system-ui, sans-serif;
  background: #10121c;
  color: #f2f1f8;
  --panel: #171b29;
  --border: #2a3042;
  --muted: #aab1c7;
  --violet: #a587ff;
  --mint: #6de5ba;
  --amber: #ffc778;
  --danger: #ffa6ae;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, input, select { min-height: 42px; border-radius: 9px; }
button, select, input { border: 1px solid var(--border); background: #111521; color: inherit; padding: 8px 13px; }
button:hover, select:hover { border-color: var(--violet); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
select {
  appearance: none;
  padding-inline-end: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: left 16px center, left 11px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input::placeholder { color: var(--muted); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 3vw, 2.5rem); letter-spacing: -.02em; }
h2 { font-size: 1.125rem; }
small, .legend { color: var(--muted); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.layout { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  inset-block-start: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 18px;
  background: #131623;
  border-inline-end: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 7px; font-size: 1.19rem; font-weight: 700; }
.brand small { display: block; width: fit-content; font-size: .81rem; font-weight: 500; margin-top: 3px; }
.brand-mark { display: flex; align-items: end; justify-content: center; gap: 3px; direction: ltr; background: #31264e; width: 38px; height: 38px; border-radius: 10px; padding-bottom: 9px; }
.brand-mark i { width: 4px; height: 8px; border-radius: 3px; background: var(--violet); }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:nth-child(3) { height: 20px; }
nav { display: grid; gap: 6px; margin-top: 35px; }
nav a { padding: 10px 13px; color: var(--muted); border-radius: 9px; }
nav a[aria-current], nav a:hover { background: #30244c; color: #e1d6ff; }
.sidebar-note { display: grid; gap: 8px; margin-top: auto; padding: 12px 7px 0; border-top: 1px solid var(--border); font-size: .875rem; color: var(--muted); }
.sidebar-note span { display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
main { width: 100%; max-width: 1560px; margin-inline: auto; padding: 26px clamp(15px, 2.4vw, 38px) 42px; }
.page-header, .section-head, .actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-header p, .orders-head p { margin-top: 5px; color: var(--muted); }
.actions { justify-content: start; flex-wrap: wrap; gap: 8px; }
.primary { background: #a386fb; color: #151024; border-color: #a386fb; font-weight: 700; }
.primary:hover { background: #b9a2ff; }
.primary span { font-size: 1.13em; margin-inline-end: 4px; }
.action-link { display: inline-flex; align-items: center; min-height: 42px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 13px; color: #decfff; }
.action-link:hover { border-color: var(--violet); }
.data-note, .notice { color: var(--muted); margin: 13px 0 17px; font-size: .875rem; }
.notice { color: var(--mint); }
.notice.error { color: var(--danger); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.card { border: 1px solid var(--border); border-radius: 13px; background: var(--panel); }
.metric { padding: 17px; min-height: 122px; display: flex; flex-direction: column; align-items: start; justify-content: space-between; gap: 5px; }
.metric-label { color: #d0d4e4; font-size: .92rem; }
.metric strong { max-width: 100%; font-size: clamp(1.18rem, 2.28vw, 2rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { font-size: .81rem; }
.queue-card { text-align: start; }
.queue-card[aria-pressed="true"] { background: #30244c; border-color: var(--violet); }
.queue-card[data-queue="awaiting-delivery"] strong { color: var(--amber); }
.queue-card[data-queue="disputed"] strong { color: var(--danger); }
.profit-metric { background: linear-gradient(145deg, #192c30, #171b29 80%); border-color: #2d474b; }
.positive { color: var(--mint); }
.negative { color: var(--danger); }
.analytics { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 13px; margin-top: 15px; }
.chart-card, .games-card { padding: 17px; }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .81rem; }
.legend i, .game-color { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); flex: none; }
.legend i:nth-child(2) { margin-inline-start: 6px; background: var(--mint); }
.chart { margin-top: 10px; min-height: 182px; display: grid; align-content: center; }
.chart svg { width: 100%; height: auto; overflow: visible; display: block; }
.chart svg text { fill: var(--muted); font: 13px "Segoe UI", Tahoma, sans-serif; }
.chart svg .grid-line { stroke: #343a4f; stroke-dasharray: 3 4; }
.chart svg .sales-line { stroke: var(--violet); }
.chart svg .profit-line { stroke: var(--mint); }
.chart svg .plot-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-note { margin-top: 8px; font-size: .81rem; color: var(--muted); }
.game-breakdown { display: grid; grid-template-columns: minmax(90px, 115px) minmax(0, 1fr); align-items: center; gap: 16px; margin-top: 21px; }
.donut { width: 100%; aspect-ratio: 1; position: relative; border-radius: 50%; }
.donut svg { display: block; width: 100%; }
.donut-value { position: absolute; inset: 0; display: grid; place-items: center; color: #f1eefb; font-size: .86rem; font-weight: 700; }
.game-list { list-style: none; padding: 0; margin: 0; }
.game-list li { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding-block: 7px; font-size: .86rem; }
.game-list li + li { border-top: 1px solid var(--border); }
.game-name { display: flex; align-items: center; gap: 7px; min-width: 0; overflow-wrap: anywhere; }
.game-list bdi:last-child { white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; }
.orders { margin-top: 15px; scroll-margin-block-start: 15px; }
.orders-head { padding: 16px 17px 12px; }
.orders-head p { font-size: .875rem; }
#search { width: min(100%, 194px); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: start; white-space: nowrap; }
th, td { padding: 10px 12px; text-align: start; }
th:first-child, td:first-child { padding-inline-start: 17px; }
thead { background: #1d2232; color: #d7dbed; font-size: .875rem; }
tbody tr + tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: #1c2232; }
td { font-size: .875rem; font-variant-numeric: tabular-nums; }
.item-name { display: block; max-width: 235px; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.item-meta { display: block; color: var(--muted); font-size: .81rem; margin-top: 4px; }
.status-chip { display: inline-flex; border-radius: 20px; padding: 4px 9px; font-size: .81rem; font-weight: 650; }
.completed { color: var(--mint); background: #213b36; }
.pending, .awaiting-delivery { color: var(--amber); background: #433520; }
.cancelled { color: var(--danger); background: #412b36; }
.disputed, .refunded { color: #e0ccff; background: #3c315b; }
.delivered { color: #bbd0ff; background: #263657; }
.received { color: #91e2e8; background: #224248; }
.missing { color: var(--amber); }
.subtle { color: #decfff; background: transparent; }
td button { min-height: 36px; padding: 5px 9px; }
.order-actions { display: flex; align-items: center; gap: 6px; }
dialog { border: 1px solid var(--border); border-radius: 15px; background: var(--panel); color: inherit; width: min(590px, calc(100% - 24px)); padding: 21px; }
dialog::backdrop { background: rgb(5 8 16 / .77); }
.close { font-size: 1.4rem; line-height: 1; }
.form-hint { color: var(--muted); font-size: .875rem; margin-top: 7px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }
.form-grid label { display: grid; gap: 5px; align-content: start; font-size: .875rem; }
.form-grid input, .form-grid select { width: 100%; min-width: 0; }
#preview-profit { display: block; margin-block: 14px; min-height: 1.5em; }
.form-actions { margin-top: 12px; }
.team-list { display: grid; padding: 0; list-style: none; margin: 14px 0 0; }
.team-list li { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--border); }
.pagination { padding: 11px 17px; border-top: 1px solid var(--border); justify-content: center; }
.report-filters { margin-top: 12px; color: var(--muted); font-size: .88rem; }
.pricing-card { margin-top: 15px; padding: 17px; scroll-margin-block-start: 15px; }
.pricing-summary { color: var(--mint); margin-top: 8px; font-size: .9rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 14px; }
.pricing-form { display: grid; align-content: start; gap: 8px; padding: 14px; background: #111521; border: 1px solid var(--border); border-radius: 10px; }
.pricing-form h3 { font-size: 1rem; margin: 0 0 3px; }
.pricing-form label { color: #d0d4e4; font-size: .9rem; }
.pricing-form input, .pricing-form select { min-width: 0; width: 100%; }
.pricing-form > button { justify-self: start; }
.price-input { display: grid; grid-template-columns: minmax(0, 1fr) minmax(89px, auto); gap: 7px; }
.pricing-card .notice { margin-block: 12px 0; }
button:disabled { opacity: .54; cursor: default; }
.auth-page { min-height: 100vh; display: grid; align-items: center; justify-items: center; padding: 14px; }
.auth-card { max-width: 472px; padding: 25px; }
.auth-card .brand { padding: 0; color: #e1d6ff; margin-bottom: 17px; }
.auth-card h1 { margin-bottom: 6px; font-size: 1.85rem; }
.auth-card p { color: var(--muted); }
.auth-card p.error { color: var(--danger); }
.auth-form { display: grid; gap: 12px; margin-top: 15px; }
.auth-form label { display: grid; gap: 6px; font-size: .93rem; }
.auth-form input { width: 100%; }
.auth-switch { margin-top: 14px; width: 100%; }
.auth-secret { padding: 12px; background: #111521; border: 1px solid var(--border); border-radius: 10px; }
.auth-secret code { display: block; color: var(--mint); font-size: 1rem; text-align: start; overflow-wrap: anywhere; margin-top: 9px; }
.android-code { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
.android-code code { font-size: 1.15rem; margin-top: 0; user-select: all; }
#recovery-list { display: grid; gap: 6px; padding-inline-start: 22px; margin: 6px 0; font-family: monospace; overflow-wrap: anywhere; }
.auth-link { display: block; text-align: center; border-radius: 9px; padding: 10px; }
@media (min-width: 1081px) {
  .game-breakdown { grid-template-columns: minmax(100px, 135px) minmax(0, 1fr); }
}
@media (max-width: 1050px) {
  .layout { grid-template-columns: 168px minmax(0, 1fr); }
  .game-breakdown { grid-template-columns: 1fr; justify-items: center; }
  .donut { max-width: 108px; }
  .game-list { width: 100%; }
}
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 11px 13px; border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .brand { font-size: 1rem; padding: 0; gap: 7px; }
  .brand-mark { width: 33px; height: 33px; padding-bottom: 6px; }
  nav { display: flex; margin: 0; font-size: .875rem; }
  nav a { padding: 8px; }
  .sidebar-note { width: 100%; display: flex; flex-wrap: wrap; align-items: center; font-size: .81rem; padding: 6px 0 0; }
  .sidebar-note button { min-height: 35px; padding: 4px 8px; }
  main { padding-top: 16px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 12px; min-height: 102px; }
  .metric strong { font-size: clamp(1.15rem, 5vw, 1.55rem); }
  .analytics { grid-template-columns: 1fr; gap: 9px; }
  .game-breakdown { grid-template-columns: minmax(80px, 106px) minmax(0, 1fr); }
  .page-header, .orders-head { align-items: start; flex-direction: column; }
  .pricing-grid { grid-template-columns: 1fr; gap: 9px; }
}
@media (max-width: 360px) {
  .form-grid { grid-template-columns: 1fr; }
}
