.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.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;
}

/* 整個 App 框架：HEADER + MAIN + FOOTER 鎖在 100vh 裡 */
html, body {
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden; /* 不讓整個視窗滾動，而是內部區塊各自滾動 */
}

.app-shell {
    height: 100vh; /* 整個畫面高度 = 視窗高度 */
    display: flex;
    flex-direction: column;
}

/* 上方 HEADER：高度由內容決定，固定在上方 */
.app-shell > header {
    flex: 0 0 auto;
}

/* 中間主體：SIDEBAR + CONTENT 放這裡，自己滾動 */
.app-main {
    flex: 1 1 auto;
    display: flex;
    overflow: hidden; /* 把滾動限制在子元素（sidebar/content） */
}

/* 下方 FOOTER：固定在底部 */
.app-footer {
    flex: 0 0 auto;
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
}
/* 左側 SIDEBAR：固定寬度，內容過長自己滾動 */
.layout-sidebar {
    flex: 0 0 220px; /* 固定寬度 = 220px，且不可縮小 */
    max-width: 260px;
    border-right: 1px solid #dee2e6;
    height: 100%;
    overflow-y: auto; /* 自己有滾動條 */
    padding: 0.75rem 0.75rem;
    background-color: #f8f9fa;
}

/* 右側 CONTENT：佔滿剩餘空間，也有自己的滾動 */
.layout-content {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
    padding: 1rem 1.5rem;
}

/* RWD：手機 / 小螢幕時，把 sidebar 變成在上面的一塊 */
@media (max-width: 768px) {
    .app-main {
        flex-direction: column;
    }

    .layout-sidebar {
        width: 100%;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        height: auto;
        max-height: 200px; /* 視需要調整 */
    }

    .layout-content {
        padding: 0.75rem 1rem;
    }
}
/* Sidebar menu 基本樣式 */
.sidebar-menu {
    font-size: 0.95rem;
}

    .sidebar-menu .menu-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .sidebar-menu .menu-item + .menu-item {
        margin-top: 0.25rem;
    }

    .sidebar-menu .menu-link {
        display: block;
        padding: 0.45rem 0.75rem;
        border-radius: 0.375rem;
        text-decoration: none;
        color: #495057;
        transition: background-color 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
    }

        /* hover 效果 */
        .sidebar-menu .menu-link:hover {
            background-color: #e9ecef;
            color: #212529;
            padding-left: 0.9rem;
        }

    /* active 狀態（由 View 判斷加上 .active） */
    .sidebar-menu .menu-item.active > .menu-link {
        background-color: #0d6efd;
        color: #fff;
        font-weight: 500;
    }

    /* 可選：讓 active 狀態顯示一條左側小邊線 */
    .sidebar-menu .menu-item.active > .menu-link {
        box-shadow: inset 3px 0 0 0 rgba(255, 255, 255, 0.9);
    }

    /* ====== 新增：依 Level 縮排，多層看起來有階層感 ====== */
    .sidebar-menu .menu-item.level-0 > .menu-link {
        padding-left: 0.75rem;
        font-weight: 600;
    }

    .sidebar-menu .menu-item.level-1 > .menu-link {
        padding-left: 1.5rem;
    }

    .sidebar-menu .menu-item.level-2 > .menu-link {
        padding-left: 2.25rem;
    }

    .sidebar-menu .menu-item.level-3 > .menu-link {
        padding-left: 3rem;
    }

/* 再更深就自己加 level-4、level-5 ... */

/* Reusable full-height page module */
.page-fill-layout {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.page-fill-layout__fixed {
    flex: 0 0 auto;
}

.page-fill-layout__main {
    flex: 1 1 auto;
    min-height: 0;
}

.fill-card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.fill-card .card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.fill-card__scroll-region {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.fill-card__scroll-region thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bs-table-bg, #fff);
}

.fill-card__pagination {
    flex: 0 0 auto;
    padding-top: 0.75rem;
}


