html, body {
    font-family: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: var(--dbh-bg-soft, #eef0f3);
    color: var(--dbh-text-main, #1a1a1a);
}

:root {
    --dbh-primary: #1a5f7a;
    --primary: #1a5f7a;
    --dbh-primary-soft: #e8f2f6;
    --primary-soft: #e8f2f6;
    --dbh-primary-soft-stronger: #c5dde8;
    --dbh-accent: #2d8fad;
    --dbh-bg-soft: #06070b;
    --bg-soft: #06070b;
    --dbh-surface: rgba(14, 17, 26, 0.88);
    --dbh-text-main: #eef2ff;
    --dbh-text-muted: #8b93a8;
    --dbh-border-soft: rgba(255, 255, 255, 0.08);
    --dbh-danger: #f87171;
    --dbh-warning: #fbbf24;
    --dbh-success: #34d399;
    --dbh-radius: 4px;
    --dbh-card-radius: 4px;
}

[data-theme="light"] {
    --dbh-bg-soft: #eceff2;
    --bg-soft: #eceff2;
    --dbh-surface: #ffffff;
    --dbh-text-main: #1c2530;
    --dbh-text-muted: #5c6773;
    --dbh-border-soft: #d0d7de;
}

a, .btn-link {
    color: var(--dbh-primary);
}

a:hover, .btn-link:hover {
    color: #134559;
}

.btn-primary,
.btn-success {
    color: #fff;
    background: var(--dbh-primary);
    border-color: var(--dbh-primary);
    border-radius: var(--dbh-radius);
}

.btn-primary:hover,
.btn-success:hover {
    background: #134559;
    border-color: #134559;
}

.btn-outline-secondary,
.btn-outline-primary {
    border-radius: var(--dbh-radius);
}

/* 共用按鈕樣式：主要／次要／危險 */
.btn-danger,
.btn-outline-danger:hover {
    background-color: var(--dbh-danger);
    border-color: var(--dbh-danger);
    color: #fff;
}

.btn-outline-danger {
    border-color: var(--dbh-danger);
    color: var(--dbh-danger);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.2rem rgba(26, 95, 122, 0.35);
    border-color: var(--dbh-primary);
}

.content {
    padding-top: 1.1rem;
}

/* 兩欄式版面：左選單／右內容（耗材與醫雜費風格） */
.dbh-two-col {
    display: flex;
    gap: 1rem;
    min-height: 420px;
}
.dbh-two-col-left {
    width: 220px;
    flex-shrink: 0;
    background: var(--dbh-bg-soft);
    border-radius: var(--dbh-card-radius);
    padding: 1rem;
    border: 1px solid var(--dbh-border-soft);
}
.dbh-two-col-left .dbh-two-col-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--dbh-text-main);
}
.dbh-two-col-left .list-group-item {
    border-radius: 8px;
    margin-bottom: 0.25rem;
    border: none;
    text-align: left;
}
.dbh-two-col-left .list-group-item.active {
    background: var(--dbh-primary-soft);
    color: var(--dbh-primary);
    font-weight: 600;
}
.dbh-two-col-right {
    flex: 1;
    min-width: 0;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ====== DiaBeautyHub Shell & Layout ====== */

.dbh-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    background: var(--dbh-bg-soft);
}

.dbh-shell-topnav {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
}

/* Login 專用版面：隱藏側邊欄、置中卡片 */
.dbh-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dbh-bg-soft);
    padding: 2rem 1rem;
}

.dbh-login-main {
    max-width: 420px;
    width: 100%;
}

.dbh-login-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dbh-sidebar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--dbh-border-soft);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
}

.dbh-main {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.dbh-main-full {
    flex: 1;
    min-width: 0;
}

.dbh-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 0.85rem;
    color: var(--dbh-text-muted);
}

.dbh-topnav {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--dbh-surface);
    border-bottom: 1px solid var(--dbh-border-soft);
    box-shadow: none;
}

.dbh-topnav-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 1.25rem;
    flex-wrap: wrap;
}

.dbh-topnav .dbh-nav-header {
    margin-bottom: 0;
    flex-shrink: 0;
}

.dbh-nav-top {
    flex: 1;
    min-width: 0;
}

.dbh-nav-top-link {
    white-space: nowrap;
}

.dbh-nav-top-dropdown {
    position: relative;
}

.dbh-nav-top-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--dbh-text-muted);
    white-space: nowrap;
}

.dbh-nav-top-group:hover {
    background-color: var(--dbh-primary-soft);
    color: var(--dbh-text-main);
}

.dbh-nav-chevron-down {
    font-size: 0.7rem;
    opacity: 0.7;
}

.dbh-nav-dropdown-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 11.5rem;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid var(--dbh-border-soft);
    border-radius: 0.65rem;
    box-shadow: 0 12px 28px rgba(160, 101, 140, 0.14);
    z-index: 1040;
}

.dbh-nav-dropdown-panel .dbh-nav-link {
    border-radius: 0.45rem;
    border-left: none;
    padding-left: 0.75rem;
}

.dbh-nav-dropdown-panel .dbh-nav-link.active {
    border-left: none;
    padding-left: 0.75rem;
}

.dbh-topnav-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    margin-left: auto;
}

.dbh-topnav-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dbh-text-main);
    white-space: nowrap;
}

.dbh-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0 1.5rem;
    min-height: 0;
}

.dbh-content .alert-success,
.dbh-content .dbh-alert-success {
    background-color: rgba(52, 211, 153, 0.2);
    border: 1px solid var(--dbh-success);
    color: #d1fae5;
}

.dbh-content .alert-danger {
    background-color: rgba(248, 113, 113, 0.16);
    border: 1px solid var(--dbh-danger);
    color: #fecaca;
}

[data-theme="light"] .dbh-content .alert-success,
[data-theme="light"] .dbh-content .dbh-alert-success {
    background-color: #d1fae5;
    border-color: #34d399;
    color: #065f46;
}

[data-theme="light"] .dbh-content .alert-danger {
    background-color: #fee2e2;
    border-color: #f87171;
    color: #991b1b;
}

.dbh-page-wrap {
    width: 100%;
}

.dbh-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dbh-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--dbh-border-soft);
}

.dbh-page-header-main {
    min-width: 0;
}

.dbh-page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.dbh-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0;
    color: var(--dbh-text-main);
    line-height: 1.3;
}

.dbh-page-title span {
    color: var(--dbh-text-main);
    background: none;
    -webkit-background-clip: unset;
}

.dbh-page-subtitle {
    font-size: 0.85rem;
    color: var(--dbh-text-muted);
    margin: 0.25rem 0 0;
}

/* ====== 結帳作業版面 ====== */

.dbh-work-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dbh-work-phase {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dbh-primary);
    background: var(--dbh-primary-soft);
    border: 1px solid var(--dbh-primary-soft-stronger);
    border-radius: var(--dbh-radius);
    padding: 0.1rem 0.45rem;
    margin-bottom: 0.35rem;
}

.dbh-ops-table {
    font-size: 0.875rem;
}

.dbh-ops-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dbh-text-muted);
    background: var(--dbh-table-head-bg, #f6f8fa);
    border-bottom: 1px solid var(--dbh-border-soft);
    white-space: nowrap;
}

.dbh-ops-table td {
    vertical-align: middle;
}

.dbh-amount {
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-weight: 600;
}

.dbh-ops-link {
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.dbh-ops-link:hover {
    text-decoration: underline;
}

/* ====== NavMenu ====== */

.dbh-nav-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    padding: 0 0.4rem;
}

.dbh-logo-circle {
    width: 30px;
    height: 30px;
    border-radius: var(--dbh-radius);
    background: var(--dbh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.dbh-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.dbh-brand-main {
    font-size: 0.95rem;
    font-weight: 600;
}

.dbh-brand-sub {
    font-size: 0.75rem;
    color: var(--dbh-text-muted);
}

.dbh-nav {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* 頂部橫向選單：覆蓋側欄直向排版 */
.dbh-nav.dbh-nav-top {
    margin-top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
}

.dbh-nav.dbh-nav-top > .dbh-nav-top-link,
.dbh-nav.dbh-nav-top > .dbh-nav-top-dropdown {
    display: inline-flex;
    align-items: center;
}

.dbh-nav.dbh-nav-top .dbh-nav-link.active {
    border-left: none;
    padding-left: 0.75rem;
}

.dbh-nav-link {
    border-radius: var(--dbh-radius);
    padding: 0.45rem 0.75rem;
    color: var(--dbh-text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
}

.dbh-nav-link:hover {
    background-color: var(--dbh-primary-soft);
    color: var(--dbh-text-main);
}

.dbh-nav-link.active {
    background: var(--dbh-primary-soft);
    color: var(--dbh-primary);
    font-weight: 600;
    border-left: none;
    padding-left: 0.75rem;
}

.dbh-nav-link .bi {
    font-size: 1rem;
}

/* ====== 扁平版面：統計列、工具列、面板、表格 ====== */

.dbh-stat-bar {
    display: flex;
    flex-wrap: wrap;
    background: var(--dbh-surface);
    border: 1px solid var(--dbh-border-soft);
    border-radius: var(--dbh-radius);
    overflow: hidden;
}

.dbh-stat-item {
    flex: 1 1 140px;
    padding: 0.65rem 1rem;
    border-right: 1px solid var(--dbh-border-soft);
    min-width: 0;
}

.dbh-stat-item:last-child {
    border-right: none;
}

.dbh-stat-label {
    font-size: 0.75rem;
    color: var(--dbh-text-muted);
    margin-bottom: 0.15rem;
}

.dbh-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--dbh-text-main);
}

.dbh-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.85rem;
    padding: 0.65rem 0.85rem;
    background: var(--dbh-surface);
    border: 1px solid var(--dbh-border-soft);
    border-radius: var(--dbh-radius) var(--dbh-radius) 0 0;
    margin-bottom: 0;
}

.dbh-toolbar + .dbh-table-panel,
.dbh-toolbar + .table-responsive.dbh-table-panel,
.dbh-card-filter + .dbh-table-panel,
.dbh-card-filter + .table-responsive.dbh-table-panel {
    border-top: none;
    border-radius: 0 0 var(--dbh-radius) var(--dbh-radius);
    margin-top: 0;
}

.dbh-panel {
    background: var(--dbh-surface);
    border: 1px solid var(--dbh-border-soft);
    border-radius: var(--dbh-radius);
    overflow: visible;
}

.dbh-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--dbh-border-soft);
    background: var(--dbh-panel-head-bg, #fafbfc);
}

.dbh-panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--dbh-text-main);
}

.dbh-panel-head-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.dbh-panel-body {
    padding: 0.85rem;
}

.dbh-panel-body.p-0 {
    padding: 0;
}

.dbh-panel.border-warning {
    border-color: #ffc107 !important;
}

div.dbh-panel:not(:has(.dbh-panel-head)) {
    padding: 0.85rem;
}

div.dbh-panel .card-body {
    padding: 0.85rem;
}

.dbh-tab-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    background: var(--dbh-surface);
    border: 1px solid var(--dbh-border-soft);
    border-radius: var(--dbh-radius);
}

.dbh-table-panel {
    background: var(--dbh-surface);
    border: 1px solid var(--dbh-border-soft);
    border-radius: var(--dbh-radius);
    overflow: visible;
}

.dbh-surface {
    background: var(--dbh-surface);
    border: 1px solid var(--dbh-border-soft);
    border-radius: var(--dbh-radius);
}

.dbh-surface-body {
    padding: 1rem;
}

.dbh-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.75rem;
}

/* 舊版卡片相容：扁平化 */
.dbh-card,
.dbh-content .card {
    background-color: var(--dbh-surface);
    border-radius: var(--dbh-radius);
    box-shadow: none !important;
    border: 1px solid var(--dbh-border-soft) !important;
}

.dbh-card .card-body,
.dbh-content .card .card-body {
    padding: 0.85rem;
}

.dbh-content .card .card-header {
    padding: 0.55rem 0.85rem;
    background: var(--dbh-panel-head-bg, #fafbfc);
    border-bottom: 1px solid var(--dbh-border-soft);
    font-size: 0.95rem;
}

/* 統計卡片列自動合併為單一橫條 */
.dbh-content .row.g-3.mb-3,
.dbh-content .row.g-3.mb-4,
.dbh-content .row.row-cols-2.g-3.mb-4 {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--dbh-border-soft);
    border-radius: var(--dbh-radius);
    background: var(--dbh-surface);
    overflow: hidden;
    margin-bottom: 0.75rem !important;
}

.dbh-content .row.g-3 > [class*="col"],
.dbh-content .row.row-cols-2.g-3 > .col {
    padding: 0;
    border-right: 1px solid var(--dbh-border-soft);
    flex: 1 1 140px;
    min-width: 0;
}

.dbh-content .row.g-3 > [class*="col"]:last-child,
.dbh-content .row.row-cols-2.g-3 > .col:last-child {
    border-right: none;
}

.dbh-content .row.g-3 .card,
.dbh-content .row.row-cols-2.g-3 .card {
    border: none !important;
    border-radius: 0 !important;
    height: 100%;
}

.dbh-content .row.g-3 .card-body,
.dbh-content .row.row-cols-2.g-3 .card-body {
    padding: 0.65rem 1rem;
}

/* ====== 地區利潤頁面排版 ====== */

.dbh-region-profit-page {
    width: 100%;
    max-width: none;
}

.dbh-region-profit-page .dbh-page-title {
    margin-bottom: 0.75rem !important;
}

/* 查詢／匯出工具列 */
.dbh-region-profit-toolbar {
    display: flex;
    justify-content: flex-end;
}

.dbh-region-profit-toolbar-block + .dbh-region-profit-toolbar-divider {
    margin: 0.75rem 0;
}

.dbh-region-profit-toolbar-divider {
    height: 1px;
    background: var(--dbh-border-soft, #e9ecef);
}

.dbh-region-profit-toolbar-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--dbh-text-muted, #6c757d);
    margin-bottom: 0.4rem;
}

.dbh-region-profit-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 1rem;
    width: fit-content;
    max-width: 100%;
}

.dbh-region-profit-filter-bar:has(.dbh-rp-filter-left) {
    width: 100%;
}

.dbh-rp-filter-left {
    flex: 0 0 auto;
    min-width: 12rem;
    max-width: 20rem;
}

.dbh-rp-filter-right {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.75rem;
    margin-left: auto;
}

.dbh-rp-filter-item {
    min-width: 0;
    flex: 0 0 auto;
}

.dbh-rp-filter-item--trip .form-select-sm {
    width: 100%;
    min-width: 12rem;
}

.dbh-rp-filter-item--region .form-select-sm {
    width: 9rem;
}

.dbh-rp-filter-item--period .dbh-rp-filter-period {
    flex-wrap: nowrap;
}

.dbh-rp-filter-item--action .btn {
    min-width: 4.5rem;
}

.dbh-rp-filter-label {
    display: block;
    font-size: 0.72rem;
    color: var(--dbh-text-muted, #6c757d);
    margin-bottom: 0.25rem;
}

.dbh-rp-filter-label--hidden {
    visibility: hidden;
    user-select: none;
}

.dbh-rp-filter-period {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dbh-rp-filter-period-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.dbh-rp-filter-period-inputs .form-control-sm {
    width: 5.5rem;
}

.dbh-rp-filter-period-inputs .form-select-sm {
    width: 4.5rem;
}

.dbh-rp-filter-period > input[type="month"].form-control-sm {
    width: 10rem;
    max-width: 100%;
}

.dbh-region-profit-export-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
}

.dbh-rp-export-regions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: center;
    flex: 1 1 auto;
}

.dbh-rp-export-period {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dbh-rp-export-period .form-select-sm {
    width: 6.5rem;
}

.dbh-rp-export-period input[type="month"].form-control-sm {
    width: 10rem;
}

.dbh-rp-export-action {
    flex: 0 0 auto;
}

.dbh-region-profit-section {
    margin-bottom: 0.65rem;
}

.dbh-region-profit-section:has(.dbh-shareholder-panel) {
    margin-bottom: 0.5rem;
}

.dbh-region-profit-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--dbh-text-muted, #6c757d);
    margin-bottom: 0.4rem;
}

/* 內容面板：統一間距 */
.dbh-rp-panel {
    width: 100%;
    margin-bottom: 0.65rem;
    box-shadow: 0 6px 18px rgba(160, 101, 140, 0.06);
}

.dbh-rp-panel .card-header {
    background: linear-gradient(180deg, rgba(255, 245, 250, 0.9), #fff);
}

.dbh-rp-panel .table {
    font-size: 0.875rem;
}

.dbh-rp-shareholder-table th,
.dbh-rp-shareholder-table td {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

/* 股東分潤：緊湊面板、可讀金額色 */
.dbh-shareholder-panel {
    margin-bottom: 0;
}

.dbh-shareholder-panel .card-header {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.dbh-shareholder-panel-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
}

.dbh-shareholder-panel-sub {
    font-size: 0.72rem;
    line-height: 1.2;
    margin-top: 0.1rem;
}

.dbh-shareholder-panel .dbh-rp-shareholder-table {
    font-size: 0.8rem;
}

.dbh-shareholder-panel .dbh-rp-shareholder-table th,
.dbh-shareholder-panel .dbh-rp-shareholder-table td {
    padding-top: 0.28rem;
    padding-bottom: 0.28rem;
}

.dbh-shareholder-single-wrap {
    max-width: 26rem;
}

.dbh-shareholder-amount,
.dbh-shareholder-net {
    color: var(--dbh-text-main, inherit);
}

.dbh-shareholder-amount-negative {
    color: var(--bs-danger, #dc3545);
}

.dbh-shareholder-overview-grid .dbh-shareholder-panel .card-header {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* 全部視圖：滿版四欄（台灣、韓國、大陸一般、大陸 VIP） */
.dbh-shareholder-overview-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 1fr;
    width: 100%;
}

@media (min-width: 768px) {
    .dbh-shareholder-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .dbh-shareholder-overview-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* 損益摘要：緊湊橫條 */
.dbh-profit-metric-strip {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dbh-profit-metric-strip--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dbh-profit-metric-strip--6,
.dbh-profit-metric-strip--7 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 576px) {
    .dbh-profit-metric-strip--5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dbh-profit-metric-strip--6,
    .dbh-profit-metric-strip--7 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .dbh-profit-metric-strip--5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .dbh-profit-metric-strip--7 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.dbh-profit-metric-chip {
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: rgba(255, 245, 250, 0.45);
    border: 1px solid rgba(160, 101, 140, 0.1);
    min-width: 0;
}

.dbh-profit-metric-label {
    font-size: 0.7rem;
    color: var(--dbh-text-muted, #6c757d);
    margin-bottom: 0.1rem;
    white-space: nowrap;
}

.dbh-profit-metric-value {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.dbh-profit-formula-line {
    font-size: 0.72rem;
    line-height: 1.45;
}

.dbh-profit-card-formula {
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--dbh-text-muted, #6c757d);
    margin-top: 0.35rem;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.dbh-card-filter {
    border-left: 3px solid var(--dbh-primary) !important;
    border-radius: var(--dbh-radius) var(--dbh-radius) 0 0 !important;
    margin-bottom: 0 !important;
}

.dbh-card-filter .card-body {
    padding: 0.65rem 0.85rem !important;
}

.dbh-filter-title {
    display: none;
}

.dbh-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dbh-text-main);
}

.dbh-section-title::after {
    display: none;
}

.dbh-table {
    border-radius: var(--dbh-card-radius);
    overflow: visible;
    background-color: var(--dbh-table-bg, var(--dbh-surface));
    color: var(--dbh-text-main);
}

.dbh-table thead {
    background-color: var(--dbh-table-head-bg, var(--dbh-primary-soft));
    border-bottom: 1px solid var(--dbh-border-soft);
}

.dbh-table thead th {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--dbh-text-muted);
    border-bottom: none;
    padding: 0.6rem 0.75rem;
}

.dbh-table {
    font-size: 0.9rem;
}

.dbh-table tbody tr {
    transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

/* 隔行變色（條紋背景） */
.dbh-table tbody tr:nth-child(even) {
    background-color: var(--dbh-table-stripe, #f6f8fa);
}

.dbh-table tbody tr:hover {
    background-color: var(--dbh-table-hover, #eef4f7);
}

.dbh-table tbody td {
    vertical-align: middle;
    padding: 0.5rem 0.75rem;
}

.dbh-table-pagination {
    margin-top: 0.6rem;
}

.dbh-table-pagination .pagination {
    --bs-pagination-border-radius: 999px;
    --bs-pagination-padding-x: 0.5rem;
    --bs-pagination-padding-y: 0.2rem;
    font-size: 0.8rem;
}

/* ====== Modal ====== */

.dbh-modal .modal-content {
    border-radius: var(--dbh-card-radius);
    box-shadow: 0 14px 40px rgba(160, 101, 140, 0.15);
}

.dbh-modal .modal-header {
    border-bottom: none;
    background: linear-gradient(135deg, var(--dbh-primary-soft), #ffffff);
    border-radius: var(--dbh-card-radius) var(--dbh-card-radius) 0 0;
}

.dbh-modal .modal-title {
    font-weight: 600;
}

.dbh-modal .modal-body {
    font-size: 1rem;
}

.dbh-modal .modal-footer {
    border-top: none;
    padding-right: 1.25rem;
}

/* 開團表單內的子彈窗（股東分潤） */
.dbh-nested-modal {
    z-index: 1065;
}

.dbh-nested-modal-backdrop {
    z-index: 1060;
}

/* ====== SalesPeople specific tweaks ====== */

/* ====== 業績紀錄頁：篩選與列表 ====== */

.dbh-sales-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--dbh-border-soft);
}

.dbh-sales-header .dbh-page-title {
    margin-bottom: 0;
}

.dbh-sales-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: var(--dbh-card-radius);
    -webkit-overflow-scrolling: touch;
}
.dbh-sales-table-wrap .table-responsive {
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
}

.dbh-sales-table {
    font-size: 0.875rem;
    min-width: 1280px; /* 台灣業績等多欄表，窄螢幕時出現水平捲動 */
}

/* 數字／金額／匯率欄一律不換行（th 與 td 都套用） */
.dbh-sales-table thead th.text-end,
.dbh-sales-table tbody td.text-end {
    white-space: nowrap;
}

/* 韓國業績：欄位最小寬度 + 橫向捲動，避免 14–16 吋筆電欄位重疊 */
.dbh-korean-sales-table {
    width: max-content;
    min-width: 100%;
    max-width: none;
    table-layout: auto;
    font-size: 0.75rem;
    border-collapse: collapse;
}

.dbh-korean-sales-table .dbh-kr-col-date { width: 4.75rem; }
.dbh-korean-sales-table .dbh-kr-col-clinic { width: 3.75rem; }
.dbh-korean-sales-table .dbh-kr-col-customer { width: 5rem; }
.dbh-korean-sales-table .dbh-kr-col-item { width: 11rem; min-width: 9rem; }
.dbh-korean-sales-table .dbh-kr-col-krw { width: 5.75rem; }
.dbh-korean-sales-table .dbh-kr-col-twd { width: 4.75rem; }
.dbh-korean-sales-table .dbh-kr-col-tax { width: 4.75rem; }
.dbh-korean-sales-table .dbh-kr-col-pct { width: 3rem; }
.dbh-korean-sales-table .dbh-kr-col-share { width: 5rem; }
.dbh-korean-sales-table .dbh-kr-col-actions { width: 5rem; }

.dbh-korean-sales-table thead th,
.dbh-korean-sales-table tbody td {
    padding: 0.25rem 0.3rem;
    vertical-align: top;
    box-sizing: border-box;
}

.dbh-korean-sales-table thead th {
    font-size: 0.7rem;
    line-height: 1.2;
    font-weight: 600;
}

.dbh-korean-sales-table thead th.dbh-th-text,
.dbh-korean-sales-table tbody td.dbh-td-text,
.dbh-korean-sales-table thead th.dbh-th-item,
.dbh-korean-sales-table tbody td.dbh-td-item {
    text-align: left;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.dbh-korean-sales-table thead th.dbh-th-date,
.dbh-korean-sales-table tbody td.dbh-td-date {
    text-align: left;
    white-space: nowrap;
}

.dbh-korean-sales-table thead th.dbh-th-num,
.dbh-korean-sales-table tbody td.dbh-kr-num {
    text-align: center !important;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.dbh-korean-sales-table thead th.dbh-th-num {
    white-space: nowrap;
    line-height: 1.2;
}

.dbh-korean-sales-table tbody td.dbh-kr-num {
    white-space: nowrap;
}

.dbh-korean-sales-table tbody td.dbh-kr-num .small {
    font-size: 0.625rem;
    line-height: 1.15;
}

.dbh-korean-sales-table thead th.dbh-th-actions,
.dbh-korean-sales-table tbody td.dbh-td-actions {
    text-align: center;
    white-space: nowrap;
    position: static !important;
    right: auto !important;
    box-shadow: none !important;
    z-index: auto !important;
}

.dbh-cell-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.dbh-cell-clamp--2 {
    -webkit-line-clamp: 2;
}

/* 客戶姓名：單行不斷，過長以 … 省略 */
.dbh-cell-nowrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 項目：可自動換行，並保留輸入時的換行 */
.dbh-cell-multiline {
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.dbh-korean-sales-table .dbh-td-customer {
    overflow: hidden;
}

.dbh-korean-actions {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: center;
}

.dbh-kr-action {
    display: inline-block;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.1rem 0.45rem;
    font-size: 0.68rem;
    line-height: 1.35;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dbh-kr-action--view {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.dbh-kr-action--view:hover {
    background: var(--bs-primary);
    color: #fff;
}

.dbh-kr-action--edit {
    color: #6c757d;
    border-color: #adb5bd;
}

.dbh-kr-action--edit:hover {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.dbh-kr-action--delete {
    color: var(--dbh-danger);
    border-color: var(--dbh-danger);
}

.dbh-kr-action--delete:hover {
    background: var(--dbh-danger);
    border-color: var(--dbh-danger);
    color: #fff;
}

.dbh-kr-action:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(225, 102, 155, 0.35);
}

.dbh-korean-sales-table tbody tr:hover .dbh-td-actions {
    background-color: var(--bs-table-hover-bg, #f8f9fa);
}

/* 台灣業績紀錄：診所(3)、客戶(4) 兩欄文字不換行；項目(5) 允許換行 */
.dbh-tw-sales-table tbody td:nth-child(3),
.dbh-tw-sales-table tbody td:nth-child(4) {
    white-space: nowrap;
}

.dbh-sales-table thead th {
    white-space: nowrap;
    padding: 0.6rem 0.5rem;
    font-weight: 600;
    color: var(--dbh-text-muted);
}

.dbh-sales-table tbody td {
    padding: 0.5rem;
    vertical-align: middle;
}

.dbh-sales-table .dbh-th-date,
.dbh-sales-table .dbh-td-date { width: 1%; white-space: nowrap; }
.dbh-sales-table .dbh-th-cat,
.dbh-sales-table .dbh-td-cat { white-space: nowrap; }
.dbh-sales-table .dbh-th-num { min-width: 4rem; }
.dbh-sales-table .dbh-th-sp,
.dbh-sales-table .dbh-td-sp { max-width: 5rem; }
.dbh-sales-table .dbh-th-tiny,
.dbh-sales-table .dbh-td-tiny { width: 1%; white-space: nowrap; max-width: 3.5rem; }
.dbh-sales-table .dbh-th-invoice-mode,
.dbh-sales-table .dbh-td-invoice-mode { min-width: 8.5rem; white-space: nowrap; }
.dbh-sales-table .dbh-th-invoice-status,
.dbh-sales-table .dbh-td-invoice-status { min-width: 6rem; white-space: nowrap; }
.dbh-sales-table .dbh-th-actions,
.dbh-sales-table .dbh-td-actions {
    width: 1%;
    white-space: nowrap;
    position: sticky;
    right: 0;
    background: var(--dbh-surface);
    box-shadow: -6px 0 12px rgba(0, 0, 0, 0.14);
    z-index: 2;
    min-width: 5.25rem;
    padding-right: 0.85rem;
}
.dbh-sales-table thead .dbh-th-actions {
    z-index: 3;
}

/* 韓國業績：覆寫共用 .dbh-sales-table / .dbh-table 規則，表頭與資料同欄同 padding、同對齊 */
.dbh-sales-table.dbh-korean-sales-table thead th,
.dbh-sales-table.dbh-korean-sales-table tbody td {
    padding: 0.3rem 0.35rem;
    vertical-align: top;
}

.dbh-sales-table.dbh-korean-sales-table thead th {
    white-space: normal;
    font-size: 0.7rem;
    line-height: 1.25;
}

.dbh-sales-table.dbh-korean-sales-table .dbh-th-date,
.dbh-sales-table.dbh-korean-sales-table .dbh-td-date,
.dbh-sales-table.dbh-korean-sales-table .dbh-th-num,
.dbh-sales-table.dbh-korean-sales-table .dbh-kr-num,
.dbh-sales-table.dbh-korean-sales-table .dbh-th-actions,
.dbh-sales-table.dbh-korean-sales-table .dbh-td-actions {
    max-width: none;
}

.dbh-sales-table.dbh-korean-sales-table .dbh-th-date,
.dbh-sales-table.dbh-korean-sales-table .dbh-td-date,
.dbh-sales-table.dbh-korean-sales-table .dbh-kr-num,
.dbh-sales-table.dbh-korean-sales-table .dbh-th-actions,
.dbh-sales-table.dbh-korean-sales-table .dbh-td-actions {
    white-space: nowrap;
}

.dbh-sales-table.dbh-korean-sales-table .dbh-th-num {
    white-space: nowrap;
    line-height: 1.2;
}

.dbh-sales-table.dbh-korean-sales-table .dbh-th-text,
.dbh-sales-table.dbh-korean-sales-table .dbh-td-text,
.dbh-sales-table.dbh-korean-sales-table .dbh-th-item,
.dbh-sales-table.dbh-korean-sales-table .dbh-td-item {
    text-align: left;
    white-space: normal;
}

.dbh-sales-table.dbh-korean-sales-table .dbh-th-num,
.dbh-sales-table.dbh-korean-sales-table .dbh-kr-num {
    text-align: center !important;
    font-variant-numeric: tabular-nums;
}

.dbh-sales-table.dbh-korean-sales-table .dbh-th-actions,
.dbh-sales-table.dbh-korean-sales-table .dbh-td-actions {
    text-align: center;
    position: static;
    right: auto;
    box-shadow: none;
    z-index: auto;
}

.dbh-sales-table.dbh-korean-sales-table tbody td.dbh-kr-num > div {
    text-align: inherit;
}

/* 上海收支明細表格 */
.dbh-sh-ledger-table thead th {
    font-size: 0.78rem;
    white-space: nowrap;
}

.dbh-sh-ledger-table tbody td:nth-child(2),
.dbh-sh-ledger-table tbody td:nth-child(11) {
    white-space: normal;
    word-break: break-word;
    max-width: 14rem;
}

.dbh-sh-ledger-table .text-end {
    font-variant-numeric: tabular-nums;
}

/* 韓國地區利潤報表：案件明細表格 */
.dbh-kr-profit-table {
    table-layout: fixed;
    width: 100%;
}

.dbh-kr-profit-table .dbh-krp-col-date { width: 6%; }
.dbh-kr-profit-table .dbh-krp-col-customer { width: 6%; }
.dbh-kr-profit-table .dbh-krp-col-item { width: 24%; }
.dbh-kr-profit-table .dbh-krp-col-clinic { width: 5%; }
.dbh-kr-profit-table .dbh-krp-col-sales { width: 5%; }
.dbh-kr-profit-table .dbh-krp-col-amount { width: 7%; }
.dbh-kr-profit-table .dbh-krp-col-pct { width: 4%; }
.dbh-kr-profit-table .dbh-krp-col-tiny { width: 4%; }
.dbh-kr-profit-table .dbh-krp-col-share { width: 8%; }
.dbh-kr-profit-table .dbh-krp-col-actions { width: 5%; }

.dbh-kr-profit-table thead th,
.dbh-kr-profit-table tbody td {
    padding: 0.35rem 0.4rem;
    vertical-align: top;
}

.dbh-kr-profit-table thead th.dbh-th-num,
.dbh-kr-profit-table tbody td.dbh-kr-num {
    text-align: center !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.dbh-kr-profit-table thead th.dbh-th-num {
    white-space: normal;
    font-size: 0.7rem;
    line-height: 1.25;
    vertical-align: middle;
}

.dbh-kr-profit-table thead th.dbh-th-date,
.dbh-kr-profit-table tbody td.dbh-td-date,
.dbh-kr-profit-table thead th.dbh-th-text,
.dbh-kr-profit-table tbody td.dbh-td-text,
.dbh-kr-profit-table thead th.dbh-th-actions,
.dbh-kr-profit-table tbody td.dbh-td-actions {
    white-space: nowrap;
}

.dbh-kr-profit-table thead th.dbh-th-item,
.dbh-kr-profit-table tbody td.dbh-td-item {
    white-space: normal;
    word-break: break-word;
    text-align: left;
}

.dbh-kr-profit-table thead th.dbh-th-actions,
.dbh-kr-profit-table tbody td.dbh-td-actions {
    text-align: center;
    position: static;
    box-shadow: none;
}

/* 表格列操作：統一「操作 ▼」下拉 */
.dbh-row-actions .dropdown-toggle {
    min-width: 4.25rem;
    white-space: nowrap;
}

.dbh-table .dbh-th-actions,
.dbh-table .dbh-td-actions { width: 1%; white-space: nowrap; }

.dbh-sales-filter-row .form-label,
.dbh-sales-filter-row .form-check-label {
    font-size: 0.85rem;
    color: var(--dbh-text-muted);
}

/* SalesPeople (kept for other pages) */
.dbh-sales-name-main {
    font-weight: 600;
}

.dbh-sales-name-sub {
    font-size: 0.8rem;
}

.dbh-attachment-status {
    font-size: 0.8rem;
}

.dbh-attachment-status .missing-label {
    font-weight: 600;
}

/* ====== Right-side drawer (檢視明細) ====== */

.dbh-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1040;
    animation: dbh-fade-in 0.2s ease;
}

.dbh-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100%;
    height: 100vh;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.dbh-drawer.dbh-drawer-open {
    transform: translateX(0);
}

.dbh-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--dbh-border-soft);
    background: linear-gradient(135deg, var(--dbh-primary-soft), #ffffff);
}

.dbh-drawer-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

@keyframes dbh-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 992px) {
    .dbh-shell:not(.dbh-shell-topnav) {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .dbh-sidebar {
        padding-inline: 0.4rem;
    }

    .dbh-shell:not(.dbh-shell-topnav) .dbh-brand-text {
        display: none;
    }

    .dbh-topnav-inner {
        padding: 0.5rem 0.75rem;
    }

    .dbh-topnav-user-name {
        display: none;
    }

    .dbh-main {
        padding: 1rem;
    }

    .dbh-page-title {
        font-size: 1.35rem;
    }

    .dbh-table {
        font-size: 0.85rem;
    }

    .dbh-table thead th,
    .dbh-table tbody td {
        padding: 0.4rem 0.5rem;
    }
}

/* 新增支出：專業多步驟表單 */
.expense-add-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* 新增/編輯支出：同一顆彈窗樣式，class 掛在 .modal-content 上 */
.modal-content.expense-add-modal {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.expense-stepper .stepper-track {
    display: flex;
    align-items: center;
    width: 100%;
}

.expense-stepper .stepper-step {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.expense-stepper .stepper-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.expense-stepper .stepper-step.active .stepper-circle {
    background: var(--dbh-primary);
    color: #fff;
}

.expense-stepper .stepper-step.done .stepper-circle {
    background: var(--dbh-primary);
    color: #fff;
    font-size: 0.7rem;
}

.expense-stepper .stepper-label {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
    min-width: 0;
}

.expense-stepper .stepper-num {
    font-weight: 600;
    font-size: 0.875rem;
    color: #212529;
}

.expense-stepper .stepper-step:not(.active):not(.done) .stepper-num,
.expense-stepper .stepper-step:not(.active):not(.done) .stepper-desc {
    color: #adb5bd;
}

.expense-stepper .stepper-desc {
    font-size: 0.7rem;
    color: #6c757d;
}

.expense-stepper .stepper-line {
    flex: 1;
    min-width: 12px;
    height: 2px;
    margin: 0 6px;
    background: #e9ecef;
}

.expense-stepper .stepper-step.done .stepper-line {
    background: var(--dbh-primary);
}

.expense-category-grid .expense-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    min-height: 100px;
}

.expense-category-grid .expense-category-card:hover {
    border-color: var(--dbh-primary-soft);
    box-shadow: 0 2px 8px rgba(225, 102, 155, 0.15);
}

.expense-category-grid .expense-category-card.selected {
    border-color: var(--dbh-primary);
    background: var(--dbh-primary-soft);
    box-shadow: 0 0 0 2px rgba(225, 102, 155, 0.25);
}

.expense-category-grid .category-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.expense-category-grid .category-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
}

.expense-category-grid .category-desc {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 0.15rem;
}

.expense-summary-card {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.expense-recurring-hint {
    border-radius: 8px;
}

.expense-will-generate {
    background: rgba(25, 135, 84, 0.08);
    border-color: rgba(25, 135, 84, 0.25) !important;
}