/* ========================================================================= */
/* public/css/mobile.css - High-Performance Mobile UI Engine for JobLink    */
/* Tối ưu hóa giao diện di động cho tất cả các trang, tất cả vai trò        */
/* ========================================================================= */

/* MẶC ĐỊNH TRÊN DESKTOP: ẨN HOÀN TOÀN CÁC THÀNH PHẦN MOBILE */
.joblink-mobile-header,
.joblink-mobile-bottom-nav,
.joblink-mobile-drawer,
.joblink-mobile-subbar,
.seeker-mobile-header,
.seeker-mobile-bottom-nav,
.seeker-mobile-drawer,
.seeker-mobile-subbar,
.mobile-sticky-job-actions,
.messenger-mobile-back-bar {
    display: none !important;
}

/* ========================================================================= */
/* GIAO DIỆN DI ĐỘNG CHUYÊN BIỆT (MÀN HÌNH <= 900PX)                         */
/* ========================================================================= */
@media (max-width: 900px) {

    /* --------------------------------------------------------------------- */
    /* 1. RESET KHUNG NỀN & ẨN CÁC KHỐI DESKTOP CỒNG KỀNH                   */
    /* --------------------------------------------------------------------- */
    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        overflow-x: hidden !important;
        overflow-x: clip !important;
        -webkit-tap-highlight-color: transparent;
        background-color: #f8fafc;
    }

    /* Ẩn header và sidebar cồng kềnh của bản desktop */
    header.navbar,
    .dashboard-layout .sidebar,
    .chrome-workspace-header {
        display: none !important;
    }

    /* Đưa layout về dạng 1 cột full-width mượt mà */
    .dashboard-layout {
        display: block !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    .workspace-main-area {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        min-height: 100vh !important;
        height: auto !important;
        overflow: visible !important;
    }

    .master-panels-container {
        height: auto !important;
        min-height: calc(100vh - 120px) !important;
    }

    .embedded-content-wrapper,
    .master-tab-panel-root .embedded-content-wrapper {
        padding: 12px 12px 30px 12px !important;
    }

    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* --------------------------------------------------------------------- */
    /* 2. TOP MOBILE APP BAR (HEADER CỐ ĐỊNH TRÊN CÙNG MÀN HÌNH)             */
    /* --------------------------------------------------------------------- */
    .joblink-mobile-header,
    .seeker-mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid #e2e8f0;
        padding: 0 12px;
        z-index: 999;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
        box-sizing: border-box;
    }

    .jmh-left,
    .smh-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .jmh-menu-btn,
    .smh-menu-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        color: #1e293b;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .jmh-menu-btn:active,
    .smh-menu-btn:active {
        background: #ccfbf1;
        color: #0f766e;
        transform: scale(0.94);
    }

    .jmh-brand,
    .smh-brand {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        text-decoration: none;
        color: #0f172a;
    }

    .jmh-logo,
    .smh-logo {
        width: 26px;
        height: 26px;
        object-fit: contain;
    }

    .jmh-brand-text,
    .smh-brand-text {
        font-size: 1.15rem;
        font-weight: 800;
        color: #0f172a;
        letter-spacing: -0.3px;
    }

    .jmh-badge,
    .smh-badge {
        font-size: 0.65rem;
        font-weight: 800;
        background: #ccfbf1;
        color: #0f766e;
        padding: 2px 7px;
        border-radius: 9999px;
        border: 1px solid #99f6e4;
        text-transform: none;
        letter-spacing: 0.3px;
    }

    .jmh-right,
    .smh-right {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .jmh-icon-btn,
    .smh-icon-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        color: #475569;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
        text-decoration: none;
        transition: all 0.15s ease;
    }

    .jmh-icon-btn:active,
    .smh-icon-btn:active {
        background: #f0fdfa;
        color: #0d9488;
        transform: scale(0.94);
    }

    .jmh-badge-count,
    .smh-badge-count {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        border-radius: 9999px;
        background: #0d9488;
        color: #ffffff;
        font-size: 0.65rem;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid #ffffff;
        box-shadow: 0 2px 5px rgba(13, 148, 136, 0.35);
    }

    .jmh-badge-count.jmh-badge-danger,
    .smh-badge-count.smh-badge-danger {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        box-shadow: 0 2px 5px rgba(220, 38, 38, 0.4);
    }

    .jmh-login-btn {
        padding: 6px 14px;
        font-size: 0.84rem;
        font-weight: 700;
        border-radius: 8px;
        text-decoration: none;
        background: #0d9488;
        color: #ffffff;
        display: inline-flex;
        align-items: center;
        box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
    }

    .jmh-avatar-btn,
    .smh-avatar-btn {
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
        margin-left: 2px;
    }

    .jmh-avatar-img,
    .smh-avatar-img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #14b8a6;
        display: block;
    }

    /* --------------------------------------------------------------------- */
    /* 3. SUB-BAR KHI ĐANG MỞ TAB CON TRÊN WORKSPACE DI ĐỘNG                */
    /* --------------------------------------------------------------------- */
    .joblink-mobile-subbar,
    .seeker-mobile-subbar {
        display: none;
        align-items: center;
        justify-content: space-between;
        background: #f1f5f9;
        border-bottom: 1px solid #cbd5e1;
        padding: 8px 12px;
        font-size: 0.82rem;
        z-index: 998;
    }

    .joblink-mobile-subbar.active,
    .seeker-mobile-subbar.active {
        display: flex !important;
    }

    .jms-back-btn,
    .sms-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        color: #0d9488;
        font-weight: 700;
        background: #ffffff;
        border: 1px solid #99f6e4;
        padding: 5px 12px;
        border-radius: 8px;
        cursor: pointer;
        text-decoration: none;
        font-size: 0.8rem;
    }

    .jms-title,
    .sms-title {
        font-weight: 700;
        color: #334155;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 55vw;
    }

    /* --------------------------------------------------------------------- */
    /* 4. BOTTOM NAVIGATION BAR (CỐ ĐỊNH CHÂN MÀN HÌNH DI ĐỘNG)            */
    /* --------------------------------------------------------------------- */
    .joblink-mobile-bottom-nav,
    .seeker-mobile-bottom-nav {
        display: flex !important;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid #e2e8f0;
        z-index: 9990;
        box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.06);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
    }

    .jbn-item,
    .sbn-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #64748b;
        text-decoration: none;
        height: 100%;
        position: relative;
        transition: color 0.15s ease, transform 0.15s ease;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .jbn-icon,
    .sbn-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .jbn-icon svg,
    .sbn-icon svg {
        width: 20px;
        height: 20px;
    }

    .jbn-label,
    .sbn-label {
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: -0.2px;
        transition: color 0.15s ease, font-weight 0.15s ease;
    }

    .jbn-item:active,
    .sbn-item:active {
        transform: scale(0.92);
    }

    .jbn-item.active,
    .sbn-item.active {
        color: #0d9488 !important;
    }

    .jbn-item.active .jbn-icon,
    .sbn-item.active .sbn-icon {
        color: #0d9488 !important;
        transform: translateY(-2px) scale(1.1);
    }

    .jbn-item.active .jbn-label,
    .sbn-item.active .sbn-label {
        font-weight: 800 !important;
        color: #0f766e !important;
    }

    .jbn-item.active::before,
    .sbn-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        width: 24px;
        height: 3px;
        background: #0d9488;
        border-radius: 0 0 3px 3px;
    }

    .jbn-dot-badge,
    .sbn-dot-badge {
        position: absolute;
        top: -2px;
        right: -4px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ef4444;
        border: 1.5px solid #ffffff;
    }

    /* Nút Đăng Tin Mới đặc biệt lồi lên giữa thanh bottom bar (Dành cho NTD) */
    .jbn-item-action {
        position: relative;
        top: -12px;
    }

    .jbn-action-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, #0d9488, #0f766e);
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
        border: 3px solid #ffffff;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .jbn-item-action:active .jbn-action-btn {
        transform: scale(0.92);
        box-shadow: 0 3px 8px rgba(13, 148, 136, 0.3);
    }

    .jbn-item-action .jbn-label {
        margin-top: 2px;
        color: #0d9488;
        font-weight: 700;
    }

    .jbn-item-action.active::before {
        display: none !important;
    }

    /* --------------------------------------------------------------------- */
    /* 5. SIDE DRAWER MENU (MENU TRƯỢT NATIVE TỪ BÊN TRÁI)                  */
    /* --------------------------------------------------------------------- */
    .joblink-mobile-drawer,
    .seeker-mobile-drawer {
        display: block !important;
        pointer-events: none;
        position: fixed;
        inset: 0;
        z-index: 10000;
    }

    .joblink-mobile-drawer.open,
    .seeker-mobile-drawer.open {
        pointer-events: auto;
    }

    .jmd-backdrop,
    .smd-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        opacity: 0;
        transition: opacity 0.28s ease;
        pointer-events: none;
    }

    .joblink-mobile-drawer.open .jmd-backdrop,
    .seeker-mobile-drawer.open .smd-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .jmd-panel,
    .smd-panel {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 310px;
        max-width: 86vw;
        background: #ffffff;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.22);
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 10001;
    }

    .joblink-mobile-drawer.open .jmd-panel,
    .seeker-mobile-drawer.open .smd-panel {
        transform: translateX(0);
    }

    /* Header của Drawer */
    .jmd-header,
    .smd-header {
        background: linear-gradient(135deg, #042f2e 0%, #0d9488 100%);
        color: #ffffff;
        padding: 22px 16px 18px 16px;
        position: relative;
        box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
    }

    .jmd-user-card,
    .smd-user-card {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .jmd-avatar,
    .smd-avatar {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #ffffff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        background: #ffffff;
    }

    .jmd-user-info,
    .smd-user-info {
        flex: 1;
        overflow: hidden;
    }

    .jmd-user-name,
    .smd-user-name {
        margin: 0 0 2px 0;
        font-size: 1.05rem;
        font-weight: 800;
        color: #ffffff;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .jmd-user-sub,
    .smd-user-sub {
        display: block;
        font-size: 0.78rem;
        color: #ccfbf1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .jmd-role-pill,
    .smd-role-pill {
        display: inline-block;
        margin-top: 4px;
        font-size: 0.68rem;
        font-weight: 700;
        background: rgba(255, 255, 255, 0.22);
        color: #ffffff;
        padding: 2px 8px;
        border-radius: 9999px;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    /* Guest Card trong Drawer */
    .jmd-guest-card {
        padding-top: 6px;
    }

    .jmd-guest-logo {
        width: 38px;
        height: 38px;
        margin-bottom: 8px;
    }

    .jmd-guest-title {
        font-size: 1.05rem;
        font-weight: 800;
        margin: 0 0 4px 0;
        color: #ffffff;
    }

    .jmd-guest-sub {
        font-size: 0.78rem;
        color: #ccfbf1;
        margin: 0 0 12px 0;
        line-height: 1.4;
    }

    .jmd-guest-actions {
        display: flex;
        gap: 8px;
    }

    .jmd-close-btn,
    .smd-close-btn {
        position: absolute;
        top: 14px;
        right: 14px;
        background: rgba(255, 255, 255, 0.18);
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        color: #ffffff;
        font-size: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        line-height: 1;
    }

    /* Nội dung cuộn của Drawer */
    .jmd-nav-scroll,
    .smd-nav-scroll {
        flex: 1;
        overflow-y: auto;
        padding: 12px 10px 20px 10px;
        -webkit-overflow-scrolling: touch;
    }

    .jmd-group-title,
    .smd-group-title {
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: none;
        letter-spacing: 0.2px;
        color: #64748b;
        margin: 14px 10px 6px 10px;
    }

    .jmd-link,
    .smd-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 10px;
        color: #334155;
        font-size: 0.88rem;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.15s ease;
        margin-bottom: 2px;
    }

    .jmd-link:active,
    .smd-link:active {
        background: #f0fdfa;
        color: #0d9488;
        transform: scale(0.98);
    }

    .jmd-link.active,
    .smd-link.active {
        background: #ccfbf1;
        color: #0f766e;
        font-weight: 700;
    }

    .jmd-link svg,
    .smd-link svg {
        color: #0d9488;
    }

    .jmd-badge-new,
    .smd-badge-new {
        margin-left: auto;
        font-size: 0.65rem;
        font-weight: 800;
        background: #0d9488;
        color: #ffffff;
        padding: 2px 7px;
        border-radius: 6px;
    }

    .jmd-badge-bot,
    .smd-badge-bot {
        margin-left: auto;
        font-size: 0.65rem;
        font-weight: 700;
        background: #fef3c7;
        color: #b45309;
        padding: 2px 7px;
        border-radius: 6px;
    }

    .jmd-link-bot,
    .smd-link-bot {
        width: 100%;
        border: 1px dashed #99f6e4;
        background: #f0fdfa;
        color: #0f766e;
        cursor: pointer;
        text-align: left;
        margin-top: 6px;
        border-radius: 10px;
    }

    /* Footer của Drawer */
    .jmd-footer,
    .smd-footer {
        padding: 12px 16px;
        border-top: 1px solid #f1f5f9;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #f8fafc;
    }

    .jmd-logout-btn,
    .smd-logout-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #dc2626;
        font-size: 0.84rem;
        font-weight: 700;
        text-decoration: none;
        padding: 6px 12px;
        border-radius: 8px;
        background: #fee2e2;
        transition: background 0.15s ease;
    }

    .jmd-logout-btn:active,
    .smd-logout-btn:active {
        background: #fecaca;
    }

    .jmd-hotline-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #0d9488;
        font-size: 0.84rem;
        font-weight: 700;
        text-decoration: none;
        padding: 6px 12px;
        border-radius: 8px;
        background: #ccfbf1;
    }

    .jmd-version,
    .smd-version {
        font-size: 0.68rem;
        color: #94a3b8;
    }

    /* --------------------------------------------------------------------- */
    /* 6. QUẢN LÝ GRID & BỐ CỤC ĐA CỘT TRÊN DI ĐỘNG                          */
    /* --------------------------------------------------------------------- */
    /* Biến các grid đa cột thành dạng 1 cột để không bị ép nhỏ */
    div[style*="grid-template-columns: 2fr 1fr"],
    div[style*="grid-template-columns: 3fr 2fr"],
    div[style*="grid-template-columns: 1fr 1.5fr"],
    div[style*="grid-template-columns: 1.1fr 1.4fr"],
    div[style*="grid-template-columns: 1fr 1.2fr"],
    div[style*="grid-template-columns: 1.2fr 1.5fr 1fr 1fr auto"],
    div[style*="grid-template-columns: 1.2fr 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 340px"],
    .job-search-layout,
    .job-detail-content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .grid-jobs,
    .grid-employers {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .container div[style*="repeat(auto-fill, minmax(320px, 1fr))"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .container .job-card {
        width: 100% !important;
        min-width: 0 !important;
    }

    .proof-row {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    .ai-breakdown-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* Danh sách việc làm AI đề xuất thu gọn kiểu sàn TMĐT (Shopee/Lazada) */
    .ai-job-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        margin-top: 0.65rem !important;
    }

    .ai-job-card {
        position: relative !important;
        padding: 9px 10px 8px 10px !important;
        border-radius: 10px !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
        cursor: pointer !important;
        overflow: hidden !important;
        transition: transform 0.12s ease, background-color 0.12s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .ai-job-card:active {
        transform: scale(0.985) !important;
        background-color: #f8fafc !important;
    }

    /* Mác tương thích kiểu mác giảm giá sàn TMĐT gắn ở góc trên phải */
    .ai-job-card .ai-match-badge,
    .job-card .ai-match-badge {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        border-top-right-radius: 10px !important;
        border-bottom-left-radius: 8px !important;
        border-top-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        padding: 2px 7px !important;
        font-size: 0.68rem !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
        z-index: 2 !important;
        gap: 2px !important;
        border: none !important;
    }

    .ai-match-badge.excellent {
        background: linear-gradient(135deg, #059669, #10b981) !important;
        color: #ffffff !important;
    }

    .ai-match-badge.high {
        background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
        color: #ffffff !important;
    }

    .ai-match-badge.medium {
        background: linear-gradient(135deg, #d97706, #f59e0b) !important;
        color: #ffffff !important;
    }

    .ai-job-card .ai-match-badge .match-text-full,
    .job-card .ai-match-badge .match-text-full {
        display: none !important;
    }

    .ai-job-card .ai-match-badge svg,
    .job-card .ai-match-badge svg {
        width: 10px !important;
        height: 10px !important;
    }

    /* Tiêu đề & Tên doanh nghiệp nằm gọn trên 1 hàng duy nhất */
    .ai-job-header-row {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding-right: 52px !important; /* Chừa chỗ cho mác giảm giá góc phải */
    }

    .ai-job-logo {
        width: 36px !important;
        height: 36px !important;
        border-radius: 7px !important;
        flex-shrink: 0 !important;
        object-fit: cover !important;
    }

    .ai-job-titles {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .ai-job-title,
    .ai-job-title a,
    .job-card h3,
    .job-card h3 a {
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        margin: 0 !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
    }

    .ai-job-company,
    .job-card p {
        font-size: 0.74rem !important;
        color: #64748b !important;
        margin: 2px 0 0 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
        line-height: 1.2 !important;
    }

    /* Hàng Lương & Địa điểm gọn gàng trên 1 dòng */
    .ai-job-meta-row {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        margin-top: 4px !important;
        padding-left: 44px !important; /* Thẳng hàng với tiêu đề (36px logo + 8px gap) */
        font-size: 0.76rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .ai-job-salary {
        color: #0d9488 !important;
        font-weight: 800 !important;
        font-size: 0.82rem !important;
    }

    .ai-job-dot {
        color: #cbd5e1 !important;
        font-size: 0.75rem !important;
    }

    .ai-job-location {
        color: #64748b !important;
        font-size: 0.74rem !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 2px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Thu gọn chiều cao: Ẩn các phần rườm rà trên danh sách di động (xem đầy đủ khi bấm vào thẻ) */
    .ai-job-card .ai-progress-wrap,
    .ai-job-card .ai-matched-skills-row,
    .ai-job-card .ai-reasons-list,
    .ai-job-card .job-card-actions {
        display: none !important;
    }

    .role-select-container {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    /* Đảm bảo các hàng nút tác vụ trên dashboard và toolbar xếp gọn 2 cột cân đối */
    .employer-quick-actions,
    div[style*="display: flex; gap: 1rem; margin-bottom: 2rem"],
    div[style*="display: flex; gap: 0.75rem; margin-bottom: 2rem"] {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 1.25rem !important;
    }

    .employer-quick-actions > .btn,
    div[style*="display: flex; gap: 1rem; margin-bottom: 2rem"] > .btn,
    div[style*="display: flex; gap: 0.75rem; margin-bottom: 2rem"] > .btn {
        width: 100% !important;
        min-height: 40px !important;
        font-size: 0.78rem !important;
        padding: 0.45rem 0.5rem !important;
        white-space: nowrap !important;
        justify-content: center !important;
        text-align: center !important;
        border-radius: 9px !important;
    }

    /* Bảng thống kê (Stats) trên di động: 4 ô xếp thành 1 dòng duy nhất, vuốt chạm tiện lợi */
    .grid-stats {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        margin-bottom: 1.25rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .grid-stats .stat-card {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 8px 4px !important;
        border-radius: 10px !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 70px !important;
        box-sizing: border-box !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
        transition: transform 0.12s ease, background-color 0.12s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .grid-stats .stat-card:active {
        transform: scale(0.96) !important;
        background-color: #f1f5f9 !important;
    }

    .grid-stats .stat-card .stat-title {
        font-size: 0.68rem !important;
        font-weight: 600 !important;
        line-height: 1.15 !important;
        color: #64748b !important;
        margin-bottom: 3px !important;
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        word-break: break-word !important;
        overflow: hidden !important;
    }

    .grid-stats .stat-card .stat-value {
        font-size: 1.35rem !important;
        font-weight: 800 !important;
        margin: 0 !important;
        line-height: 1.1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
    }

    .grid-stats .stat-card .stat-value svg {
        width: 14px !important;
        height: 14px !important;
    }

    .grid-stats .stat-card a,
    .grid-stats .stat-card .stat-icon-badge,
    .grid-stats .stat-card .stat-link-arrow {
        display: none !important;
    }

    .grid-stats .stat-card .stat-row-top,
    .grid-stats .stat-card .stat-row-bottom {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .admin-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 1.25rem !important;
    }

    .admin-kpi-card {
        padding: 12px 10px !important;
        border-radius: 12px !important;
    }

    .kpi-main-number {
        font-size: 1.45rem !important;
        margin: 4px 0 !important;
    }

    /* Header chào mừng & Banner Onboarding gọn gàng trên di động */
    .dashboard-greeting {
        margin-bottom: 0.85rem !important;
    }

    .dashboard-greeting h1 {
        font-size: 1.35rem !important;
        margin-bottom: 0.15rem !important;
        line-height: 1.25 !important;
    }

    .greeting-subtitle {
        font-size: 0.82rem !important;
        color: #64748b !important;
        line-height: 1.3 !important;
    }

    .onboarding-banner {
        padding: 0.95rem !important;
        border-radius: 12px !important;
        margin-bottom: 1rem !important;
    }

    .onboarding-banner h3 {
        font-size: 1rem !important;
    }

    .onboarding-banner p {
        font-size: 0.78rem !important;
    }

    /* Card chuẩn trên di động */
    .card,
    .auth-card,
    .filter-sidebar {
        padding: 1.15rem !important;
        border-radius: 14px !important;
        margin-bottom: 1rem !important;
    }

    /* --------------------------------------------------------------------- */
    /* 7. FORM INPUTS & TOUCH TARGETS THÂN THIỆN VỚI NGÓN TAY               */
    /* --------------------------------------------------------------------- */
    /* Chiều cao tối thiểu 46px & font 16px tránh iOS tự động zoom khi gõ */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    select,
    textarea,
    .form-control {
        min-height: 46px !important;
        font-size: 16px !important; /* Quan trọng: Ngăn Safari tự zoom */
        border-radius: 10px !important;
        padding: 0.65rem 0.85rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* --------------------------------------------------------------------- */
    /* 7. HỆ THỐNG NÚT BẤM (BUTTONS) CHUẨN DI ĐỘNG - CÂN ĐỐI & GỌN GÀNG     */
    /* --------------------------------------------------------------------- */
    .btn {
        min-height: 38px !important;
        height: auto !important;
        border-radius: 9px !important;
        padding: 0.45rem 0.9rem !important;
        font-size: 0.86rem !important;
        font-weight: 600 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
        touch-action: manipulation;
        transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
        -webkit-tap-highlight-color: transparent !important;
    }

    .btn:active {
        transform: scale(0.96) !important;
    }

    /* Đảm bảo chữ bên trong nút luôn nằm trên 1 hàng duy nhất */
    .btn span,
    .btn * {
        white-space: nowrap !important;
    }

    /* Nút nhỏ (.btn-sm) - thẻ công việc, danh sách, action bars */
    .btn-sm,
    .btn.btn-sm {
        min-height: 34px !important;
        height: 34px !important;
        padding: 0.3rem 0.65rem !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        gap: 0.3rem !important;
    }

    .btn-sm svg,
    .btn.btn-sm svg {
        width: 14px !important;
        height: 14px !important;
        flex-shrink: 0 !important;
    }

    /* Nút siêu nhỏ (.btn-xs) */
    .btn-xs,
    .btn.btn-xs {
        min-height: 28px !important;
        height: 28px !important;
        padding: 0.2rem 0.5rem !important;
        font-size: 0.74rem !important;
        border-radius: 6px !important;
        white-space: nowrap !important;
    }

    /* Nút lớn CTA (.btn-lg) */
    .btn-lg,
    .btn.btn-lg {
        min-height: 44px !important;
        height: 44px !important;
        padding: 0.6rem 1.25rem !important;
        font-size: 0.92rem !important;
        font-weight: 700 !important;
        border-radius: 11px !important;
        width: 100% !important;
        white-space: nowrap !important;
    }

    /* Cặp nút tác vụ trong thẻ card: luôn xếp trên 1 dòng duy nhất, chia đều 50/50 cân đối */
    .onboarding-actions,
    .card-action-bar,
    .job-card-actions,
    div[style*="display: flex; justify-content: space-between; align-items: center; border-top"],
    div[style*="display: flex; justify-content: space-between"][style*="border-top"] {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .onboarding-actions > .btn,
    .card-action-bar > .btn,
    .job-card-actions > .btn,
    div[style*="display: flex; justify-content: space-between; align-items: center; border-top"] > .btn,
    div[style*="display: flex; justify-content: space-between"][style*="border-top"] > .btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        text-align: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Nút trong bảng dữ liệu di động */
    .table .btn,
    .table-responsive .btn {
        min-height: 28px !important;
        height: 28px !important;
        padding: 0.2rem 0.5rem !important;
        font-size: 0.74rem !important;
        white-space: nowrap !important;
    }

    /* Form nhóm 2 cột trên điện thoại nhỏ sẽ xếp chồng */
    @media (max-width: 600px) {
        div[style*="grid-template-columns: 1fr 1fr"] {
            grid-template-columns: 1fr !important;
            gap: 0.85rem !important;
        }
    }

    /* --------------------------------------------------------------------- */
    /* 8. BỘ LỌC TÌM KIẾM VIỆC LÀM & GPS TRÊN DI ĐỘNG                       */
    /* --------------------------------------------------------------------- */
    .geo-search-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.85rem !important;
    }

    .geo-search-container .form-group {
        width: 100% !important;
        margin-bottom: 0 !important;
    }

    .btn-get-current-location {
        padding: 4px 8px !important;
        font-size: 0.8rem !important;
    }

    /* --------------------------------------------------------------------- */
    /* 9. NÚT ỨNG TUYỂN DÍNH CHÂN TRANG CHI TIẾT VIỆC LÀM (STICKY ACTION)    */
    /* --------------------------------------------------------------------- */
    .mobile-sticky-job-actions {
        display: flex !important;
        align-items: center;
        gap: 10px;
        position: fixed;
        bottom: calc(60px + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid #e2e8f0;
        padding: 10px 14px;
        z-index: 9980;
        box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
        box-sizing: border-box;
    }

    .mobile-sticky-save-btn {
        width: 46px;
        height: 46px;
        border-radius: 12px;
        background: #f1f5f9;
        border: 1.5px solid #cbd5e1;
        color: #475569;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: all 0.15s ease;
    }

    .mobile-sticky-save-btn:active {
        background: #ffe4e6;
        color: #e11d48;
        transform: scale(0.94);
    }

    .mobile-sticky-apply-btn {
        flex: 1;
        height: 46px;
        border-radius: 12px;
        background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
        color: #ffffff;
        border: none;
        font-weight: 800;
        font-size: 0.96rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
        text-decoration: none;
        transition: transform 0.15s ease;
    }

    .mobile-sticky-apply-btn:active {
        transform: scale(0.97);
    }

    /* --------------------------------------------------------------------- */
    /* 10. TỐI ƯU HÓA KHUNG CHAT MESSENGER TRÊN DI ĐỘNG                     */
    /* --------------------------------------------------------------------- */
    .messenger-container {
        display: flex !important;
        flex-direction: column !important;
        height: calc(100vh - 120px) !important;
        max-height: calc(100vh - 120px) !important;
        border-radius: 12px !important;
        margin: 0 !important;
    }

    /* Chế độ danh sách chat vs chế độ phòng chat trực tiếp */
    .messenger-container.mobile-in-chat .messenger-sidebar {
        display: none !important;
    }

    .messenger-container.mobile-in-chat .messenger-main {
        display: flex !important;
        flex: 1 !important;
        width: 100% !important;
    }

    .messenger-container:not(.mobile-in-chat) .messenger-main {
        display: none !important;
    }

    .messenger-container:not(.mobile-in-chat) .messenger-sidebar {
        display: flex !important;
        flex: 1 !important;
        width: 100% !important;
    }

    /* Thanh quay lại danh sách trên đỉnh khung chat di động */
    .messenger-mobile-back-bar {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
    }

    .messenger-mobile-back-btn {
        background: #ffffff;
        border: 1px solid #cbd5e1;
        color: #0d9488;
        padding: 5px 10px;
        border-radius: 8px;
        font-size: 0.8rem;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        cursor: pointer;
    }

    /* --------------------------------------------------------------------- */
    /* 11. BẢNG DỮ LIỆU CUỘN NGANG ÊM ÁI TRÊN DI ĐỘNG                      */
    /* --------------------------------------------------------------------- */
    .table-responsive,
    .admin-table-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 10px !important;
        margin-bottom: 1rem !important;
        border: 1px solid #e2e8f0 !important;
    }

    table {
        min-width: 600px; /* Cho phép cuộn ngang thay vì bóp méo chữ */
    }

    table th, table td {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
        white-space: nowrap;
    }

    /* --------------------------------------------------------------------- */
    /* 12. TỐI ƯU HÓA TRỢ LÝ AI JOBY TRÊN DI ĐỘNG                           */
    /* --------------------------------------------------------------------- */
    .ai-chat-launcher {
        right: 14px !important;
        z-index: 9985 !important;
        touch-action: none !important;
    }

    .ai-chat-launcher:not([style*="top"]) {
        bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .ai-chat-drag-handle {
        display: none !important;
    }

    .ai-chat-btn {
        width: 50px !important;
        height: 50px !important;
        touch-action: none !important;
    }

    .ai-chat-badge {
        padding: 5px 12px !important;
        font-size: 0.78rem !important;
    }

    .ai-chat-launcher.is-dragging .ai-chat-badge {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateX(0) scale(1) !important;
    }

    .ai-chat-window {
        bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        max-width: none !important;
        height: calc(100vh - 145px) !important;
        max-height: calc(100vh - 145px) !important;
        border-radius: 16px !important;
    }

    .ai-proactive-bubble {
        bottom: calc(135px + env(safe-area-inset-bottom, 0px)) !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
        border-radius: 12px !important;
    }

    /* --------------------------------------------------------------------- */
    /* 13. MODAL & DIALOG THÂN THIỆN PHONG CÁCH BOTTOM-SHEET                */
    /* --------------------------------------------------------------------- */
    .modal-dialog,
    .custom-dialog-box {
        width: 94vw !important;
        max-width: 94vw !important;
        margin: auto !important;
        border-radius: 16px !important;
    }
}
