/* ===== Layout classes (AdminLTE 4 CSS Grid 補充) ===== */

/* 固定頂部導覽列 — sticky 在 Grid 內比 fixed 更穩定，不會脫離文件流 */
.layout-navbar-fixed .app-header {
    position: sticky;
    top: 0;
    z-index: 1034;
}

/* 固定底部 */
.layout-footer-fixed .app-footer {
    position: sticky;
    bottom: 0;
    z-index: 1032;
}

/* Sidebar Logo：展開 = 完整 logo 置中，收合 = mini icon */
.sidebar-logo-mini {
    display: none !important;
    max-height: 2rem;
}
.sidebar-logo-full {
    display: block;
    max-height: 2rem;
}
.sidebar-collapse .app-sidebar:not(:hover) .sidebar-logo-mini {
    display: block !important;
}
.sidebar-collapse .app-sidebar:not(:hover) .sidebar-logo-full {
    display: none !important;
}

/* Sidebar 收合時所有元素置中 */
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .sidebar-menu .nav-link {
    width: auto;
    margin-left: auto;
    margin-right: auto;
}
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .sidebar-brand .brand-link {
    justify-content: center;
}
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .user-avatar-nav .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* ===== Layout Customizer Panel ===== */
#layoutCustomizer .offcanvas-body {
    padding: 1rem;
}

#layoutCustomizer .setting-section {
    margin-bottom: 1.5rem;
}

#layoutCustomizer .setting-section h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 色彩方塊 */
#layoutCustomizer .color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#layoutCustomizer .color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}

#layoutCustomizer .color-swatch:hover {
    transform: scale(1.1);
}

#layoutCustomizer .color-swatch.active {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

#layoutCustomizer .color-swatch.active::after {
    content: '\F272'; /* Bootstrap Icon check */
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 色彩方塊顏色 */
#layoutCustomizer .color-swatch[data-color="default"] { background: linear-gradient(135deg, #3341c2, #c0c3f8); }
#layoutCustomizer .color-swatch[data-color="blue"]    { background: linear-gradient(135deg, #1565C0, #90CAF9); }
#layoutCustomizer .color-swatch[data-color="red"]     { background: linear-gradient(135deg, #C62828, #EF9A9A); }
#layoutCustomizer .color-swatch[data-color="yellow"]  { background: linear-gradient(135deg, #A06000, #FFE082); }
#layoutCustomizer .color-swatch[data-color="green"]   { background: linear-gradient(135deg, #2E7D32, #A5D6A7); }
#layoutCustomizer .color-swatch[data-color="purple"]  { background: linear-gradient(135deg, #7B1FA2, #CE93D8); }
#layoutCustomizer .color-swatch[data-color="black"]   { background: linear-gradient(135deg, #263238, #B0BEC5); }

/* Offcanvas footer (Bootstrap 無內建) */
#layoutCustomizer .offcanvas-footer {
    padding: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Form switch 間距 */
#layoutCustomizer .form-check.form-switch {
    margin-bottom: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}
