:root {
    --wz-primary: #5b74e8;
    --wz-text: #1d273b;
    --wz-muted: #8792a6;
    --wz-border: #e7ecf4;
    --bs-primary: #5b74e8;
    --bs-primary-rgb: 91, 116, 232;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #f4f7fb;
    color: var(--wz-text);
    font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
h1:focus { outline: none; }
button, input, textarea { font: inherit; }

.page-heading {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.page-heading > div:first-child { min-width: 0; flex: 1; }
.page-heading h1 { margin: .18rem 0 .32rem; color: #202a3e; font-size: clamp(1.55rem, 2.5vw, 2rem); font-weight: 800; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--wz-muted); font-size: .88rem; }
.eyebrow { color: #6178df; font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.heading-actions { display: flex; gap: .6rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.metric-card { display: flex; align-items: center; gap: .95rem; min-height: 118px; padding: 1.15rem; border: 1px solid var(--wz-border); border-radius: 16px; background: white; box-shadow: 0 8px 24px rgba(31,42,68,.045); }
.metric-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; font-size: 1.05rem; }
.metric-icon.blue { color: #4f6de4; background: #edf1ff; }.metric-icon.purple { color: #7a56d1; background: #f2edff; }.metric-icon.green { color: #278964; background: #eaf8f2; }.metric-icon.orange { color: #d98735; background: #fff3e5; }
.metric-card > div > small, .metric-card > div > strong, .metric-card > div > span { display: block; }
.metric-card small { color: #828da2; font-size: .72rem; font-weight: 700; }
.metric-card strong { margin: .2rem 0 .1rem; color: #202a3e; font-size: 1.65rem; line-height: 1; }
.metric-card span { color: #a0a8b7; font-size: .7rem; }

.panel { padding: 1.2rem; border: 1px solid var(--wz-border); border-radius: 16px; background: white; box-shadow: 0 8px 26px rgba(31,42,68,.045); }
.panel-heading { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.panel-heading > div { min-width: 0; flex: 1; }
.panel-heading h2 { margin: 0; color: #263148; font-size: .98rem; font-weight: 800; }
.panel-heading p { margin: .25rem 0 0; color: #929bad; font-size: .74rem; }
.panel-heading a { color: #5c73df; font-size: .74rem; font-weight: 700; text-decoration: none; }
.panel-heading a i { margin-left: .25rem; }

.data-panel { padding: 0; overflow: hidden; }
.panel-toolbar { display: flex; align-items: center; gap: .65rem; min-height: 70px; padding: .9rem 1rem; border-bottom: 1px solid #edf0f5; }
.search-box { position: relative; width: min(380px, 100%); }
.search-box > i { position: absolute; z-index: 2; left: .85rem; top: 50%; color: #a0a8b8; transform: translateY(-50%); }
.search-box .form-control { padding-left: 2.35rem; }
.toolbar-count { margin-left: auto; color: #909aab; font-size: .75rem; }
.panel-pagination { display: flex; justify-content: flex-end; padding: .85rem 1rem; border-top: 1px solid #edf0f5; }
.data-panel .table { margin-bottom: 0; }
.data-panel .table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: #edf0f5; vertical-align: middle; }
.data-panel .table thead th { color: #7e899d; background: #fafbfc; font-size: .72rem; font-weight: 800; }
.data-panel .table tbody td { color: #596579; font-size: .78rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; margin-bottom: .4rem; color: #475268; font-size: .78rem; font-weight: 700; }
.selection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.selection-grid label { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .65rem .7rem; border: 1px solid #e7ebf2; border-radius: 9px; cursor: pointer; }
.selection-grid label:hover { background: #f7f9fc; }.selection-grid label.disabled { opacity: .5; cursor: not-allowed; }
.switch-line label { display: flex; align-items: center; gap: .55rem; }
.empty-state { min-height: 180px; display: grid; place-content: center; justify-items: center; gap: .65rem; color: #9ca5b5; }
.empty-state i { font-size: 1.7rem; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { margin-top: .25rem; color: #c83c3c; font-size: .72rem; }
.blazor-error-boundary { padding: 1rem; background: #b32121; color: white; }

@media (max-width: 1150px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading > .btn, .heading-actions { width: 100%; }
    .metric-grid { grid-template-columns: 1fr; }
    .panel-toolbar { align-items: stretch; flex-wrap: wrap; }
    .search-box { width: 100%; }
    .toolbar-count { width: 100%; margin-left: 0; }
    .form-grid, .selection-grid { grid-template-columns: 1fr; }
}
