.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-selected="true"]) {
    border-color: #c8dbfa;
    background: #e7f0ff;
    color: #154ba9;
}
.erp-tabs button {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.erp-tabs [role="tab"] { padding: 6px 10px; 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-frame-panel iframe {
    display: block;
    width: 100%;
    height: calc(100dvh - 155px);
    min-height: 360px;
    border: 1px solid var(--erp-line);
    border-radius: 10px;
    background: var(--erp-canvas);
}
.erp-main [role="tabpanel"][hidden] { display: none !important; }
.erp-embedded .erp-header,
.erp-embedded .erp-sidebar,
.erp-embedded .erp-tabs { display: none !important; }
.erp-embedded .erp-shell > .erp-layout {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 0;
    height: auto;
    padding: 0;
    margin: 0;
}
.erp-embedded .erp-shell .erp-main {
    width: 100%;
    max-width: none;
    height: auto;
    padding: 14px;
    margin: 0;
}
.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-entry-sidebar-width: var(--admin-sidebar-width, 220px);
}
.erp-enter .erp-header {
    animation: erp-arrive 340ms 1280ms ease-out backwards;
}
.erp-enter .erp-sidebar {
    animation: erp-sidebar-unfold 420ms 1130ms cubic-bezier(.2,.7,.25,1) backwards;
}
.erp-enter .erp-main {
    animation: erp-arrive 400ms 1480ms ease-out backwards;
}
@keyframes erp-sidebar-unfold {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0); }
}
@keyframes erp-arrive {
    from { opacity: 0; translate: -14px 0; }
    to { opacity: 1; translate: 0 0; }
}

.erp-entry-cover {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: grid;
    place-items: center;
    isolation: isolate;
    background: #091629 url('/static/images/login-background.png') left center / 62% 100% no-repeat;
    color: #e8f2ff;
    pointer-events: none;
    animation: erp-entry-retract 1510ms cubic-bezier(.55,.06,.24,1) both;
}
.erp-entry-cover::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: #091629;
    animation: erp-panel-sweep 460ms cubic-bezier(.55,.06,.24,1) both;
}
.erp-entry-brand {
    display: grid;
    justify-items: center;
    gap: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
    animation: erp-entry-brand 960ms ease both;
}
.erp-entry-brand::after {
    content: "";
    width: 68px;
    height: 3px;
    border-radius: 3px;
    background: #79afff;
    animation: erp-entry-bar 430ms 430ms ease-out both;
}
@keyframes erp-panel-sweep {
    from { clip-path: inset(0 0 0 62%); }
    to { clip-path: inset(0); }
}
@keyframes erp-entry-fade {
    0%, 72% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}
@keyframes erp-entry-retract {
    0%, 63% { clip-path: inset(0); visibility: visible; opacity: 1; }
    92% { clip-path: inset(0 calc(100% - var(--erp-entry-sidebar-width)) 0 0); opacity: 1; }
    100% { clip-path: inset(0 calc(100% - var(--erp-entry-sidebar-width)) 0 0); opacity: 0; visibility: hidden; }
}
@keyframes erp-entry-brand {
    0%, 40%, 100% { opacity: 0; }
    55%, 85% { opacity: 1; }
}
@keyframes erp-entry-bar {
    from { transform: scaleX(.2); opacity: .5; }
    to { transform: scaleX(1); opacity: 1; }
}
@media (max-width: 760px) {
    .erp-entry-cover { background-image: none; animation: erp-entry-fade 1200ms ease both; }
    .erp-enter .erp-sidebar { animation: erp-arrive 340ms 940ms ease-out backwards; }
    .erp-enter .erp-header, .erp-enter .erp-main { animation-delay: 940ms; }
    .erp-entry-cover::before { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    .erp-enter .erp-header, .erp-enter .erp-sidebar, .erp-enter .erp-main { animation: none; }
    .erp-entry-cover { animation: erp-entry-fade 700ms steps(1, end) both; }
    .erp-entry-cover::before,
    .erp-entry-brand,
    .erp-entry-brand::after { animation: none; }
}

.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; }
}
.erp-shell > .erp-client-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.erp-client-header .erp-product-title {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    color: #111827;
}
.erp-client-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    font-size: 13px;
}
.erp-client-identity > a { white-space: nowrap; }
.erp-client-identity small {
    display: block;
    color: #526078;
    font-size: 11px;
}
.erp-client-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eaf0fb;
    color: #254376;
    font-size: 13px;
    font-weight: 700;
}
.erp-client-logout {
    padding-left: 10px;
    border-left: 1px solid #dce3ed;
}
.erp-shell .erp-dashboard {
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.erp-shell .erp-dashboard .dashboard-heading h1 {
    font-size: 26px;
    letter-spacing: -.025em;
    color: #111827;
}
.erp-shell .erp-dashboard .card { padding: clamp(14px, 1.5vw, 22px); }
.erp-shell .erp-dashboard .card h3 {
    margin-bottom: 12px;
    padding-bottom: 10px;
    font-size: 16px;
    color: #111827;
}
.erp-shell .erp-dashboard .stat-item .label {
    font-weight: 500;
    font-size: 13px;
    letter-spacing: normal;
}
.erp-shell .erp-dashboard .stat-item .value {
    color: #111827;
    font-size: clamp(20px, 2vw, 29px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.erp-shell .erp-dashboard .btn {
    box-shadow: none;
    text-shadow: none;
    border-radius: 8px;
}
.erp-shell .erp-dashboard .btn-secondary {
    background: #fff;
    border-color: #d6dfeb;
    color: #26364c;
}
.erp-shell .erp-dashboard .btn-secondary:hover { background: #f1f5fb; }
.erp-shell .erp-dashboard .btn-danger {
    background: #b91c1c;
    border-color: #b91c1c;
}
.erp-dashboard .dashboard-panels .announcement-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.erp-dashboard .dashboard-panels .announcement-list > li {
    padding: 0;
    border-bottom: 1px solid #e6ebf2;
}
.erp-dashboard .dashboard-panels .announcement-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 2px;
    color: #111827;
    font-weight: 550;
}
.erp-dashboard .dashboard-panels .announcement-list time {
    color: #526078;
    font-size: 12px;
    white-space: nowrap;
}
.erp-dashboard .dashboard-chart-panel { border: 0; padding: 0; }
.erp-chart-total { margin: 0 0 14px; color: #475569; font-size: 13px; }
.erp-chart-layout { display: grid; grid-template-columns: minmax(26px, auto) minmax(0, 1fr); }
.erp-chart-axis { display: flex; flex-direction: column; justify-content: space-between; height: 160px; padding-right: 8px; color: #526078; font-size: 11px; }
.erp-chart-days {
    display: grid;
    grid-auto-columns: minmax(10px, 1fr);
    grid-auto-flow: column;
    gap: 3px;
    overflow-x: auto;
}
.erp-chart-day { display: grid; grid-template-rows: 160px 22px; text-align: center; }
.erp-chart-track {
    display: flex;
    align-items: end;
    border-bottom: 1px solid #dce3ed;
    background: repeating-linear-gradient(to top, transparent 0 calc(40px - 1px), #eef1f6 calc(40px - 1px) 40px);
}
.erp-chart-bar { width: min(65%, 18px); margin-inline: auto; background: #2563cb; border-radius: 3px 3px 0 0; }
.erp-chart-day time { margin-top: 5px; color: #526078; font-size: 11px; }
.erp-dashboard .dashboard-details { align-items: start; }
.erp-dashboard .dashboard-address-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.erp-dashboard .dashboard-address-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.erp-dashboard #address-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 12px; }
.erp-dashboard .dashboard-address-card { line-height: 1.65; }
@media (max-width: 580px) {
    .erp-client-header .erp-product-title { font-size: 14px; }
    .erp-client-avatar { display: none; }
}

/* 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-selected="true"]) {
    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); }

/* Client dashboard overview */
.erp-shell:has(.erp-dashboard) .erp-main {
    --erp-canvas: #f5f7fb;
}
.erp-shell .erp-main:has(.erp-dashboard) {
    padding: clamp(12px, 2vw, 28px);
}
.erp-shell .erp-dashboard {
    display: flow-root;
    color: #151a25;
}
.erp-shell .erp-dashboard .dashboard-heading {
    align-items: end;
    margin: 4px 0 15px;
}
.erp-shell .erp-dashboard .dashboard-heading h1 {
    font-size: clamp(23px, 2vw, 28px);
    line-height: 1.25;
}
.erp-shell .erp-dashboard .stats-grid {
    gap: 14px;
    padding: 2px 1px 12px;
    margin: 0 0 18px;
}
.erp-shell .erp-dashboard .stat-item {
    display: flex;
    flex: 1 0 190px;
    min-height: 102px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 16px 18px;
    background: #fff;
}
.erp-shell .erp-dashboard .stat-item .value {
    line-height: 1.12;
    margin: 0;
    font-size: clamp(22px, 2.15vw, 32px);
    letter-spacing: -.025em;
}
.erp-shell .erp-dashboard .stat-item .value.is-unavailable {
    font-size: 16px;
    font-weight: 550;
    letter-spacing: 0;
    color: var(--erp-muted);
}
.erp-dashboard .dashboard-panels {
    gap: 16px;
    margin-bottom: 16px;
}
.erp-shell .erp-dashboard .dashboard-panels > .card {
    margin: 0;
    padding: clamp(16px, 1.7vw, 24px);
}
.erp-dashboard .dashboard-details {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}
.erp-dashboard .dashboard-chart-panel {
    padding: 0;
    border: 0;
    min-height: 245px;
}
.erp-dashboard .erp-chart-total { margin-bottom: 16px; }
.erp-dashboard .erp-chart-empty {
    display: grid;
    place-items: center;
    min-height: 160px;
    border: 1px dashed var(--erp-line);
    border-radius: 8px;
    color: var(--erp-muted);
    font-size: 13px;
}
.erp-dashboard .announcement-list > li:last-child { border-bottom: 0; }
.erp-dashboard .announcement-list > li:only-child:not(:has(a)) {
    border: 0;
    color: var(--erp-muted);
    padding: 14px 0;
}
.erp-shell .erp-dashboard .account-info-card .fee-settings-section {
    margin-top: 16px;
    padding: 16px;
}
@media (max-width: 850px) {
    .erp-dashboard .dashboard-details { grid-template-columns: 1fr; }
}

.erp-sidebar .sub-menu a::before {
    content: "·" / "";
    display: inline-block;
    width: 12px;
    color: var(--erp-muted);
    font-weight: 700;
}
.erp-sidebar .sub-menu a.active::before { color: currentColor; }
.erp-nav-home-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
    color: #536993;
}
