.sx-home {
    --sx-home-brand: var(--sx-brand, var(--sx-primary, #176b59));
    --sx-home-brand-soft: var(--sx-brand-soft, #e8f3ef);
    --sx-home-canvas: var(--sx-canvas, #f5f7f5);
    --sx-home-surface: var(--sx-surface, #fff);
    --sx-home-ink: var(--sx-ink, var(--sx-text, #19312c));
    --sx-home-muted: var(--sx-muted, #53675f);
    --sx-home-border: var(--sx-border, #dce5df);
    --sx-home-radius: var(--sx-radius-lg, 16px);
    --sx-home-shadow: var(--sx-shadow-sm, 0 8px 24px rgba(25, 49, 44, .07));
    min-height: 100%;
    padding: 28px;
    color: var(--sx-home-ink);
    background: var(--sx-home-canvas);
}

.sx-home__header,
.sx-home__chart-layout,
.sx-home__disk,
.sx-home__distribution-meta,
.sx-home__legend li {
    display: flex;
}

.sx-home__header {
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto 22px;
}

.sx-home__heading { min-width: 0; }

.sx-home__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--sx-home-brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sx-home__title {
    margin: 0;
    color: var(--sx-home-ink);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
}

.sx-home__title i {
    margin-inline-end: 10px;
    color: var(--sx-home-brand);
    font-size: 23px;
}

.sx-home__selector {
    width: min(340px, 42vw);
    min-width: 280px;
}

/* DashboardSelector carries a spacer column for the former full-width header. */
.sx-home__selector > .row {
    margin: 0;
}

.sx-home__selector > .row > div:first-child {
    display: none;
}

.sx-home__selector > .row > div:last-child {
    width: 100%;
    padding: 0;
    float: none;
}

.sx-home__selector .ui-select-container,
.sx-home__selector .ui-select-match,
.sx-home__selector .ui-select-toggle {
    width: 100%;
}

.sx-home__selector .ui-select-toggle {
    min-height: var(--sx-control-height, 40px);
    padding: 9px 32px 9px 13px;
    overflow: hidden;
    border-color: var(--sx-home-border);
    border-radius: var(--sx-radius-sm, 7px);
    background: var(--sx-home-surface);
    color: var(--sx-home-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: none;
}

[dir="rtl"] .sx-home__selector .ui-select-toggle,
.rtl .sx-home__selector .ui-select-toggle {
    padding-right: 13px;
    padding-left: 32px;
}

.sx-home__overview,
.sx-home__workspace,
.sx-home__widget {
    border: 1px solid var(--sx-home-border);
    border-radius: var(--sx-home-radius);
    background: var(--sx-home-surface);
    box-shadow: var(--sx-home-shadow);
}

.sx-home__overview,
.sx-home__workspace {
    max-width: 1600px;
    margin: 0 auto 22px;
}

.sx-home__overview { padding: 20px 22px 22px; }

.sx-home__section-heading,
.sx-home__widget-heading {
    display: flex;
    align-items: center;
}

.sx-home__section-heading {
    gap: 12px;
    margin-bottom: 18px;
}

.sx-home__section-icon,
.sx-home__widget-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: var(--sx-home-brand);
    background: var(--sx-home-brand-soft);
}

.sx-home__section-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 16px;
}

.sx-home__section-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.sx-home__section-rule {
    display: block;
    width: 32px;
    height: 2px;
    margin-top: 6px;
    border-radius: 2px;
    background: var(--sx-home-brand);
}

.sx-home__overview-content > .row {
    margin: 0;
}

.sx-home__overview-content > .row > div {
    padding: 0;
}

.sx-home__overview-content .DashboardWrapper {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 12px;
}

.sx-home__overview-content .DashboardWrapper::before,
.sx-home__overview-content .DashboardWrapper::after {
    display: none;
}

.sx-home__overview-content .DashboardWrapper > [class*="col-"] {
    width: auto;
    min-width: 0;
    padding: 0;
    float: none;
}

.sx-home__overview-content .stat-box {
    display: flex;
    min-height: 112px;
    height: 100%;
    margin: 0;
    padding: 12px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border: 1px solid var(--sx-home-border);
    border-radius: var(--sx-radius, 12px);
    background: var(--sx-home-surface-muted, #f8faf8);
    color: var(--sx-home-ink);
    box-shadow: none;
}

.sx-home__overview-content a.stat-box:hover,
.sx-home__overview-content a.stat-box:focus {
    border-color: var(--sx-border-strong, #bdcbc4);
    color: var(--sx-home-ink);
    background: var(--sx-home-brand-soft);
    text-decoration: none;
    box-shadow: none;
}

.sx-home__overview-content .stat-box > a.pull-right {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-end: 12px;
    z-index: 1;
}

.sx-home__overview-content .stat-box h3 {
    min-height: 0;
    margin: 0 0 13px;
    padding-inline-end: 22px;
    color: var(--sx-home-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.sx-home__overview-content .stat-box-content {
    display: flex;
    min-height: 58px;
    height: auto;
    align-items: center;
    gap: 12px;
}

.sx-home__overview-content .stat-box-content h4,
.sx-home__overview-content .stat-box-content h4.centered {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    color: var(--sx-home-ink);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
}

.sx-home__overview-content .stat-box-content h4.danger { color: var(--sx-danger, #b43c48); }
.sx-home__overview-content .stat-box-content h4.warning { color: var(--sx-warning, #a66b00); }

.sx-home__overview-content .stat-box-content h4 > small {
    color: var(--sx-home-muted);
    font-size: 11px;
    font-weight: 500;
}

.sx-home__overview-content .stat-box .stat-icon {
    display: none;
}

.sx-home__overview-content .stat-box-content .chart-labels {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.sx-home__overview-content .stat-box-content .chart-labels ul {
    margin: 0;
    padding-inline-start: 16px;
    color: var(--sx-home-muted);
    font-size: 10px;
    line-height: 1.5;
}

.sx-home__overview-content .stat-box-content .chart-labels li {
    overflow: hidden;
    color: inherit;
    font-size: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-home__overview-content .stat-box-content .chart {
    flex: 0 0 auto;
}

.sx-home__overview-content .stat-box-content .chart canvas { width:64px !important; height:64px !important; }

.sx-home__overview-content .stat-box > .progress-xs {
    height: 4px;
    margin: 12px 0 0 !important;
    overflow: hidden;
    border-radius: 4px;
    background: var(--sx-home-border);
}

.sx-home__workspace { overflow: hidden; }

.sx-home__tabs.tab-container {
    margin: 0;
    border: 0;
    box-shadow: none;
}

.sx-home__tabs > .nav-tabs {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 10px 14px 0;
    border-bottom: 1px solid var(--sx-home-border);
    background: var(--sx-home-surface);
}

.sx-home__tabs > .nav-tabs > li { float: none; margin: 0; }

.sx-home__tabs > .nav-tabs > li > a {
    margin: 0;
    padding: 11px 16px;
    border: 0;
    border-radius: 9px 9px 0 0;
    color: var(--sx-home-muted);
    font-weight: 600;
}

.sx-home__tabs > .nav-tabs > li > a:hover,
.sx-home__tabs > .nav-tabs > li > a:focus {
    border: 0;
    color: var(--sx-home-ink);
    background: var(--sx-home-canvas);
}

.sx-home__tabs > .nav-tabs > li.active > a,
.sx-home__tabs > .nav-tabs > li.active > a:hover,
.sx-home__tabs > .nav-tabs > li.active > a:focus {
    border: 0;
    color: var(--sx-home-brand);
    background: var(--sx-home-brand-soft);
}

.sx-home__tabs > .tab-content { padding: 0; border: 0; }

.sx-home__tab-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sx-home__badge {
    min-width: 20px;
    padding: 3px 6px;
    border-radius: 10px;
}

.sx-home__messages { min-height: 260px; padding: 18px; }

.sx-home__stats {
    padding: 20px;
    background: var(--sx-home-canvas);
}

.sx-home__widget-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: 18px;
    margin-top: 18px;
}

.sx-home__widget { overflow: hidden; box-shadow: none; }
.sx-home__widget--disk { margin-top: 18px; }

.sx-home__widget-heading {
    gap: 10px;
    min-height: 58px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--sx-home-border);
}

.sx-home__widget-heading h3 { margin: 0; font-size: 15px; font-weight: 600; }

.sx-home__widget-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

.sx-home__widget-body { padding: 18px; }

.sx-home__state {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--sx-home-muted);
    text-align: center;
}

.sx-home__state i { color: var(--sx-home-brand); font-size: 27px; }
.sx-home__state--empty i { color: var(--sx-home-muted); }

.sx-home__chart-layout { align-items: center; gap: 18px; }

.sx-home__chart,
.sx-home__chart-summary { flex: 1 1 50%; min-width: 0; }

.sx-home__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sx-home-border);
    color: var(--sx-home-muted);
}

.sx-home__total strong { color: var(--sx-home-ink); font-size: 22px; }
.sx-home__legend { margin: 0; }

.sx-home__legend li {
    align-items: center;
    gap: 8px;
    min-height: 30px;
}

.sx-home__legend-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.sx-home__legend-name,
.sx-home__distribution-meta strong {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-home__legend-value,
.sx-home__distribution-meta span,
.sx-home__available,
.sx-home__disk-copy small {
    color: var(--sx-home-muted);
    font-size: 12px;
}

.sx-home__distribution-row + .sx-home__distribution-row { margin-top: 16px; }

.sx-home__distribution-meta {
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.sx-home__progress.progress {
    height: 7px;
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--sx-home-border);
    box-shadow: none;
}

.sx-home__progress .progress-bar {
    min-width: 2px;
    border-radius: 8px;
    box-shadow: none;
}

.sx-home__disk { align-items: center; gap: 28px; }

.sx-home__disk-copy {
    display: grid;
    min-width: 180px;
    gap: 2px;
}

.sx-home__disk-copy > span {
    color: var(--sx-home-muted);
    font-size: 12px;
    font-weight: 600;
}

.sx-home__disk-copy strong { font-size: 24px; line-height: 1.25; }
.sx-home__disk-meter { flex: 1 1 auto; }

.sx-home__progress--disk.progress { height: 22px; margin-bottom: 7px; }

.sx-home__progress--disk .progress-bar {
    min-width: 0;
    font-size: 11px;
    line-height: 22px;
}

@media (max-width: 991px) {
    .sx-home { padding: 20px; }
    .sx-home__widget-grid { grid-template-columns: 1fr; }
    .sx-home__overview-content .DashboardWrapper { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .sx-home { padding: 14px; }

    .sx-home__header,
    .sx-home__chart-layout,
    .sx-home__disk {
        align-items: stretch;
        flex-direction: column;
    }

    .sx-home__selector { width: 100%; min-width: 0; }
    .sx-home__overview { padding: 18px 16px; }
    .sx-home__stats, .sx-home__messages { padding: 12px; }

    .sx-home__tabs > .nav-tabs {
        overflow-x: auto;
        padding-inline: 8px;
        white-space: nowrap;
    }

    .sx-home__chart { min-height: 260px; }
    .sx-home__disk-copy { min-width: 0; }
}

@media (max-width: 479px) {
    .sx-home__overview-content .DashboardWrapper { grid-template-columns: 1fr; }
}

@media print {
    .sx-home { padding: 0; background: #fff; }

    .sx-home__overview,
    .sx-home__workspace,
    .sx-home__widget { border-color: #ddd; box-shadow: none; }
}

.sx-home__widget-grid > .sx-home__widget--chart { grid-column:1 / -1; }
.sx-home__chart { height:340px; }
.sx-home__legend { max-height:360px; overflow:auto; }
