/* ============================================ */
/*      APP HEADER â€” SINGLE ROW (REFINED)       */
/* ============================================ */
body {
    background-color: #f0f4f8 !important;
}


.app-header {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.03), 0 2px 4px -1px rgba(15, 23, 42, 0.02) !important;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* ---- Single row layout ---- */
.app-header-row {
    max-width: 100%;
    padding: 0 16px;
    height: 48px;
    display: grid;
    grid-template-columns: minmax(180px, auto) 1fr minmax(auto, max-content);
    align-items: center;
    gap: 12px;
    transition: height 0.3s, padding 0.3s;
}

.app-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
    flex-shrink: 0;
    max-width: 280px;
}
.app-header-brand:hover { opacity: 0.9; }

.app-header-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.app-header-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    overflow: hidden;
}

.app-header-company {
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, #e60012 0%, #ff4d4d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
    transition: all 0.3s;
}

.app-header-sub {
    font-size: 9px;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header-user-name {
    font-weight: 700;
    color: #0071bc;
}

/* ---- Nav pills (center, fit-content) ---- */
.app-header-nav {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.04);
}
.app-header-nav::-webkit-scrollbar { display: none; }

.app-header-mobile {
    display: none;
    align-items: center;
    gap: 6px;
    justify-self: end;
}

/* Insights hub: segment tabs inside page hero (replaces duplicate sticky bar) */
.insights-hero-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.insights-hero-tabs .insights-section-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 9px;
    cursor: pointer;
    line-height: 1.1;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.insights-hero-tabs .insights-section-btn i {
    font-size: 12px;
    opacity: 0.8;
}
.insights-hero-tabs .insights-section-btn:hover {
    color: #0f766e;
    background: rgba(255, 255, 255, 0.85);
}
.insights-hero-tabs .insights-section-btn.is-active {
    background: #0f766e;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.22);
}
.insights-hero-tabs .insights-section-btn.is-active i {
    opacity: 1;
    color: #ffffff;
}
@media (max-width: 640px) {
    .insights-hero-tabs { width: 100%; }
    .insights-hero-tabs .insights-section-btn { flex: 1; justify-content: center; }
}

.tab-btn-pill {
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.tab-btn-pill i {
    font-size: 12px;
    min-width: 14px;
    width: 14px;
    flex-shrink: 0;
    text-align: center;
    opacity: 0.7;
    transition: all 0.2s ease;
}
.tab-btn-pill:hover {
    color: #0d9488;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.08);
    transform: translateY(-1px);
}
.tab-btn-pill:hover i {
    opacity: 1;
    color: #0d9488;
    transform: scale(1.08);
}
.tab-btn-pill:active {
    transform: translateY(0) scale(0.98);
}

.tab-btn-pill.active {
    background: #ffffff;
    color: #0d9488;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.12);
}
.tab-btn-pill.active:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.16);
}
.tab-btn-pill.active i {
    opacity: 1;
    color: #0d9488;
}

/* ---- Actions (right) ---- */
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 1;
    min-width: 0;
    justify-self: end;
    max-width: 100%;
}

/* Native select kept for JS value; UI uses custom dropdown only */
#superadmin-filter {
    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;
}

#superadmin-custom-dropdown-container:not(.hidden) {
    display: inline-flex !important;
    align-items: center !important;
    min-width: 0;
    max-width: 180px;
}
#superadmin-custom-btn {
    max-width: 180px;
    overflow: hidden;
}
#superadmin-custom-btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.app-header-select {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.app-header-select:hover { border-color: #cbd5e1; }
.app-header-select:focus {
    border-color: #0071bc;
    box-shadow: 0 0 0 2px rgba(0, 113, 188, 0.1);
}

.app-header-scope {
    min-width: 120px;
    max-width: 140px;
}

.app-header-lang {
    min-width: 68px;
    width: auto;
    padding-left: 10px !important;
    padding-right: 28px !important;
    text-align: left;
}

.app-header-mobile .lang-select-ui {
    min-width: 62px;
    padding-left: 8px !important;
    padding-right: 26px !important;
}

.app-header-icon-btn {
    height: 32px;
    min-width: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.app-header-icon-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}
.app-header-icon-btn i { font-size: 11px; }

.app-header-icon-btn-icon-only {
    width: 32px;
    padding: 0;
}

.app-header-mobile-mute {
    flex-shrink: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-header-icon-btn-danger:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.app-header-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 140px;
    padding-top: 6px;
    z-index: 60;
}
.app-header-dropdown-inner {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    padding: 4px;
}
.app-header-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.app-header-dropdown button:hover {
    background: #f8fafc;
    color: #0071bc;
}

.app-header-menu-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
}
.app-header-menu-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* ---- Mobile menu ---- */
.app-mobile-menu {
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    padding: 10px 12px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0 0 14px 14px;
}

.app-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 10px;
}

.app-mobile-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.app-mobile-nav-btn i {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #64748b;
    transition: color 0.15s ease;
}

.app-mobile-nav-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.app-mobile-nav-btn:hover i {
    color: #0f172a;
}

/* Active mobile nav state */
.app-mobile-nav-btn.active {
    background: linear-gradient(135deg, rgba(0, 113, 188, 0.08) 0%, rgba(56, 189, 248, 0.08) 100%) !important;
    color: #0071bc !important;
    font-weight: 700 !important;
}

.app-mobile-nav-btn.active i {
    color: #0071bc !important;
}

.app-mobile-nav-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    background: #0071bc;
    border-radius: 0 3px 3px 0;
}

.app-mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.app-mobile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    font-size: 10.5px;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.app-mobile-action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.app-mobile-action-btn:active {
    transform: scale(0.97);
}

.app-mobile-action-btn i {
    font-size: 11px;
    color: #64748b;
}

/* Accent states for utility buttons */
.app-mobile-action-btn.global-sound-mute-btn i {
    color: #0284c7;
}

.app-mobile-action-btn:has(.fa-rotate) i,
.app-mobile-action-btn:has(.fa-moon) i {
    color: #4f46e5;
}

.app-mobile-action-btn:has(.fa-file-excel) i {
    color: #16a34a;
}

.app-mobile-action-btn:has(.fa-file-code) i {
    color: #ea580c;
}

.app-mobile-action-btn:has(.fa-database) i {
    color: #0d9488;
}

.app-mobile-action-btn:has(.fa-file-csv) i {
    color: #2563eb;
}

.app-mobile-action-danger {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fca5a5;
}

.app-mobile-action-danger i {
    color: #b91c1c;
}

.app-mobile-action-danger:hover {
    color: #ffffff !important;
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

.app-mobile-action-danger:hover i {
    color: #ffffff !important;
}

@media (max-width: 1600px) {
    .app-header-row {
        padding: 0 16px;
        gap: 8px;
        grid-template-columns: minmax(130px, auto) minmax(0, 1fr) minmax(0, max-content);
    }
    .app-header-nav {
        gap: 2px;
    }
    .tab-btn-pill {
        font-size: 11.5px;
        padding: 6px 8px;
        gap: 4px;
    }
    .app-header-actions {
        gap: 4px;
    }
    .app-header-icon-btn {
        padding: 0 8px;
    }
    /* Hide Export/Thoát labels only — keep Check Out + branch text */
    .app-header-actions .app-header-icon-btn-text span,
    .app-header-actions .app-header-icon-btn-text .fa-chevron-down,
    .app-header-actions .app-header-icon-btn-danger span {
        display: none;
    }
    .app-header-scope {
        min-width: 90px;
        max-width: 105px;
    }
}

@media (max-width: 1366px) {
    .tab-btn-pill {
        font-size: 11px;
        padding: 6px 6px;
        gap: 3px;
    }
    .app-header-actions {
        gap: 4px;
    }
    /* Drop secondary Export to free space for real labels */
    .app-header-actions .header-action-export {
        display: none !important;
    }
    .app-header-actions .app-header-icon-btn-danger {
        min-width: 30px !important;
        width: 30px !important;
        padding: 0 !important;
    }
}

/* Tablet / small laptop: 2-row chrome — keep readable labels, scroll nav */
@media (max-width: 1279px) and (min-width: 768px) {
    .app-header-row {
        height: auto !important;
        min-height: 48px;
        padding: 8px 12px !important;
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 8px 10px !important;
        align-items: center;
    }
    .app-header-brand {
        grid-column: 1;
        grid-row: 1;
        max-width: 160px;
    }
    .app-header-company {
        font-size: 11px;
    }
    .app-header-actions {
        grid-column: 2;
        grid-row: 1;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-self: end;
        justify-content: flex-end;
        align-items: center !important;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px !important;
    }
    .app-header-actions::-webkit-scrollbar {
        display: none;
        height: 0;
    }
    .app-header-actions > * {
        flex-shrink: 0;
    }
    /* Keep status / Check Out / branch labels readable */
    #text-user-status {
        display: inline !important;
        font-size: 10px !important;
    }
    #text-checkin {
        display: inline !important;
        font-size: 10px !important;
    }
    .status-pill-btn {
        padding: 0 8px !important;
        min-width: 0 !important;
        height: 30px !important;
        gap: 5px !important;
    }
    #btn-checkin {
        padding: 0 10px !important;
        min-width: 0 !important;
        height: 30px !important;
        gap: 5px !important;
    }
    #superadmin-custom-dropdown-container:not(.hidden) {
        max-width: 160px !important;
    }
    #superadmin-custom-btn {
        max-width: 160px !important;
        padding: 0 10px !important;
        height: 30px !important;
    }
    #superadmin-custom-btn-text {
        max-width: 120px !important;
        font-size: 11px !important;
    }
    #lang-btn-desktop-custom {
        padding: 0 8px !important;
        height: 30px !important;
    }
    .app-header-actions .header-action-export {
        display: none !important;
    }
    .app-header-actions .app-header-icon-btn-danger {
        min-width: 30px !important;
        width: 30px !important;
        padding: 0 !important;
    }
    .app-header-actions .app-header-icon-btn-danger span {
        display: none !important;
    }
    .app-header-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex !important;
        flex-wrap: nowrap !important;
        width: max-content !important;
        max-width: 100% !important;
        justify-self: center;
        justify-content: center;
        margin-inline: auto;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        gap: 2px !important;
    }
    .app-header-nav::-webkit-scrollbar {
        display: none;
    }
    .app-header-nav .tab-btn-pill {
        flex: 0 0 auto !important;
        position: relative;
        z-index: 1;
    }
    .app-header-nav .tab-btn-pill.active {
        z-index: 2;
    }
    .app-header-mobile {
        display: none !important;
    }
    .tab-btn-pill span {
        display: inline !important;
    }
    .tab-btn-pill {
        font-size: 11px;
        padding: 6px 8px;
    }
    #dashboard-section main {
        margin-top: 0 !important;
    }
}

@media (max-width: 767px) {
    .app-header {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 50 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .app-header-row {
        background: #ffffff !important;
        border-radius: 16px !important;
        border: 2px solid transparent !important;
        background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(135deg, #7D8BFF, #B56DFF, #FFA8DA) !important;
        background-origin: border-box !important;
        background-clip: padding-box, border-box !important;
        box-shadow: 0 10px 30px -10px rgba(125, 139, 255, 0.15) !important;
        padding: 0 12px !important;
        height: 60px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 6px 12px 0 12px !important;
        width: calc(100% - 24px) !important;
        box-sizing: border-box !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
    }
    #dashboard-section main {
        margin-top: 66px !important;
    }
    .app-header-brand-text { display: none !important; }
    .app-header-logo { width: 32px !important; height: 32px !important; }
    .app-header-brand { max-width: none !important; }
    .app-header-nav { display: none !important; }
    .app-header-actions { display: none !important; }
    .app-header-mobile { display: flex !important; align-items: center !important; gap: 5px !important; }

    /* Custom Mobile Status Pill */
    .status-pill-btn--mobile {
        background-color: #FFF2F4 !important;
        border: none !important;
        border-radius: 10px !important;
        padding: 0 8px !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        box-shadow: 0 2px 6px rgba(229, 57, 53, 0.08) !important;
        height: 32px !important;
    }
    .status-pill-btn--mobile.status-pill-btn--available {
        background-color: #E8F8F5 !important;
        box-shadow: 0 2px 6px rgba(5, 150, 105, 0.08) !important;
    }
    .status-dot--mobile {
        width: 6px !important;
        height: 6px !important;
        border-radius: 50% !important;
    }
    .status-pill-btn--mobile.status-pill-btn--busy .status-dot--mobile {
        background-color: #E53935 !important;
    }
    .status-pill-btn--mobile.status-pill-btn--available .status-dot--mobile {
        background-color: #059669 !important;
    }
    #text-user-status-mobile {
        font-family: 'Inter', sans-serif !important;
        font-size: 10.5px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
    }
    .status-pill-btn--mobile.status-pill-btn--busy #text-user-status-mobile {
        color: #E53935 !important;
    }
    .status-pill-btn--mobile.status-pill-btn--available #text-user-status-mobile {
        color: #059669 !important;
    }

    /* Check-In/Check-Out Button */
    #btn-checkin-mobile-header {
        background: linear-gradient(135deg, #4D5DFF, #5A36FF) !important;
        border: none !important;
        border-radius: 10px !important;
        height: 32px !important;
        padding: 0 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        box-shadow: 0 4px 12px rgba(90, 54, 255, 0.2) !important;
    }
    #btn-checkin-mobile-header i {
        color: #ffffff !important;
        font-size: 11px !important;
    }
    #btn-checkin-mobile-header span {
        color: #ffffff !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 10.5px !important;
        font-weight: 700 !important;
    }

    /* Custom Mobile Language Dropdown */
    #lang-btn-mobile-custom {
        background-color: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 10px !important;
        height: 32px !important;
        padding: 0 8px !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    }
    #lang-btn-mobile-custom span {
        color: #334155 !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 10.5px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
    }
    #lang-btn-mobile-custom i.fa-chevron-down {
        color: #64748b !important;
        font-size: 8px !important;
        opacity: 0.8 !important;
    }

    /* Hamburger Menu Button */
    .app-header-menu-btn {
        background-color: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 10px !important;
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    }
    .app-header-menu-btn i {
        color: #334155 !important;
        font-size: 14px !important;
    }

    /* Mobile drawer main navigation 2-column layout */
    .app-mobile-nav {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
    }
    
    .app-mobile-nav-btn {
        padding: 8px 10px !important;
        font-size: 11px !important;
        gap: 6px !important;
        background: #f8fafc !important;
        border: 1px solid #f1f5f9 !important;
        justify-content: flex-start !important;
        height: 38px !important;
        box-sizing: border-box !important;
    }
    
    .dark-theme .app-mobile-nav-btn {
        background: rgba(255, 255, 255, 0.02) !important;
        border-color: rgba(255, 255, 255, 0.05) !important;
        color: #94a3b8 !important;
    }
    
    .app-mobile-nav-btn.active {
        background: linear-gradient(135deg, rgba(0, 113, 188, 0.08) 0%, rgba(56, 189, 248, 0.08) 100%) !important;
        border-color: rgba(0, 113, 188, 0.15) !important;
    }
}

/* Custom styling for sleek select menus & icons */
.lang-select-ui {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E") !important;
    background-position: right 8px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    padding-right: 28px !important;
    padding-left: 12px !important;
    cursor: pointer;
}
.dark-theme .lang-select-ui {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E") !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.app-mobile-menu:not(.hidden) {
    animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Quick Stats Bar (legacy) */
.ov-quick-stats-bar {
    background-color: #eff6ff !important;
    border: 1px solid #dbeafe !important;
    border-radius: 1rem !important;
}
.ov-quick-stats-divider {
    border-color: #dbeafe !important;
}

/* Dropdown styling for Excel/JSON export */
.relative.group:hover .absolute {
    display: block;
}
.relative.group .absolute {
    transition: opacity 0.15s ease;
}

/* PC Header Toolbar Overhaul based on mockup design requirements */
@media (min-width: 1024px) {
    /* Main toolbar alignment & properties */
    .app-header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    /* Wrap helper to align wrapper divs vertically */
    .app-header-actions > div {
        display: inline-flex !important;
        align-items: center !important;
    }

    #superadmin-custom-dropdown-container:not(.hidden) {
        display: inline-flex !important;
    }
    #superadmin-custom-dropdown-container.hidden {
        display: none !important;
    }

    /* Common style for only top-level buttons in the toolbar */
    .app-header-actions > button,
    .app-header-actions > div > button,
    .app-header-actions select,
    .app-header-actions #btn-user-status,
    .app-header-actions #btn-checkin,
    .app-header-actions #superadmin-custom-btn,
    .app-header-actions #lang-btn-desktop-custom,
    .app-header-actions #btn-notif-bell,
    .app-header-actions #btn-settings-gear,
    .app-header-actions .app-header-icon-btn-text {
        height: 30px !important;
        border: 1px solid #E5E7EB !important;
        background: #FFFFFF !important;
        color: #374151 !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        cursor: pointer !important;
        box-sizing: border-box !important;
        box-shadow: none !important;
        transition: all 0.2s ease !important;
        outline: none !important;
        text-transform: none !important;
        letter-spacing: normal !important;
    }

    /* Text buttons default padding */
    .app-header-actions > button:not(.app-header-icon-btn-icon-only),
    .app-header-actions > div > button:not(.app-header-icon-btn-icon-only),
    .app-header-actions select,
    .app-header-actions #btn-user-status,
    .app-header-actions #btn-checkin,
    .app-header-actions #superadmin-custom-btn,
    .app-header-actions #lang-btn-desktop-custom,
    .app-header-actions .app-header-icon-btn-text {
        padding: 0 10px !important;
    }

    /* Keep primary labels visible on mid desktops */
    .app-header-actions #text-user-status,
    .app-header-actions #text-checkin,
    .app-header-actions #superadmin-custom-btn-text,
    .app-header-actions #current-lang-text-desktop {
        display: inline !important;
    }

    /* Hover and Active states */
    .app-header-actions > button:hover,
    .app-header-actions > div > button:hover,
    .app-header-actions select:hover,
    .app-header-actions #btn-user-status:hover,
    .app-header-actions #btn-checkin:hover,
    .app-header-actions #superadmin-custom-btn:hover,
    .app-header-actions #lang-btn-desktop-custom:hover,
    .app-header-actions .app-header-icon-btn-text:hover {
        background: #F8FAFC !important;
        border-color: #D1D5DB !important;
        color: #1F2937 !important;
    }

    .app-header-actions > button:active,
    .app-header-actions > div > button:active,
    .app-header-actions select:active,
    .app-header-actions #btn-user-status:active,
    .app-header-actions #btn-checkin:active,
    .app-header-actions #superadmin-custom-btn:active,
    .app-header-actions #lang-btn-desktop-custom:active,
    .app-header-actions .app-header-icon-btn-text:active {
        background: #F1F5F9 !important;
    }

    /* Square icons only (Chuông, Cài đặt) */
    .app-header-actions #btn-notif-bell,
    .app-header-actions #btn-settings-gear {
        width: 30px !important;
        min-width: 30px !important;
        padding: 0 !important;
    }

    /* Special style: ĐANG BẬN / SẴN SÀNG */
    /* Available State (Staff status active) */
    .app-header-actions .status-pill-btn.status-pill-btn--available {
        border-color: #E5E7EB !important;
        background: #FFFFFF !important;
        color: #059669 !important;
    }
    .app-header-actions .status-pill-btn.status-pill-btn--available:hover {
        background: #F8FAFC !important;
        border-color: #D1D5DB !important;
        color: #047857 !important;
    }
    .app-header-actions .status-pill-btn.status-pill-btn--available .status-dot {
        background-color: #059669 !important;
        width: 8px !important;
        height: 8px !important;
    }

    /* Busy State (ĐANG BẬN) */
    .app-header-actions .status-pill-btn.status-pill-btn--busy {
        border-color: #E5E7EB !important;
        background: #FFFFFF !important;
        color: #EF4444 !important;
    }
    .app-header-actions .status-pill-btn.status-pill-btn--busy:hover {
        background: #F8FAFC !important;
        border-color: #D1D5DB !important;
        color: #DC2626 !important;
    }
    .app-header-actions .status-pill-btn.status-pill-btn--busy .status-dot {
        background-color: #EF4444 !important;
        width: 8px !important;
        height: 8px !important;
    }

    /* Special style: Check In / Check Out button */
    .app-header-actions #btn-checkin {
        border-color: #E5E7EB !important;
        background: #FFFFFF !important;
        color: #7C3AED !important;
    }
    .app-header-actions #btn-checkin:hover {
        background: #F8FAFC !important;
        border-color: #D1D5DB !important;
        color: #6D28D9 !important;
    }
    .app-header-actions #btn-checkin i {
        color: #7C3AED !important;
    }

    /* Select elements custom arrow styles to match */
    .app-header-actions select {
        appearance: none !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E") !important;
        background-position: right 12px center !important;
        background-repeat: no-repeat !important;
        background-size: 16px !important;
        padding-right: 32px !important;
    }

    /* Thin modern icons styling (simulate Lucide style by opacity) */
    .app-header-actions i {
        font-size: 14px !important;
        color: #64748B !important;
        opacity: 0.85 !important;
    }

    /* Keep colors for specific active states intact */
    .app-header-actions #btn-checkin i { color: #7C3AED !important; }
    .app-header-actions .status-pill-btn.status-pill-btn--busy .status-dot { background-color: #EF4444 !important; }
    .app-header-actions .status-pill-btn.status-pill-btn--available .status-dot { background-color: #059669 !important; }

    /* Custom Language dropdown switcher button alignment */
    .app-header-actions #lang-btn-desktop-custom {
        border-radius: 9px !important;
        height: 34px !important;
        padding: 0 12px !important;
    }
}

