/* =========================
   MODAL
   ========================= */

/* Khi modal mở, chặn cuộn */
.modal-open {
    overflow: visible;
}

/* Backdrop biến mất khi modal đóng */
.modal-backdrop.fade:not(.show) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Backdrop chỉ hiển thị khi modal mở */
body:not(.modal-open) .modal-backdrop {
    display: none !important;
}

/* Z-index chuẩn cho modal và backdrop */
.modal {
    z-index: 1050;
}
.modal-backdrop {
    z-index: 1040;
}

/* Ẩn hoàn toàn modal khi đóng */
.modal:not(.show) {
    display: none !important;
    pointer-events: none;
}

/* Ghi đè khi aria-hidden chưa đồng bộ */
.modal.show[aria-hidden="true"] {
    display: block !important;
}

/* Bỏ viền khi focus trong modal */
.modal.show:focus-within {
    outline: none;
}

/* Animation modal */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translateY(-50px);
}
.modal.show .modal-dialog {
    transform: none;
}

/* Focus cho input/button trong modal */
.modal.show button:focus,
.modal.show input:focus,
.modal.show select:focus,
.modal.show textarea:focus {
    outline: 2px solid #fd7e14;
    outline-offset: 2px;
}


/* =========================
   BUTTON & TEXT COLORS
   ========================= */

/* Cam - Màu thương hiệu */
.btn-primary {
    background-color: #fd7e14 !important;
    border-color: #fd7e14 !important;
    transition: all 0.2s ease;
}
.btn-primary:hover {
    background-color: #e67510 !important;
    border-color: #e67510 !important;
}
.btn-outline-light:hover {
    background-color: #fd7e14 !important;
    border-color: #fd7e14 !important;
    color: #fff !important;
}
.btn-outline-primary {
    color: #fd7e14 !important;
    border-color: #fd7e14 !important;
}
.btn-outline-primary:hover {
    background-color: #fd7e14 !important;
    color: #fff !important;
}
.text-primary {
    color: #fd7e14 !important;
}

/* Đỏ */
.btn-danger:hover {
    background-color: #c82333;
}

/* Xám */
.btn-secondary:hover {
    background-color: #5a6268;
}

/* Xanh dương */
.btn-info {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}
.btn-info:hover {
    background-color: #0b5ed7 !important;
    border-color: #0b5ed7 !important;
}
.btn-outline-info {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
}
.btn-outline-info:hover {
    background-color: #0d6efd !important;
    color: #fff !important;
}
.text-info {
    color: #0d6efd !important;
}
.link-color {
    color: #0d6efd !important;
}

/* Nền */
.bg-primary {
    background-color: #fd7e14 !important;
}
.bg-info {
    background-color: #0d6efd !important;
}
.card-header.bg-primary {
    background-color: #fd7e14 !important;
}
.card-header.bg-info {
    background-color: #0d6efd !important;
}


/* =========================
   LAYOUT & HEADER / FOOTER
   ========================= */

/* Body layout - Sticky Footer */
html {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

body.sidebar-mobile-lock {
    overflow: hidden;
}

/* Main content area phải chiếm hết không gian còn lại */
body > .d-flex.flex-grow-1 {
    flex: 1 0 auto;
}

/* Khu vực nội dung */
.content-area {
    flex: 1 1 auto;
    padding: 1rem;
    padding-top: calc(var(--header-height, 70px) + 1rem);
    padding-bottom: 2rem;
    transition: margin-left 0.3s ease;
    max-width: 100%;
}

/* Xóa khoảng trống do phần tử đầu tiên trong content thêm margin-top (vd: mt-4) */
.content-area > *:first-child {
    margin-top: 0 !important;
}

/* Sidebar pinned styles đã được chuyển sang sidebar.css */

/* Header */
header.bg-light,
header.fixed-top {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1040 !important;
    background-color: #fff !important;
    border-bottom: 2px solid #fd7e14;
    flex-shrink: 0;
}

.app-header-row {
    gap: 0.75rem;
    min-height: 55px;
}

.app-header-brand,
.app-header-actions {
    min-width: 0;
}

.app-header-brand a {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.app-header-logo {
    width: auto;
    height: 45px;
    object-fit: contain;
}

.mobile-sidebar-toggle {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-user-label {
    display: inline-block;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.app-user-menu-button {
    position: relative;
    min-height: 2.65rem;
    max-width: min(28rem, calc(100vw - 8rem));
    padding: 0.32rem 0.8rem 0.32rem 0.45rem;
    border-radius: 999px !important;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    overflow: visible;
    isolation: isolate;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.app-user-menu-button > * {
    position: relative;
    z-index: 1;
}

.app-user-menu-button:hover,
.app-user-menu-button:focus-visible {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04) !important;
    transform: translateY(-1px);
}

.app-user-menu-button.dropdown-toggle::after {
    border-top-color: #94a3b8 !important;
    margin-left: 0.15rem;
    opacity: 0.8;
    flex-shrink: 0;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.app-user-menu-button:hover.dropdown-toggle::after {
    border-top-color: #475569 !important;
    opacity: 1;
}

/* Remove visual clutter / overlapping dots / corner ticks */
.app-user-special-frame,
.app-user-menu-button--special::before,
.app-user-avatar-wrap--holiday::after,
.app-user-avatar-wrap--anniversary::after,
.app-user-avatar-wrap--special::before {
    display: none !important;
}

/* Base celebratory button */
.app-user-menu-button--special {
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(0, 0, 0, 0.03);
    animation: none !important;
}

/* Anniversary variant: Royal Warm Gold & Clean Ivory */
.app-user-menu-button--anniversary {
    background: linear-gradient(135deg, #ffffff 0%, #fffefc 60%, #fffbeb 100%) !important;
    border: 1.5px solid rgba(245, 158, 11, 0.45) !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
.app-user-menu-button--anniversary:hover {
    border-color: rgba(245, 158, 11, 0.75) !important;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.22), 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

/* Birthday variant: Elegant Festive Rose */
.app-user-menu-button--birthday {
    background: linear-gradient(135deg, #ffffff 0%, #fffafd 60%, #fdf2f8 100%) !important;
    border: 1.5px solid rgba(244, 63, 94, 0.45) !important;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
.app-user-menu-button--birthday:hover {
    border-color: rgba(244, 63, 94, 0.75) !important;
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.22), 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

/* Holiday variant: Prestigious Emerald & Amber */
.app-user-menu-button--holiday {
    background: linear-gradient(135deg, #ffffff 0%, #f7fee7 60%, #f0fdf4 100%) !important;
    border: 1.5px solid rgba(22, 163, 74, 0.45) !important;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
.app-user-menu-button--holiday:hover {
    border-color: rgba(22, 163, 74, 0.75) !important;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.22), 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

/* Avatar container */
.app-user-avatar-wrap {
    position: relative;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.app-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 0 1px #cbd5e1 !important;
}

.app-user-avatar--initials {
    color: #1e40af;
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
}

/* Festive avatar rings */
.app-user-menu-button--anniversary .app-user-avatar {
    box-shadow: 0 0 0 1.5px #f59e0b !important;
    animation: none;
}
.app-user-menu-button--birthday .app-user-avatar {
    box-shadow: 0 0 0 1.5px #f43f5e !important;
    animation: none;
}
.app-user-menu-button--holiday .app-user-avatar {
    box-shadow: 0 0 0 1.5px #16a34a !important;
    animation: none;
}

/* Birthday Hat decoration */
.app-user-birthday-hat {
    position: absolute;
    left: -0.28rem;
    top: -0.85rem;
    z-index: 3;
    width: 1.18rem;
    height: 1.28rem;
    border-radius: 0.16rem 0.16rem 0.08rem 0.08rem;
    background:
        linear-gradient(145deg, transparent 0 16%, #ffffff 16% 20%, transparent 20%),
        linear-gradient(145deg, transparent 0 33%, #facc15 33% 44%, transparent 44%),
        linear-gradient(145deg, transparent 0 54%, #f97316 54% 66%, transparent 66%),
        linear-gradient(160deg, #1d4ed8 0%, #2563eb 52%, #60a5fa 100%);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    filter: drop-shadow(0 0.14rem 0.14rem rgba(30, 64, 175, 0.24));
    transform: rotate(-20deg);
}

.app-user-birthday-hat-dot {
    position: absolute;
    left: 0.24rem;
    top: -0.95rem;
    z-index: 4;
    width: 0.34rem;
    height: 0.34rem;
    border-radius: 50%;
    background: #facc15;
    border: 1px solid #ffffff;
    box-shadow: 0 0.1rem 0.18rem rgba(127, 29, 29, 0.2);
}

.app-user-birthday-hat::after {
    content: "";
    position: absolute;
    left: 0.1rem;
    right: 0.08rem;
    bottom: -0.03rem;
    height: 0.18rem;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.24);
}

/* Single crisp festive micro-dot */
.app-user-special-dot {
    position: absolute;
    right: -0.22rem;
    bottom: -0.15rem;
    z-index: 2;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
    border: 2px solid #ffffff !important;
    font-size: 0.58rem;
    box-shadow: 0 2px 5px rgba(234, 88, 12, 0.35);
    animation: none;
}
.app-user-special-dot i {
    line-height: 1;
    display: inline-flex;
}
.app-user-menu-button--birthday .app-user-special-dot {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
    box-shadow: 0 2px 5px rgba(225, 29, 72, 0.35);
}
.app-user-menu-button--holiday .app-user-special-dot {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    box-shadow: 0 2px 5px rgba(22, 163, 74, 0.35);
}

/* User Name Label */
.app-user-label {
    color: #0f172a !important;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Special Festive Chip Label */
.app-user-special-label {
    min-width: 0;
    max-width: 12rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    animation: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.app-user-special-label:hover {
    transform: translateY(-0.5px);
}
.app-user-special-label i {
    font-size: 0.78rem;
    display: inline-flex;
    line-height: 1;
}

.app-user-menu-button--anniversary .app-user-special-label {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    color: #92400e !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.12) !important;
}
.app-user-menu-button--anniversary .app-user-special-label:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border-color: rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2) !important;
}
.app-user-menu-button--anniversary .app-user-special-label i {
    color: #b45309 !important;
}

.app-user-menu-button--birthday .app-user-special-label {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%) !important;
    color: #9f1239 !important;
    border: 1px solid rgba(244, 63, 94, 0.4) !important;
    box-shadow: 0 1px 2px rgba(244, 63, 94, 0.12) !important;
}
.app-user-menu-button--birthday .app-user-special-label:hover {
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%) !important;
    border-color: rgba(244, 63, 94, 0.6) !important;
    box-shadow: 0 2px 6px rgba(244, 63, 94, 0.2) !important;
}
.app-user-menu-button--birthday .app-user-special-label i {
    color: #be185d !important;
}

.app-user-menu-button--holiday .app-user-special-label {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    color: #166534 !important;
    border: 1px solid rgba(34, 197, 94, 0.4) !important;
    box-shadow: 0 1px 2px rgba(34, 197, 94, 0.12) !important;
}
.app-user-menu-button--holiday .app-user-special-label:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    border-color: rgba(34, 197, 94, 0.6) !important;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.2) !important;
}
.app-user-menu-button--holiday .app-user-special-label i {
    color: #15803d !important;
}

@keyframes app-user-special-glow {
    0%,
    100% {
        background-position: 0% 50%;
        box-shadow: 0 0.45rem 1.1rem color-mix(in srgb, var(--app-special-main) 8%, transparent);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0.55rem 1.25rem color-mix(in srgb, var(--app-special-main) 13%, transparent);
    }
}

@keyframes app-user-special-sheen {
    0%,
    72%,
    100% {
        background-position: -170% 50%;
    }
    84% {
        background-position: 170% 50%;
    }
}

@keyframes app-user-avatar-ring-rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes app-user-avatar-soft-ring {
    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(242, 116, 5, 0.22);
    }
    50% {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-special-main) 34%, transparent), 0 0 0.8rem color-mix(in srgb, var(--app-special-main) 14%, transparent);
    }
}

@keyframes app-user-special-dot-breathe {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0.25rem 0.55rem color-mix(in srgb, var(--app-special-main) 25%, transparent);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0.32rem 0.7rem color-mix(in srgb, var(--app-special-main) 34%, transparent);
    }
}

@keyframes app-user-special-label-breathe {
    0%,
    100% {
        background: color-mix(in srgb, var(--app-special-main) 10%, #ffffff);
    }
    50% {
        background: color-mix(in srgb, var(--app-special-main) 16%, #ffffff);
    }
}

.app-user-special-label span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-dropdown-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
    min-width: 17rem;
    padding: 0.75rem 1rem 0.45rem;
}

.app-user-dropdown-summary .app-user-avatar-wrap,
.app-user-dropdown-summary .app-user-avatar {
    width: 2.15rem;
    height: 2.15rem;
}

.app-user-dropdown-summary__text {
    min-width: 0;
}

.app-user-dropdown-summary__text strong,
.app-user-dropdown-summary__text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-dropdown-summary__text strong {
    color: #1f2937;
    font-size: 0.92rem;
}

.app-user-dropdown-summary__text small {
    margin-top: 0.12rem;
    color: #64748b;
    font-size: 0.76rem;
}

.app-header-link-label {
    display: inline-block;
    white-space: nowrap;
}

.mobile-compact {
    gap: 0.35rem;
}

.mobile-compact-label {
    display: inline;
    white-space: nowrap;
}

/* Footer - luôn ở cuối */
#footer {
    flex-shrink: 0;
    width: 100%;
    background-color: #fff !important;
    border-top: 2px solid #fd7e14;
    margin-top: auto;
}

/* Auth screens */
body.auth-layout > .d-flex.flex-grow-1 {
    min-height: 0;
}

body.auth-layout .content-area {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: calc(73px + clamp(0.75rem, 2vh, 1.5rem)) 1rem clamp(0.75rem, 2vh, 1.25rem);
}

body.auth-layout.auth-headerless .content-area {
    padding-top: clamp(0.75rem, 2vh, 1.5rem);
}

body.auth-layout.auth-headerless {
    background:
        radial-gradient(circle at 15% 12%, rgba(253, 126, 20, 0.08), transparent 28rem),
        radial-gradient(circle at 85% 88%, rgba(13, 110, 253, 0.07), transparent 30rem),
        #f8fafc;
}

body.auth-layout #footer {
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
}

.auth-skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1070;
    padding: 0.65rem 0.9rem;
    border-radius: 0.4rem;
    background: #212529;
    color: #fff;
    transform: translateY(-150%);
}

.auth-skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

.login-page {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(0.5rem, 2vh, 1.25rem) 0;
}

.login-container {
    width: 100%;
}

.login-column {
    max-width: 33rem;
}

.login-heading {
    margin-bottom: clamp(0.75rem, 2.4vh, 1.5rem);
}

.login-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 500;
    line-height: 1.15;
}

.login-subtitle {
    margin: 0;
    color: #6c757d;
}

.login-card {
    overflow: hidden;
}

.login-card .form-control,
.login-card .input-group-text,
.login-card .btn,
.identity-card .btn {
    min-height: 44px;
}

.login-card .form-check {
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    column-gap: 0.5rem;
    padding-left: 0;
}

.login-card .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.75rem 0 0;
}

.login-card .form-check-label {
    display: flex;
    min-height: 44px;
    align-items: center;
}

.login-card .form-check .form-text {
    grid-column: 2;
}

.login-card .card-footer a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}

/* Central login */
.login-shell {
    width: min(100%, 34rem);
}

.login-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1.25rem 3.5rem rgba(30, 41, 59, 0.12);
}

.login-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #fd7e14, #ff9f43);
    content: "";
}

.login-card .card-body {
    padding: clamp(1.5rem, 5vw, 2.65rem);
}

.login-logo {
    display: flex;
    margin: 0 auto 0.9rem;
    justify-content: center;
}

.auth-headerless .login-page .login-logo img[src*="LogoPHCM"] {
    display: block;
    width: 7.75rem !important;
    max-width: 100% !important;
    max-height: none !important;
    height: auto !important;
    object-fit: contain;
}

.login-heading {
    margin-bottom: 1.6rem;
}

.login-eyebrow {
    margin-bottom: 0.45rem;
    color: #b84d00;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.login-title {
    margin-bottom: 0.65rem;
    color: #172033;
    font-size: clamp(1.55rem, 5vw, 1.95rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.login-subtitle {
    max-width: 26rem;
    margin: 0 auto;
    color: #5b6472;
    line-height: 1.55;
}

.login-card--federated .login-logo {
    margin-bottom: 0.65rem;
}

.login-card--federated .login-heading {
    margin-bottom: 1.15rem;
}

.login-card--federated .identity-request {
    margin-bottom: 1rem !important;
}

.login-reauthentication {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    border: 0;
    line-height: 1.45;
}

.login-reauthentication .bi {
    flex: 0 0 auto;
    margin-top: 0.1rem;
}

.login-input-group .input-group-text,
.login-input-group .form-control,
.login-password-toggle {
    min-height: 50px;
}

.login-input-group .input-group-text {
    min-width: 3rem;
    justify-content: center;
    border-right: 0;
    background: #f8fafc;
    color: #64748b;
}

.login-input-group .input-group-text + .form-control {
    border-left: 0;
}

.login-input-group .form-control:focus {
    position: relative;
    z-index: 2;
    border-color: #fd7e14;
    box-shadow: none;
}

.login-input-group:focus-within {
    border-radius: 0.5rem;
    box-shadow: 0 0 0 0.2rem rgba(253, 126, 20, 0.2);
}

.login-input-group:focus-within :is(.input-group-text, .form-control, .login-password-toggle) {
    border-color: #fd7e14;
}

.login-page .login-input-group :is(input, button):focus-visible {
    outline: none;
}

.login-password-toggle {
    width: 3rem;
    padding: 0;
    border-color: #ced4da;
    color: #495057;
}

.login-options {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.85rem 0 1.25rem;
}

.login-options .form-check {
    flex: 1 1 auto;
}

.login-forgot-link {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 44px;
    align-items: center;
    color: #0b5ed7;
    font-weight: 600;
    text-decoration: none;
}

.login-forgot-link:hover {
    color: #084298;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.login-submit {
    display: inline-flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-color: #b84d00;
    background: #c45100;
    box-shadow: 0 0.45rem 1rem rgba(196, 81, 0, 0.2);
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.login-submit:hover,
.login-submit:focus-visible {
    border-color: #943b00;
    background: #a94400;
    box-shadow: 0 0.55rem 1.15rem rgba(169, 68, 0, 0.26);
}

.login-submit:active {
    transform: translateY(1px);
}

.login-submit:disabled {
    cursor: wait;
}

.login-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 1.1rem 0 0;
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
}

.login-security-note .bi {
    color: #198754;
}

.login-page :is(a, button, input):focus-visible {
    outline: 3px solid rgba(253, 126, 20, 0.7);
    outline-offset: 3px;
}

@media (max-width: 575.98px) {
    .login-page {
        align-items: flex-start;
        padding-top: 0;
    }

    .login-card .card-body {
        padding: 1.5rem 1.15rem 1.35rem;
    }

    .login-options {
        align-items: stretch;
        flex-direction: column;
        gap: 0.25rem;
    }

    .login-forgot-link {
        align-self: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-page *,
    .login-page *::before,
    .login-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

.password-recovery-input {
    min-height: 48px;
    font-size: 1rem;
}

.password-recovery-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.5;
}

.password-recovery-note .bi {
    flex: 0 0 auto;
    margin-top: 0.1rem;
    color: #198754;
}

.password-recovery-card button[type="submit"]:disabled {
    cursor: wait;
}

/* Password reset verification */
.verification-page {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(0.5rem, 2vh, 1.5rem) 0;
}

.verification-shell {
    width: min(100%, 32rem);
}

.verification-progress {
    margin-bottom: 1.25rem;
}

.verification-progress ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.verification-progress li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.verification-progress li:not(:last-child)::after {
    position: absolute;
    top: 0.85rem;
    left: calc(50% + 1.1rem);
    width: calc(100% - 2.2rem);
    height: 2px;
    background: #dee2e6;
    content: "";
}

.verification-progress li.is-complete::after {
    background: #198754;
}

.verification-progress__marker {
    position: relative;
    z-index: 1;
    display: inline-grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border: 2px solid #ced4da;
    border-radius: 50%;
    background: #fff;
    color: #6c757d;
    font-size: 0.75rem;
}

.verification-progress .is-complete .verification-progress__marker {
    border-color: #198754;
    background: #198754;
    color: #fff;
}

.verification-progress .is-current {
    color: #0a58ca;
}

.verification-progress .is-current .verification-progress__marker {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
}

.verification-card {
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 1rem 2.5rem rgba(20, 37, 63, 0.12);
}

.verification-card .card-body {
    padding: clamp(1.5rem, 5vw, 2.5rem);
}

.verification-icon {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    place-items: center;
    border-radius: 1rem;
    background: #eaf2ff;
    color: #0b5ed7;
    font-size: 1.55rem;
}

.verification-heading {
    margin-bottom: 1.5rem;
    text-align: center;
}

.verification-eyebrow {
    margin-bottom: 0.4rem;
    color: #0b5ed7;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.verification-heading h1 {
    margin-bottom: 0.65rem;
    color: #212529;
    font-size: clamp(1.5rem, 5vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
}

.verification-heading p:last-of-type {
    margin: 0;
    color: #5f6872;
    line-height: 1.55;
}

.verification-destination {
    display: flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem auto 0;
    padding: 0.5rem 0.8rem;
    border: 1px solid #cfe2ff;
    border-radius: 0.75rem;
    background: #f4f8ff;
    color: #084298;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
}

.verification-destination .bi {
    flex: 0 0 auto;
}

.verification-destination span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.verification-code-input {
    min-height: 3.5rem;
    padding-left: 1rem;
    border-width: 2px;
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 0.65rem;
    text-align: center;
}

.verification-code-input::placeholder {
    color: #adb5bd;
    opacity: 1;
}

.verification-code-input.is-invalid:focus-visible {
    outline-color: rgba(220, 53, 69, 0.75);
}

.verification-form .invalid-feedback {
    font-weight: 500;
}

.verification-submit {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.verification-recovery {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #f8f9fa;
    color: #5f6872;
    text-align: center;
}

.verification-recovery a,
.verification-back-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.verification-back-link {
    width: 100%;
    gap: 0.4rem;
    margin-top: 0.75rem;
    color: #495057;
    text-decoration: none;
}

.verification-back-link:hover {
    color: #0b5ed7;
}

.verification-page :is(a, button, input):focus-visible {
    outline: 3px solid rgba(253, 126, 20, 0.7);
    outline-offset: 3px;
}

@media (max-width: 575.98px) {
    .verification-page {
        align-items: flex-start;
        padding-top: 0;
    }

    .verification-card .card-body {
        padding: 1.35rem 1.1rem;
    }

    .verification-progress {
        margin-bottom: 0.9rem;
    }

    .verification-code-input {
        letter-spacing: 0.45rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .verification-page *,
    .verification-page *::before,
    .verification-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Password reset completion */
.password-reset-input-group .input-group-text {
    min-width: 3rem;
    justify-content: center;
    border-right: 0;
    background: #f8f9fa;
    color: #5f6872;
}

.password-reset-input {
    min-height: 48px;
    border-left: 0;
    font-size: 1rem;
}

.password-reset-toggle {
    display: inline-grid;
    min-width: 48px;
    min-height: 48px;
    place-items: center;
    border-color: #ced4da;
    color: #495057;
}

.password-reset-input-group:focus-within :is(.input-group-text, .password-reset-input, .password-reset-toggle) {
    border-color: #86b7fe;
}

.password-requirements {
    margin-bottom: 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e4e9ef;
    border-radius: 0.75rem;
    background: #f8f9fa;
}

.password-requirements__title {
    margin-bottom: 0.55rem;
    color: #343a40;
    font-size: 0.875rem;
    font-weight: 600;
}

.password-requirements ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.84rem;
    line-height: 1.4;
}

.password-requirements li .bi {
    flex: 0 0 auto;
    color: #adb5bd;
}

.password-requirements li.is-met {
    color: #146c43;
}

.password-requirements li.is-met .bi {
    color: #198754;
}

.password-match-feedback {
    min-height: 1.35rem;
    padding-top: 0.35rem;
    color: #dc3545;
    font-size: 0.875rem;
    font-weight: 500;
}

.password-reset-security-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
    color: #6c757d;
    font-size: 0.8rem;
    line-height: 1.5;
}

.password-reset-security-note .bi {
    flex: 0 0 auto;
    margin-top: 0.1rem;
    color: #198754;
}

.password-reset-page button[type="submit"]:disabled {
    cursor: wait;
}

@media (max-width: 575.98px) {
    .password-reset-card .card-body {
        padding-bottom: 1.2rem;
    }
}

.identity-request {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    border: 1px solid #c9dcf7;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #f5f9ff 0%, #eef5ff 100%);
}

.identity-request__icon {
    display: grid;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 0.3rem 0.65rem rgba(13, 110, 253, 0.18);
}

.identity-request__content {
    min-width: 0;
}

.identity-request__content h2 {
    margin-bottom: 0.15rem !important;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.identity-request__eyebrow,
.identity-eyebrow {
    color: #0a58ca;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.identity-request__eyebrow {
    margin-bottom: 0.15rem !important;
    font-size: 0.68rem;
    line-height: 1.25;
}

.identity-page {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 0;
}

.identity-card {
    width: min(100%, 36rem);
    overflow: hidden;
}

.identity-mark {
    display: grid;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: 0.85rem;
    background: #e7f1ff;
    color: #0d6efd;
    font-size: 1.45rem;
}

.identity-mark--danger {
    margin-right: auto;
    margin-left: auto;
    background: #f8d7da;
    color: #b02a37;
}

.identity-account {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    background: #f8f9fa;
}

.identity-account > i {
    color: #0d6efd;
    font-size: 1.75rem;
}

.identity-account__details {
    min-width: 0;
}

.identity-account__details :is(strong, span) {
    overflow-wrap: anywhere;
}

.identity-scope-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.identity-scope-list li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.identity-scope-list i {
    margin-top: 0.1rem;
    color: #198754;
}

.identity-scope-list code {
    color: #6c757d;
    font-size: 0.75em;
}

.identity-destination {
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.identity-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.identity-actions .btn {
    min-width: 9rem;
}

/* OAuth / OpenID Connect user-facing pages */
body.oauth-layout #footer {
    display: none !important;
}

body.auth-layout.oauth-layout > .d-flex.flex-grow-1 {
    min-height: 100vh;
}

body.auth-layout.oauth-layout .content-area {
    padding: clamp(0.35rem, 1.5vh, 0.75rem);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oauth-page {
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.oauth-card {
    width: min(100%, 28rem);
    margin: 0 auto;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.85) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 10px 24px -2px rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.oauth-card__body {
    padding: 1.15rem 1.25rem;
}

.oauth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.oauth-layout .oauth-brand img[src*="LogoPHCM"] {
    display: block;
    width: 6.25rem !important;
    max-width: 100% !important;
    max-height: 2.8rem !important;
    height: auto !important;
    object-fit: contain;
}

.oauth-heading {
    margin-bottom: 0.65rem;
    text-align: center;
}

.oauth-heading .identity-mark {
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 0.5rem;
}

.oauth-heading h1 {
    margin-bottom: 0.2rem;
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.oauth-error-state h1 {
    margin-bottom: 0.5rem;
    color: #212529;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
}

.oauth-heading > p:last-child {
    margin: 0;
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.oauth-error-state > p:last-of-type {
    margin: 0;
    color: #5f6872;
    line-height: 1.5;
    font-size: 0.85rem;
}

.oauth-application {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #f8fafc;
}

.oauth-application__icon {
    display: grid;
    flex: 0 0 2.1rem;
    width: 2.1rem;
    height: 2.1rem;
    place-items: center;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    color: #fff;
    font-size: 0.95rem;
}

.oauth-application__content {
    flex: 1 1 auto;
    min-width: 0;
}

.oauth-application__content > span {
    display: block;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1.2;
}

.oauth-application__content > strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
    font-size: 0.925rem;
    font-weight: 700;
    line-height: 1.3;
}

.oauth-application__content > small {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.2;
}

.oauth-verified-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #059669;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.oauth-application--logout {
    border-color: #dee2e6;
    background: #f8f9fa;
}

.oauth-application--logout .oauth-application__icon {
    background: #6c757d;
}

.oauth-card .identity-account {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #f8fafc;
}

.oauth-card .identity-account > i {
    color: #0d6efd;
    font-size: 1.6rem;
    line-height: 1;
    flex: 0 0 auto;
}

.oauth-card .identity-account__details {
    flex: 1 1 auto;
    min-width: 0;
}

.oauth-card .identity-account__details > span:first-child {
    font-size: 0.68rem !important;
    line-height: 1.2;
    color: #64748b !important;
}

.oauth-card .identity-account__details > strong {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oauth-card .identity-account__details > span:last-child {
    font-size: 0.72rem !important;
    line-height: 1.2;
    color: #64748b !important;
}

.oauth-card .oauth-switch-account-form {
    flex: 0 0 auto;
    margin-left: auto;
}

.oauth-card .oauth-switch-account {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 150ms ease;
}

.oauth-card .oauth-switch-account:hover,
.oauth-card .oauth-switch-account:focus-visible {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
    box-shadow: none;
}

.oauth-card .oauth-switch-account:active {
    background: #fee2e2;
    color: #b91c1c;
}

.oauth-internal-note {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.45rem;
    margin-bottom: 0.55rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #475569;
    font-size: 0.76rem;
    line-height: 1.35;
}

.oauth-internal-note .bi {
    flex: 0 0 auto;
    margin-top: 0;
    color: #0284c7;
    font-size: 0.85rem;
}

.oauth-internal-note p {
    margin: 0;
}

.oauth-permissions {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
}

.oauth-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.oauth-section-heading > .bi {
    color: #0b5ed7;
    font-size: 1.1rem;
}

.oauth-section-heading h2 {
    margin: 0 0 0.2rem;
    font-size: 1rem;
    font-weight: 700;
}

.oauth-section-heading p {
    margin: 0;
    color: #6c757d;
    font-size: 0.82rem;
}

.oauth-card .identity-scope-list code {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.1rem 0.35rem;
    border-radius: 0.3rem;
    background: #eef2f7;
    color: #495057;
}

.oauth-destination,
.oauth-logout-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.oauth-destination {
    border: 1px solid #cfe2ff;
    background: #f4f8ff;
    color: #495057;
}

.oauth-logout-warning {
    border: 1px solid #ffecb5;
    background: #fff9e6;
    color: #664d03;
}

.oauth-destination .bi,
.oauth-logout-warning .bi {
    flex: 0 0 auto;
    margin-top: 0.15rem;
}

.oauth-destination p,
.oauth-logout-warning p {
    margin: 0;
    overflow-wrap: anywhere;
}

.oauth-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
    gap: 0.6rem;
    margin-top: 0.65rem;
}

.oauth-actions .btn {
    display: inline-flex;
    min-width: 0;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.5rem;
    line-height: 1.3;
    transition: all 150ms ease;
}

.oauth-actions .btn-outline-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.oauth-actions .btn-outline-secondary:hover,
.oauth-actions .btn-outline-secondary:focus-visible {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.oauth-actions .btn-primary {
    background: #0d6efd;
    border: 1px solid #0d6efd;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(13, 110, 253, 0.25);
}

.oauth-actions .btn-primary:hover,
.oauth-actions .btn-primary:focus-visible {
    background: #0b5ed7;
    border-color: #0a58ca;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.35);
}

.oauth-actions--logout {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.oauth-form-error ul {
    margin-bottom: 0;
}

.oauth-error-state {
    color: #1f2937;
}

.oauth-error-state__header {
    max-width: 31rem;
    margin: 0 auto;
    text-align: center;
}

.oauth-error-state__header .identity-mark {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    border-radius: 1rem;
    font-size: 1.35rem;
}

.oauth-error-state__header .identity-eyebrow {
    margin-bottom: 0.65rem;
    color: #b42318;
}

.oauth-error-recovery {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #dbe4ee;
    border-radius: 0.75rem;
    background: #f8fafc;
    color: #475569;
    line-height: 1.5;
}

.oauth-error-recovery > .bi {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    color: #0b5ed7;
    font-size: 1.1rem;
}

.oauth-error-recovery strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #1f2937;
}

.oauth-error-recovery p {
    margin: 0;
    font-size: 0.9rem;
}

.oauth-error-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.oauth-error-actions .btn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.oauth-error-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.78rem;
}

.oauth-error-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.oauth-error-meta code {
    padding: 0.18rem 0.4rem;
    border-radius: 0.35rem;
    background: #eef2f7;
    color: #334155;
    font-size: inherit;
    font-weight: 700;
}

.oauth-error-reported {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.85rem 0 0;
    color: #147d55;
    font-size: 0.82rem;
}

.oauth-error-details {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.65rem;
    background: #f8f9fa;
    text-align: left;
}

.oauth-error-details summary {
    min-height: 44px;
    cursor: pointer;
    color: #495057;
    font-weight: 600;
    line-height: 44px;
}

.oauth-error-details p {
    margin: 0;
    padding-top: 0.5rem;
    overflow-wrap: anywhere;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.5;
}

.oauth-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.5rem 0 0;
    padding-top: 0.45rem;
    border-top: 1px solid #f1f5f9;
    color: #64748b;
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.3;
}

.oauth-security-note .bi {
    color: #16a34a;
    font-size: 0.82rem;
}

.oauth-card :is(a, button):focus-visible {
    outline: 3px solid rgba(253, 126, 20, 0.7);
    outline-offset: 3px;
}

@media (max-width: 575.98px) {
    .oauth-page {
        padding: 0.35rem 0.5rem;
    }

    .oauth-card__body {
        padding: 1rem 1.15rem;
    }

    .oauth-actions {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
        gap: 0.5rem;
    }

    .oauth-actions--logout {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    }

    .oauth-error-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 359.98px) {
    .oauth-actions,
    .oauth-actions--logout {
        grid-template-columns: 1fr;
    }

    .oauth-card .identity-account {
        flex-wrap: wrap;
    }

    .oauth-card .oauth-switch-account-form {
        width: 100%;
        margin-left: 2.25rem;
    }

    .oauth-card .oauth-switch-account {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .oauth-page *,
    .oauth-page *::before,
    .oauth-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

.login-card :focus-visible,
.identity-card :focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.35);
    outline-offset: 2px;
}

.auth-footer-links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.6rem;
    margin-top: 0.15rem;
    color: #6c757d;
    font-size: 0.78rem;
}

.auth-footer-links__label {
    font-weight: 600;
}

.auth-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #fd7e14;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-link:hover,
.auth-footer-link:focus {
    color: #e67510;
    text-decoration: underline;
}

@media (max-height: 820px) {
    body.auth-layout .content-area {
        padding-top: calc(73px + 0.75rem);
        padding-bottom: 0.75rem;
    }

    .login-heading {
        margin-bottom: 0.7rem;
    }

    .login-card .card-body {
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }

    .login-card .card-header,
    .login-card .card-footer {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

@media (max-width: 575.98px) {
    body.auth-layout .content-area {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .login-column {
        max-width: 100%;
    }

    .identity-actions .btn {
        width: 100%;
    }
}


/* =========================
   LINK, TABLE, FORM
   ========================= */

a {
    color: #0d6efd;
}
a:hover {
    color: #0b5ed7;
}

/* Bảng màu */
.table-primary,
.table-primary > th,
.table-primary > td {
    background-color: #ffe5d0;
}
.table-info,
.table-info > th,
.table-info > td {
    background-color: #cfe2ff;
}
.table-hover .table-primary:hover {
    background-color: #ffd7b5;
}
.table-hover .table-info:hover {
    background-color: #bacbe6;
}

/* Form focus */
.form-control:focus,
.form-select:focus {
    border-color: #fd7e14;
    box-shadow: 0 0 0 0.25rem rgba(253, 126, 20, 0.25);
}

/*thông báo không bị che bởi header */
.notification {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 2147483000 !important;
    margin: 0.5rem;
}


/* Style cho container thông báo */
.notification-container {
    position: fixed;
    top: calc(var(--header-height, 60px) + 0.75rem);
    right: 1rem;
    left: auto;
    max-width: 26rem;
    width: min(26rem, calc(100vw - 2rem));
    z-index: 1090;
    pointer-events: none;
}

.notification-header-offset {
    top: calc(var(--header-height, 60px) + 0.75rem);
    right: 1rem;
    left: auto;
    z-index: 1090;
    pointer-events: none;
}

body.auth-headerless .notification-container,
body.auth-headerless .notification-header-offset {
    top: 1rem;
}

.page-header-shell {
    gap: 1rem;
    flex-wrap: wrap;
}

.page-actions-shell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 0.85rem;
}

/* Style cho alert trong thông báo */
.notification-alert {
    --notification-accent: var(--bs-info, #0dcaf0);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.9rem 3.25rem 0.9rem 1rem;
    border: 1px solid #e4e7ec;
    border-left: 4px solid var(--notification-accent);
    border-radius: 0.8rem;
    background: #ffffff;
    color: #344054;
    box-shadow: 0 0.65rem 1.5rem rgba(16, 24, 40, 0.14), 0 0.15rem 0.35rem rgba(16, 24, 40, 0.06);
    animation: slideInRight 0.22s ease-out;
    pointer-events: auto;
}

.notification-alert.alert-success { --notification-accent: var(--bs-success, #198754); }
.notification-alert.alert-danger { --notification-accent: var(--bs-danger, #dc3545); }
.notification-alert.alert-warning { --notification-accent: var(--bs-warning, #ffc107); }
.notification-alert.alert-info { --notification-accent: var(--bs-info, #0dcaf0); }

.notification-icon {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.08rem;
    color: var(--notification-accent);
    font-size: 1.15rem;
    line-height: 1.5;
}

.notification-content {
    min-width: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.notification-close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    display: inline-grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #667085;
    opacity: 1;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.notification-close i {
    font-size: 0.78rem;
    line-height: 1;
}

.notification-close:hover {
    background: #f2f4f7;
    color: #344054;
    transform: scale(1.04);
}

.notification-close:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--notification-accent) 45%, transparent);
    outline-offset: 1px;
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .notification-container,
    .notification-header-offset {
        left: 1rem;
        right: 1rem;
        width: auto;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notification-alert {
        animation: none;
        transition: none;
    }

    .notification-close {
        transition: none;
    }
}



@media (max-width: 991.98px) {
    .content-area .container > .d-flex.justify-content-between.align-items-center.mb-4,
    .content-area .container-fluid > .d-flex.justify-content-between.align-items-center.mb-4,
    .content-area .container > .d-flex.justify-content-between.align-items-center.mt-4,
    .content-area .container-fluid > .d-flex.justify-content-between.align-items-center.mt-4 {
        gap: 1rem;
        flex-wrap: wrap;
        align-items: flex-start !important;
    }

    .content-area .container > .d-flex.justify-content-between.align-items-center.mb-4 > :last-child,
    .content-area .container-fluid > .d-flex.justify-content-between.align-items-center.mb-4 > :last-child,
    .content-area .container > .d-flex.justify-content-between.align-items-center.mt-4 > :last-child,
    .content-area .container-fluid > .d-flex.justify-content-between.align-items-center.mt-4 > :last-child {
        width: 100%;
    }

    .content-area {
        padding: 0.85rem;
        padding-top: calc(var(--header-height, 70px) + 0.85rem);
        padding-bottom: 1.5rem;
    }

    .content-area .container,
    .content-area .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .breadcrumb {
        row-gap: 0.35rem;
    }

    .page-header-shell {
        align-items: flex-start !important;
        margin-bottom: 1rem !important;
    }

    .page-header-shell h1,
    .page-header-shell h2,
    .page-header-shell .h2,
    .page-header-shell .h3 {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
    }

    .page-actions-shell {
        width: 100%;
        justify-content: flex-start;
    }

    .page-actions-shell > * {
        max-width: 100%;
    }

    .page-actions-shell .btn,
    .page-actions-shell > .dropdown,
    .page-actions-shell > a,
    .page-actions-shell > button {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .app-header-actions {
        gap: 0.5rem;
    }

    .app-header-actions .dropdown,
    .app-header-actions > div {
        margin-right: 0 !important;
    }

    .app-user-label {
        display: none;
    }

    .app-user-menu-button {
        max-width: none;
        width: 2.75rem;
        height: 2.75rem;
        min-height: 2.75rem;
        padding: 0;
        justify-content: center;
        border-radius: 0.9rem;
        gap: 0;
    }

    .app-user-menu-button.dropdown-toggle::after,
    .app-user-special-label {
        display: none;
    }

    .app-header-link-label {
        display: none;
    }

    .notification-trigger,
    .mobile-sidebar-toggle {
        width: 2.5rem;
        height: 2.5rem;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .card-footer .d-flex {
        align-items: flex-start !important;
    }

    .footer-meta {
        font-size: 0.84rem;
        line-height: 1.5;
    }


}

@media (max-width: 575.98px) {
    .content-area {
        padding-top: calc(var(--header-height, 70px) + 0.75rem);
    }

    .page-actions-shell .btn,
    .page-actions-shell > .dropdown,
    .page-actions-shell > a,
    .page-actions-shell > button {
        flex: 1 1 100%;
    }

    .app-header-brand img {
        height: 38px !important;
    }

    .app-header-actions .btn {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .app-user-menu-button {
        width: 2.5rem;
        height: 2.5rem;
        min-height: 2.5rem;
        padding: 0 !important;
    }

    .app-user-avatar-wrap,
    .app-user-avatar {
        width: 1.75rem;
        height: 1.75rem;
    }

    .app-user-dropdown-summary {
        min-width: 15.5rem;
    }

    .app-header-actions .app-header-icon-button {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.85rem;
    }

    .app-header-actions .app-header-icon-button::after {
        display: none;
    }

    .app-header-actions .app-header-icon-button .bi,
    .app-header-actions .app-header-icon-button .fas {
        margin-right: 0 !important;
        font-size: 1.05rem;
    }

    .mobile-compact {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .mobile-compact-label {
        display: none !important;
    }

    .mobile-compact.btn,
    .mobile-compact.nav-link,
    .btn-group .btn-sm.mobile-compact {
        min-width: 2.5rem !important;
        padding-left: 0.7rem !important;
        padding-right: 0.7rem !important;
    }

    .mobile-compact .bi,
    .mobile-compact .fas,
    .mobile-compact .far,
    .mobile-compact .fa,
    .mobile-compact .fa-solid,
    .mobile-compact .fa-regular,
    .mobile-compact svg {
        margin-right: 0 !important;
    }

    .mobile-compact.nav-link {
        gap: 0.25rem;
    }

    .mobile-compact.nav-link .badge,
    .mobile-compact.btn .badge {
        margin-left: 0.15rem !important;
    }

    .table-responsive > .table {
        min-width: 640px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-user-menu-button,
    .notification-trigger,
    .notification-item {
        transition: none;
    }

    .app-user-menu-button:hover,
    .app-user-menu-button:focus-visible,
    .notification-item:hover {
        transform: none;
    }

    .app-user-menu-button--special,
    .app-user-menu-button--special::before,
    .app-user-avatar-wrap--special::before,
    .app-user-avatar-wrap--special .app-user-avatar,
    .app-user-special-dot,
    .app-user-special-label {
        animation: none;
    }
}



.footer-meta {
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =========================
   RESPONSIVE
   ========================= */

/* =========================
   PAGINATION STYLES
   ========================= */

.pagination {
    justify-content: center; /* Center the pagination */
    margin-top: 20px; /* Add some space above the pagination */
}

.pagination .page-item {
    margin: 0 5px; /* Add space between pagination items */
}

.pagination .page-link {
    padding: 10px 15px; /* Adjust padding for better click area */
}

@media (max-width: 768px) {
    .content-area {
        padding: 0.5rem;
        padding-top: calc(var(--header-height, 70px) + 0.75rem);
    }
    /* Responsive sidebar styles đã được chuyển sang sidebar.css */
}

/* =========================
   LOGO & HEADER FIXES
   ========================= */

/* Fix logo size in header */
header img[src*="logo"],
header img[src*="Logo"] {
    max-height: 50px !important;
    height: auto !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
}

/* Responsive logo for mobile */
@media (max-width: 768px) {
    header img[src*="logo"],
    header img[src*="Logo"] {
        max-height: 40px !important;
    }
}

/* Fix for any banner/hero logo */
.banner-logo,
.hero-logo {
    max-width: 150px !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Prevent logo from being too large */
img[src*="LogoPHCM"],
img[src*="logo.png"] {
    max-height: 60px !important;
    width: auto !important;
    object-fit: contain !important;
}

/* Fix for flex containers with logo */
.d-flex img[src*="logo"],
.d-flex img[src*="Logo"] {
    flex-shrink: 0;
    max-height: 50px !important;
}

/* =========================
   EXPANDABLE NOTES
   ========================= */

.expandable-note {
    position: relative;
}

.expandable-note .note-content {
    line-height: 1.5;
}

.expandable-note .note-controls {
    margin-top: 0.5rem;
}

.expandable-note .note-controls .btn-link {
    font-size: 0.875rem;
    color: #0d6efd;
    text-decoration: none !important;
    padding: 0;
    border: none;
    background: none;
    transition: color 0.2s ease;
}

.expandable-note .note-controls .btn-link:hover {
    color: #0a58ca;
}

.expandable-note .note-controls .btn-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.expandable-note .note-controls .btn-link i {
    transition: transform 0.2s ease;
}

.expandable-note .note-controls .btn-link:hover i {
    transform: translateY(-1px);
}

/* Smooth transitions for expand/collapse */
.expandable-note #more-* {
    transition: opacity 0.3s ease;
}

.expandable-note #dots-* {
    transition: opacity 0.3s ease;
}

/* =========================
   LOCAL LIST LOADER
   ========================= */

.local-list-region {
    position: relative;
}

.local-list-region.is-loading {
    cursor: progress;
}

.local-list-region.is-loading [data-local-list-filter],
.local-list-region.is-loading [data-local-list-panel],
.local-list-region.is-loading [data-local-list-scroll],
.local-list-region.is-loading form[method="get"],
.local-list-region.is-loading form[method="GET"],
.local-list-region.is-loading .pagination {
    opacity: 0.68;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.local-list-loading-status {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1030;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: calc(100% - 1.5rem);
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(253, 126, 20, 0.35);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.16);
    color: #344054;
    font-size: 0.875rem;
    font-weight: 600;
}

.local-list-loading-status.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    display: block !important;
}

.local-list-loading-status[hidden] {
    display: none !important;
}

.local-list-loading-status .spinner-border {
    color: #fd7e14;
}

@media (prefers-reduced-motion: reduce) {
    .local-list-region.is-loading [data-local-list-filter],
    .local-list-region.is-loading [data-local-list-panel],
    .local-list-region.is-loading [data-local-list-scroll],
    .local-list-region.is-loading form[method="get"],
    .local-list-region.is-loading form[method="GET"],
    .local-list-region.is-loading .pagination {
        transition: none;
    }
}

.local-list-lazy-row td,
.local-list-lazy-row th {
    text-align: center;
    border-bottom: none !important;
    padding: 0.75rem 0.5rem;
    background: transparent !important;
}

.local-list-lazy-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: #334155;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(242, 116, 5, 0.24);
    border-radius: 2rem;
    padding: 0.4rem 1.15rem;
    font-size: 0.82rem;
    font-weight: 650;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06), 0 0 10px rgba(242, 116, 5, 0.08);
    transition: all 0.2s ease;
}

.local-list-lazy-state:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1), 0 0 14px rgba(242, 116, 5, 0.15);
}

.local-list-lazy-state [data-local-list-lazy-retry] {
    min-height: 2.2rem;
    padding: 0.2rem 0.75rem;
    margin-left: 0.25rem;
    border-radius: 1rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.local-list-lazy-state [data-local-list-lazy-retry]:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

/* ==========================================================================
   BDU Mini Logo Spinner for Lazy Loading & In-place Lists (Anchor & Blue Orbit)
   - Anchor: Brand logo stays upright and static in center (crisp & respectful)
   - Orbit: Smooth blue aura arc spins around the perimeter with subtle track
   - 100% backward-compatible via pseudo-elements on .bdu-lazy-logo-wrapper
   ========================================================================== */
.bdu-lazy-logo-wrapper {
    position: relative;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
}

/* Static Track Ring (Quỹ đạo tĩnh định hướng) */
.bdu-lazy-logo-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(2, 132, 199, 0.16);
    box-sizing: border-box;
    pointer-events: none;
}

/* Dynamic Blue Orbit Arc (Vòng hào quang xanh dương xoay quanh) */
.bdu-lazy-logo-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #0284c7;
    border-right-color: #38bdf8;
    box-sizing: border-box;
    animation: bdu-lazy-orbit-spin 0.85s cubic-bezier(0.4, 0.12, 0.3, 0.95) infinite;
    filter: drop-shadow(0 0 2.5px rgba(2, 132, 199, 0.45));
    pointer-events: none;
}

/* Optional/Fallback .bdu-lazy-orbit helper (if explicitly present in DOM) */
.bdu-lazy-orbit {
    display: none;
}

/* Static Centerpiece Logo: perfectly upright, clear, no spinning */
.bdu-lazy-logo-img,
.bdu-lazy-logo-mini {
    width: 14px;
    height: 14px;
    object-fit: contain;
    border-radius: 50%;
    display: block;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    animation: none;
    transform: none;
    z-index: 1;
    pointer-events: none;
}

@keyframes bdu-lazy-orbit-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bdu-lazy-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility: Respect user reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .bdu-lazy-logo-wrapper::after {
        animation: bdu-lazy-orbit-spin 2.5s linear infinite;
        filter: none;
    }
}

.local-list-lazy-state .spinner-border,
.local-list-loading-status .spinner-border {
    width: 1.1rem;
    height: 1.1rem;
    border-width: 2px;
    border-color: rgba(242, 116, 5, 0.2);
    border-top-color: #F27405;
    border-right-color: #FFB703;
    animation-duration: 0.85s;
}

.local-list-table-scroll {
    position: relative;
    max-height: min(68vh, 720px);
    overflow: auto;
}

.local-list-table-scroll[data-local-list-loading="true"]::after {
    content: "🔄 " attr(data-local-list-loading-text);
    position: sticky;
    left: 50%;
    bottom: 0.75rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transform: translateX(-50%);
    padding: 0.4rem 1rem;
    border: 1px solid rgba(242, 116, 5, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 0 12px rgba(242, 116, 5, 0.12);
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 650;
    pointer-events: none;
    animation: bdu-sticky-appear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bdu-sticky-appear {
    0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

body.dark-mode .local-list-lazy-state,
.dark-mode .local-list-lazy-state {
    color: #f1f5f9;
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(242, 116, 5, 0.35);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 12px rgba(242, 116, 5, 0.15);
}

body.dark-mode .local-list-table-scroll[data-local-list-loading="true"]::after {
    background: rgba(30, 41, 59, 0.94);
    border-color: rgba(242, 116, 5, 0.4);
    color: #f8fafc;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(242, 116, 5, 0.2);
}

body.dark-mode .bdu-lazy-logo-wrapper::before,
.dark-mode .bdu-lazy-logo-wrapper::before {
    border-color: rgba(56, 189, 248, 0.2);
}

body.dark-mode .bdu-lazy-logo-wrapper::after,
.dark-mode .bdu-lazy-logo-wrapper::after {
    border-top-color: #38bdf8;
    border-right-color: #0ea5e9;
    filter: drop-shadow(0 0 3.5px rgba(56, 189, 248, 0.65));
}

body.dark-mode .bdu-lazy-logo-img,
body.dark-mode .bdu-lazy-logo-mini,
.dark-mode .bdu-lazy-logo-img,
.dark-mode .bdu-lazy-logo-mini {
    background-color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   GLOBAL DESIGN SYSTEM: SUBTLE COLORS & BADGE LEGIBILITY FIXES
   Provides support for Bootstrap 5.3+ subtle backgrounds, text emphasis,
   and border-subtle classes in Bootstrap 5.1.3 environment.
   Guarantees 100% legibility, non-faded text, high contrast, and vivid badges.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SUBTLE BACKGROUND UTILITIES
   -------------------------------------------------------------------------- */
.bg-primary-subtle {
    background-color: #e0f2fe !important;
}
.bg-secondary-subtle {
    background-color: #f1f5f9 !important;
}
.bg-success-subtle {
    background-color: #dcfce7 !important;
}
.bg-danger-subtle {
    background-color: #fee2e2 !important;
}
.bg-warning-subtle {
    background-color: #fef3c7 !important;
}
.bg-info-subtle {
    background-color: #cff4fc !important;
}
.bg-light-subtle {
    background-color: #f8f9fa !important;
}
.bg-dark-subtle {
    background-color: #e2e8f0 !important;
}

/* --------------------------------------------------------------------------
   2. TEXT EMPHASIS UTILITIES (High contrast, crisp text)
   -------------------------------------------------------------------------- */
.text-primary-emphasis {
    color: #0369a1 !important;
}
.text-secondary-emphasis {
    color: #334155 !important;
}
.text-success-emphasis {
    color: #15803d !important;
}
.text-danger-emphasis {
    color: #b91c1c !important;
}
.text-warning-emphasis {
    color: #92400e !important; /* Deep amber brown for crisp contrast */
}
.text-info-emphasis {
    color: #0e7490 !important;
}
.text-light-emphasis {
    color: #475569 !important;
}
.text-dark-emphasis {
    color: #0f172a !important;
}

/* --------------------------------------------------------------------------
   3. BORDER SUBTLE UTILITIES
   -------------------------------------------------------------------------- */
.border-primary-subtle {
    border-color: #7dd3fc !important;
}
.border-secondary-subtle {
    border-color: #cbd5e1 !important;
}
.border-success-subtle {
    border-color: #86efac !important;
}
.border-danger-subtle {
    border-color: #fca5a5 !important;
}
.border-warning-subtle {
    border-color: #fde047 !important;
}
.border-info-subtle {
    border-color: #67e8f9 !important;
}
.border-light-subtle {
    border-color: #e2e8f0 !important;
}
.border-dark-subtle {
    border-color: #94a3b8 !important;
}

/* --------------------------------------------------------------------------
   4. SYSTEM-WIDE BADGE CONTRAST & LEGIBILITY OVERRIDES
   Overrides Bootstrap 5.1.3 default `.badge { color: #fff }` when subtle backgrounds
   or explicit text colors are applied.
   -------------------------------------------------------------------------- */

/* Warning Badge (Unpaired logs, pending state, alerts) */
.badge.bg-warning-subtle,
.bg-warning-subtle .badge,
.badge.text-warning-emphasis,
.badge.text-warning {
    color: #78350f !important; /* High contrast dark amber */
    background-color: #fef3c7 !important;
    border-color: #fde047 !important;
}
.badge.bg-warning-subtle i,
.badge.text-warning-emphasis i,
.badge.text-warning i {
    color: #b45309 !important; /* Vibrant warning icon color */
}

/* Success Badge */
.badge.bg-success-subtle,
.bg-success-subtle .badge,
.badge.text-success-emphasis,
.badge.text-success {
    color: #14532d !important;
    background-color: #dcfce7 !important;
    border-color: #86efac !important;
}
.badge.bg-success-subtle i,
.badge.text-success-emphasis i,
.badge.text-success i {
    color: #16a34a !important;
}

/* Danger Badge */
.badge.bg-danger-subtle,
.bg-danger-subtle .badge,
.badge.text-danger-emphasis,
.badge.text-danger {
    color: #7f1d1d !important;
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
}
.badge.bg-danger-subtle i,
.badge.text-danger-emphasis i,
.badge.text-danger i {
    color: #dc2626 !important;
}

/* Primary Badge */
.badge.bg-primary-subtle,
.bg-primary-subtle .badge,
.badge.text-primary-emphasis,
.badge.text-primary {
    color: #0c4a6e !important;
    background-color: #e0f2fe !important;
    border-color: #7dd3fc !important;
}
.badge.bg-primary-subtle i,
.badge.text-primary-emphasis i,
.badge.text-primary i {
    color: #0284c7 !important;
}

/* Info Badge */
.badge.bg-info-subtle,
.bg-info-subtle .badge,
.badge.text-info-emphasis,
.badge.text-info {
    color: #164e63 !important;
    background-color: #cff4fc !important;
    border-color: #67e8f9 !important;
}
.badge.bg-info-subtle i,
.badge.text-info-emphasis i,
.badge.text-info i {
    color: #0891b2 !important;
}

/* Secondary & Light Badges */
.badge.bg-secondary-subtle,
.bg-secondary-subtle .badge,
.badge.text-secondary-emphasis,
.badge.text-secondary {
    color: #1e293b !important;
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.badge.bg-light.text-dark,
.badge.bg-light-subtle {
    color: #0f172a !important;
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* General helper: Ensure explicit text color on any badge overrides white text */
.badge.text-dark { color: #0f172a !important; }
.badge.text-muted { color: #475569 !important; }

/* --------------------------------------------------------------------------
   5. WORK HOURS SPECIFIC BADGE STYLES (Thiếu giờ: Đỏ cam | Đủ/Dư giờ: Xanh dương đậm)
   -------------------------------------------------------------------------- */
/* Thiếu giờ (< 8h): Màu đỏ cam nổi bật, tương phản cao */
.hours-badge-under {
    color: #c2410c !important; /* Màu chữ đỏ cam đậm (Reddish-Orange) */
    background-color: #ffedd5 !important; /* Nền da cam dịu */
    border: 1px solid #fdba74 !important; /* Viền da cam */
}

/* Đủ giờ / Dư giờ (>= 8h): Màu xanh dương đậm */
.hours-badge-surplus {
    color: #1e3a8a !important; /* Màu chữ xanh dương đậm (Deep Dark Blue) */
    background-color: #dbeafe !important; /* Nền xanh dương dịu */
    border: 1px solid #93c5fd !important; /* Viền xanh dương */
}

/* ==========================================================================
   GLOBAL APP PAGE & TASK LOADING EFFECTS (4-TIER UNIFIED ARCHITECTURE)
   ========================================================================== */

/* Tier 1: Top Page Navigation Progress Bar - Positioned at exact bottom border of Header */
.app-top-loader {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3.5px;
    width: 0%;
    background: linear-gradient(90deg, #F27405 0%, #FF8C00 45%, #FFB703 80%, #00C49F 100%);
    box-shadow: 0 0 10px rgba(242, 116, 5, 0.9), 0 0 4px rgba(255, 183, 3, 0.8);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    will-change: width, opacity;
    transition: width 200ms ease, opacity 250ms ease;
}

.app-top-loader.is-active {
    opacity: 1;
}

.app-top-loader.is-finished {
    opacity: 0;
    transition: width 180ms ease, opacity 260ms ease 100ms;
}

.app-top-loader.no-transition {
    transition: none !important;
    animation: none !important;
}

/* Content Area & PJAX Page Navigation Transition */
.content-area {
    position: relative;
    transition: opacity 0.18s ease, filter 0.18s ease;
}

.content-area.is-navigating {
    opacity: 0.55;
    filter: saturate(0.85);
    pointer-events: none;
    cursor: wait;
}

.app-global-loader {
    position: fixed;
    inset: 0;
    /* Block the whole app, including navigation, modals and notifications. */
    z-index: 2147483001;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-global-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-global-loader-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(242, 116, 5, 0.22);
    border-radius: 1.5rem;
    padding: 2rem 2.25rem;
    min-width: 300px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15), 0 0 25px rgba(242, 116, 5, 0.12);
    text-align: center;
    transform: scale(0.92) translateY(8px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-global-loader.is-visible .app-global-loader-card {
    transform: scale(1) translateY(0);
}

/* --- BDU Brand Logo & Orbit Halo Rings --- */
.app-global-loader-brand-wrapper {
    position: relative;
    width: 86px;
    height: 86px;
    margin: 0 auto 1.2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-global-loader-orbit-outer {
    position: absolute;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: #F27405;
    border-right-color: #FF8C00;
    border-bottom-color: #FFB703;
    animation: bdu-orbit-spin 1.4s cubic-bezier(0.6, 0.2, 0.4, 0.8) infinite;
    filter: drop-shadow(0 0 6px rgba(242, 116, 5, 0.45));
}

.app-global-loader-orbit-inner {
    position: absolute;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    border: 1.5px dashed rgba(2, 132, 199, 0.65);
    animation: bdu-orbit-spin-reverse 2.2s linear infinite;
}

.app-global-loader-logo-container {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    padding: 3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(242, 116, 5, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    animation: bdu-logo-pulse 2s ease-in-out infinite;
}

.app-global-loader-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    display: block;
}

@keyframes bdu-orbit-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bdu-orbit-spin-reverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes bdu-logo-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(242, 116, 5, 0.2);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 6px 18px rgba(242, 116, 5, 0.25), 0 0 0 2px rgba(242, 116, 5, 0.4);
    }
}

/* --- Brand Name & Typography --- */
.app-global-loader-brand-text {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.app-global-loader-brand-text .brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #F27405 0%, #FF8C00 25%, #0284C7 50%, #FF8C00 75%, #F27405 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: bdu-text-shimmer 2.4s linear infinite;
}

.app-global-loader-brand-text .brand-sub {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
}

@keyframes bdu-text-shimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* --- Progress Bar & Percentage Indicator --- */
.app-global-loader-progress-container {
    width: 100%;
    max-width: 260px;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-global-loader-progress-track {
    flex: 1;
    height: 6px;
    background: rgba(242, 116, 5, 0.14);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.app-global-loader-progress-bar {
    height: 100%;
    width: var(--loader-progress, 0%);
    background: linear-gradient(90deg, #F27405 0%, #FF8C00 50%, #FFB703 100%);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(242, 116, 5, 0.75);
    transition: width 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-global-loader-percent {
    font-size: 0.75rem;
    font-weight: 700;
    color: #F27405;
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- Title & Message Descriptions --- */
.app-global-loader-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.app-global-loader-message {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 0;
    line-height: 1.4;
}

/* --- Dark Mode Adaptation --- */
body.dark-mode .app-global-loader {
    background-color: rgba(15, 23, 42, 0.82);
}

body.dark-mode .app-global-loader-card {
    background: rgba(30, 41, 59, 0.94);
    border-color: rgba(242, 116, 5, 0.35);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 30px rgba(242, 116, 5, 0.2);
}

body.dark-mode .app-global-loader-logo-container {
    background: #0f172a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(242, 116, 5, 0.3);
}

body.dark-mode .app-global-loader-brand-text .brand-sub {
    color: #94a3b8;
}

body.dark-mode .app-global-loader-progress-track {
    background: rgba(255, 255, 255, 0.12);
}

body.dark-mode .app-global-loader-title {
    color: #f8fafc;
}

body.dark-mode .app-global-loader-message {
    color: #94a3b8;
}


/* ==========================================================================
   TIER 2: SHARED LIST & TABLE SKELETON LOADERS
   ========================================================================== */

@keyframes skeleton-shimmer {
    0% {
        background-position: -250px 0;
    }
    100% {
        background-position: 250px 0;
    }
}

.table-skeleton-bar,
.skeleton-bar {
    height: 14px;
    background: linear-gradient(90deg, #f1f5f9 0%, #cbd5e1 50%, #f1f5f9 100%);
    background-size: 500px 100%;
    animation: skeleton-shimmer 1.4s infinite ease-in-out;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
}

.table-skeleton-avatar,
.skeleton-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f1f5f9 0%, #cbd5e1 50%, #f1f5f9 100%);
    background-size: 500px 100%;
    animation: skeleton-shimmer 1.4s infinite ease-in-out;
    display: inline-block;
    flex-shrink: 0;
}

.table-skeleton-badge {
    height: 22px;
    width: 70px;
    border-radius: 12px;
    background: linear-gradient(90deg, #f1f5f9 0%, #cbd5e1 50%, #f1f5f9 100%);
    background-size: 500px 100%;
    animation: skeleton-shimmer 1.4s infinite ease-in-out;
    display: inline-block;
}

.table-skeleton-row {
    transition: opacity 0.2s ease;
}

.table-skeleton-row td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

/* Local List Region Container & In-Place Overlay */
[data-local-list-region],
.local-list-container {
    position: relative;
    min-height: 120px;
}

.local-list-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    pointer-events: none;
}

[data-local-list-region].is-loading > .local-list-loading-overlay,
.local-list-container.is-loading > .local-list-loading-overlay,
.local-list-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.local-list-loading-spinner-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(242, 116, 5, 0.25);
    padding: 0.55rem 1.35rem;
    border-radius: 2rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 0 15px rgba(242, 116, 5, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 650;
    color: #1e293b;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.local-list-loading-overlay.is-visible .local-list-loading-spinner-box {
    transform: scale(1);
}

.local-list-loading-status {
    padding: 0.4rem 0;
    margin-bottom: 0.4rem;
}

/* Dark Mode support for local-list overlay & skeletons */
body.dark-mode .table-skeleton-bar,
body.dark-mode .skeleton-bar,
body.dark-mode .table-skeleton-avatar,
body.dark-mode .skeleton-avatar-circle,
body.dark-mode .table-skeleton-badge {
    background: linear-gradient(90deg, #1e293b 0%, #334155 50%, #1e293b 100%);
    background-size: 500px 100%;
}

body.dark-mode .local-list-loading-overlay {
    background-color: rgba(15, 23, 42, 0.45);
}

body.dark-mode .local-list-loading-spinner-box {
    background: rgba(30, 41, 59, 0.96);
    border-color: rgba(242, 116, 5, 0.35);
    color: #f8fafc;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 15px rgba(242, 116, 5, 0.15);
}


/* ==========================================================================
   TIER 4: BUTTON ASYNC LIFECYCLE & BUTTON SPINNERS
   ========================================================================== */

.btn-loading {
    position: relative !important;
    pointer-events: none !important;
    cursor: wait !important;
    opacity: 0.85 !important;
}

.btn-spinner-bdu {
    display: inline-block;
    width: 0.95em;
    height: 0.95em;
    vertical-align: -0.125em;
    border: 2px solid currentColor;
    border-right-color: transparent !important;
    border-radius: 50%;
    animation: btn-bdu-spin 0.75s linear infinite;
}

@keyframes btn-bdu-spin {
    to { transform: rotate(360deg); }
}

.btn-primary .btn-spinner-bdu,
.btn-danger .btn-spinner-bdu,
.btn-dark .btn-spinner-bdu,
.btn-success .btn-spinner-bdu {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff !important;
    border-right-color: transparent !important;
}

.btn-outline-primary .btn-spinner-bdu,
.btn-outline-secondary .btn-spinner-bdu,
.btn-light .btn-spinner-bdu,
.btn-outline-dark .btn-spinner-bdu {
    border-color: rgba(242, 116, 5, 0.3);
    border-top-color: #F27405 !important;
    border-right-color: transparent !important;
}

/* Compatibility fallback for bootstrap-icons 1.8.1 (which lacks bi-buildings) */
.bi-buildings::before {
    content: "\F1DD" !important;
}


