/* ── Header: nền đặc để không bị content trang lộ qua khi scroll ── */
.navbar-custom {
    background-color: #fff !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

[data-bs-theme=dark] .navbar-custom {
    background-color: #313a46 !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

/* Fix: condensed sidebar popup - expand to fit content width */
html[data-sidenav-size=condensed]:not([data-layout=horizontal]) .app-menu .menu > .menu-item:hover > .menu-link > .menu-text {
    width: max-content !important;
    background: #ccc !important;
}
html[data-sidenav-size=condensed]:not([data-layout=horizontal]) .app-menu .menu .menu-item:hover > .collapse > .sub-menu,
html[data-sidenav-size=condensed]:not([data-layout=horizontal]) .app-menu .menu .menu-item:hover > .collapsing > .sub-menu {
    width: max-content !important;
}

/*Layout & Card*/
.stepper-card {
    border: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1rem 2rem rgba(0,0,0,.1);
}

.stepper-body {
    padding: 0.75rem 1.5rem;
}

.stepper-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}
/*Stepper item*/
.stepper-item {
    flex: 1;
    text-align: center;
    position: relative;
}

.stepper-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    position: relative;
}
/*Progress connector*/
.progress-connector {
    position: absolute;
    width: 100%;
    height: 3px;
    left: 50%;
    top: 28px;
    z-index: 0;
}

.progress-connector-bg {
    height: 100%;
    background: #e9ecef;
    border-radius: 10px;
}

.progress-connector-fill {
    position: absolute;
    inset: 0;
    width: 0;
    background: linear-gradient(90deg, #0d6efd, #0dcaf0);
    border-radius: 10px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
}

    .progress-connector-fill.filled {
        width: 100%;
    }
/*Icon*/
.stepper-icon-wrapper {
    position: relative;
}

.stepper-icon {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: white;
    color: #adb5bd;
    border: 3px solid #e9ecef;
    transition: all .5s cubic-bezier(.34,1.56,.64,1);
}
/*Active / Completed state*/
.stepper-item.active .stepper-icon {
    background: linear-gradient(135deg, #0d6efd, #0dcaf0);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(13,110,253,.3);
}

.stepper-item.completed .stepper-icon {
    background: linear-gradient(135deg, #198754, #20c997);
    color: white;
}
/*Check badge*/
.check-badge {
    position: absolute;
    width: 24px;
    height: 24px;
    bottom: -4px;
    right: -4px;
    border-radius: 50%;
    background: #198754;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(25,135,84,.4);
    animation: check-pop .5s cubic-bezier(.34,1.56,.64,1);
}

    .check-badge i {
        font-size: 14px;
        color: white;
    }
/*Ripple*/
.ripple-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(13,110,253,.15);
    animation: ripple 2s infinite;
}
/*Label*/
.stepper-label {
    max-width: 200px;
}

.step-title {
    display: block;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: -0.02em;
    color: #6c757d;
}

.stepper-item.active .step-title {
    color: #0d6efd;
}

.stepper-item.completed .step-title {
    color: #198754;
}

.step-subtitle {
    font-size: .8rem;
    color: #6c757d;
    line-height: 1.3;
}


/* Toggle icon xoay */
.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-link[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* Text toggle */
.toggle-link[aria-expanded="true"] .toggle-text {
    display: none;
}

.toggle-link[aria-expanded="true"]::after {
    content: "Thu gọn luồng chi tiết";
    display: inline;
}

/* Ẩn bước hiện tại khi collapse mở (toàn bộ luồng) */
.collapse.show ~ .current-step-wrapper {
    display: none !important;
}

/* Responsive cho danh sách người */
.d-flex.flex-wrap.gap-2 > span {
    white-space: nowrap;
    font-size: 0.875rem;
}

@media (max-width: 576px) {
    .d-flex.flex-wrap.gap-2 > span {
        flex-basis: 100%;
        white-space: normal;
    }
}

/* ── Back navigation button ────────────────────────────────── */
.btn-back-nav {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: transparent;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.75;
    transition: opacity .15s, background .15s, border-color .15s, color .15s;
}

.btn-back-nav i {
    font-size: 16px;
    line-height: 1;
}

.btn-back-nav:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.2);
    color: inherit;
}

[data-bs-theme=dark] .btn-back-nav {
    border-color: rgba(255, 255, 255, 0.18);
}

[data-bs-theme=dark] .btn-back-nav:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

/* ── Topbar height token (dùng để overlay không che header) ── */
:root {
    --topbar-height: 70px;
}

/* ── Fix: sidebar toggle gây tràn ngang về phải ────────────────
   Nguyên nhân: min-width của .app-menu nhảy ngay lên 240px khi
   toggle condensed→default, trong khi .content-page vẫn giữ
   width cũ qua transition: all → tổng = 240 + (100vw-80) > 100vw.
   Fix 1: min-width: 0 cho phép flex shrink .content-page đúng cách.
   Fix 2: flex-shrink: 0 + min-width: 0 trên .app-menu để sidebar
   dùng đúng giá trị width đang animate, không bị min-width ghim.
   ──────────────────────────────────────────────────────────── */
.app-menu {
    min-width: 0 !important;
    flex-shrink: 0;
}

.content-page {
    min-width: 0;
}

/* ── Notification Bell ─────────────────────────────────────── */
.noti-icon-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    font-size: 9px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    line-height: 16px;
    border-radius: 10px;
}

.noti-dropdown {
    border-radius: 0.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
}

/* Thông báo chưa đọc — light mode */
.noti-unread {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

/* Thông báo chưa đọc — dark mode */
[data-bs-theme=dark] .noti-unread {
    background-color: rgba(13, 110, 253, 0.12) !important;
}

.noti-message {
    white-space: normal;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Overlay dùng chung cho bell + support dropdown.
   Bắt đầu từ dưới topbar nên không che nút sidebar-toggle / dark-mode */
.noti-overlay {
    position: fixed;
    top: var(--topbar-height, 70px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
}