:root {
  color-scheme: dark;
  --bg: #151515;
  --panel: #202020;
  --panel-2: #292929;
  --line: #383838;
  --text: #f7f4f1;
  --muted: #aaa49f;
  --orange: #f07b3c;
  --orange-soft: #4a2b1e;
  --green: #54c887;
  --red: #ef6d78;
  --yellow: #e9bb55;
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.5 Poppins, Inter, ui-sans-serif, system-ui, sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.topbar { height: 68px; padding: 0 28px; border-bottom: 1px solid #2b2b2b; display: flex; align-items: center; gap: 32px; position: sticky; top: 0; z-index: 20; background: rgba(21,21,21,.96); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--orange); color: #20130d; }
.nav { display: flex; align-self: stretch; }
.nav a { color: var(--muted); display: grid; place-items: center; padding: 0 15px; border-bottom: 2px solid transparent; font-weight: 600; }
html[data-page="staff"] .nav [data-nav="staff"], html[data-page="rules"] .nav [data-nav="rules"], html[data-page="carts"] .nav [data-nav="carts"], html[data-page="claims"] .nav [data-nav="claims"] { color: var(--text); border-color: var(--orange); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.account img { border-radius: 50%; background: var(--panel-2); }
.app-shell { width: min(1280px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.app-shell.narrow { width: min(980px, calc(100% - 40px)); }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.page-head h1, .login-card h1 { margin: 4px 0 4px; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.page-head p, .section-head p, .rule-card p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--orange); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; }
.live-indicator { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.live-indicator span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(84,200,135,.12); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); padding: 16px 18px; border-radius: 14px; }
.stat strong { display: block; font-size: 24px; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.search { flex: 1; }
input, select { width: 100%; color: var(--text); background: #1d1d1d; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; outline: none; }
input:focus, select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,123,60,.12); }
select { width: auto; min-width: 180px; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); background: #1d1d1d; border-radius: 11px; overflow-x: auto; }
.segmented button { color: var(--muted); border: 0; background: transparent; padding: 8px 11px; white-space: nowrap; border-radius: 8px; cursor: pointer; }
.segmented button.active { background: var(--panel-2); color: var(--text); }
.cart-list { display: grid; gap: 12px; }
.cart-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.cart-card { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden; }
.cart-card.priority { border-color: rgba(240,123,60,.65); }
.cart-card.priority::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--orange); }
.cart-top, .rule-card-head, .section-head, .dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.cart-card h2 { margin: 8px 0 6px; font-size: 17px; letter-spacing: -.02em; }
.cart-meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 12px; }
.cart-data { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.cart-grid .cart-data { grid-template-columns: repeat(2, minmax(0,1fr)); }
.datum span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.datum strong { display: block; margin-top: 2px; font-size: 13px; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.badge.orange { color: #ffaf82; border-color: #71432d; background: var(--orange-soft); }
.badge.green { color: #8de0ad; border-color: #315c43; background: #20382a; }
.badge.red { color: #ff9da5; border-color: #67343a; background: #3b2428; }
.badge.yellow { color: #f3d68e; border-color: #67552b; background: #39331f; }
.cart-actions, .form-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.button { border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; color: var(--text); background: var(--panel-2); font-weight: 700; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; }
.button:hover { filter: brightness(1.12); }
.button:disabled { cursor: wait; opacity: .55; }
.button.primary { background: var(--orange); border-color: var(--orange); color: #27150d; }
.button.danger { color: #ffabb2; background: #422429; border-color: #643039; }
.button.ghost { background: transparent; }
.button.small { padding: 6px 9px; font-size: 11px; }
.countdown { margin-right: auto; color: var(--yellow); font-variant-numeric: tabular-nums; font-weight: 700; }
.empty { padding: 52px 20px; border: 1px dashed var(--line); color: var(--muted); text-align: center; border-radius: var(--radius); }
.login-shell { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 60% 30%, rgba(240,123,60,.11), transparent 34%); }
.login-card { width: min(520px, 100%); padding: 42px; border: 1px solid var(--line); background: rgba(32,32,32,.96); border-radius: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.login-card h1 span { color: var(--orange); }
.login-card p { color: var(--muted); font-size: 16px; }
.discord-login { width: 100%; margin: 18px 0 12px; padding: 13px; }
.login-card small { color: #77716d; display: block; text-align: center; }
.rule-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.rule-card h2, .section-head h2, dialog h2 { margin: 0; }
.rule-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; margin-top: 22px; }
.rule-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.rule-form .wide { grid-column: 1/-1; }
.rule-form .check { grid-template-columns: auto 1fr; align-items: center; justify-content: start; }
.rule-form .check input { width: auto; }
.section-head { margin: 34px 0 14px; }
.override-list { display: grid; gap: 10px; }
.override { display: flex; align-items: center; gap: 16px; padding: 15px 17px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.override strong { flex: 1; }
.override span { color: var(--muted); }
dialog { width: min(620px, calc(100% - 30px)); max-height: calc(100vh - 40px); overflow: auto; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.dialog-form { margin: 0; }
.icon-button { color: var(--muted); border: 0; background: transparent; font-size: 26px; cursor: pointer; }
.toast-region { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; }
.toast { max-width: 360px; padding: 12px 15px; border: 1px solid var(--line); background: #282828; box-shadow: 0 10px 35px rgba(0,0,0,.35); border-radius: 10px; }
.toast.error { border-color: #68343a; color: #ffabb2; }
@media (max-width: 900px) { .topbar { height: auto; min-height: 68px; flex-wrap: wrap; padding-top: 10px; } .nav { order: 3; width: 100%; height: 44px; overflow-x: auto; } .nav a { flex: 1; min-width: max-content; } .cart-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .cart-data { grid-template-columns: repeat(2,minmax(0,1fr)); } .stats { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) { .topbar { padding-inline: 14px; gap: 12px; } .account > span { display: none; } .app-shell,.app-shell.narrow { width: min(100% - 24px, 1280px); padding-top: 26px; } .page-head,.toolbar { align-items: stretch; flex-direction: column; } .cart-grid { grid-template-columns: 1fr; } .segmented { width: 100%; } .cart-actions { flex-wrap: wrap; } .cart-actions .button { flex: 1; } .rule-form { grid-template-columns: 1fr; } .rule-form .wide { grid-column: auto; } .login-card { padding: 28px 22px; } }
