/* =========================================================
   FUSION ADMIN DASHBOARD
   Reference-inspired Fusion dashboard
========================================================= */


/* =========================================================
   DARK THEME
========================================================= */

body.dark {
    --bg: #232334;
    --panel: #2c2c43;
    --ink: #e0dff0;
    --muted: #afafcf;
    --line: #42425c;
    --blue: #7368ff;
    --sidebar: #2c2c43;
    --side-ink: #b2b1d1;
    --tint: #363650;
    --shadow: 0 4px 20px #11112220;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: 265px;
    flex-basis: 265px;
}

.workspace {
    margin-left: 265px;
    width: calc(100% - 265px);
}

.sidebar nav > a,
.sidebar summary {
    font-size: 15px;
    padding: 14px 15px;
}

.nav-symbol {
    color: #aaa7d0;
}

.sidebar .brand {
    padding-bottom: 22px;
}

.sidebar nav > a.active {
    box-shadow: none;
}


/* =========================================================
   TOP BAR
========================================================= */

.topbar {
    position: sticky;
    top: 16px;
    z-index: 9;

    margin: 16px 30px 0;
    min-height: 80px;
    padding: 13px 22px;

    border: 0;
    border-radius: 9px;
    box-shadow: var(--shadow);
}

.topbar-right {
    gap: 18px;
}

.top-link {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 3px;

    font-size: 12px;
    color: var(--muted);
}

.top-link svg {
    width: 25px;
    height: 25px;
}

.topbar .branch-label {
    display: none;
}

.branch-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.branch-control span {
    font-size: 11px;
    color: var(--muted);
}

#branch {
    max-width: 160px;

    border: 0;
    background: transparent;

    font-size: 12px;
}

.topbar #theme {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;

    padding: 5px;

    font-size: 12px;
    font-weight: 400;
}

.topbar #theme svg {
    width: 25px;
    height: 25px;
}


/* =========================================================
   MAIN
========================================================= */

main {
    max-width: 1850px;
    padding: 30px;
}

.dashboard-intro {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 25px;
}

.dashboard-intro h1 {
    font-size: 23px;
    font-weight: 600;
    letter-spacing: 0;
}

.dashboard-intro > span {
    font-size: 12px;
    color: var(--muted);
}


/* =========================================================
   PANELS
========================================================= */

.panel {
    border: 0;
    border-radius: 10px;
}

.fusion-panel {
    margin-bottom: 26px;
}

.fusion-panel .panel-head {
    padding: 24px 28px;
    border: 0;
}

.fusion-panel h2 {
    font-size: 20px;
    font-weight: 600;
}

.fusion-panel .panel-head .text-button {
    font-size: 12px;
}


/* =========================================================
   OVERVIEW
========================================================= */

.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 36px 20px;

    margin-bottom: 26px;
    padding: 36px 28px;

    background: var(--panel);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.overview-stat {
    display: flex;
    align-items: center;
    gap: 17px;

    min-height: 94px;
    border-radius: 8px;
}

.overview-stat:hover {
    background: var(--tint);
}

.overview-icon {
    display: grid;
    place-items: center;

    flex: 0 0 68px;
    width: 68px;
    height: 68px;

    border-radius: 50%;

    color: var(--accent);
    background: color-mix(
        in srgb,
        var(--accent) 15%,
        transparent
    );
}

.overview-icon svg {
    width: 35px;
    height: 35px;
}

.purple {
    --accent: #9189ff;
}

.cyan {
    --accent: #04c1df;
}

.amber {
    --accent: #ffb923;
}

.green {
    --accent: #86d854;
}

.red {
    --accent: #ff6858;
}

.slate {
    --accent: #a3b3c7;
}

.overview-label {
    display: block;

    color: var(--muted);
    font-size: 15px;
}

.overview-stat strong {
    display: block;

    margin-top: 3px;

    color: var(--accent);
    font-size: 27px;
    font-weight: 500;
}

.overview-stat.amber strong {
    font-size: 24px;
}


/* =========================================================
   DASHBOARD GRID
========================================================= */

.fusion-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 26px;
}

.fusion-grid .fusion-panel {
    grid-column: span 3;
    min-width: 0;
    margin: 0;
}

.fusion-grid .product-panel {
    grid-column: span 2;
}

.fusion-grid .collections-panel {
    grid-column: span 4;
}


/* =========================================================
   TABS
========================================================= */

.fusion-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    padding: 12px 28px 24px;
}

.fusion-tabs button {
    min-height: 44px;
    padding: 11px 15px;

    border-radius: 7px;
    background: transparent;

    color: var(--muted);
    font-size: 14px;
}

.fusion-tabs button:hover {
    background: var(--tint);
}

.fusion-tabs button.selected {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 3px 8px #6c63ff35;
}

.fusion-tabs button.selected:hover {
    background: var(--blue);
}


/* =========================================================
   COLLECTION / PRODUCT SUMMARY
========================================================= */

.collection-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;

    padding: 14px 28px 38px;
}

.collection-summary strong {
    font-size: 36px;
    font-weight: 500;
}

.collection-summary span,
.product-total p {
    color: var(--muted);
}

.product-total {
    padding: 12px 28px 30px;
}

.product-total .overview-icon {
    float: right;
}

.product-total strong {
    font-size: 40px;
    font-weight: 500;
}

.product-total .text-button {
    display: inline-block;
    margin-top: 14px;
}

.panel-note {
    padding: 12px 28px 24px;

    color: var(--muted);
    font-size: 12px;
}

.dashboard-empty {
    padding: 30px 28px;
    color: var(--muted);
}


/* =========================================================
   CHART LEGEND
========================================================= */

.fusion-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;

    padding: 8px 28px 20px;

    color: var(--muted);
    font-size: 12px;
}

.fusion-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fusion-legend i {
    display: inline-block;

    width: 13px;
    height: 13px;
}

.series-0 {
    background: #7970ff;
}

.series-1 {
    background: #03bad8;
}

.series-2 {
    background: #f5ac0a;
}

.series-3 {
    background: #3dca96;
}


/* =========================================================
   CHART
========================================================= */

.fusion-chart {
    display: flex;
    gap: 12px;

    height: 275px;
    padding: 16px 28px 15px;
}

.chart-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    flex-shrink: 0;
    width: 66px;
    padding-bottom: 29px;

    color: var(--muted);
    font-size: 11px;
}

.chart-plot {
    display: flex;
    flex: 1;
    gap: 10px;

    min-width: 0;
    margin-bottom: 27px;

    background: repeating-linear-gradient(
        to top,
        transparent 0,
        transparent 99px,
        var(--line) 100px,
        var(--line) 101px
    );

    border-bottom: 1px solid var(--line);
}

.plot-group {
    position: relative;
    flex: 1;
    min-width: 0;
}

.plot-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;

    height: 100%;
}

.plot-series {
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;

    max-width: 46%;
}

.plot-bar {
    max-width: 100%;
    border-radius: 2px 2px 0 0;
}

.plot-value {
    margin-bottom: 3px;

    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.plot-label {
    position: absolute;
    right: 0;
    bottom: -25px;
    left: 0;

    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.fusion-grid .plot-value {
    font-size: 9px;
}

.fusion-grid .fusion-chart {
    padding-right: 20px;
    padding-left: 20px;
}

.fusion-grid th {
    background: transparent;
}


/* =========================================================
   INSTALL GUIDE MODAL
========================================================= */

.install-guide {
    width: min(520px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);

    margin: auto;
    padding: 0;

    overflow-x: hidden;
    overflow-y: auto;

    box-sizing: border-box;
}

.install-guide * {
    box-sizing: border-box;
}

.install-guide .install-guide-content,
.install-guide .dialog-content,
.install-guide > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.install-guide h2,
.install-guide p,
.install-guide li {
    max-width: 100%;

    overflow-wrap: break-word;
    word-break: normal;
}

.install-guide button {
    max-width: 100%;
}


/* =========================================================
   DESKTOP - SIDEBAR COLLAPSE
========================================================= */

@media (min-width: 1201px) {

    #menu-toggle {
        display: block;
    }

    .application.sidebar-closed .sidebar {
        transform: translateX(-100%);
    }

    .application.sidebar-closed .workspace {
        width: 100%;
        margin-left: 0;
    }

}


/* =========================================================
   ≤ 1350PX
========================================================= */

@media (max-width: 1350px) {

    .overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar-right {
        gap: 10px;
    }

    .topbar .breadcrumb {
        display: none;
    }

}


/* =========================================================
   ≤ 1200PX
========================================================= */

@media (max-width: 1200px) {

    .sidebar {
        width: 225px;
    }

    .workspace {
        width: calc(100% - 225px);
        margin-left: 225px;
    }

    .fusion-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fusion-grid .fusion-panel,
    .fusion-grid .product-panel,
    .fusion-grid .collections-panel {
        grid-column: span 1;
    }

    .fusion-grid .product-panel,
    .fusion-grid .collections-panel {
        grid-column: span 2;
    }

    .fusion-grid .plot-value {
        display: none;
    }

}


/* =========================================================
   TABLET ≤ 850PX
========================================================= */

@media (max-width: 850px) {

    .workspace {
        width: 100%;
        margin-left: 0;
    }

    .sidebar {
        width: 250px;
    }

    .topbar {
        top: 0;

        margin: 0;
        border-radius: 0;
    }

    .fusion-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .fusion-grid .fusion-panel,
    .fusion-grid .product-panel,
    .fusion-grid .collections-panel {
        grid-column: span 1;
    }

    .overview-grid {
        gap: 18px;
        padding: 22px;
    }

    .overview-icon {
        flex-basis: 52px;
        width: 52px;
        height: 52px;
    }

    .overview-icon svg {
        width: 28px;
        height: 28px;
    }

    .overview-stat {
        gap: 12px;
    }

    .fusion-chart {
        padding-right: 14px;
        padding-left: 14px;
    }

    .chart-plot {
        gap: 5px;
    }

    .plot-value {
        font-size: 9px;
    }

    .top-shortcuts {
        display: none;
    }

}


/* =========================================================
   MOBILE ≤ 650PX
   INSTALL GUIDE
========================================================= */

@media (max-width: 650px) {

    .install-guide {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);

        margin: auto;

        border-radius: 18px;

        overflow-x: hidden;
        overflow-y: auto;
    }

    .install-guide h2 {
        font-size: 1.35rem;
        line-height: 1.2;
    }

    .install-guide ol {
        max-width: 100%;
        padding-left: 22px;
        padding-right: 8px;
    }

    .install-guide li {
        max-width: 100%;
        padding-left: 2px;

        line-height: 1.6;
        overflow-wrap: break-word;
    }

    .install-guide button {
        width: 100%;
    }

}


/* =========================================================
   MOBILE ≤ 550PX
========================================================= */

@media (max-width: 550px) {

    main {
        padding: 22px 14px;
    }

    .topbar {
        gap: 5px;
        padding: 10px;
    }

    .topbar-right {
        gap: 9px;
    }

    .top-link {
        display: none;
    }

    .branch-control span {
        display: none;
    }

    .topbar #theme {
        font-size: 10px;
    }

    .overview-grid {
        gap: 16px;
        padding: 18px 14px;
    }

    .overview-stat {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .overview-stat strong {
        font-size: 24px;
    }

    .overview-label {
        font-size: 12px;
    }

    .overview-icon {
        flex-basis: 43px;
        width: 43px;
        height: 43px;
    }

    .overview-icon svg {
        width: 24px;
        height: 24px;
    }

    .fusion-panel .panel-head {
        gap: 8px;
        padding: 20px;
    }

    .fusion-panel .panel-head .text-button {
        padding: 5px;
        font-size: 11px;
    }

    .fusion-tabs {
        gap: 4px;
        padding: 8px 18px 20px;
    }

    .fusion-tabs button {
        padding: 8px 10px;
        font-size: 12px;
    }

    .fusion-legend {
        padding: 8px 18px 16px;
    }

    .chart-scale {
        width: 38px;
        font-size: 9px;
    }

    .plot-label {
        font-size: 9px;
    }

    .plot-value {
        display: none;
    }

    .panel-note {
        padding: 12px 18px 20px;
    }

    .fusion-panel h2 {
        font-size: 17px;
    }

    .dashboard-intro > span {
        font-size: 10px;
    }

}


/* =========================================================
   PRINT
========================================================= */

@media print {

    .topbar {
        display: none;
    }

    .fusion-grid {
        display: block;
    }

    .fusion-panel {
        break-inside: avoid;
    }

    .overview-grid {
        background: #fff;
    }

    .overview-stat strong {
        color: #000;
    }

}