:root {
  color-scheme: dark;
  --bg: #101116;
  --panel: #191a22;
  --panel-2: #242530;
  --line: #30313e;
  --text: #f3f5f7;
  --muted: #8e9aab;
  --accent: #b2a2ff;
  --accent-dark: #302842;
  --danger: #ff7676;
  --danger-dark: #3f1d24;
  --radius: 18px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; border-right: 1px solid var(--line); background: #0e1219; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; }
.brand span, .login-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #07110d; background: var(--accent); font-weight: 900; letter-spacing: -.05em; }
.brand strong { font-size: 16px; }
nav { display: grid; gap: 7px; }
nav a { color: #c6ced8; padding: 11px 13px; border-radius: 10px; }
nav a:hover { background: var(--panel-2); color: #fff; }
.logout-form { margin-top: auto; }
.link-button { width: 100%; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-align: left; padding: 12px; }
.content { min-width: 0; padding: 38px clamp(22px, 4vw, 58px) 70px; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 30px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.04em; margin-bottom: 0; }
h2 { font-size: 20px; letter-spacing: -.02em; margin-bottom: 0; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-weight: 800; font-size: 11px; letter-spacing: .13em; margin-bottom: 7px; }
.muted, small { color: var(--muted); }
small { display: block; margin-top: 2px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; cursor: pointer; font-weight: 700; white-space: nowrap; }
.button:hover { border-color: #46546a; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #08110e; }
.button.danger { color: var(--danger); background: var(--danger-dark); border-color: #64303a; }
.notice { border: 1px solid; border-radius: 12px; padding: 12px 15px; margin: -12px 0 24px; }
.notice.success { color: var(--accent); background: var(--accent-dark); border-color: #28614e; }
.notice.error { color: #ff9b9b; background: var(--danger-dark); border-color: #74343e; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { min-height: 142px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, var(--panel-2), var(--panel)); display: flex; flex-direction: column; }
.stat span { color: var(--muted); }
.stat strong { font-size: 40px; letter-spacing: -.05em; margin-top: auto; line-height: 1; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.panel.narrow { max-width: 760px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th, td { padding: 14px 18px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
code { color: #bcd7ff; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 17px; }
.product-card { display: flex; flex-direction: column; min-height: 300px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.card-title { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.card-title h2 { font-size: 24px; margin-top: 10px; }
.id { color: var(--muted); }
.status { display: inline-block; padding: 3px 8px; border-radius: 99px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; background: #252d39; color: #aeb8c6; }
.status.on, .status.available { background: var(--accent-dark); color: var(--accent); }
.status.off, .status.review { background: var(--danger-dark); color: #ff9b9b; }
.status.rented { background: #3b3219; color: #ffd86b; }
.games { color: #c6d0dc; margin: 16px 0 8px; }
.description { color: var(--muted); white-space: pre-line; }
.card-meta { display: flex; gap: 22px; margin-top: auto; padding: 20px 0 16px; border-top: 1px solid var(--line); }
.card-meta strong { color: var(--text); font-size: 20px; margin-right: 4px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.danger-zone { position: relative; }
.danger-zone summary { list-style: none; cursor: pointer; color: var(--danger); padding: 9px 10px; }
.danger-zone[open] form { position: absolute; z-index: 2; right: 0; top: 42px; padding: 10px; border: 1px solid #64303a; background: #20151a; border-radius: 12px; }
.form-stack { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: #cbd2dc; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; min-width: 0; color: var(--text); background: #0e131b; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(112,225,178,.09); }
textarea { resize: vertical; }
.check, .switch { display: flex; align-items: center; gap: 10px; }
.check input, .switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.inline-form { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)) auto; align-items: end; gap: 12px; }
.account-form { grid-template-columns: repeat(5, minmax(120px, 1fr)) auto; }
.rows { display: grid; gap: 12px; }
.row-form, .account-row { padding-top: 14px; border-top: 1px solid var(--line); }
.account-row { display: grid; grid-template-columns: 90px repeat(5, minmax(115px, 1fr)); gap: 12px; align-items: end; }
.account-row .actions { grid-column: 2 / -1; justify-content: flex-end; }
.row-heading { align-self: center; }
.filters { display: flex; gap: 10px; margin-bottom: 22px; }
.filters input { max-width: 340px; }
.filters select { max-width: 240px; }
.user-form { display: grid; grid-template-columns: minmax(110px, 160px) auto auto; align-items: center; gap: 10px; }
.check.compact { white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.provider { margin: 0; }
.settings-wide { grid-column: 1 / -1; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.settings-wide label { width: min(360px, 100%); }
.empty, .empty-state { color: var(--muted); text-align: center; padding: 40px 20px; }
.empty-state { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: var(--radius); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 20%, #19352d 0, var(--bg) 38%); }
.login-card { width: min(440px, 100%); padding: 36px; border: 1px solid var(--line); background: rgba(18,23,32,.96); border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-mark { margin-bottom: 28px; }
.login-card h1 { font-size: 30px; margin-bottom: 10px; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .account-form, .account-row { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .account-row .actions { grid-column: auto; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 4px 12px; }
  nav { display: flex; overflow-x: auto; }
  nav a { white-space: nowrap; }
  .logout-form { display: block; margin-top: 8px; }
  .content { padding: 25px 15px 50px; }
  .topbar { align-items: flex-end; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { min-height: 120px; }
  .inline-form, .account-form, .account-row, .settings-grid { grid-template-columns: 1fr; }
  .settings-wide { grid-column: auto; align-items: stretch; flex-direction: column; }
  .account-row .actions { grid-column: auto; justify-content: flex-start; }
  .filters { flex-wrap: wrap; }
}

/* Consistent spacing and controls across the administration workspace. */
.sidebar { background: #14151c; padding: 30px 18px 20px; }
.brand { padding: 0 8px 36px; }
.brand span, .login-mark { color: #24193e; border-radius: 13px; box-shadow: 0 5px 24px #9580ff18; }
.brand small { font-size: 9px; letter-spacing: 1.4px; font-weight: 500; margin-top: 3px; }
.nav-caption { color: #828296; font-size: 9px; font-weight: 600; letter-spacing: 1.4px; margin: 0 0 14px; padding: 0 12px; }
nav a { display: flex; align-items: center; gap: 12px; border: 1px solid transparent; color: #aaaabb; font-size: 13px; font-weight: 500; }
nav a.active { background: #29243e; border-color: #403654; color: #c9beff; }
.nav-icon { display: grid; place-items: center; width: 22px; font-size: 21px; line-height: 1; }
.sidebar-account { display: flex; align-items: center; gap: 11px; padding: 22px 8px 12px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.sidebar-account small { font-size: 10px; font-weight: 400; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #51446b; border-radius: 50%; color: #c9beff; background: #29243c; }
.link-button { font-size: 12px; }
.content { max-width: 1680px; width: 100%; margin: 0 auto; padding-top: 42px; }
.topbar { margin-bottom: 32px; }
h1 { font-size: clamp(25px, 2.8vw, 34px); font-weight: 650; letter-spacing: -1px; line-height: 1.25; }
h2 { font-size: 18px; font-weight: 600; }
.eyebrow { color: #9f9eb3; font-size: 10px; font-weight: 600; letter-spacing: 1.5px; }
.button { height: 42px; min-height: 42px; width: auto; padding: 0 17px; border-radius: 9px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.button.primary { color: #24193e; box-shadow: 0 4px 16px #9177ff16; }
.button.primary:hover { background: #c8bdff; }
.button:hover { border-color: #76668c; }
.panel { padding: 24px; border-radius: 16px; overflow: hidden; }
.panel-head { margin-bottom: 24px; }
.table-wrap { margin: 0 -24px -24px; }
th, td { text-align: left; padding: 17px 24px; }
th { background: #15161d; font-size: 10px; font-weight: 600; letter-spacing: 1px; color: #a4a2b8; white-space: nowrap; }
td { font-size: 13px; font-variant-numeric: tabular-nums; }
td .button { min-width: 112px; }
tbody tr:hover { background: #ffffff03; }
code { color: #c5bce6; font-size: 12px; }
.money-input { position: relative; width: 132px; }
.money-input input { padding-right: 30px; }
.money-input>span { position: absolute; right: 13px; top: 10px; color: var(--muted); pointer-events: none; }
.stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { position: relative; background: var(--panel); border-radius: 16px; min-height: 155px; padding: 22px; }
.stat::after { content: ""; position: absolute; top: 24px; right: 18px; width: 6px; height: 6px; border-radius: 50%; background: #ad9eff; box-shadow: 0 0 0 5px #ad9eff0d; }
.stat span { font-size: 12px; padding-right: 12px; color: #aaa8bd; }
.stat strong { font-size: 38px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -1.5px; margin-top: 20px; }
.stat:nth-child(2)::after { background: #7bdabb; }
.stat:nth-child(4)::after { background: #7cb8ff; }
.stat:nth-child(5)::after { background: #e9bf7d; }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 20px; }
.product-card { padding: 24px; border-radius: 16px; min-height: 315px; }
.product-card:hover { border-color: #655278; }
.card-title h2 { font-size: 23px; margin-top: 15px; }
.description { font-size: 13px; overflow-wrap: anywhere; }
.card-meta { font-size: 12px; color: var(--muted); }
.card-meta strong { font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 7px; border-radius: 6px; font-size: 10px; text-transform: none; letter-spacing: .2px; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.on, .status.available { background: #20332c; color: #8bdabc; }
.status.off, .status.review { background: #38252e; color: #efa0af; }
label { gap: 9px; font-size: 12px; font-weight: 500; color: #bdb9d0; min-width: 0; }
input, select, textarea { background: #12131b; border-color: #383744; font-size: 13px; border-radius: 8px; }
input, select { height: 42px; padding: 0 12px; }
textarea { padding: 12px; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px #b2a2ff15; }
input::placeholder, textarea::placeholder { color: #818094; }
input[type=file] { padding: 7px; font-size: 11px; }
input::file-selector-button { background: #31283f; border: 0; color: #d0c2ff; border-radius: 5px; padding: 5px 8px; margin-right: 8px; cursor: pointer; }
.check input, .switch input { appearance: none; flex-shrink: 0; width: 34px; height: 20px; padding: 0; border-radius: 20px; border: 1px solid #535063; background: #393545; position: relative; cursor: pointer; }
.check input::before, .switch input::before { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; top: 3px; left: 3px; background: #c0bbce; transition: transform .15s; }
.check input:checked, .switch input:checked { background: #9883e6; border-color: #b4a2ff; }
.check input:checked::before, .switch input:checked::before { background: #fff; transform: translateX(14px); }
.form-stack { gap: 22px; }
.form-stack>.button { justify-self: start; min-width: 150px; }
.inline-form { grid-template-columns: minmax(160px, 2fr) repeat(2, minmax(100px, 1fr)) auto; gap: 14px; }
.row-form { grid-template-columns: minmax(160px, 2fr) repeat(2, minmax(100px, 1fr)) auto auto; padding: 20px 0; }
.account-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.account-form>.button { justify-self: start; }
.account-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; border: 1px solid var(--line); background: #15161e; border-radius: 12px; padding: 22px; }
.row-heading { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.account-row .actions { grid-column: auto; justify-content: flex-start; }
.provider { border-top: 2px solid #9480c4; padding: 28px; }
.filters { gap: 12px; margin-bottom: 24px; }
.empty { padding: 60px 24px; }
.login-page { background: radial-gradient(ellipse at 50% 0%, #38285166, transparent 65%), #101116; }
.login-card { padding: 42px; background: #191921; border-color: #403548; box-shadow: 0 28px 100px #0005; }
.login-card .button { width: 100%; }
.login-mark { width: 50px; height: 50px; margin-bottom: 32px; }
.login-card h1 { font-size: 28px; }
a, button { transition: background .15s, border-color .15s; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inline-form, .row-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 16px; }
  .brand { padding-bottom: 16px; }
  .nav-caption, .sidebar-account { display: none; }
  nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
  nav a { white-space: nowrap; padding: 9px 12px; font-size: 12px; }
  .logout-form { margin-top: 6px; }
  .link-button { padding: 4px 0; }
  .content { padding: 26px 16px 40px; }
  .topbar { flex-wrap: wrap; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-form, .row-form, .account-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { flex-wrap: wrap; }
  .settings-wide { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
  .inline-form, .row-form, .account-row { grid-template-columns: 1fr; }
  .panel-head { flex-wrap: wrap; }
  .login-card { padding: 28px; }
  .stat { padding: 16px; }
  .stat::after { right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
