/* ==========================================================================
   Payner Hub - Demo distribution dashboard ([py_demo_dashboard]).
   Self-scoped under .pyd-app so it can render inside any page. Dark, mock data,
   multi-screen with a working sidebar. Charts are inline SVG (no dependencies).
   ========================================================================== */

.pyd-app{
  --pyd-bg:#0B0C0E; --pyd-surface:#15181C; --pyd-surface-2:#1C2026; --pyd-elev:#101216;
  --pyd-line:rgba(255,255,255,.08); --pyd-line-2:rgba(255,255,255,.14);
  --pyd-text:#F3F4F6; --pyd-muted:#9AA1A9; --pyd-faint:#697079;
  --pyd-brand:#4A8FD8; --pyd-brand-2:#6ba6e4;
  --pyd-green:#1ED760; --pyd-red:#FC5B67; --pyd-blue:#38BDF8; --pyd-yt:#FF5252;
  --pyd-pos:#39d98a;
  --pyd-f-disp:"Sofia Sans","Montserrat","Inter",sans-serif;
  --pyd-f-mono:"JetBrains Mono","Consolas",monospace;
  position:relative; display:grid; grid-template-columns:242px minmax(0,1fr);
  background:var(--pyd-bg); color:var(--pyd-text);
  font-family:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  border:1px solid var(--pyd-line); border-radius:18px; overflow:hidden;
  -webkit-font-smoothing:antialiased; color-scheme:dark;
}
.pyd-app *{box-sizing:border-box}
.pyd-app h1,.pyd-app h2,.pyd-app h3,.pyd-app h4,.pyd-app p,.pyd-app ul{margin:0}
.pyd-app ul{list-style:none;padding:0}
.pyd-mono{font-variant-numeric:tabular-nums}

/* ---- sidebar ---- */
.pyd-side{background:var(--pyd-elev);border-right:1px solid var(--pyd-line);padding:18px 14px;display:flex;flex-direction:column;gap:5px}
.pyd-brand{display:flex;align-items:center;gap:11px;padding:2px 6px 14px}
.pyd-mark{width:30px;height:auto;flex:none}
.pyd-orb{width:26px;height:26px;border-radius:50%;flex:none;background:radial-gradient(circle at 34% 30%,#9cc6f4,#4A8FD8 44%,#1E3A7B);box-shadow:0 0 0 4px rgba(74,143,216,.14)}
.pyd-word{font-family:var(--pyd-f-disp);font-weight:700;font-size:15.5px;letter-spacing:.15em;color:var(--pyd-text)}
.pyd-word em{color:var(--pyd-brand);font-style:normal;font-weight:600}
.pyd-navlabel{font-size:10.5px;font-weight:500;letter-spacing:.16em;text-transform:uppercase;color:var(--pyd-faint);padding:12px 10px 5px}
.pyd-nav{display:flex;flex-direction:column;gap:3px}
.pyd-navlink{display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:10px;color:var(--pyd-muted);font-size:14px;font-weight:500;cursor:pointer;transition:background .18s,color .18s;text-decoration:none}
.pyd-navlink svg{width:18px;height:18px;flex:none}
.pyd-navlink:hover{background:rgba(255,255,255,.04);color:var(--pyd-text)}
.pyd-navlink.is-active{background:rgba(74,143,216,.14);color:#cfe2f6}
.pyd-navlink.is-active svg{color:var(--pyd-brand)}
.pyd-side-foot{margin-top:18px;padding-top:14px;border-top:1px solid var(--pyd-line);display:flex;flex-direction:column;gap:10px}
.pyd-demo-badge{display:inline-flex;align-items:center;gap:7px;align-self:flex-start;font-size:10px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:#f0c67a;background:rgba(240,198,122,.1);border:1px solid rgba(240,198,122,.3);border-radius:999px;padding:5px 11px}
.pyd-demo-badge::before{content:"";width:6px;height:6px;border-radius:50%;background:#f0c67a}
.pyd-side-note{font-size:11.5px;line-height:1.5;color:var(--pyd-faint)}

/* ---- main + topbar ---- */
.pyd-main{min-width:0;display:flex;flex-direction:column}
.pyd-top{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px clamp(18px,2.4vw,32px);border-bottom:1px solid var(--pyd-line)}
.pyd-h1{font-family:var(--pyd-f-disp);font-weight:800;font-size:22px;letter-spacing:.05em;text-transform:uppercase}
.pyd-top-r{display:flex;align-items:center;gap:14px}
.pyd-period{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;color:var(--pyd-muted);background:var(--pyd-surface);border:1px solid var(--pyd-line-2);border-radius:9px;padding:8px 13px;cursor:pointer;transition:border-color .2s}
.pyd-period:hover{border-color:rgba(74,143,216,.5)}
.pyd-period svg{width:13px;height:13px;opacity:.7;flex:none}
.pyd-period select{appearance:none;-webkit-appearance:none;background:transparent url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23697079' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right center/11px;border:0;color:var(--pyd-muted);font:inherit;font-size:12.5px;outline:none;cursor:pointer;padding:0 17px 0 0;color-scheme:dark}
.pyd-period select option{background-color:#15181C;color:#F3F4F6;font-size:13px;padding:8px 12px}
.pyd-period select option:checked{background-color:#1C2026;color:#6ba6e4}
.pyd-user{display:flex;align-items:center;gap:9px}
.pyd-user .pyd-ava{width:42px;height:42px;border-radius:50%;background:linear-gradient(135deg,#4A8FD8,#7d5bd6);flex:none;display:block;object-fit:cover;border:1.5px solid rgba(74,143,216,.5);box-shadow:0 0 0 3px rgba(74,143,216,.12)}
.pyd-user .nm{font-size:13px;font-weight:600}
.pyd-user .rl{display:block;font-size:11px;color:var(--pyd-faint)}

.pyd-scroll{padding:clamp(18px,2.4vw,32px);overflow:auto}
.pyd-panel{display:none;animation:pyd-fade .35s ease}
.pyd-panel.is-active{display:block}
@keyframes pyd-fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* ---- section headers ---- */
.pyd-cardh{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.pyd-cardh h3{display:flex;align-items:center;gap:10px;font-family:var(--pyd-f-disp);font-weight:700;font-size:16px;letter-spacing:.01em}
.pyd-cardh h3::before{content:"";width:4px;height:16px;border-radius:2px;background:var(--pyd-brand)}
.pyd-cardh .pyd-sub{font-size:11.5px;color:var(--pyd-faint);letter-spacing:.02em}

/* ---- stat cards ---- */
.pyd-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.pyd-stat{position:relative;background:var(--pyd-surface);border:1px solid rgba(74,143,216,.34);border-radius:14px;padding:18px 18px 16px;overflow:hidden}
.pyd-stat--g{border-color:rgba(30,215,96,.30)}
.pyd-stat--r{border-color:rgba(255,82,82,.30)}
.pyd-stat--y{border-color:rgba(240,165,58,.32)}
.pyd-stat-top{display:flex;align-items:flex-start;justify-content:space-between}
.pyd-stat-k{font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--pyd-faint)}
.pyd-stat-ic{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;background:rgba(74,143,216,.14);color:var(--pyd-brand)}
.pyd-stat-ic svg{width:17px;height:17px}
.pyd-stat-num{font-family:var(--pyd-f-disp);font-weight:800;font-size:31px;line-height:1;letter-spacing:.01em;margin:12px 0 8px}
.pyd-delta{font-size:12px;font-weight:600;color:var(--pyd-pos)}
.pyd-delta span{color:var(--pyd-faint);font-weight:400}
.pyd-delta.neg{color:var(--pyd-red)}

/* ---- generic panel card ---- */
.pyd-block{background:var(--pyd-surface);border:1px solid var(--pyd-line);border-radius:16px;padding:clamp(18px,2vw,24px);margin-bottom:20px}
.pyd-grid-2{display:grid;grid-template-columns:1.5fr 1fr;gap:20px}
.pyd-grid-2>*{margin-bottom:0}

/* ---- platform mini-stats ---- */
.pyd-plats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}
.pyd-plat{background:var(--pyd-elev);border:1px solid var(--pyd-line);border-radius:12px;padding:14px}
.pyd-plat-k{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--pyd-muted)}
.pyd-plat-k i{width:9px;height:9px;border-radius:3px;flex:none}
.pyd-plat-v{font-family:var(--pyd-f-disp);font-weight:700;font-size:20px;letter-spacing:.01em;margin:8px 0 4px}
.pyd-plat-d{font-size:11.5px;color:var(--pyd-pos)}

/* ---- line chart ---- */
.pyd-linewrap{position:relative;width:100%}
.pyd-line{width:100%;height:auto;display:block}
.pyd-legend{display:flex;flex-wrap:wrap;gap:16px;justify-content:flex-end;margin-bottom:8px}
.pyd-legend span{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--pyd-muted)}
.pyd-legend i{width:11px;height:11px;border-radius:3px}
.pyd-chart-foot{display:flex;justify-content:space-between;font-size:12px;color:var(--pyd-faint);margin-top:10px;border-top:1px solid var(--pyd-line);padding-top:12px}
.pyd-chart-foot b{color:var(--pyd-text)}

/* ---- revenue: donut + bars ---- */
.pyd-donutwrap{display:flex;align-items:center;justify-content:center;position:relative;padding:8px}
.pyd-donut{width:190px;height:190px}
.pyd-donut-c{position:absolute;text-align:center}
.pyd-donut-c b{display:block;font-family:var(--pyd-f-disp);font-weight:800;font-size:24px}
.pyd-donut-c span{font-size:11px;color:var(--pyd-faint);letter-spacing:.08em;text-transform:uppercase}
.pyd-barlist{display:flex;flex-direction:column;gap:14px}
.pyd-barrow{display:grid;grid-template-columns:1fr auto;gap:4px 12px;align-items:center}
.pyd-barrow .lb{font-size:13px;color:var(--pyd-text)}
.pyd-barrow .vb{font-size:12.5px;color:var(--pyd-muted);font-variant-numeric:tabular-nums}
.pyd-track-bar{grid-column:1/-1;height:7px;border-radius:99px;background:rgba(255,255,255,.06);overflow:hidden}
.pyd-track-bar>i{display:block;height:100%;border-radius:99px}

/* ---- artists table ---- */
.pyd-table{width:100%;border-collapse:collapse;font-size:13.5px}
.pyd-table th{text-align:left;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--pyd-faint);font-weight:600;padding:0 14px 12px}
.pyd-table td{padding:13px 14px;border-top:1px solid var(--pyd-line)}
.pyd-table tr:hover td{background:rgba(255,255,255,.02)}
.pyd-table .ar{text-align:right}
.pyd-artist{display:flex;align-items:center;gap:11px}
.pyd-artist .pyd-ava{width:34px;height:34px;border-radius:50%;flex:none}
.pyd-artist b{font-size:13.5px}
.pyd-artist span{display:block;font-size:11.5px;color:var(--pyd-faint)}
.pyd-up{color:var(--pyd-pos);font-weight:600}
.pyd-down{color:var(--pyd-red);font-weight:600}

/* ---- audience (male/female split bars) ---- */
.pyd-aud{display:flex;flex-direction:column;gap:16px}
.pyd-aud-row{display:grid;grid-template-columns:46px 1fr;gap:14px;align-items:center}
.pyd-aud-row .ag{font-size:12.5px;color:var(--pyd-muted);font-variant-numeric:tabular-nums}
.pyd-split{display:flex;height:12px;border-radius:99px;overflow:hidden;background:rgba(255,255,255,.05)}
.pyd-split i{display:block;height:100%}
.pyd-split .m{background:#4A8FD8}
.pyd-split .f{background:#a56be0}
.pyd-legend--aud i.m{background:#4A8FD8}
.pyd-legend--aud i.f{background:#a56be0}

/* ---- geography ---- */
.pyd-geo{display:flex;flex-direction:column;gap:13px}
.pyd-geo-row{display:grid;grid-template-columns:26px 1fr auto;gap:12px;align-items:center;font-size:13px}
.pyd-geo-row .fl{width:26px;height:18px;border-radius:3px;background:var(--pyd-surface-2);overflow:hidden;font-size:13px;line-height:18px;text-align:center}
.pyd-geo-row .gv{color:var(--pyd-muted);font-variant-numeric:tabular-nums}
.pyd-geo-bar{grid-column:2/-1;height:6px;border-radius:99px;background:rgba(255,255,255,.06);overflow:hidden;margin-top:-6px}
.pyd-geo-bar>i{display:block;height:100%;border-radius:99px;background:var(--pyd-brand)}

/* ---- music / top tracks ---- */
.pyd-tracks{display:flex;flex-direction:column}
.pyd-track{display:grid;grid-template-columns:26px 44px 1fr auto auto;gap:14px;align-items:center;padding:12px 6px;border-top:1px solid var(--pyd-line)}
.pyd-track:first-child{border-top:0}
.pyd-track:hover{background:rgba(255,255,255,.02)}
.pyd-track .rk{font-family:"JetBrains Mono","Montserrat",monospace;font-size:12px;color:var(--pyd-faint)}
.pyd-track .cv{width:44px;height:44px;display:grid;place-items:center;color:rgba(255,255,255,.5)}
.pyd-track .cv svg{width:21px;height:21px;display:block}
.pyd-track .tt{display:block;font-family:var(--pyd-f-disp);font-size:15.5px;font-weight:700;letter-spacing:.01em}
.pyd-track .ar2{display:block;font-size:12px;color:var(--pyd-faint);margin-top:2px}
.pyd-track .pl{font-size:12.5px;color:var(--pyd-muted);font-variant-numeric:tabular-nums}
.pyd-chip{font-size:11px;color:var(--pyd-muted);border:1px solid var(--pyd-line-2);border-radius:99px;padding:4px 10px}

/* ---- royalties ---- */
.pyd-earnhead{display:flex;align-items:flex-end;gap:16px;margin-bottom:6px}
.pyd-earnhead b{font-family:var(--pyd-f-disp);font-weight:800;font-size:36px;line-height:1}
.pyd-week{display:flex;align-items:flex-end;gap:clamp(10px,2.4vw,26px);height:190px;padding:10px 4px 0}
.pyd-week-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:8px;height:100%;justify-content:flex-end}
.pyd-week-bars{display:flex;align-items:flex-end;gap:5px;height:100%;width:100%;justify-content:center}
.pyd-week-bars i{width:12px;border-radius:5px 5px 0 0;display:block}
.pyd-week-bars i.cur{background:var(--pyd-green)}
.pyd-week-bars i.prev{background:#7d5bd6}
.pyd-week-col span{font-size:11.5px;color:var(--pyd-faint)}
.pyd-clear{display:flex;flex-direction:column;gap:16px}
.pyd-clear-row .cr-top{display:flex;justify-content:space-between;font-size:13px;margin-bottom:7px}
.pyd-clear-row .cr-top b{font-variant-numeric:tabular-nums}
.pyd-clear-row .cr-lbl{color:var(--pyd-muted);letter-spacing:.04em;text-transform:uppercase;font-size:11px}
.pyd-payout{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;background:var(--pyd-elev);border:1px solid var(--pyd-line);border-radius:12px;padding:18px}
.pyd-payout .amt{font-family:var(--pyd-f-disp);font-weight:800;font-size:24px}
.pyd-payout .amt span{display:block;font-size:11px;color:var(--pyd-faint);font-weight:400;letter-spacing:.06em;text-transform:uppercase}

/* ---- settings ---- */
.pyd-form{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.pyd-field{display:flex;flex-direction:column;gap:7px}
.pyd-field.full{grid-column:1/-1}
.pyd-field label{font-size:12px;color:var(--pyd-muted)}
.pyd-field input,.pyd-field select{background:var(--pyd-elev);border:1px solid var(--pyd-line-2);border-radius:9px;color:var(--pyd-text);font:inherit;font-size:14px;padding:11px 13px}
.pyd-toggles{display:flex;flex-direction:column;gap:12px;margin-top:4px}
.pyd-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13.5px;padding:12px 0;border-top:1px solid var(--pyd-line)}
.pyd-sw{width:38px;height:22px;border-radius:99px;background:var(--pyd-surface-2);position:relative;flex:none;transition:background .2s}
.pyd-sw::after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#8891a0;transition:transform .2s,background .2s}
.pyd-sw.on{background:rgba(74,143,216,.5)}
.pyd-sw.on::after{transform:translateX(16px);background:var(--pyd-brand)}
.pyd-btn{display:inline-flex;align-items:center;gap:8px;font-family:var(--pyd-f-disp);font-weight:700;font-size:14px;letter-spacing:.02em;background:#fff;color:#0B0C0E;border:0;border-radius:99px;padding:12px 24px;cursor:pointer}
.pyd-btn--ghost{background:transparent;color:var(--pyd-text);border:1px solid var(--pyd-line-2)}
.pyd-note{font-size:12px;color:var(--pyd-faint);margin-top:14px}

/* ---- gate (shown until the demo cookie is set) ---- */
.py-demo-gatewrap{max-width:560px;margin:0 auto;text-align:center;padding:clamp(40px,8vw,90px) 20px;font-family:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif}
.py-demo-gatewrap h2{font-family:"Montserrat","Inter",sans-serif;font-weight:700;text-transform:uppercase;letter-spacing:.02em;font-size:clamp(24px,3vw,34px);color:#F3F4F6;margin:0 0 14px}
.py-demo-gatewrap p{color:#9AA1A9;font-size:15px;line-height:1.6;margin:0 0 26px}

/* ---- responsive ---- */
@media(max-width:1040px){
  .pyd-app{grid-template-columns:1fr}
  .pyd-side{flex-direction:row;align-items:center;gap:4px;overflow-x:auto;padding:12px 14px;border-right:0;border-bottom:1px solid var(--pyd-line)}
  .pyd-brand{padding:0 12px 0 4px}
  .pyd-navlabel,.pyd-side-foot{display:none}
  .pyd-nav{flex-direction:row;gap:4px}
  .pyd-navlink span{white-space:nowrap}
  .pyd-stats{grid-template-columns:1fr 1fr}
  .pyd-plats{grid-template-columns:1fr 1fr}
  .pyd-grid-2{grid-template-columns:1fr}
}
@media(max-width:560px){
  .pyd-stats,.pyd-plats,.pyd-form{grid-template-columns:1fr}
  .pyd-top{flex-wrap:wrap}
  .pyd-track{grid-template-columns:22px 40px 1fr auto}
  .pyd-track .pl{display:none}
}
@media(prefers-reduced-motion:reduce){
  .pyd-panel{animation:none}
  .pyd-navlink,.pyd-sw,.pyd-sw::after{transition:none}
}

/* ---- demo-page gate logo ---- */
.py-demo-gate-logo{width:min(230px,60%);height:auto;display:block;margin:0 auto 28px}

/* ---- demo page chrome (the page hosting [py_demo_dashboard]) ---- */
body.py-demo-page{background:#0B0C0E}
.py-demo-wrap{max-width:1280px;margin:0 auto;padding:120px clamp(14px,3vw,40px) 80px}
@media(max-width:768px){.py-demo-wrap{padding:96px 10px 56px}}
