*{box-sizing:border-box}
body{margin:0;background:#fbfaff;color:#28213a;font:14px/1.6 "DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif}
a{color:#7048d9}
.wrap{width:min(1240px,100%);margin:0 auto;padding:28px 20px 60px}
.topbar{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.eyebrow{color:#805ad2;font-size:12px;font-weight:800;letter-spacing:.14em;text-transform:uppercase}
h1{margin:4px 0 0;font:800 30px/1.2 Manrope,system-ui,sans-serif;letter-spacing:-1px}
.sub{margin:6px 0 0;color:#6a6178;font-size:13px}
.btn{display:inline-block;height:44px;padding:0 18px;border:0;border-radius:11px;background:linear-gradient(100deg,#7449d7,#8b57d9);color:#fff;font:800 13px Manrope,system-ui,sans-serif;box-shadow:0 9px 20px #7048d92c;cursor:pointer}
.btn:disabled{opacity:.6;cursor:wait}
.btn-ghost{background:#fff;border:1px solid #e6ddf3;color:#6040a6;box-shadow:none}
.card{background:#fff;border:1px solid #eae4f2;border-radius:16px;padding:20px 22px;margin-top:18px;box-shadow:0 10px 30px #34214c0d}
.card h2{margin:0 0 4px;font:800 17px Manrope,system-ui,sans-serif;letter-spacing:-.3px}
.card p.note{margin:0 0 14px;color:#6a6178;font-size:13px}
.subhead{margin:24px 0 4px;padding-top:20px;border-top:1px solid #f1ecf8;font:800 15px Manrope,system-ui,sans-serif}
.form-actions{margin-top:16px}
.field{display:grid;gap:6px;margin:0 0 14px}
.field label{color:#4b435c;font-size:13px;font-weight:700}
.field input{width:100%;height:45px;padding:0 13px;border:1px solid #e8e2ef;border-radius:11px;outline:none;background:#fff;color:#28213a;font:14px "DM Sans",system-ui,sans-serif}
.field input:focus{border-color:#a78bfa;box-shadow:0 0 0 3px #a78bfa24}
.row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.row .field{flex:1;min-width:200px;margin:0}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.form-grid .field{margin:0}
.form-grid .field.full{grid-column:1/-1}
.field.check{display:flex;flex-direction:row;align-items:center;gap:8px}
.field.check input{width:auto;height:auto}
.btn-small{height:34px;padding:0 12px;font-size:12px;border-radius:9px}
.error{display:none;margin:12px 0 0;padding:10px 12px;border:1px solid #f5c6c2;border-radius:10px;background:#fef3f2;color:#b42318;font-size:13px}
.error.show{display:block}
.success{display:none;margin:12px 0 0;padding:10px 12px;border:1px solid #b7e4c7;border-radius:10px;background:#f0fdf4;color:#157347;font-size:13px}
.success.show{display:block}
[hidden]{display:none!important}
#dashView{display:flex;align-items:stretch}
.sidebar{width:232px;flex:none;background:#fff;border:1px solid #eae4f2;border-radius:16px;padding:18px 14px;position:sticky;top:20px;align-self:flex-start;height:calc(100vh - 40px);display:flex;flex-direction:column;gap:18px;box-shadow:0 10px 30px #34214c0d;overflow-y:auto}
.side-brand{font:800 20px Manrope,system-ui,sans-serif;letter-spacing:-.5px;color:#28213a}
.side-sub{color:#6a6178;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;margin-top:2px}
.menu{display:flex;flex-direction:column;gap:4px}
.menu-item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:10px 12px;border:1px solid transparent;border-radius:10px;background:transparent;color:#4b435c;font:800 13px Manrope,system-ui,sans-serif;cursor:pointer}
.menu-item svg{flex:none;color:#805ad2}
.menu-item:hover{background:#f6f1fd}
.menu-item.active{background:#f1eafd;border-color:#e6ddf3;color:#6040a6}
.side-foot{margin-top:auto;color:#6a6178;font-size:12px;line-height:1.5}
.main{flex:1;min-width:0;padding-left:20px}
.hamburger{display:none;flex:none;width:44px;height:44px;border:1px solid #e6ddf3;border-radius:11px;background:#fff;cursor:pointer;align-items:center;justify-content:center;color:#6040a6}
.backdrop{position:fixed;inset:0;background:rgba(40,33,58,.45);z-index:55}
.statusline{margin:0 2px 14px}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}
.stat{background:#fff;border:1px solid #eae4f2;border-radius:16px;padding:16px;box-shadow:0 10px 30px #34214c0d;display:flex;gap:12px;align-items:center}
.stat .ring{flex:none}
.stat b{display:block;font:800 26px Manrope,system-ui,sans-serif;letter-spacing:-.8px}
.stat span{display:block;color:#6a6178;font-size:12px;font-weight:700;line-height:1.45;letter-spacing:.06em;text-transform:uppercase}
.donut-wrap{display:flex;gap:24px;align-items:center;flex-wrap:wrap}
.donut-legend{display:grid;gap:10px;min-width:180px;flex:1}
.legend-item{display:flex;align-items:center;gap:8px;font-size:13px}
.legend-item .dot{width:12px;height:12px;border-radius:4px;flex:none}
.legend-item b{margin-left:auto}
.range-row{display:flex;gap:12px;align-items:center;padding:9px 0;border-top:1px solid #f1ecf8;flex-wrap:wrap}
.range-row:first-child{border-top:0}
.range-name{flex:0 0 150px;font-weight:700}
.range-bar{flex:1;min-width:140px;height:14px;display:block}
.range-val{flex:none;font-weight:700;font-size:13px;white-space:nowrap}
.tablewrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{padding:9px 10px;text-align:left;border-top:1px solid #f1ecf8;white-space:nowrap}
th{color:#6a6178;font-size:11px;letter-spacing:.08em;text-transform:uppercase;border-top:0}
td.muted{color:#6a6178}
.badge{display:inline-block;padding:3px 9px;border-radius:999px;background:#f4f0fb;color:#5f5870;font-size:12px;font-weight:700}
.badge.green{background:#e7f6ec;color:#15803d}
.badge.blue{background:#e8effe;color:#1d4ed8}
.badge.red{background:#fdeceb;color:#b42318}
.badge.amber{background:#fdf3d7;color:#8a6d00}
.order{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid #f1ecf8}
.order:first-child{border-top:0}
.order .amt{text-align:right;flex:none;font-weight:800}
.order .meta{color:#6a6178;font-size:13px;margin-top:2px}
#loginView{max-width:480px;margin:18px auto 0}
@media(max-width:820px){.form-grid{grid-template-columns:1fr}}
@media(max-width:768px){
.hamburger{display:inline-flex}
.sidebar{position:fixed;left:0;top:0;bottom:0;z-index:60;width:min(280px,85vw);height:auto;border-radius:0;transform:translateX(-105%);transition:transform .2s ease}
.sidebar.open{transform:none}
.main{padding-left:0}
}
@media(max-width:640px){.stats{grid-template-columns:repeat(2,1fr)}.range-name{flex-basis:110px}}
@media(max-width:480px){.wrap{padding:20px 14px 48px}h1{font-size:26px}.row .btn{width:100%}}
/* Skeleton loading states. Shown in the shell markup so the panel never
   paints blank while the JS bundle or the API data loads; each view's
   renderer replaces the skeletons inside its own container on success,
   and the error paths below replace them with the honest error state.
   Grey tones match the light theme. The shimmer is a CSS-only moving
   highlight; it is disabled for users who prefer reduced motion. */
.skel{position:relative;display:block;overflow:hidden;background:#ece7f3;border-radius:6px}
.skel::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.75),transparent);transform:translateX(-100%);animation:skel-shimmer 1.4s infinite}
@keyframes skel-shimmer{to{transform:translateX(100%)}}
@media (prefers-reduced-motion:reduce){.skel::after,.skel-donut::after{animation:none}}
/* Stat cards: same box as .stat, same 26px number / 12px label heights. */
.skel-stat-text{display:grid;gap:8px;align-content:center}
.skel-num{height:26px;width:56px}
.skel-label{height:12px;width:110px}
.skel-ring{width:44px;height:44px;border-radius:50%;flex:none}
.skel-bar{height:12px}
/* Donut: grey ring (white hole punched out) the same 180px as the real
   chart, centre bars where the total sits, legend rows like the real one. */
.skel-donut{position:relative;width:180px;height:180px;flex:none;border-radius:50%;background:#ece7f3;overflow:hidden}
.skel-donut::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.75),transparent);transform:translateX(-100%);animation:skel-shimmer 1.4s infinite}
.skel-donut-hole{position:absolute;inset:26px;border-radius:50%;background:#fff}
.skel-donut-centre{position:absolute;inset:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
.skel-dot{width:12px;height:12px;border-radius:4px;flex:none}
/* Range bars and order rows reuse .range-row / .order so spacing matches. */
.skel-track{flex:1;min-width:140px;height:14px;border-radius:7px}
.skel-order-text{display:grid;gap:8px}
