* { box-sizing: border-box; }
:root { color-scheme: dark; background: #0d0e12; color: #f4f4f5; font: 15px/1.5 Inter, Arial, sans-serif; --muted:#aba9bb; --surface:#17181f; --border:#2b2b36; --accent:#b39af9; }
body { margin:0; }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
button, input, textarea, select { font:inherit; color:inherit; }
button, input, textarea, select, .icon { min-height:42px; padding:8px 13px; border:1px solid var(--border); border-radius:12px; background:#20212a; }
button { cursor:pointer; background:#33284e; border-color:#69518e; }
button:hover { background:#453563; }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
h1,h2,p { margin:0; }
h1 { font-size:clamp(1.8rem,3.5vw,2.6rem); letter-spacing:-.035em; line-height:1.13; }
h2 { font-size:1.06rem; font-weight:650; margin:0 0 15px; }
p, small { color:var(--muted); }
.shell { display:grid; grid-template-columns:244px minmax(0,1fr); min-height:100vh; }
aside { display:flex; flex-direction:column; gap:22px; align-self:start; position:sticky; top:0; min-height:100vh; padding:23px 14px 16px; background:#111217; border-right:1px solid #22232c; }
.brand { display:flex; align-items:center; gap:12px; margin:0 5px; }
.brand strong { font-size:1.05rem; letter-spacing:.035em; }
.brand small,.account small { display:block; font-size:.8rem; letter-spacing:.02em; }
.mark { display:grid; place-items:center; flex:0 0 43px; height:43px; border-radius:13px; background:linear-gradient(145deg,#463361,#231c32); color:#eadfff; font-size:1.65rem; box-shadow:inset 0 0 0 1px #6a508a; }
nav { display:grid; gap:4px; }
nav a { display:flex; align-items:center; gap:12px; padding:8px 12px; color:#dddbe7; border:1px solid transparent; border-radius:12px; min-height:41px; }
nav a:hover { background:#1d1e26; text-decoration:none; }
nav a[aria-current] { border-color:#644f8e; background:linear-gradient(105deg,#362a51,#252333); color:#fff; }
nav i,.metric i { font-style:normal; color:var(--accent); text-align:center; line-height:1; font-size:1.35rem; width:26px; flex-shrink:0; }
.account { display:grid; grid-template-columns:38px minmax(0,1fr) 42px; align-items:center; gap:9px; margin-top:auto; padding:10px; background:var(--surface); border:1px solid var(--border); border-radius:15px; overflow-wrap:anywhere; }
.avatar { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; background:#39304d; }
main { min-width:0; padding:26px clamp(14px,2.5vw,42px); }
header { display:flex; flex-wrap:wrap; align-items:end; justify-content:space-between; gap:16px; margin-bottom:24px; }
header p { margin-top:5px; }
.crumb { font-size:.8rem; color:var(--muted); }
.toggle { margin-right:8px; min-height:32px; padding:2px 10px; }
.global-search input { max-width:100%; width:235px; }
.panel { background:linear-gradient(155deg,#191a22,var(--surface) 72%); border:1px solid var(--border); border-radius:21px; padding:19px; min-width:0; }
main > .panel { margin-bottom:16px; }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; margin-bottom:18px; }
.metric { display:flex; gap:12px; align-items:center; padding:15px; min-height:90px; color:inherit; transition:border-color .15s, transform .15s; }
a.metric:hover { text-decoration:none; border-color:#675384; transform:translateY(-2px); }
.metric i { width:43px; height:43px; display:grid; place-items:center; border-radius:13px; background:#29243a; }
.metric span { display:block; color:#d0ccdb; font-size:.87rem; }
.metric strong { font-size:clamp(1rem,1.63vw,1.45rem); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.overview,.split { display:grid; gap:16px; grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
.split { grid-template-columns:repeat(2,minmax(0,1fr)); }
.stack { display:grid; align-content:start; gap:16px; min-width:0; }
.period { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.period a,.pages a { padding:5px 10px; background:#20212a; color:#e6dff1; border-radius:9px; }
.period a[aria-current] { background:#40305c; }
.chart { position:relative; min-height:220px; }
canvas { display:block; width:100%; height:220px; }
#chart-caption { font-variant-numeric:tabular-nums; min-height:24px; }
.chart-select { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.attention,.bar-row { display:flex; justify-content:space-between; gap:8px; padding:9px 11px; margin-top:7px; border-radius:11px; background:#20212a; color:#f4f4f5; }
.attention b { border-radius:12px; background:#483362; color:#eee4ff; min-width:25px; text-align:center; }
.activity { list-style:none; padding:0; margin:0; }
.activity li { border-bottom:1px solid var(--border); padding:9px 0; }
.activity li:last-child { border:0; }
.activity span { display:block; color:var(--muted); font-size:.85rem; }
.filters,.action { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.action { align-items:start; margin:15px 0 0; }
.action button { align-self:end; }
label { display:grid; gap:5px; color:#d9d5e4; }
input,select,textarea { width:100%; }
input::placeholder { color:#9f98ad; }
textarea { min-width:min(18rem,72vw); min-height:80px; }
fieldset { border:1px solid var(--border); border-radius:12px; min-width:0; }
.check { display:flex; align-items:center; gap:8px; min-height:34px; }
.check input { width:17px; min-height:17px; accent-color:var(--accent); }
.scroll { overflow-x:auto; }
table { width:100%; border-collapse:collapse; text-align:left; }
th { color:#c2bacf; background:#20212a; font-size:.87rem; }
td,th { padding:11px 12px; border-bottom:1px solid var(--border); vertical-align:top; }
td { overflow-wrap:anywhere; }
td:first-child, th { white-space:nowrap; }
td:last-child { min-width:90px; }
.pages { display:flex; justify-content:flex-end; align-items:center; gap:12px; padding-top:12px; }
.badge { display:inline-block; padding:2px 8px; border-radius:10px; background:#342a48; color:#dfcaff; white-space:nowrap; }
.badge[data-status=COMPLETED], .badge[data-status=paid] { background:#233c31; color:#9be9b8; }
.badge[data-status=DISPUTE] { background:#483038; color:#ffcbd3; }
dl { display:flex; flex-wrap:wrap; gap:12px 23px; margin:0 0 10px; }
dl div { min-width:120px; overflow-wrap:anywhere; }
dt { color:var(--muted); }
dd { margin:3px 0 0; }
.prose { white-space:pre-wrap; overflow-wrap:anywhere; }
.empty,.notice { padding:12px 15px; border-radius:12px; background:#22212c; }
.notice { margin-bottom:14px; color:#eadfff; }
footer { margin-top:24px; color:var(--muted); font-size:.85rem; }
.signin { min-height:100vh; display:grid; place-items:center; padding:16px; background:radial-gradient(ellipse at top,#20192d,#0d0e12 67%); }
.login { width:min(100%,425px); padding:30px; }
.login h1 { margin-top:24px; }
.login p { margin:10px 0; }
.login form { display:grid; gap:14px; margin-top:20px; }
.telegram-button { display:block; margin:20px 0 12px; padding:12px; text-align:center; border:1px solid #69518e; border-radius:12px; background:#33284e; color:#f4f4f5; font-weight:650; }
.telegram-button:hover { background:#453563; text-decoration:none; }
.login-alternative summary { cursor:pointer; color:var(--muted); }
.shell.collapsed { grid-template-columns:75px minmax(0,1fr); }
.collapsed aside { padding-inline:8px; }
.collapsed .brand div,.collapsed nav span,.collapsed .account > div { display:none; }
.collapsed .account { display:flex; justify-content:center; padding-inline:2px; }
@media(max-width:1100px) { .metrics { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:900px) { .overview { grid-template-columns:1fr; } .shell { grid-template-columns:185px minmax(0,1fr); } }
@media(max-width:650px) {
  .shell,.shell.collapsed { grid-template-columns:1fr; }
  aside { position:static; min-height:auto; }
  nav { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .collapsed aside { display:none; }
  .metrics,.split { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric { display:block; min-height:106px; }
  .metric i { width:31px; height:29px; margin-bottom:4px; }
}
@media(prefers-reduced-motion:reduce) { * { transition:none !important; } }
