/* Jolixo — Admin typography, collapsible sidebar and the analytics dashboard. */

.admin-body {
    --vi:#8b7bff;
    --vi-2:#6c5ce7;
    --vi-soft:rgba(139,123,255,.16);
    --good:#9be15d;
    --bad:#ff6a3d;
    font-family:"Segoe UI Variable Text","Segoe UI Variable","SF Pro Text",-apple-system,BlinkMacSystemFont,Inter,Roboto,"Segoe UI",sans-serif;
    font-size:14px;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

.admin-body h1,.admin-body h2,.admin-body h3,.admin-body strong,.admin-body .admin-logo {
    font-family:"Segoe UI Variable Display","SF Pro Display",-apple-system,Inter,"Segoe UI",sans-serif;
}

.admin-body h1,.admin-body h2 {
    letter-spacing:-.025em;
    font-weight:650;
}

.admin-body .admin-title-row h1 {
    font-weight:700;
}

.admin-nav-link {
    font-size:13.5px;
    font-weight:600;
    min-height:42px;
}

.admin-nav-heading {
    letter-spacing:.06em;
}

.data-table {
    font-size:13px;
}

.data-table td strong {
    font-size:13px;
}

.stat-card strong,.dash strong {
    font-variant-numeric:tabular-nums;
}

/* collapsible sidebar */
.admin-shell {
    transition:grid-template-columns .25s ease;
}

.admin-side {
    position:sticky;
}

.admin-logo {
    padding-right:40px;
}

.side-toggle {
    position:absolute;
    top:34px;
    right:14px;
    width:28px;
    height:28px;
    border-radius:9px;
    border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.06);
    color:#a6b6cc;
    display:grid;
    place-items:center;
    transition:transform .25s,color .18s;
}

.side-toggle:hover {
    color:#fff;
}

[data-side=mini] .admin-shell {
    grid-template-columns:80px minmax(0,1fr);
}

[data-side=mini] .admin-side {
    padding:26px 12px;
    overflow-x:hidden;
}

[data-side=mini] .admin-logo {
    padding:0;
    justify-content:center;
    margin-bottom:22px;
}

[data-side=mini] .admin-logo>span:last-child,[data-side=mini] .side-label,[data-side=mini] .admin-nav-heading,[data-side=mini] .admin-nav-link span,[data-side=mini] .admin-sidebar-bottom {
    display:none;
}

[data-side=mini] .side-toggle {
    position:static;
    margin:0 auto 18px;
    transform:rotate(180deg);
}

[data-side=mini] .admin-nav {
    align-items:center;
    gap:6px;
}

[data-side=mini] .admin-nav-link {
    width:46px;
    height:46px;
    min-height:46px;
    padding:0;
    justify-content:center;
    border-radius:14px;
}

[data-side=mini] .admin-nav-link svg {
    width:20px;
    height:20px;
}

/* dashboard */
.dash-head {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin:4px 0 22px;
    flex-wrap:wrap;
}

.dash-head h1 {
    font-size:clamp(24px,2.2vw,30px);
    margin:0;
}

.dash-head-actions {
    display:flex;
    align-items:center;
    gap:12px;
}

.date-chip {
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-size:13px;
    font-weight:600;
    color:var(--muted);
}

.date-chip svg {
    width:16px;
    height:16px;
}

.btn-violet {
    background:linear-gradient(135deg,var(--vi),var(--vi-2));
    color:#fff;
    box-shadow:0 10px 26px -10px rgba(108,92,231,.8),inset 0 1px 0 rgba(255,255,255,.25);
}

.btn-violet:hover {
    filter:brightness(1.08);
}

.dash {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr)) minmax(280px,1.15fr);
    grid-template-areas:"k1 k2 k3 heat" "line line cmp heat" "ins don gau gau";
    gap:16px;
    margin-bottom:20px;
}

.dk {
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:22px;
    padding:20px;
    min-width:0;
    position:relative;
    overflow:hidden;
}

[data-theme=dark] .dk {
    background:linear-gradient(180deg,#191e2d,#141826);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}

.dk h2 {
    font-size:16px;
    margin:0 0 14px;
    font-weight:600;
    letter-spacing:-.01em;
}

.card-head {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-bottom:6px;
}

.card-head h2 {
    margin:0;
}

.muted-sm {
    font-size:12px;
    color:var(--muted);
}

.k1 {
    grid-area:k1;
}

.k2 {
    grid-area:k2;
}

.k3 {
    grid-area:k3;
}

.heat {
    grid-area:heat;
}

.line {
    grid-area:line;
}

.compare {
    grid-area:cmp;
}

.insight {
    grid-area:ins;
}

.donut-card {
    grid-area:don;
}

.gauge-card {
    grid-area:gau;
}

.kpi {
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    gap:26px;
    color:var(--ink);
    transition:border-color .18s,transform .18s;
}

.kpi:hover {
    border-color:rgba(139,123,255,.45);
    transform:translateY(-2px);
}

.kpi-top {
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-size:13px;
    color:var(--muted);
    font-weight:600;
}

.kpi-top span {
    display:flex;
    align-items:center;
    gap:8px;
}

.kpi-top svg {
    width:16px;
    height:16px;
}

.kpi-top i {
    font-style:normal;
    width:30px;
    height:30px;
    border-radius:50%;
    border:1px solid var(--border);
    display:grid;
    place-items:center;
    font-size:13px;
    color:var(--ink);
}

.kpi-val {
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

.kpi-val strong {
    font-size:clamp(30px,2.8vw,42px);
    font-weight:500;
    letter-spacing:-.04em;
    line-height:1;
}

.trend {
    font-size:11px;
    font-weight:800;
    padding:4px 9px;
    border-radius:999px;
    white-space:nowrap;
}

.trend.up {
    background:rgba(155,225,93,.16);
    color:var(--good);
}

.trend.down {
    background:rgba(255,106,61,.16);
    color:var(--bad);
}

.trend.flat {
    background:var(--soft);
    color:var(--muted);
}

[data-theme=light] .trend.up {
    color:#3f8f12;
}

.legend {
    display:flex;
    gap:14px;
    font-size:11px;
    color:var(--muted);
    margin-bottom:14px;
}

.legend span {
    display:flex;
    align-items:center;
    gap:6px;
}

.legend i {
    width:12px;
    height:12px;
    border-radius:4px;
}

.heat-grid {
    display:grid;
    grid-template-columns:42px repeat(7,1fr);
    gap:6px;
    align-items:center;
}

.heat-grid i {
    aspect-ratio:1.3;
    border-radius:7px;
}

.l0 {
    background:repeating-linear-gradient(135deg,var(--soft) 0 3px,transparent 3px 6px);
    border:1px solid var(--border);
}

.l1 {
    background:rgba(139,123,255,.25);
}

.l2 {
    background:rgba(139,123,255,.45);
}

.l3 {
    background:rgba(139,123,255,.7);
}

.l4 {
    background:var(--vi);
    box-shadow:0 0 14px rgba(139,123,255,.5);
}

.hl,.hd {
    font-size:10.5px;
    color:var(--muted);
    font-weight:600;
}

.hd {
    text-align:center;
}

.split-bar {
    display:flex;
    gap:4px;
    height:6px;
    margin:20px 0 10px;
}

.split-bar i {
    border-radius:9px;
    background:var(--soft);
}

.split-bar .s0 {
    background:var(--vi);
}

.split-bar .s1 {
    background:var(--good);
}

.split-bar .s2 {
    background:#5b6275;
}

.split-labels {
    display:flex;
    gap:22px;
}

.split-labels span {
    display:grid;
    font-size:11px;
    color:var(--muted);
    font-weight:600;
}

.split-labels b {
    font-size:20px;
    color:var(--ink);
    font-weight:500;
}

.ai-note {
    display:flex;
    gap:10px;
    align-items:flex-start;
    margin-top:16px;
    padding:12px 14px;
    border-radius:14px;
    background:var(--soft);
    border:1px solid var(--border);
}

.ai-note svg {
    width:16px;
    height:16px;
    color:var(--vi);
    flex:none;
    margin-top:2px;
}

.ai-note p {
    margin:0;
    font-size:12px;
    line-height:1.55;
    color:var(--muted);
}

.ai-note b {
    color:var(--ink);
}

.ai-note a {
    color:var(--vi);
    font-weight:700;
}

.chart-wrap {
    position:relative;
    height:230px;
    margin-top:8px;
}

.chart {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    overflow:visible;
}

.chart .grid {
    stroke:var(--border);
    stroke-width:1;
    stroke-dasharray:3 5;
    vector-effect:non-scaling-stroke;
}

.chart .ln {
    fill:none;
    stroke:#c9c1ff;
    stroke-width:2.5;
    vector-effect:non-scaling-stroke;
}

.y-axis {
    position:absolute;
    left:0;
    top:calc(10/220*100% - 7px);
    height:calc(180/220*100%);
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    font-size:10.5px;
    color:var(--muted);
    font-weight:600;
}

.y-axis span {
    line-height:14px;
}

.chart-hover {
    position:absolute;
    top:0;
    bottom:0;
    left:calc(40/600*100%);
    right:calc(10/600*100%);
    cursor:crosshair;
}

.ch-line,.ch-dot,.ch-tip {
    position:absolute;
    opacity:0;
    transition:opacity .15s;
    pointer-events:none;
}

.chart-hover.on .ch-line,.chart-hover.on .ch-dot,.chart-hover.on .ch-tip {
    opacity:1;
}

.ch-line {
    top:0;
    bottom:calc(30/220*100%);
    width:22px;
    margin-left:-11px;
    border-radius:999px;
    background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.02));
}

.ch-dot {
    width:10px;
    height:10px;
    margin:-5px 0 0 -5px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 0 0 4px rgba(139,123,255,.45);
}

.ch-tip {
    transform:translate(-50%,calc(-100% - 14px));
    background:#fff;
    color:#111;
    font-size:11.5px;
    font-weight:700;
    padding:6px 10px;
    border-radius:10px;
    white-space:nowrap;
    box-shadow:0 8px 20px rgba(0,0,0,.3);
}

.x-axis {
    position:relative;
    height:18px;
    margin:4px calc(10/600*100%) 0 calc(40/600*100%);
}

.x-axis span {
    position:absolute;
    transform:translateX(-50%);
    font-size:10.5px;
    color:var(--muted);
    font-weight:600;
    white-space:nowrap;
}

.cmp {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
}

.cmp strong {
    font-size:30px;
    font-weight:500;
    letter-spacing:-.03em;
    display:block;
    line-height:1.1;
}

.cmp small {
    font-size:12px;
    color:var(--muted);
    font-weight:600;
}

.bars {
    display:grid;
    gap:4px;
    margin-top:12px;
}

.bars i {
    height:7px;
    border-radius:3px;
    background:var(--soft);
}

.bars .on-g {
    background:var(--good);
    box-shadow:0 0 8px rgba(155,225,93,.35);
}

.bars .on-r {
    background:var(--bad);
    box-shadow:0 0 8px rgba(255,106,61,.35);
}

.insight {
    background:radial-gradient(circle at 85% 10%,rgba(255,255,255,.35),transparent 30%),linear-gradient(150deg,#9d8cff,#6c4fe0)!important;
    border:0;
    color:#fff;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    gap:16px;
    box-shadow:0 20px 50px -20px rgba(108,79,224,.7);
}

.ins-tag {
    display:inline-flex;
    align-items:center;
    gap:6px;
    align-self:flex-start;
    font-size:11px;
    font-weight:700;
    padding:5px 10px;
    border-radius:999px;
    background:rgba(255,255,255,.18);
    border:1px solid rgba(255,255,255,.25);
}

.ins-tag svg {
    width:13px;
    height:13px;
}

.ins-text {
    font-size:clamp(17px,1.45vw,21px);
    line-height:1.3;
    margin:0;
    color:#fff;
    font-family:"Segoe UI Variable Display","SF Pro Display",-apple-system,Inter,sans-serif;
    letter-spacing:-.01em;
}

.ins-text mark {
    background:rgba(255,255,255,.95);
    color:#5b3fd6;
    border-radius:999px;
    padding:0 8px;
    font-weight:700;
}

.ins-bars {
    display:grid;
    grid-template-columns:repeat(10,1fr);
    gap:4px;
}

.ins-bars i {
    height:14px;
    border-radius:4px;
    background:rgba(255,255,255,.22);
}

.ins-bars .on {
    background:#fff;
}

.mini-chip {
    font-size:12px;
    font-weight:700;
    padding:6px 12px;
    border-radius:999px;
    border:1px solid var(--border);
    color:var(--ink);
}

.donut-row {
    display:flex;
    align-items:center;
    gap:18px;
    margin-top:8px;
}

.donut {
    position:relative;
    width:150px;
    flex:none;
}

.donut svg {
    width:100%;
    transform:rotate(-90deg);
}

.d-bg {
    fill:none;
    stroke:var(--soft);
    stroke-width:14;
}

.d-seg {
    fill:none;
    stroke-width:14;
    stroke-linecap:butt;
}

.d-seg.d0,.legend-list .d0 {
    stroke:#8b7bff;
    background:#8b7bff;
}

.d-seg.d1,.legend-list .d1 {
    stroke:#6c5ce7;
    background:#6c5ce7;
}

.d-seg.d2,.legend-list .d2 {
    stroke:#4f43a8;
    background:#4f43a8;
}

.d-seg.d3,.legend-list .d3 {
    stroke:#a9a2d6;
    background:#a9a2d6;
}

.d-seg.d4,.legend-list .d4 {
    stroke:#3a3560;
    background:#3a3560;
}

.donut-c {
    position:absolute;
    inset:0;
    display:grid;
    place-content:center;
    text-align:center;
}

.donut-c strong {
    font-size:26px;
    font-weight:500;
    letter-spacing:-.03em;
    line-height:1;
}

.donut-c small {
    font-size:11px;
    color:var(--muted);
}

.legend-list {
    list-style:none;
    margin:0;
    padding:0;
    display:grid;
    gap:9px;
    flex:1;
    min-width:0;
}

.legend-list li {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:12.5px;
    color:var(--muted);
}

.legend-list li i {
    width:8px;
    height:8px;
    border-radius:50%;
    flex:none;
}

.legend-list li span {
    flex:1;
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    border-bottom:1px dashed var(--border);
    padding-bottom:2px;
}

.legend-list li b {
    color:var(--ink);
    font-weight:600;
}

.round-link {
    width:30px;
    height:30px;
    border-radius:50%;
    border:1px solid var(--border);
    display:grid;
    place-items:center;
    font-size:13px;
}

.gauge {
    position:relative;
    max-width:340px;
    margin:10px auto 0;
}

.gauge svg {
    width:100%;
    display:block;
}

.gauge line {
    stroke-width:11;
    stroke-linecap:round;
}

.g-on {
    stroke:var(--vi);
    filter:drop-shadow(0 0 4px rgba(139,123,255,.6));
}

.g-off {
    stroke:var(--soft);
}

.gauge-c {
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    text-align:center;
}

.gauge-c strong {
    font-size:40px;
    font-weight:500;
    letter-spacing:-.04em;
    display:block;
    line-height:1;
}

.gauge-c small {
    font-size:12px;
    color:var(--muted);
}

.dash-bottom {
    margin-top:4px;
}

@media(max-width:1400px) {
    .dash {
        grid-template-columns:repeat(3,minmax(0,1fr));
        grid-template-areas:"k1 k2 k3" "line line cmp" "heat heat ins" "don gau gau";
    }
}

@media(max-width:900px) {
    .dash {
        grid-template-columns:1fr 1fr;
        grid-template-areas:"k1 k2" "k3 k3" "line line" "cmp ins" "heat heat" "don don" "gau gau";
    }
}

@media(max-width:600px) {
    .dash {
        grid-template-columns:1fr;
        grid-template-areas:"k1" "k2" "k3" "line" "cmp" "ins" "heat" "don" "gau";
    }
    .donut-row {
        flex-direction:column;
        align-items:stretch;
    }
    .donut {
        margin:0 auto;
    }
}

@media(prefers-reduced-motion:reduce) {
    .admin-shell,.side-toggle,.kpi {
        transition:none;
    }
}

/* Sidebar scrollbar: slim and subtle, clearer while the sidebar is hovered */
.admin-side {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    scrollbar-gutter: stable;
}

.admin-side:hover,
.admin-side:focus-within {
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
}

.admin-side::-webkit-scrollbar {
    width: 6px;
}

.admin-side::-webkit-scrollbar-track {
    background: transparent;
    margin: 12px 0;
}

.admin-side::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
}

.admin-side:hover::-webkit-scrollbar-thumb,
.admin-side:focus-within::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .22);
}

.admin-side::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .4);
}

/* Game library bulk actions */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.bulk-all {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.bulk-count {
    margin-right: auto;
    font-size: 12px;
    color: var(--muted);
}

.bulk-col {
    width: 36px;
}

.bulk-col input,
.bulk-all input {
    width: 17px;
    height: 17px;
    accent-color: var(--coral);
    cursor: pointer;
}

.bulk-bar .btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
