:root {
    --topbar-height: 0px;
}

.fi-sidebar {
    --topbar-height: 0px;
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

.fi-body {
    background: #f4f6f9;
}

.fi-topbar {
    min-height: 3.25rem;
    padding-inline: 1rem;
    box-shadow: none;
    border-bottom: 1px solid #e6ebf2;
}

.fi-body .fi-sidebar,
.dark .fi-body .fi-sidebar {
    background: #004de3;
    border-inline-end: 0;
    color: #fff;
}

.fi-sidebar.fi-sidebar-open {
    box-shadow: none;
}

.fi-sidebar-header-ctn {
    display: none;
}

.fi-sidebar-header {
    justify-content: flex-start;
    padding-inline: 0.65rem;
}

:not(.fi-body-has-topbar) .fi-sidebar-header .fi-logo,
.fi-body .fi-sidebar .fi-logo {
    margin-inline-start: 0;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.fi-sidebar-open-collapse-sidebar-btn,
.fi-sidebar-close-collapse-sidebar-btn {
    display: none;
}

.fi-sidebar-nav {
    gap: 0.35rem;
    padding: 0.85rem 0 0.85rem;
    scrollbar-gutter: auto;
}

.fi-sidebar-item-label {
    white-space: nowrap;
}

.admin-sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    padding: 0.65rem 0.45rem 0.75rem;
}

.admin-sidebar-tools {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.admin-sidebar-footer .fi-theme-switcher {
    justify-content: flex-start;
    gap: 0.1rem;
}

.admin-sidebar-footer .fi-theme-switcher-btn,
.admin-sidebar-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.45rem;
    padding: 0;
    color: #fff;
}

.admin-sidebar-footer .fi-theme-switcher-btn:hover,
.admin-sidebar-collapse:hover,
.admin-sidebar-footer .fi-theme-switcher-btn.fi-active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.admin-sidebar-collapse-icon {
    width: 1.15rem;
    height: 1.15rem;
}

.admin-sidebar-logout button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.35rem;
    border-radius: 0.5rem;
    padding: 0.4rem 0.35rem;
    color: #fff;
    font-size: 0.8125rem;
    line-height: 1.25rem;
}

.admin-sidebar-logout button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.admin-sidebar-logout-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex: none;
}

.fi-sidebar-nav-groups {
    gap: 0.35rem;
    margin-inline: 0;
}

.fi-body .fi-sidebar .fi-sidebar-group-items {
    gap: 0.35rem;
}

.fi-body .fi-sidebar .fi-sidebar-item,
.fi-body .fi-sidebar .fi-sidebar-item-btn {
    width: 100%;
    border-radius: 0;
}

.fi-sidebar-item-btn {
    gap: 0.5rem;
    padding: 0.95rem 0.7rem;
}

.fi-body .fi-sidebar .fi-sidebar-item-btn > .fi-icon,
.fi-body .fi-sidebar .fi-sidebar-item-label {
    color: #fff;
}

.fi-body .fi-sidebar .fi-sidebar-item-btn:hover,
.fi-body .fi-sidebar .fi-sidebar-item-btn:focus-visible {
    background: rgba(255, 255, 255, 0.16);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-body .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-body .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn:hover {
    background: #fff;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label,
.fi-body .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon,
.fi-body .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: #004de3;
}

@media (min-width: 1024px) {
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-header-ctn {
        display: none;
    }

    /* 收缩态：菜单项占满整条侧栏并让图标水平居中，避免挤在左边/溢出到右侧 */
    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav {
        padding-inline: 0;
        scrollbar-gutter: auto;
    }

    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav-groups {
        width: 100% !important;
        max-width: none !important;
        margin-inline: 0 !important;
    }

    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item,
    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-btn {
        width: 100%;
        max-width: 100%;
    }

    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-btn {
        justify-content: center !important;
        gap: 0 !important;
        padding-inline: 0 !important;
    }

    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-btn > .fi-icon {
        margin-inline: auto;
    }

    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-label,
    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-badge-ctn,
    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group-label {
        display: none;
    }

    .fi-sidebar:not(.fi-sidebar-open) .admin-sidebar-tools {
        flex-direction: column;
        align-items: center;
    }

    .fi-sidebar:not(.fi-sidebar-open) .fi-theme-switcher {
        grid-auto-flow: row;
    }

    .fi-sidebar:not(.fi-sidebar-open) .admin-sidebar-logout span {
        display: none;
    }

    .fi-sidebar:not(.fi-sidebar-open) .admin-sidebar-logout button {
        justify-content: center;
        padding-inline: 0;
    }
}

.fi-main {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem 1rem;
}

.fi-page {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: calc(100dvh - 1.5rem);
}

.fi-page-header-main-ctn {
    gap: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.75rem;
}

.fi-header {
    gap: 0.75rem;
}

.fi-header .fi-breadcrumbs {
    margin-bottom: 0.25rem;
}

.fi-header-heading {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.fi-page-content {
    gap: 0.75rem;
}

.fi-resource-list-records-page .fi-page-content,
.fi-resource-list-records-page .fi-ta,
.fi-resource-list-records-page .fi-ta-ctn {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.fi-resource-list-records-page .fi-ta-ctn {
    min-height: calc(100dvh - 6rem);
    border: 1px solid #e6ebf2;
    box-shadow: none;
}

.fi-resource-list-records-page .fi-ta-main,
.fi-resource-list-records-page .fi-ta-content-ctn {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.fi-resource-list-records-page .fi-ta-empty-state {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.fi-ta-header-toolbar {
    padding: 0.65rem 1rem;
}

.student-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem 0.35rem;
}

.student-toolbar label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #334155;
    font-size: 0.875rem;
    white-space: nowrap;
}

.student-toolbar select,
.student-toolbar input {
    height: 2.25rem;
    border: 1px solid #d5dde8;
    border-radius: 0.5rem;
    padding: 0 0.75rem;
    background: #fff;
    color: #0f172a;
    font-size: 0.875rem;
}

.student-toolbar select {
    min-width: 8.5rem;
}

.student-toolbar input {
    width: 14rem;
    max-width: 100%;
}

.student-toolbar select:focus,
.student-toolbar input:focus {
    outline: none;
    border-color: #004de3;
    box-shadow: 0 0 0 1px #004de3;
}

.student-toolbar button {
    height: 2.25rem;
    border: 0;
    border-radius: 0.5rem;
    padding: 0 0.95rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.student-toolbar button.is-primary {
    background: #004de3;
    color: #fff;
}

.student-date-range {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    color: #334155;
    font-size: 0.875rem;
    white-space: nowrap;
}

.student-date-range input {
    width: 9.5rem;
    padding: 0 0.5rem;
}

.student-toolbar button.is-primary:hover {
    background: #003db6;
}

.student-toolbar button.is-muted {
    background: #fff;
    border: 1px solid #d5dde8;
    color: #334155;
}

.student-toolbar button.is-muted:hover {
    background: #f8fafc;
}

.fi-ta:has(.student-grid) .fi-ta-content-header {
    display: none;
}

.student-grid-wrap {
    overflow-x: auto;
}

.student-grid {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: #0f172a;
}

.student-grid th,
.student-grid td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e6ebf2;
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
}

.student-grid th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
}

.student-grid tbody tr:hover {
    background: #f8fafc;
}

.student-grid-check {
    width: 2.5rem;
    text-align: center;
}

.student-grid-actions {
    position: sticky;
    right: 0;
    background: #fff;
}

.student-grid th.student-grid-actions {
    background: #f8fafc;
}

.student-grid-actions a,
.student-grid-actions button {
    border: 0;
    padding: 0;
    background: none;
    color: #004de3;
    font-size: inherit;
    cursor: pointer;
}

.student-grid-actions button {
    margin-left: 0.75rem;
    color: #b91c1c;
}

.dark .student-grid {
    color: #e2e8f0;
}

.dark .student-grid th,
.dark .student-grid th.student-grid-actions {
    background: #0f172a;
    color: #cbd5e1;
}

.dark .student-grid th,
.dark .student-grid td {
    border-bottom-color: #1e293b;
}

.dark .student-grid tbody tr:hover,
.dark .student-grid-actions,
.dark .student-grid tbody tr:hover .student-grid-actions {
    background: #111827;
}

.fi-ta-header-cell {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.fi-ta-ctn {
    border: 1px solid #e6ebf2;
    box-shadow: none;
}

.organizer-specialty-select .fi-select-input-btn,
.organizer-specialty-select .fi-select-input-value-ctn,
.organizer-specialty-select .fi-select-input-value-label,
.organizer-specialty-select .fi-select-input-option {
    height: auto;
    white-space: normal;
    line-height: 1.7;
}

.organizer-specialty-select .fi-dropdown-panel {
    max-height: 28rem;
}

.fi-fo-repeater-item-header-label:not(.fi-truncated) {
    white-space: normal;
    line-height: 1.7;
}

/* 公式表格：表头左对齐，调整值列表头带批量填充控件 */
.fi-fo-table-repeater > table > thead > tr > th .organizer-batch-th {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.organizer-adjustment .fi-fo-table-repeater {
    overflow-x: auto;
}

.organizer-adjustment .fi-fo-table-repeater > table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.organizer-adjustment .fi-fo-table-repeater > table > thead,
.organizer-adjustment .fi-fo-table-repeater > table > tbody,
.organizer-adjustment .fi-fo-table-repeater > table > thead > tr,
.organizer-adjustment .fi-fo-table-repeater > table > tbody > tr {
    border: 0 !important;
}

.organizer-adjustment .fi-fo-table-repeater > table > thead > tr > th,
.organizer-adjustment .fi-fo-table-repeater > table > tbody > tr > td {
    border: 0 !important;
    border-bottom: 1px solid #eef0f3 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.organizer-adjustment[data-price-system="1"] .fi-fo-table-repeater th:has([data-price-side]:not([data-price-side="1"])),
.organizer-adjustment[data-price-system="1"] .fi-fo-table-repeater td:has([data-price-side]:not([data-price-side="1"])),
.organizer-adjustment[data-price-system="2"] .fi-fo-table-repeater th:has([data-price-side]:not([data-price-side="2"])),
.organizer-adjustment[data-price-system="2"] .fi-fo-table-repeater td:has([data-price-side]:not([data-price-side="2"])),
.organizer-adjustment[data-price-system="3"] .fi-fo-table-repeater th:has([data-price-side]:not([data-price-side="3"])),
.organizer-adjustment[data-price-system="3"] .fi-fo-table-repeater td:has([data-price-side]:not([data-price-side="3"])),
.organizer-adjustment[data-price-system="4"] .fi-fo-table-repeater th:has([data-price-side]:not([data-price-side="4"])),
.organizer-adjustment[data-price-system="4"] .fi-fo-table-repeater td:has([data-price-side]:not([data-price-side="4"])),
.organizer-adjustment[data-price-system="5"] .fi-fo-table-repeater th:has([data-price-side]:not([data-price-side="5"])),
.organizer-adjustment[data-price-system="5"] .fi-fo-table-repeater td:has([data-price-side]:not([data-price-side="5"])) {
    display: none !important;
}

.fi-fo-table-repeater > table > thead > tr > th .organizer-batch-th.has-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.organizer-batch-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.organizer-mode-switch {
    display: inline-flex;
    flex: none;
    overflow: hidden;
    border: 1px solid #d4dae4;
    border-radius: 0.375rem;
    background: #fff;
}

.organizer-adjustment .fi-fo-table-repeater > table > tbody > tr > td:has(.organizer-adjustment-input) {
    padding-left: 0.75rem !important;
    text-align: start;
}

.organizer-adjustment .fi-fo-table-repeater td:has(.organizer-adjustment-input) .fi-input-wrp {
    justify-self: start;
    margin-right: auto;
    margin-left: 0;
}

.organizer-adjustment .fi-input-wrp:has(.organizer-adjustment-input) {
    display: inline-flex;
    width: 5.6rem;
    max-width: 5.6rem;
    justify-self: start;
    background: #fff !important;
    border: 1px solid #d4dae4;
    border-radius: 0.375rem;
    box-shadow: none !important;
}

.organizer-adjustment .fi-input-wrp:has(.organizer-adjustment-input) input {
    text-align: right;
    padding-inline: 0.35rem 0.15rem;
}

.organizer-adjustment .fi-input-wrp:has(.organizer-adjustment-input) .fi-input-wrp-suffix {
    border: 0;
    padding-inline: 0 0.45rem;
}

.organizer-mode-btn {
    height: 1.65rem;
    padding: 0 0.7rem;
    border: 0;
    background: transparent;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.organizer-mode-btn + .organizer-mode-btn {
    border-left: 1px solid #d4dae4;
}

.organizer-mode-btn.is-active {
    background: #004de3;
    color: #fff;
}

/* 表头按钮是整张表共用的，高亮改由每个专业自己保存的算法决定。 */
.fi-fo-repeater-item:has([data-value-mode-input]) .organizer-mode-btn.is-active {
    background: transparent;
    color: #374151;
}

.fi-fo-repeater-item:has([data-value-mode-input]:not([value="amount"])) .organizer-mode-btn[data-value-mode-choice="percent"],
.fi-fo-repeater-item[data-value-mode="percent"] .organizer-mode-btn[data-value-mode-choice="percent"],
.fi-fo-repeater-item:has([data-value-mode-input][value="amount"]) .organizer-mode-btn[data-value-mode-choice="amount"],
.fi-fo-repeater-item[data-value-mode="amount"] .organizer-mode-btn[data-value-mode-choice="amount"] {
    background: #004de3;
    color: #fff;
}

.fi-fo-repeater-item[data-value-mode="amount"] .fi-input-wrp:has(.organizer-adjustment-input) .fi-input-wrp-suffix,
.fi-fo-repeater-item:has([data-value-mode-input][value="amount"]) .fi-input-wrp:has(.organizer-adjustment-input) .fi-input-wrp-suffix,
.fi-fo-table-repeater tr:has([data-price-side="1"] select option[value="="]:checked) .fi-input-wrp:has(.organizer-adjustment-input[data-price-side="1"]) .fi-input-wrp-suffix,
.fi-fo-table-repeater tr:has([data-price-side="2"] select option[value="="]:checked) .fi-input-wrp:has(.organizer-adjustment-input[data-price-side="2"]) .fi-input-wrp-suffix,
.fi-fo-table-repeater tr:has([data-price-side="3"] select option[value="="]:checked) .fi-input-wrp:has(.organizer-adjustment-input[data-price-side="3"]) .fi-input-wrp-suffix,
.fi-fo-table-repeater tr:has([data-price-side="4"] select option[value="="]:checked) .fi-input-wrp:has(.organizer-adjustment-input[data-price-side="4"]) .fi-input-wrp-suffix,
.fi-fo-table-repeater tr:has([data-price-side="5"] select option[value="="]:checked) .fi-input-wrp:has(.organizer-adjustment-input[data-price-side="5"]) .fi-input-wrp-suffix {
    display: none;
}

.organizer-batch-th-label {
    white-space: nowrap;
}

.organizer-batch-ctl {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.organizer-batch-input {
    width: 4.35rem;
    height: 1.65rem;
    padding: 0 0.35rem;
    border: 1px solid #d4dae4;
    border-radius: 0.375rem;
    background: #fff;
    color: #111827;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

.organizer-batch-input::-webkit-outer-spin-button,
.organizer-batch-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.organizer-batch-input::placeholder {
    color: #9aa4b2;
    font-weight: 400;
}

.organizer-batch-input:focus {
    outline: none;
    border-color: #004de3;
    box-shadow: 0 0 0 1px #004de3;
}

.organizer-batch-btn {
    height: 1.65rem;
    padding: 0 0.45rem;
    border: 0;
    border-radius: 0.375rem;
    background: #004de3;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.organizer-batch-btn:hover {
    background: #003db6;
}

.organizer-batch-btn:disabled {
    opacity: 0.85;
    cursor: default;
}

/* 「批量运算符」下拉：选一个符号，整列套用 */
.organizer-batch-operator {
    width: 4.05rem;
    height: 1.65rem;
    padding: 0 1.05rem 0 0.4rem;
    border: 1px solid #d4dae4;
    border-radius: 0.375rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237b8794'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.17l3.71-3.94a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.32rem center;
    background-size: 0.72rem;
    color: #111827;
    font-size: 0.75rem;
    line-height: 1.2;
    appearance: none;
    cursor: pointer;
}

.organizer-batch-operator:hover {
    border-color: #b9c4d4;
}

.organizer-batch-operator:focus {
    outline: none;
    border-color: #004de3;
    box-shadow: 0 0 0 1px #004de3;
}

.organizer-batch-operator.is-flashing {
    border-color: #9bd9b4;
    background-color: #f0fdf4;
    color: #0f9d58;
}

/* 「清零」图标按钮：把整列值清成 0 */
.organizer-batch-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    margin-inline-start: 0.1rem;
    padding: 0;
    border: 1px solid #d4dae4;
    border-radius: 0.375rem;
    background: #fff;
    color: #7b8794;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.organizer-batch-clear > svg {
    width: 0.85rem;
    height: 0.85rem;
}

.organizer-batch-clear:hover {
    border-color: #f3b4b7;
    background: #fff5f5;
    color: #e5484d;
}

.organizer-batch-clear:active {
    transform: scale(0.92);
}

.organizer-batch-clear.is-flashing {
    border-color: #9bd9b4;
    background: #f0fdf4;
    color: #0f9d58;
}

.dark .organizer-batch-clear {
    border-color: rgba(255, 255, 255, 0.14);
    background: #18181b;
    color: #a1a1aa;
}

.dark .organizer-batch-clear:hover {
    border-color: rgba(229, 72, 77, 0.5);
    background: rgba(229, 72, 77, 0.12);
    color: #ff8f95;
}

.dark .organizer-batch-clear.is-flashing {
    border-color: rgba(15, 157, 88, 0.55);
    background: rgba(15, 157, 88, 0.16);
    color: #6ee7a8;
}

.dark .organizer-batch-input {
    border-color: rgba(255, 255, 255, 0.14);
    background: #18181b;
    color: #fff;
}

.dark .organizer-batch-input::placeholder {
    color: #71717a;
}

.dark .organizer-batch-operator {
    border-color: rgba(255, 255, 255, 0.14);
    background-color: #18181b;
    color: #fff;
}

.dark .organizer-batch-operator:hover {
    border-color: rgba(255, 255, 255, 0.26);
}

.dark .organizer-batch-operator.is-flashing {
    border-color: rgba(15, 157, 88, 0.55);
    background-color: rgba(15, 157, 88, 0.16);
    color: #6ee7a8;
}

.fi-btn.fi-color-primary.fi-bg-color-400,
.fi-btn.fi-color-primary.fi-bg-color-500,
.fi-btn.fi-color-primary.fi-bg-color-600 {
    background-color: #004de3;
    color: #fff;
}

.fi-btn.fi-color-primary.fi-bg-color-400:hover,
.fi-btn.fi-color-primary.fi-bg-color-500:hover,
.fi-btn.fi-color-primary.fi-bg-color-600:hover {
    background-color: #003db6;
    color: #fff;
}

.dark .fi-body {
    background: #09090b;
}

.dark .fi-topbar {
    background: #18181b;
    border-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   暗色主题：侧边栏跟着一起变
   （浅色下是品牌蓝底 + 白色选中块，暗色下换成深海军蓝底 + 品牌蓝选中块）
   ========================================================================== */

.dark .fi-body .fi-sidebar,
.dark .fi-body .fi-sidebar.fi-sidebar-open {
    background: #0a1020;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.07);
    color: #e5e7eb;
    box-shadow: none;
}

.dark .fi-body .fi-sidebar .fi-logo {
    color: #ffffff;
    text-shadow: 0 0 18px rgba(0, 77, 227, 0.55);
}

/* 普通菜单项 */
.dark .fi-body .fi-sidebar .fi-sidebar-item-btn > .fi-icon,
.dark .fi-body .fi-sidebar .fi-sidebar-item-label {
    color: rgba(226, 232, 240, 0.72);
}

.dark .fi-body .fi-sidebar .fi-sidebar-group-label {
    color: rgba(226, 232, 240, 0.42);
}

.dark .fi-body .fi-sidebar .fi-sidebar-item-btn:hover,
.dark .fi-body .fi-sidebar .fi-sidebar-item-btn:focus-visible {
    background: rgba(255, 255, 255, 0.06);
}

.dark .fi-body .fi-sidebar .fi-sidebar-item-btn:hover > .fi-icon,
.dark .fi-body .fi-sidebar .fi-sidebar-item-btn:hover > .fi-sidebar-item-label,
.dark .fi-body .fi-sidebar .fi-sidebar-item-btn:focus-visible > .fi-icon,
.dark .fi-body .fi-sidebar .fi-sidebar-item-btn:focus-visible > .fi-sidebar-item-label {
    color: #ffffff;
}

/* 选中项：品牌蓝块 + 微光 */
.dark .fi-body .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.dark .fi-body .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn:hover {
    background: #004de3;
    box-shadow: 0 10px 26px -14px rgba(0, 77, 227, 0.95);
}

.dark .fi-body .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon,
.dark .fi-body .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: #ffffff;
}

/* 页脚工具区 */
.dark .admin-sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.dark .admin-sidebar-footer .fi-theme-switcher-btn,
.dark .admin-sidebar-collapse,
.dark .admin-sidebar-logout button {
    color: rgba(226, 232, 240, 0.7);
}

.dark .admin-sidebar-footer .fi-theme-switcher-btn:hover,
.dark .admin-sidebar-collapse:hover,
.dark .admin-sidebar-logout button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.dark .admin-sidebar-footer .fi-theme-switcher-btn.fi-active {
    background: #004de3;
    color: #ffffff;
}

/* ==========================================================================
   慢请求遮罩（每页条数调大后，一次要传好几 MB，需要让用户知道在跑）
   ========================================================================== */

.admin-loading-veil {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.26);
    -webkit-backdrop-filter: blur(1.5px);
    backdrop-filter: blur(1.5px);
    animation: admin-veil-in 0.18s ease-out;
}

.admin-loading-box {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.3rem;
    border-radius: 0.85rem;
    background: #ffffff;
    box-shadow:
        0 24px 48px -20px rgba(2, 10, 40, 0.45),
        0 0 0 1px rgba(2, 10, 40, 0.06);
    color: #334155;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.admin-loading-spinner {
    width: 1.05rem;
    height: 1.05rem;
    flex: none;
    border: 2px solid rgba(0, 77, 227, 0.18);
    border-top-color: #004de3;
    border-radius: 50%;
    animation: admin-veil-spin 0.8s linear infinite;
}

@keyframes admin-veil-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes admin-veil-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.dark .admin-loading-veil {
    background: rgba(3, 6, 20, 0.5);
}

.dark .admin-loading-box {
    background: #18181b;
    color: #e4e4e7;
    box-shadow:
        0 24px 48px -20px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dark .admin-loading-spinner {
    border-color: rgba(120, 165, 255, 0.25);
    border-top-color: #6fa8ff;
}

.fi-page:has(.dash) .fi-header {
    display: none;
}

.dash {
    display: grid;
    gap: 0.9rem;
}

.dash-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.7fr);
    gap: 0.85rem;
}

.dash-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    min-height: 7.75rem;
    padding: 1.15rem 3.4rem 1.15rem 1.25rem;
    border-radius: 1rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(226, 232, 240, 0.9);
}

.dash-card:hover {
    box-shadow: 0 8px 24px -16px rgba(0, 77, 227, 0.45);
}

.dash-card-kicker {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dash-card-value {
    color: #0f172a;
    font-size: 2rem;
    font-weight: 650;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.dash-card-value.is-received,
.dash-list em.is-received {
    color: #e11d48;
}

.dash-card-sub {
    color: #94a3b8;
    font-size: 0.78rem;
}

.dash-card-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    border-radius: 0.65rem;
    background: #eff6ff;
    color: #2563eb;
}

.dash-card-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.dash-card-money {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 0;
    padding-right: 1.25rem;
}

.dash-card-money > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    min-height: 5.4rem;
    padding-right: 0.8rem;
}

.dash-card-money > div + div {
    padding-right: 0;
    padding-left: 1.15rem;
    border-left: 1px solid #eef0f3;
}

.dash-charts {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 0.9fr);
    gap: 0.85rem;
}

.dash-chart,
.dash-toolbar-card,
.dash-list {
    min-width: 0;
    padding: 1rem 1.1rem 1.05rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(226, 232, 240, 0.9);
}

.dash-chart h2,
.dash-list h2 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 650;
}

.dash-chart h2::before,
.dash-list h2::before {
    content: "";
    width: 3px;
    height: 0.9rem;
    border-radius: 2px;
    background: #2563eb;
}

.dash-line {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 0.35rem;
}

.dash-line line {
    stroke: #eef2f7;
    stroke-width: 1;
}

.dash-line polygon {
    fill: rgba(37, 99, 235, 0.16);
}

.dash-line polyline {
    fill: none;
    stroke: #2563eb;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.dash-line circle {
    fill: #fff;
    stroke: #2563eb;
    stroke-width: 2;
}

.dash-line text {
    fill: #94a3b8;
    font-size: 11px;
    text-anchor: end;
}

.dash-line text.dash-line-label {
    text-anchor: middle;
}

.dash-donut {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.7rem;
}

.dash-donut svg {
    width: 100%;
    height: auto;
}

.dash-donut svg circle {
    fill: none;
    stroke-width: 16;
}

.dash-donut svg > circle:first-child {
    stroke: #eef2f7;
}

.dash-donut svg text {
    fill: #0f172a;
    font-size: 16px;
    font-weight: 700;
    text-anchor: middle;
}

.dash-donut svg text + text {
    fill: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}

.dash-donut ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-donut li {
    display: grid;
    grid-template-columns: 0.55rem minmax(0, 1fr) auto;
    gap: 0.4rem;
    align-items: center;
    padding: 0.22rem 0;
    color: #475569;
    font-size: 0.78rem;
}

.dash-donut li i {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 99px;
}

.dash-donut li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-donut li em {
    color: #64748b;
    font-style: normal;
}

.dash-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    gap: 0.45rem;
    height: 11.5rem;
    margin-top: 0.85rem;
}

.dash-bars > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 0.25rem;
}

.dash-bars span {
    display: block;
    width: 100%;
    max-width: 1.7rem;
    min-height: 0;
    border-radius: 0.35rem 0.35rem 0.15rem 0.15rem;
    background: #2563eb;
}

.dash-bars em,
.dash-bars small,
.dash-chart-note {
    color: #94a3b8;
    font-size: 0.72rem;
    font-style: normal;
}

.dash-money-bars {
    display: grid;
    gap: 0.95rem;
    margin-top: 1.15rem;
}

.dash-money-bars > div {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
}

.dash-money-bars span,
.dash-money-bars strong {
    color: #334155;
    font-size: 0.82rem;
}

.dash-money-bars strong.is-received {
    color: #e11d48;
}

.dash-money-bars i {
    display: block;
    height: 0.7rem;
    overflow: hidden;
    border-radius: 99px;
    background: #eef2f7;
}

.dash-money-bars b {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
    background: #2563eb;
}

.dash-money-bars .is-received b {
    background: #e11d48;
}

.dash-chart-note {
    margin: 0.85rem 0 0;
}

.dash-toolbar-card {
    padding: 0.75rem 1rem;
}

.dash-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dash-switch,
.dash-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-switch {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.dash-switch button,
.dash-nav button {
    height: 2rem;
    padding: 0 0.8rem;
    border: 0;
    background: transparent;
    color: #334155;
    font-size: 0.82rem;
    cursor: pointer;
}

.dash-switch button + button {
    border-left: 1px solid #e2e8f0;
}

.dash-switch button.is-active {
    background: #004de3;
    color: #fff;
}

.dash-nav button {
    border: 1px solid #e2e8f0;
    border-radius: 0.45rem;
    background: #fff;
}

.dash-nav button:hover,
.dash-card:hover .dash-card-kicker {
    color: #004de3;
}

.dash-nav input[type="date"] {
    height: 2rem;
    padding: 0 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.45rem;
    background: #fff;
    color: #0f172a;
    font-size: 0.82rem;
}

.dash-range {
    color: #475569;
    font-size: 0.86rem;
    font-weight: 600;
}

.dash-columns {
    display: grid;
    grid-template-columns: 1.25fr 0.9fr 1.15fr;
    gap: 0.85rem;
}

.dash-list header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.dash-list header a,
.dash-list li a {
    color: #004de3;
    font-size: 0.82rem;
    text-decoration: none;
}

.dash-list li a {
    font-size: 0.9rem;
    font-weight: 600;
}

.dash-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-top: 1px solid #eef0f3;
}

.dash-list li > div {
    min-width: 0;
    display: grid;
}

.dash-list li span,
.dash-list li em,
.dash-empty,
.dash-more {
    color: #64748b;
    font-size: 0.78rem;
    font-style: normal;
}

.dash-list li em {
    flex: none;
    white-space: nowrap;
}

.dash-list li a,
.dash-list li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-empty,
.dash-more {
    margin: 0.4rem 0 0;
}

@media (max-width: 1100px) {
    .dash-cards,
    .dash-charts,
    .dash-columns {
        grid-template-columns: 1fr;
    }

    .dash-donut {
        grid-template-columns: 8.5rem minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-loading-spinner {
        animation-duration: 2.4s;
    }
}

.data-library-quick svg {
    display: none;
}

.data-library-menu-label {
    opacity: 1 !important;
    pointer-events: none;
    cursor: default;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280 !important;
}

/* 侧边栏：带子菜单的项可以折叠，默认收起 */
.fi-sidebar-item.is-perm-group > .fi-sidebar-item-btn {
    cursor: pointer;
}
.fi-sidebar-item.is-perm-collapsed > .fi-sidebar-sub-group-items {
    display: none;
}
