.erp-shell {
    --erp-blue: #1859d1;
    --erp-ink: #192f53;
    --erp-line: #dce6f5;
    --erp-canvas: #fff;
    background: var(--erp-canvas);
    color: var(--erp-ink);
}
.erp-shell.admin-workspace {
    --admin-canvas: var(--erp-canvas);
    --admin-ink: #192f53;
    --admin-muted: #496281;
    --admin-line: #dce6f5;
    --admin-accent: #1859d1;
    --admin-accent-hover: #164aaa;
    --admin-accent-wash: #e8f0ff;
}
.erp-shell > .erp-header {
    background: #fff !important;
    color: var(--erp-ink);
    border-bottom: 1px solid var(--erp-line) !important;
    box-shadow: none !important;
}
.erp-shell .erp-header .admin-brand h1,
.erp-shell .erp-header .admin-brand h1 span,
.erp-shell .erp-header .admin-logout { color: var(--erp-ink); }
.erp-shell .erp-header .user-info a { color: var(--erp-blue) !important; }
.erp-shell:not(.admin-workspace) > .erp-header > div[aria-hidden="true"] { display: none; }
.erp-shell:not(.admin-workspace) > .erp-header {
    height: 64px;
    padding: 12px 24px !important;
}
.erp-shell .erp-sidebar {
    background: #f8fbff;
    border-right: 1px solid var(--erp-line);
}
.erp-shell .erp-sidebar a.active {
    background: #e5efff;
    color: #174ca9;
    border-left-color: #2867d9;
}
.erp-shell .erp-main {
    min-width: 0;
    color: var(--erp-ink);
    background: var(--erp-canvas);
    backdrop-filter: none;
    box-shadow: none;
}
.erp-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    margin-bottom: 14px;
    border: 1px solid var(--erp-line);
    border-radius: 10px;
    background: #fff;
    scrollbar-width: thin;
}
.erp-tab-group {
    display: flex;
    flex: none;
    align-items: center;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #3b5377;
}
.erp-tab-group:has([aria-current="page"]) {
    border-color: #c8dbfa;
    background: #e7f0ff;
    color: #154ba9;
}
.erp-tabs button {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.erp-tabs .erp-tab-link { padding: 6px 10px; color: inherit; font-size: 13px; white-space: nowrap; }
.erp-tab-close { margin-right: 4px; border-radius: 4px; font-size: 18px !important; }
.erp-tab-close:hover { background: #d8e6fc; }
.erp-tabs button:focus-visible { outline: 2px solid #2867d9; outline-offset: -2px; }
.erp-shell .erp-sidebar {
    background: #fff;
    color: var(--erp-ink);
    border-color: var(--erp-line);
}
.erp-shell .erp-sidebar .menu-header,
.erp-shell .erp-sidebar a { color: #354763 !important; }
.erp-shell .erp-sidebar .menu-header:hover,
.erp-shell .erp-sidebar a:hover { background: #edf4ff; }
.erp-shell .erp-sidebar a.active {
    background: var(--erp-blue);
    border-left-color: #1859d1;
    color: #fff !important;
}
.erp-shell .erp-sidebar .menu-group-icon { color: #54729a; }
.erp-shell .erp-sidebar .submenu { background: transparent; }
.erp-shell .erp-sidebar .menu-header .menu-icon { background: transparent; }
.erp-shell {
    --erp-surface: #fff;
    --erp-muted: #516682;
}
.erp-shell .erp-sidebar .menu-header,
.erp-shell .erp-sidebar .sub-menu a {
    text-shadow: none;
    box-shadow: none;
    transform: none;
}
.erp-sidebar button.menu-header {
    width: 100%;
    border: 0;
    border-radius: 8px;
    text-align: left;
    font: inherit;
}
.erp-shell .erp-sidebar .sub-menu a {
    border-radius: 6px;
}
.erp-shell .erp-main .erp-initial-panel > .card,
.erp-shell .erp-main .erp-dashboard .card {
    background: var(--erp-surface);
    border: 1px solid var(--erp-line);
    border-radius: 12px;
    box-shadow: none;
    backdrop-filter: none;
}
.erp-shell .erp-main .table > thead > tr > th {
    background: #eaf1fb;
    color: var(--erp-ink);
    border-color: var(--erp-line);
    text-shadow: none;
}
.erp-shell .erp-main .btn-primary {
    background: var(--erp-blue);
    border-color: var(--erp-blue);
    color: #fff;
    text-shadow: none;
}
.erp-shell .erp-main .btn-primary:hover { background: #174ba9; }
.erp-shell .erp-dashboard .card:hover {
    transform: none;
    box-shadow: none;
}
.erp-dashboard .card::before,
.erp-dashboard .card::after,
.erp-dashboard .stat-item::before,
.erp-dashboard .stat-item::after,
.erp-dashboard .card h3::after { display: none; }
.erp-shell .erp-dashboard .card h3 {
    color: var(--erp-ink);
    border-color: var(--erp-line);
    text-shadow: none;
}
.erp-shell .erp-dashboard .stats-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 4px 2px 12px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #a8bde0 #e8eef8;
    scroll-snap-type: x proximity;
}
.erp-shell .erp-dashboard .stat-item,
.erp-shell .erp-dashboard .stat-item:hover {
    flex: 1 0 186px;
    min-width: 0;
    margin: 0;
    padding: 16px 14px;
    text-align: left;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 9px;
    box-shadow: none;
    transform: none;
}
.erp-shell .erp-dashboard .stat-item .label { color: var(--erp-muted); }
.erp-shell .erp-dashboard .stat-item .value {
    margin: 6px 0 0;
    font-size: clamp(18px, 2vw, 28px);
    color: var(--erp-blue);
    text-shadow: none;
    animation: none;
    overflow-wrap: anywhere;
}
.erp-dashboard .dashboard-chart-panel {
    min-height: 200px;
    padding: 15px;
    border: 1px solid var(--erp-line);
    border-radius: 10px;
    background: #fff;
}

.erp-dashboard .dashboard-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 4px 0 14px;
}
.erp-dashboard .dashboard-heading h1 {
    margin: 0;
    color: var(--erp-ink);
    font-size: 24px;
    font-weight: 700;
}
.erp-dashboard .dashboard-scroll-buttons {
    display: flex;
    gap: 6px;
}
.erp-dashboard .dashboard-scroll-buttons button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    background: #fff;
    color: var(--erp-blue);
    font-size: 22px;
    line-height: 1;
}
.erp-dashboard .dashboard-scroll-buttons button:hover:not(:disabled) {
    background: #e8f0ff;
}
.erp-dashboard .dashboard-scroll-buttons button:disabled {
    color: #9aa9be;
}
.erp-dashboard .dashboard-scroll-buttons button:focus-visible,
.erp-dashboard .stats-grid:focus-visible {
    outline: 2px solid #608ff0;
    outline-offset: 2px;
}
.erp-dashboard .dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 16px;
}
.erp-dashboard .dashboard-panels .card { min-width: 0; }
.erp-dashboard .dashboard-panels .announcement-list > li {
    background: #fff !important;
    color: var(--erp-ink);
    box-shadow: none !important;
}
.erp-dashboard .dashboard-panels .announcement-list > li span {
    color: var(--erp-ink) !important;
}
@media (max-width: 850px) {
    .erp-dashboard .dashboard-panels { grid-template-columns: 1fr; }
}

/* Workspace theme shared by both ERP interfaces. */
.erp-shell {
    --erp-blue: #4365e8;
    --erp-ink: #20242c;
    --erp-line: #e8ebf0;
    --erp-muted: #626b7c;
    --erp-selected: #eef2ff;
    --erp-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.erp-shell.admin-workspace {
    --admin-ink: var(--erp-ink);
    --admin-muted: var(--erp-muted);
    --admin-line: var(--erp-line);
    --admin-accent: var(--erp-blue);
    --admin-accent-hover: #324fc1;
    --admin-accent-wash: var(--erp-selected);
}
.erp-shell .erp-sidebar {
    padding: 12px 10px;
}
.erp-shell .erp-sidebar .menu-header {
    min-height: 40px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0;
    color: var(--erp-ink) !important;
}
.erp-shell .erp-sidebar .sub-menu a {
    padding: 7px 10px 7px 20px;
    font-size: 13px;
    line-height: 1.45;
}
.erp-shell .erp-sidebar .menu-header:hover,
.erp-shell .erp-sidebar .sub-menu a:hover { background: #f6f7fa; }
.erp-shell .erp-sidebar .sub-menu a.active {
    color: #3456cd !important;
    background: var(--erp-selected);
    border-left-color: var(--erp-blue);
    font-weight: 650;
}
.erp-shell .erp-tabs {
    padding: 6px;
    border-radius: var(--erp-radius);
}
.erp-shell .erp-tab-group {
    min-height: 32px;
    color: var(--erp-muted);
}
.erp-shell .erp-tab-group:has([aria-current="page"]) {
    border-color: transparent;
    color: #3456cd;
    background: var(--erp-selected);
    font-weight: 650;
}
.erp-shell .erp-main .erp-initial-panel > .card,
.erp-shell .erp-main .erp-dashboard .card,
.erp-shell .erp-main .stat-item {
    border-color: var(--erp-line);
    border-radius: var(--erp-radius);
}
.erp-shell .erp-main .table > thead > tr > th {
    border-color: var(--erp-line);
    background: #f6f7fa;
    color: #485264;
    font-weight: 650;
}
.erp-shell .erp-main .table > tbody > tr > td { border-color: var(--erp-line); }
.erp-shell .erp-main .table-hover > tbody > tr:hover { background: #f7f9ff; }
.erp-shell .erp-main .btn-primary,
.erp-shell .erp-main .btn-outline-primary { border-radius: 8px; }
.erp-shell .erp-main .btn-primary:hover { background: #324fc1; border-color: #324fc1; }
.erp-shell .erp-main :is(.form-control, .form-select, .custom-select) {
    border-color: #dfe4ee;
    border-radius: 8px;
}
.erp-shell .erp-main :is(.form-control, .form-select, .custom-select):focus {
    border-color: var(--erp-blue);
    box-shadow: 0 0 0 2px #4365e826;
}
.erp-shell .erp-main .page-item.active .page-link {
    background: var(--erp-blue);
    border-color: var(--erp-blue);
    color: #fff;
}
.erp-shell .erp-chart-bar { background: var(--erp-blue); }

/* Align the warehouse shell with the client workbench. */
.admin-workspace.erp-shell {
    --admin-header-height: 48px;
    --admin-sidebar-width: 230px;
    --admin-sidebar-offset: var(--admin-sidebar-width);
    --erp-canvas: #f6f8fc;
    --admin-surface: #fff;
}
.admin-workspace > .admin-header {
    min-height: var(--admin-header-height);
    padding-block: 6px !important;
}
.admin-workspace-title {
    margin: 0;
    color: var(--erp-ink);
    font-size: 15px !important;
    font-weight: 650 !important;
}
.admin-workspace-version {
    color: var(--erp-muted, currentColor);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    padding: 0 4px;
    margin-bottom: 5px;
    color: var(--erp-ink);
    font-size: 15px;
    white-space: nowrap;
}
.admin-sidebar-brand img {
    border-radius: 6px;
    background: #fff;
}
.admin-header-leading {
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-workspace :is(.admin-theme-toggle, .admin-sidebar-toggle) {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 7px;
    color: var(--erp-ink);
    background: transparent;
    cursor: pointer;
}
.admin-workspace :is(.admin-theme-toggle, .admin-sidebar-toggle):hover {
    background: var(--erp-selected);
}
.admin-workspace .erp-sidebar .menu-group {
    margin-bottom: 3px;
}
.admin-workspace .erp-sidebar .menu-header,
.admin-workspace .erp-sidebar .sub-menu a {
    border-radius: 7px;
}
.admin-workspace .erp-tabs {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--erp-line);
    border-radius: 0;
    background: var(--admin-surface);
}
.admin-workspace .erp-tab-group {
    border-color: var(--erp-line);
    border-radius: 7px;
}
.admin-workspace .erp-main .erp-initial-panel > .card {
    box-shadow: none;
}
.admin-workspace.admin-sidebar-collapsed {
    --admin-sidebar-offset: 0px;
}
.admin-workspace.admin-sidebar-collapsed .admin-sidebar {
    display: none;
}
@media (min-width: 761px) {
}

html.dashan-admin-dark {
    color-scheme: dark;
    background: #171a21;
}
.dashan-admin-dark .admin-workspace.erp-shell {
    --erp-canvas: #171a21;
    --admin-surface: #21252e;
    --erp-ink: #edf1f9;
    --erp-muted: #b4bfd1;
    --erp-line: #394152;
    --erp-selected: #293450;
    --erp-blue: #6786ff;
}
.dashan-admin-dark .admin-workspace > .admin-header,
.dashan-admin-dark .admin-workspace .erp-sidebar {
    background: var(--admin-surface) !important;
}
.dashan-admin-dark .admin-workspace .erp-sidebar a {
    color: var(--erp-muted) !important;
}
.dashan-admin-dark .admin-workspace .erp-sidebar :is(a, button):hover,
.dashan-admin-dark .admin-workspace .erp-sidebar a.active {
    background: var(--erp-selected);
}
.dashan-admin-dark .admin-workspace .erp-tab-group:has([aria-current="page"]) {
    color: #bdcaff;
}
.dashan-admin-dark .admin-workspace .erp-main :is(.card, .modal-content, .form-control, .form-select) {
    color: var(--erp-ink);
    background: var(--admin-surface);
    border-color: var(--erp-line);
}
.dashan-admin-dark .admin-workspace .erp-main .table :is(th, td) {
    color: var(--erp-ink);
    background: var(--admin-surface);
    border-color: var(--erp-line);
}

@media (prefers-reduced-motion: no-preference) {
    .erp-login-arrival .erp-initial-panel {
        animation: erp-login-arrive 320ms cubic-bezier(.2, .7, .2, 1);
    }

    @keyframes erp-login-arrive {
        from { opacity: .7; translate: 0 6px; }
        to { opacity: 1; translate: 0 0; }
    }
}
