/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Theme */
    --bg-primary: #fafafa;
    --bg-secondary: #f0f0f0;
    --bg-card: #ffffff;
    --text-primary: #212121;
    --text-secondary: #616161;
    --text-muted: #9e9e9e;
    --border-color: #e0e0e0;
    --accent-red: #d32f2f;
    --accent-red-dark: #b71c1c;
    --accent-gray: #757575;
    --shadow: rgba(0, 0, 0, 0.08);
}

.dark-theme {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #404040;
    --border-color-table: #4a4a4a;
    --accent-red: #f44336;
    --accent-red-dark: #d32f2f;
    --accent-gray: #9e9e9e;
    --shadow: rgba(0, 0, 0, 0.3);
}

html {
    overflow-x: hidden;
    overscroll-behavior-y: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    overscroll-behavior-y: none;
    overscroll-behavior: none;
    position: relative;
}

/* Header */
.main-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.header-left .app-title {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-left .app-title a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.header-left .app-title a:hover {
    opacity: 0.7;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon {
    position: relative;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon:hover {
    background-color: var(--bg-secondary);
}

.header-icon svg {
    width: 20px;
    height: 20px;
}

.header-icon-container {
    position: relative;
    display: inline-block;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--accent-red);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid var(--bg-card);
}

.notification-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 350px;
    max-height: 500px;
    overflow: hidden;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    display: none;
    z-index: 1001;
    flex-direction: column;
}

.notification-panel #notificationList {
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.notification-panel.active {
    display: flex;
}

.notification-panel h3 {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

.notification-panel #markAllReadBtn {
    position: relative !important;
    z-index: 1002 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.notification-panel #markAllReadBtn,
.notification-panel #markAllReadBtn * {
    pointer-events: auto !important;
}

/* Đảm bảo container của button không chặn click */
.notification-panel > div:first-child {
    pointer-events: auto !important;
    flex-shrink: 0;
}

.notification-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.notification-item:hover {
    background-color: var(--bg-secondary);
}

.notification-item.unread {
    background-color: var(--bg-secondary);
    font-weight: 500;
}

/* Container */
.container {
    max-width: 1650px;
    margin: 1.25rem auto;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.container h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Employee Header */
.employee-header {
    margin-bottom: 1.25rem;
}

.employee-avatar-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.employee-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid #bababa;
    object-fit: cover;
}

.employee-avatar-section .employee-name-level {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.employee-avatar-section h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.3px;
}

.employee-level {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.employee-level.level-updating {
    position: relative;
    overflow: hidden;
}

.employee-level.level-updating::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.2), transparent);
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes levelUpPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.employee-level.level-updating {
    animation: levelUpPulse 0.6s ease-in-out;
}

/* Ticker */
.ticker-wrapper {
    overflow: hidden;
    background-color: var(--bg-secondary);
    padding: 0.625rem 0.875rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    position: relative;
}

.ticker {
    white-space: nowrap;
    font-size: 0.875rem;
    color: #787878;
    font-weight: 500;
}

/* Animation: Từ phải qua trái (mặc định) */
.ticker[data-animation="right-to-left"] {
    animation: tickerRightToLeft 30s linear forwards;
}

@keyframes tickerRightToLeft {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Animation: Từ trái qua phải */
.ticker[data-animation="left-to-right"] {
    animation: tickerLeftToRight 30s linear forwards;
}

@keyframes tickerLeftToRight {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Animation: Từ trên xuống dưới */
.ticker[data-animation="top-to-bottom"] {
    animation: tickerTopToBottom 30s linear forwards;
    white-space: normal;
    text-align: center;
}

@keyframes tickerTopToBottom {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Animation: Từ dưới lên trên */
.ticker[data-animation="bottom-to-top"] {
    animation: tickerBottomToTop 30s linear forwards;
    white-space: normal;
    text-align: center;
}

@keyframes tickerBottomToTop {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Animation: Hiện lên mờ dần */
.ticker[data-animation="fade-in"] {
    animation: tickerFadeIn 30s linear forwards;
    text-align: center;
}

@keyframes tickerFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    90% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Animation: Phóng to dần */
.ticker[data-animation="zoom-in"] {
    animation: tickerZoomIn 30s linear forwards;
    text-align: center;
}

@keyframes tickerZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    90% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* Animation: Trượt lên */
.ticker[data-animation="slide-up"] {
    animation: tickerSlideUp 30s linear forwards;
    text-align: center;
}

@keyframes tickerSlideUp {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    10% {
        transform: translateY(0);
        opacity: 1;
    }
    90% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

/* Animation: Trượt xuống */
.ticker[data-animation="slide-down"] {
    animation: tickerSlideDown 30s linear forwards;
    text-align: center;
}

@keyframes tickerSlideDown {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    10% {
        transform: translateY(0);
        opacity: 1;
    }
    90% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(50px);
        opacity: 0;
    }
}

/* Jobs Section */
.jobs-section {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px var(--shadow);
    border: 1px solid var(--border-color);
}

.jobs-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-group, .refresh-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group label, .refresh-group label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.filter-group select {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: var(--accent-gray);
    border-radius: 24px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

input:checked + .slider {
    background-color: var(--accent-red);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.toggle-label {
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Jobs List */
.jobs-list, .jobs-list-admin {
    margin-bottom: 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

#jobsList {
    width: 100%;
    box-sizing: border-box;
}

/* Admin Jobs Management */
.admin-jobs-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-jobs-filter label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.admin-jobs-filter select {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}



#employeeJobsList {
    width: 100%;
    box-sizing: border-box;
}

.admin-jobs-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
}

/* Dark theme cho wrapper admin */
.dark-theme .admin-jobs-table-wrapper {
    border-color: var(--border-color-table);
}

@media (max-width: 1400px) {
    .admin-jobs-table-wrapper {
        overflow-x: auto;
    }
}

@media (max-width: 1200px) {
    .admin-jobs-table-wrapper {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .admin-jobs-table-wrapper {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .admin-jobs-table-wrapper {
        overflow-x: hidden;
    }
}

.admin-jobs-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-card);
    font-size: 0.813rem;
    table-layout: auto;
    min-width: 700px;
}

@media (max-width: 1200px) {
    .admin-jobs-table {
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    .admin-jobs-table {
        min-width: auto;
        width: 100%;
    }
}

.admin-jobs-table thead {
    background-color: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Dark theme cho thead admin */
.dark-theme .admin-jobs-table thead {
    background-color: #1a1a1a;
}

.admin-jobs-table th {
    padding: 0.625rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    white-space: nowrap;
}

/* Dark theme cho viền tiêu đề admin */
.dark-theme .admin-jobs-table th {
    border-bottom-color: var(--border-color-table);
    border-right-color: var(--border-color-table);
}

.admin-jobs-table th:last-child {
    border-right: none;
}

@media (max-width: 768px) {
    .admin-jobs-table th {
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 1200px) {
    .admin-jobs-table th,
    .admin-jobs-table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.813rem;
    }
    
    .admin-job-thumb {
        width: 60px;
        height: 60px;
    }
    
    .admin-job-title-cell {
        min-width: 150px;
        max-width: 200px;
    }
    
    .admin-job-date-cell,
    .admin-job-deadline-cell {
        min-width: 110px;
        font-size: 0.75rem;
    }
    
    .admin-job-quantity-cell,
    .admin-job-price-cell {
        min-width: 70px;
    }
}

.admin-jobs-table td {
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    vertical-align: middle;
}

/* Dark theme cho viền các ô dữ liệu admin */
.dark-theme .admin-jobs-table td {
    border-bottom-color: var(--border-color-table);
    border-right-color: var(--border-color-table);
}

.admin-jobs-table td:last-child {
    border-right: none;
}

.admin-jobs-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* Dark theme cho hover admin */
.dark-theme .admin-jobs-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.admin-jobs-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-job-thumb-cell {
    width: 70px;
    padding: 0.5rem !important;
}

.admin-job-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.admin-job-title-cell {
    min-width: 140px;
    max-width: 180px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.813rem;
    line-height: 1.4;
}

.admin-job-date-cell,
.admin-job-deadline-cell {
    min-width: 115px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .admin-job-date-cell,
    .admin-job-deadline-cell {
        white-space: normal;
        word-break: break-word;
    }
}

.admin-job-deadline-cell {
    color: #d32f2f;
    font-weight: 500;
}

.admin-job-quantity-cell,
.admin-job-price-cell {
    text-align: center;
    min-width: 70px;
    white-space: nowrap;
    font-size: 0.813rem;
}

.admin-job-total-cell {
    text-align: center;
    min-width: 100px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    font-size: 0.813rem;
}

.admin-job-result-link-cell {
    text-align: center;
    min-width: 50px;
    padding: 0.5rem 0.25rem !important;
}

.admin-job-result-link-cell .download-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2196F3;
    transition: color 0.2s ease;
    padding: 0.25rem;
}

.admin-job-result-link-cell .download-icon-link svg {
    width: 18px;
    height: 18px;
}

.admin-job-result-link-cell .download-icon-link:hover {
    color: #1976D2;
}

.admin-job-status-cell {
    text-align: center;
    min-width: 120px;
}

.admin-job-action-cell {
    text-align: center;
    min-width: 180px;
    padding: 0.5rem 0.375rem !important;
}

.admin-job-action-cell > div {
    justify-content: center;
    gap: 0.375rem;
}

.admin-job-action-cell .no-action {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Tối ưu button trong admin-jobs-table */
.admin-jobs-table .btn-small {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.admin-jobs-table .btn-small svg {
    width: 12px;
    height: 12px;
    margin-right: 0.25rem;
}

/* Employee Jobs Table */
.employee-jobs-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
}

/* Dark theme cho wrapper */
.dark-theme .employee-jobs-table-wrapper {
    border-color: var(--border-color-table);
}

@media (max-width: 1400px) {
    .employee-jobs-table-wrapper {
        overflow-x: auto;
    }
}

@media (max-width: 1200px) {
    .employee-jobs-table-wrapper {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .employee-jobs-table-wrapper {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .employee-jobs-table-wrapper {
        overflow-x: hidden;
    }
}

.employee-jobs-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-card);
    font-size: 0.813rem;
    table-layout: auto;
    min-width: 1100px;
}

@media (max-width: 1400px) {
    /* Ẩn cột "Giao" và "Còn lại" trên màn hình trung bình */
    .employee-jobs-table th:nth-child(4),
    .employee-jobs-table td:nth-child(4),
    .employee-jobs-table th:nth-child(6),
    .employee-jobs-table td:nth-child(6) {
        display: none;
    }
}

@media (max-width: 1200px) {
    .employee-jobs-table {
        min-width: 850px;
    }
}

@media (max-width: 768px) {
    .employee-jobs-table {
        min-width: auto;
        width: 100%;
    }
}

.employee-jobs-table thead {
    background-color: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Dark theme cho thead employee */
.dark-theme .employee-jobs-table thead {
    background-color: #1a1a1a;
}

.employee-jobs-table th {
    padding: 0.625rem 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    white-space: nowrap;
}

/* Dark theme cho viền tiêu đề */
.dark-theme .employee-jobs-table th {
    border-bottom-color: var(--border-color-table);
    border-right-color: var(--border-color-table);
}

.employee-jobs-table th:last-child {
    border-right: none;
}

/* Căn chỉnh tiêu đề cho các cột có text-align center */
.employee-jobs-table th:nth-child(7),
.employee-jobs-table th:nth-child(8),
.employee-jobs-table th:nth-child(9),
.employee-jobs-table th:nth-child(11),
.employee-jobs-table th:nth-child(12),
.employee-jobs-table th:nth-child(13) {
    text-align: center;
}

/* Căn chỉnh tiêu đề cho cột tổng tiền (text-align right) */
.employee-jobs-table th:nth-child(10) {
    text-align: right;
    padding-right: 0.5rem;
}

@media (max-width: 768px) {
    .employee-jobs-table th {
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 1200px) {
    .employee-jobs-table th,
    .employee-jobs-table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .employee-job-thumb {
        width: 45px;
        height: 45px;
    }
    
    .employee-job-title-cell {
        min-width: 120px;
        max-width: 180px;
        font-size: 0.75rem;
    }
    
    .employee-job-date-cell,
    .employee-job-deadline-cell,
    .employee-job-countdown-cell {
        min-width: 90px;
        font-size: 0.7rem;
    }
    
    .employee-job-quantity-cell,
    .employee-job-price-cell {
        min-width: 50px;
        font-size: 0.7rem;
    }
    
    .employee-job-download-cell {
        min-width: 40px;
    }
    
    .employee-job-id-cell {
        min-width: 70px;
        font-size: 0.7rem;
    }
    
    .employee-job-bonus-cell {
        min-width: 60px;
        font-size: 0.7rem;
    }
    
    .employee-job-total-cell {
        min-width: 90px;
        font-size: 0.7rem;
    }
    
    .employee-job-status-cell {
        min-width: 100px;
        font-size: 0.7rem;
    }
    
    .employee-job-action-cell {
        min-width: 100px;
    }
}

.employee-jobs-table td {
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    vertical-align: middle;
}

/* Dark theme cho viền các ô dữ liệu */
.dark-theme .employee-jobs-table td {
    border-bottom-color: var(--border-color-table);
    border-right-color: var(--border-color-table);
}

.employee-jobs-table td:last-child {
    border-right: none;
}

.employee-jobs-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* Dark theme cho hover */
.dark-theme .employee-jobs-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.employee-jobs-table tbody tr.warning-row {
    background-color: #ffebee;
}

/* Dark theme cho warning row */
.dark-theme .employee-jobs-table tbody tr.warning-row {
    background-color: rgba(244, 67, 54, 0.15);
}

.employee-jobs-table tbody tr.warning-row:hover {
    background-color: #ffcdd2;
}

/* Dark theme cho warning row hover */
.dark-theme .employee-jobs-table tbody tr.warning-row:hover {
    background-color: rgba(244, 67, 54, 0.25);
}

.employee-jobs-table tbody tr:last-child td {
    border-bottom: none;
}

.employee-job-thumb-cell {
    width: 60px;
    padding: 0.625rem 0.5rem !important;
    text-align: center;
}

/* Căn chỉnh tiêu đề cho cột ảnh */
.employee-jobs-table th:nth-child(2) {
    text-align: center;
    padding: 0.625rem 0.5rem;
}

.employee-job-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.employee-job-title-cell {
    min-width: 150px;
    max-width: 250px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.813rem;
}

.deadline-warning-inline {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #d32f2f;
    font-weight: 500;
}

.employee-job-date-cell,
.employee-job-deadline-cell {
    min-width: 100px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .employee-job-date-cell,
    .employee-job-deadline-cell,
    .employee-job-countdown-cell {
        white-space: normal;
        word-break: break-word;
    }
}

.employee-job-deadline-cell {
    color: #d32f2f;
    font-weight: 500;
}

.employee-job-countdown-cell {
    min-width: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.employee-job-quantity-cell,
.employee-job-price-cell {
    text-align: center;
    min-width: 60px;
    white-space: nowrap;
    font-size: 0.75rem;
}

.employee-job-id-cell {
    min-width: 80px;
    font-size: 0.75rem;
}

.employee-job-bonus-cell {
    text-align: center;
    min-width: 70px;
    font-size: 0.75rem;
}

.employee-job-total-cell {
    text-align: right;
    min-width: 100px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    font-size: 0.75rem;
    padding-right: 0.5rem !important;
}

.employee-job-total-cell strong {
    display: block;
    text-align: right;
}

.employee-job-status-cell {
    text-align: center;
    min-width: 110px;
    font-size: 0.75rem;
}

.employee-job-download-cell {
    text-align: center;
    min-width: 50px;
}

.employee-job-download-cell .download-icon-link {
    margin: 0;
    padding: 0.375rem;
}

.employee-job-download-cell .download-icon-link svg {
    width: 20px;
    height: 20px;
}

.employee-job-action-cell {
    text-align: center;
    min-width: 120px;
}

.btn-tiny {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Button chi tiết công việc - thiết kế tinh tế */
/* Selector với độ ưu tiên cao để override các style khác */
.employee-jobs-table .employee-job-title-cell button.btn.btn-tiny.btn-secondary,
.employee-job-title-cell button.btn.btn-tiny.btn-secondary,
button.btn.btn-tiny.btn-secondary[onclick^="openJobDetail"] {
    padding: 0.375rem 0.5rem !important;
    background-color: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    border-radius: 6px !important;
    min-width: 28px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    margin: 0 !important;
    font-weight: normal !important;
}

.employee-jobs-table .employee-job-title-cell button.btn.btn-tiny.btn-secondary:hover,
.employee-job-title-cell button.btn.btn-tiny.btn-secondary:hover,
button.btn.btn-tiny.btn-secondary[onclick^="openJobDetail"]:hover {
    background-color: var(--bg-secondary) !important;
    border-color: var(--accent-gray) !important;
    color: var(--text-primary) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.employee-jobs-table .employee-job-title-cell button.btn.btn-tiny.btn-secondary:active,
.employee-job-title-cell button.btn.btn-tiny.btn-secondary:active,
button.btn.btn-tiny.btn-secondary[onclick^="openJobDetail"]:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.employee-jobs-table .employee-job-title-cell button.btn.btn-tiny.btn-secondary svg,
.employee-job-title-cell button.btn.btn-tiny.btn-secondary svg,
button.btn.btn-tiny.btn-secondary[onclick^="openJobDetail"] svg {
    width: 14px !important;
    height: 14px !important;
    transition: transform 0.2s ease !important;
}

.employee-jobs-table .employee-job-title-cell button.btn.btn-tiny.btn-secondary:hover svg,
.employee-job-title-cell button.btn.btn-tiny.btn-secondary:hover svg,
button.btn.btn-tiny.btn-secondary[onclick^="openJobDetail"]:hover svg {
    transform: scale(1.1) !important;
}

.employee-jobs-table .download-icon-link:hover {
    transform: none;
}

.admin-jobs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    margin-bottom: 0;
    padding-top: 1.25rem;
    padding-bottom: 0;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.admin-jobs-pagination .pagination-btn {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    z-index: 11;
    pointer-events: auto;
}

.admin-jobs-pagination .pagination-btn:hover:not(.active) {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.admin-jobs-pagination .pagination-btn.active {
    background-color: #212121;
    color: white;
    border-color: #212121;
}

.admin-jobs-pagination .pagination-ellipsis {
    padding: 0.5rem 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.job-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
    transition: border-color 0.2s ease;
}

.job-card:hover {
    border-color: rgb(71, 71, 71);
}

.job-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.job-details {
    flex: 1;
}

.job-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: -0.2px;
}

.job-description {
    color: var(--text-secondary);    
    line-height: 1.5;
    font-size: 0.875rem;
}

/* Job Detail Modal */
.job-detail-content {
    padding: 0.5rem 0;
}

.job-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    align-items: start;
}

.job-detail-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 1rem;
}

.job-detail-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    letter-spacing: -0.5px;
}

.job-detail-image-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.job-detail-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    min-height: 350px;
    max-height: 550px;
    background-color: var(--bg-secondary);
}

.job-detail-right {
    flex: 1;
}

.job-detail-info {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    background-color: var(--bg-secondary);
    padding: 1.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow);
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.875rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 160px;
    flex-shrink: 0;
    font-size: 0.938rem;
}

.detail-value {
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
    font-size: 0.938rem;
    line-height: 1.6;
}

.job-detail-modal h2 {
    display: none;
}

.download-link-text {
    color: #424242;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.download-link-text:hover {
    color: #212121;
    text-decoration: underline;
}

.job-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.375rem;
    
}

.job-info-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
}

.job-info-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.813rem;
}

.job-info-value {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.job-link {
    color: var(--accent-red);
    text-decoration: none;
    word-break: break-all;
}

.job-link:hover {
    text-decoration: underline;
}

.download-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-red);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-left: 0.5rem;
}

.download-icon-link:hover {
    background-color: var(--bg-secondary);
    transform: translateY(-2px);
}

.download-icon-link svg {
    width: 24px;
    height: 24px;
}

.job-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.job-info-item.job-actions {
    justify-content: flex-end;
}

.job-info-item.job-actions .job-info-label {
    display: none;
}

.deadline-countdown {
    font-weight: 600;
    color: #424242;
}

.deadline-overdue {
    color: #d32f2f !important;
    font-weight: 600;
}

.deadline-warning {
    background-color: #ffebee;
    border: 1px solid #d32f2f;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.status-pending {
    background-color: #ff9800;
    color: white;
}

.status-in-progress {
    background-color: #2196f3;
    color: white;
}

.status-completed {
    background-color: #4caf50;
    color: white;
}

.status-payment-pending {
    background-color: #ffc107;
    color: #000;
}

.status-paid {
    background-color: #009688;
    color: white;
}

.status-no-job {
    background-color: var(--accent-gray);
    color: white;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.125rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.2px;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    user-select: none;
}

.btn-primary {
    background-color: var(--accent-red);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-red-dark);
}

.auth-box .btn-primary {
    background-color: #212121;
    color: white;
    width: 100%;
    padding: 0.75rem;
    font-size: 0.938rem;
    font-weight: 500;
}

.auth-box .btn-primary:hover {
    background-color: #424242;
}

.btn-secondary {
    background-color: var(--accent-gray);
    color: white;
}

.btn-secondary:hover {
    background-color: #616161;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-small {
    padding: 0.375rem 0.875rem;
    font-size: 0.813rem;
}

/* Badge và animation cho button Quản lý */
.manage-btn {
    position: relative;
}

.pending-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent-red);
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.manage-btn.has-pending {
    animation: pulse 2s infinite;
}

.manage-btn.shaking {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(3px);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(211, 47, 47, 0);
    }
}

.btn-danger {
    background-color: #d32f2f;
    color: white;
}

.btn-danger:hover {
    background-color: #b71c1c;
}

.btn-danger svg {
    display: inline-block;
    vertical-align: middle;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    margin: 1.25rem 0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.pagination button {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    position: relative;
    z-index: 11;
    pointer-events: auto;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.pagination button.active {
    background-color: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Jobs Summary */
.jobs-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.summary-item {
    background-color: var(--bg-primary);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.summary-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.813rem;
    margin-bottom: 0.375rem;
}

.summary-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.summary-value.unpaid {
    color: #ff9800;
}

.summary-value.paid {
    color: #4caf50;
}

/* Employees Table */
.employees-table {
    background-color: var(--bg-card);
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 1px 3px var(--shadow);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.employees-table table {
    width: 100%;
    border-collapse: collapse;
}

.employees-table th,
.employees-table td {
    padding: 0.625rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.employees-table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.813rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

/* Đảm bảo button refresh trong employees-table có thể click được */
.employees-table #refreshEmployeesBtn,
.employees-table #autoRefreshEmployees {
    position: relative;
    z-index: 1 !important; /* Giảm z-index để nằm dưới modal (z-index: 2000) */
    pointer-events: auto !important;
}

.employees-table #refreshEmployeesBtn * {
    pointer-events: none;
}

/* Khi modal đang active, ẩn hoàn toàn button và checkbox của employees-table */
.modal.active ~ * .employees-table #refreshEmployeesBtn,
.modal.active ~ * .employees-table #autoRefreshEmployees,
body:has(.modal.active) .employees-table #refreshEmployeesBtn,
body:has(.modal.active) .employees-table #autoRefreshEmployees,
.modal.active #refreshEmployeesBtn,
.modal.active ~ #refreshEmployeesBtn,
.modal.active #autoRefreshEmployees,
.modal.active ~ #autoRefreshEmployees {
    z-index: -1 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    display: none !important;
}

/* Đảm bảo employees-table không bị ảnh hưởng khi modal active */
#employeeJobsModal.active ~ * .employees-table #refreshEmployeesBtn,
#employeeJobsModal.active ~ * .employees-table #autoRefreshEmployees {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.employees-table tr:hover {
    background-color: var(--bg-secondary);
}

.avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.modal-content {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.modal-large {
    max-width: 1200px;
    width: 95%;
    max-width: min(1500px, 95vw);
    box-sizing: border-box;
}

/* Ticker Message Item */
.ticker-message-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ticker-message-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Backup Item */
.backup-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.backup-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.backup-item code {
    background-color: var(--bg-primary);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    color: var(--accent-red);
}

/* Settings Modal */
.settings-container {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    min-height: 400px;
}

.settings-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    padding-right: 1.5rem;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.settings-menu-item:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.settings-menu-item.active {
    background-color: var(--bg-secondary);
    color: var(--accent-red);
    font-weight: 600;
}

.settings-menu-item svg {
    flex-shrink: 0;
}

.settings-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    max-height: 70vh;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.settings-tab {
    display: none;
}

.settings-tab.active {
    display: block;
    animation: fadeInTab 0.3s ease;
}

.settings-tab h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--accent-red);
}

/* Form */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-of-type {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.2px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s ease;
    line-height: 1.5;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #424242;
    box-shadow: 0 0 0 2px rgba(33, 33, 33, 0.1);
}

/* Dark theme cho focus state */
.dark-theme .form-group input:focus,
.dark-theme .form-group select:focus,
.dark-theme .form-group textarea:focus {
    border-color: #616161;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #f5f5f5;
    color: #424242;
    border: 1px solid #e0e0e0;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.alert-success {
    background-color: #f5f5f5;
    color: #424242;
    border: 1px solid #e0e0e0;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    padding: 1.5rem;
    animation: fadeIn 0.5s ease-in;
}

.auth-box {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.5s ease-out;
}

.auth-box h1 {
    text-align: center;
    color: #212121;
    margin-bottom: 1.75rem;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-link a {
    color: #424242;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-link a:hover {
    color: #212121;
    text-decoration: underline;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* QR Code */
.qr-code-container {
    text-align: center;
    padding: 0.75rem 0.5rem;
    margin-top: 0.5rem;
}

.qr-code-container img {
    max-width: 200px;
    width: 200px;
    height: auto;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.payment-info {
    margin-top: 0.75rem;
    padding: 0.875rem;
    background-color: var(--bg-secondary);
    border-radius: 6px;
}

.payment-info p {
    margin: 0.375rem 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.payment-info p:first-child {
    margin-top: 0;
    font-size: 0.938rem;
}

.payment-amount {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent-red);
    margin-top: 0.5rem !important;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Chat Widget */
.chat-widget {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 60px;
    height: 60px;
    background-color: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    margin: 0 !important;
    padding: 0 !important;
}

.chat-widget:hover {
    background-color: var(--accent-red-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.5);
}

.chat-widget:active {
    transform: scale(0.95);
}

.chat-widget svg {
    color: white;
    width: 28px;
    height: 28px;
}

@media (max-width: 768px) {
    .chat-widget {
        width: 50px !important;
        height: 50px !important;
        bottom: 20px !important;
        right: 20px !important;
        top: auto !important;
        left: auto !important;
    }
    
    .chat-widget svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .chat-widget {
        width: 45px !important;
        height: 45px !important;
        bottom: 15px !important;
        right: 15px !important;
        top: auto !important;
        left: auto !important;
    }
    
    .chat-widget svg {
        width: 20px;
        height: 20px;
    }
}

/* Responsive */
@media (max-width: 1400px) {
    .container {
        padding: 0 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .main-header {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 1024px) {
    .admin-jobs-table th:nth-child(3),
    .admin-jobs-table td:nth-child(3),
    .admin-jobs-table th:nth-child(4),
    .admin-jobs-table td:nth-child(4) {
        display: none;
    }
    
    .employee-jobs-table th:nth-child(3),
    .employee-jobs-table td:nth-child(3),
    .employee-jobs-table th:nth-child(4),
    .employee-jobs-table td:nth-child(4),
    .employee-jobs-table th:nth-child(5),
    .employee-jobs-table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
        margin: 1rem auto;
    }
    
    .main-header {
        padding: 0.625rem 0.75rem;
    }
    
    .header-content {
        gap: 0.375rem;
        flex-wrap: wrap;
    }
    
    .header-left .app-title {
        font-size: 1.25rem;
    }
    
    .header-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .jobs-section {
        padding: 1rem;
    }
    
    .jobs-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .filter-group,
    .refresh-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .filter-group label,
    .refresh-group label {
        font-size: 0.813rem;
    }
    
    .job-card {
        flex-direction: column;
        padding: 0.875rem;
    }
    
    .job-thumb {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.25rem;
        margin: 1rem;
    }
    
    .modal-large {
        max-width: 100%;
        width: 98%;
    }
    
    /* Job Detail Modal - Mobile */
    .job-detail-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .job-detail-left {
        position: static;
    }
    
    .job-detail-title {
        font-size: 1.5rem;
    }
    
    .job-detail-image {
        min-height: 250px;
        max-height: 350px;
    }
    
    .job-detail-info {
        padding: 1.25rem;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .detail-label {
        min-width: auto;
        font-weight: 600;
    }
    
    .employee-avatar-section {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .employee-avatar {
        width: 60px;
        height: 60px;
    }
    
    .employee-avatar-section h2 {
        font-size: 1.25rem;
    }
    
    /* Ẩn các cột ít quan trọng trong table khi màn hình nhỏ */
    .admin-jobs-table th:nth-child(5),
    .admin-jobs-table td:nth-child(5),
    .admin-jobs-table th:nth-child(6),
    .admin-jobs-table td:nth-child(6) {
        display: none;
    }
    
    .employee-jobs-table th:nth-child(6),
    .employee-jobs-table td:nth-child(6),
    .employee-jobs-table th:nth-child(7),
    .employee-jobs-table td:nth-child(7) {
        display: none;
    }
    
    .admin-jobs-table,
    .employee-jobs-table {
        width: 100%;
        table-layout: auto;
    }
    
    .admin-jobs-table th,
    .admin-jobs-table td,
    .employee-jobs-table th,
    .employee-jobs-table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.75rem;
    }
    
    .admin-job-thumb,
    .employee-job-thumb {
        width: 50px;
        height: 50px;
    }
    
    .admin-job-title-cell,
    .employee-job-title-cell {
        min-width: 100px;
        max-width: 150px;
        font-size: 0.813rem;
    }
    
    .admin-job-date-cell,
    .admin-job-deadline-cell,
    .employee-job-date-cell,
    .employee-job-deadline-cell,
    .employee-job-countdown-cell {
        min-width: 90px;
        font-size: 0.688rem;
    }
    
    .admin-job-quantity-cell,
    .admin-job-price-cell,
    .employee-job-quantity-cell,
    .employee-job-price-cell {
        min-width: 60px;
    }
    
    .admin-job-total-cell,
    .employee-job-total-cell {
        min-width: 90px;
        font-size: 0.813rem;
    }
    
    .admin-job-result-link-cell {
        min-width: 50px;
    }
    
    .admin-job-status-cell,
    .employee-job-status-cell {
        min-width: 100px;
    }
    
    .admin-job-action-cell,
    .employee-job-action-cell {
        min-width: 90px;
    }
    
    .admin-job-download-cell,
    .employee-job-download-cell {
        min-width: 50px;
    }
    
    .btn-small {
        padding: 0.25rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .employees-table {
        padding: 0.75rem;
    }
    
    .employees-table th,
    .employees-table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.813rem;
    }
    
    .jobs-summary {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .summary-item {
        padding: 0.625rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
        margin: 0.75rem auto;
    }
    
    .main-header {
        padding: 0.5rem;
    }
    
    .header-left .app-title {
        font-size: 1rem;
    }
    
    .header-right {
        gap: 0.25rem;
    }
    
    .header-icon {
        padding: 0.3rem;
    }
    
    .jobs-section {
        padding: 0.75rem;
    }
    
    /* Ẩn thêm cột khi màn hình rất nhỏ */
    .admin-jobs-table th:nth-child(1),
    .admin-jobs-table td:nth-child(1),
    .admin-jobs-table th:nth-child(7),
    .admin-jobs-table td:nth-child(7) {
        display: none;
    }
    
    .employee-jobs-table th:nth-child(1),
    .employee-jobs-table td:nth-child(1),
    .employee-jobs-table th:nth-child(8),
    .employee-jobs-table td:nth-child(8),
    .employee-jobs-table th:nth-child(9),
    .employee-jobs-table td:nth-child(9) {
        display: none;
    }
    
    .admin-jobs-table,
    .employee-jobs-table {
        width: 100%;
        table-layout: auto;
    }
    
    .admin-jobs-table th,
    .admin-jobs-table td,
    .employee-jobs-table th,
    .employee-jobs-table td {
        padding: 0.375rem 0.25rem;
        font-size: 0.688rem;
    }
    
    .admin-job-title-cell,
    .employee-job-title-cell {
        min-width: 80px;
        max-width: 120px;
        font-size: 0.75rem;
    }
    
    .admin-job-date-cell,
    .admin-job-deadline-cell,
    .employee-job-date-cell,
    .employee-job-deadline-cell,
    .employee-job-countdown-cell {
        min-width: 70px;
        font-size: 0.625rem;
    }
    
    .admin-job-quantity-cell,
    .admin-job-price-cell,
    .employee-job-quantity-cell,
    .employee-job-price-cell {
        min-width: 50px;
        font-size: 0.688rem;
    }
    
    .admin-job-total-cell,
    .employee-job-total-cell {
        min-width: 80px;
        font-size: 0.75rem;
    }
    
    .admin-job-result-link-cell {
        min-width: 40px;
    }
    
    .admin-job-status-cell,
    .employee-job-status-cell {
        min-width: 80px;
    }
    
    .admin-job-action-cell,
    .employee-job-action-cell {
        min-width: 80px;
    }
    
    .btn-small {
        padding: 0.25rem 0.5rem;
        font-size: 0.688rem;
    }
    
    .modal-content {
        padding: 1rem;
        width: 98%;
        margin: 0.5rem;
    }
    
    .auth-box {
        padding: 1.5rem;
    }
}

/* ============================================
   MOBILE RESPONSIVE DESIGN - TỐI ƯU CHO THIẾT BỊ DI ĐỘNG
   ============================================ */

@media (max-width: 768px) {
    /* Container và Layout */
    .container {
        padding: 0.75rem;
        max-width: 100%;
    }
    
    /* Header - Mobile Optimized */
    .main-header {
        padding: 0.5rem 0.75rem;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .header-left .app-title {
        font-size: 1.25rem;
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .header-right {
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    
    .header-icon {
        padding: 0.35rem;
        width: 36px;
        height: 36px;
    }
    
    .header-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .header-icon-container {
        position: relative !important;
    }
    
    .notification-badge {
        top: -2px;
        right: -2px;
        width: 18px;
        height: 18px;
        font-size: 0.625rem;
        padding: 0.125rem;
    }
    
    /* Employee Header Section */
    .employee-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem 0;
        gap: 1rem;
    }
    
    .employee-avatar-section {
        flex-direction: column;
        align-items: center;
    }
    
    .employee-avatar {
        width: 80px;
        height: 80px;
        margin-bottom: 0.5rem;
    }
    
    .employee-avatar-section h2 {
        font-size: 1.25rem;
    }
    
    /* Ticker Wrapper - Mobile */
    .ticker-wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    #tickerContainer {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    /* Jobs Section - Mobile */
    .jobs-section {
        margin-top: 1rem;
    }
    
    .jobs-controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
    }
    
    .refresh-group {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Tables - Chuyển sang Card View trên Mobile */
    .employee-jobs-table-wrapper,
    .admin-jobs-table-wrapper {
        border: none;
        overflow: visible;
    }
    
    .employee-jobs-table,
    .admin-jobs-table {
        display: none;
    }
    
    /* Card View cho Jobs trên Mobile */
    .jobs-card-view {
        display: block;
        margin-top: 1rem;
        margin-bottom: 0;
    }
    
    /* Admin Job Card Mobile - Gọn gàng với expand/collapse */
    .admin-job-card-mobile {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 4px var(--shadow);
        cursor: pointer;
        transition: all 0.3s ease;
        overflow: visible;
        position: relative;
        z-index: 1;
        pointer-events: auto;
    }
    
    .admin-job-card-mobile.expanded {
        margin-bottom: 1rem;
        z-index: 2;
    }
    
    .admin-job-card-mobile:active {
        transform: scale(0.98);
    }
    
    .admin-job-card-main {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.875rem;
        position: relative;
        z-index: 1;
        pointer-events: auto;
        cursor: pointer;
    }
    
    .admin-job-card-thumb {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid var(--border-color);
        flex-shrink: 0;
    }
    
    .admin-job-card-info {
        flex: 1;
        min-width: 0;
    }
    
    .admin-job-card-title {
        font-size: 0.938rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.375rem;
        word-break: break-word;
        line-height: 1.4;
    }
    
    .admin-job-card-status {
        display: inline-block;
    }
    
    .admin-job-card-expand-icon {
        flex-shrink: 0;
        color: var(--text-secondary);
        transition: transform 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .admin-job-card-expand-icon svg {
        transition: transform 0.3s ease;
    }
    
    .admin-job-card-details {
        max-height: 0;
        opacity: 0;
        overflow: visible;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
        padding: 0 0.875rem;
    }
    
    .admin-job-card-mobile.expanded .admin-job-card-details {
        padding: 0.875rem;
        padding-bottom: 1.5rem;
        border-top: 1px solid var(--border-color);
        overflow: visible;
        max-height: 2000px; /* Đủ lớn để chứa tất cả nội dung */
    }
    
    .admin-job-card-detail-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .admin-job-card-detail-row:last-of-type {
        border-bottom: none;
    }
    
    .admin-job-card-detail-label {
        font-size: 0.813rem;
        color: var(--text-secondary);
        font-weight: 500;
        flex-shrink: 0;
        min-width: 100px;
    }
    
    .admin-job-card-detail-value {
        font-size: 0.875rem;
        color: var(--text-primary);
        font-weight: 500;
        text-align: right;
        flex: 1;
        word-break: break-word;
    }
    
    .admin-job-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.75rem;
        margin-bottom: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }
    
    .admin-job-card-actions .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        font-size: 0.813rem;
        padding: 0.5rem;
    }
    
    /* Employee Job Card Mobile - Gọn gàng với expand/collapse */
    .employee-job-card-mobile {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 4px var(--shadow);
        cursor: pointer;
        transition: all 0.3s ease;
        overflow: visible;
        position: relative;
        z-index: 1;
        pointer-events: auto;
    }
    
    .employee-job-card-mobile.expanded {
        margin-bottom: 1rem;
        z-index: 2;
    }
    
    .employee-job-card-mobile:active {
        transform: scale(0.98);
    }
    
    .employee-job-card-main {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.875rem;
        position: relative;
        z-index: 1;
        pointer-events: auto;
        cursor: pointer;
    }
    
    .employee-job-card-thumb {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid var(--border-color);
        flex-shrink: 0;
    }
    
    .employee-job-card-info {
        flex: 1;
        min-width: 0;
    }
    
    .employee-job-card-title {
        font-size: 0.938rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.375rem;
        word-break: break-word;
        line-height: 1.4;
    }
    
    .employee-job-card-status {
        display: inline-block;
    }
    
    .employee-job-card-expand-icon {
        flex-shrink: 0;
        color: var(--text-secondary);
        transition: transform 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .employee-job-card-expand-icon svg {
        transition: transform 0.3s ease;
    }
    
    .employee-job-card-details {
        max-height: 0;
        opacity: 0;
        overflow: visible;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
        padding: 0 0.875rem;
    }
    
    .employee-job-card-mobile.expanded .employee-job-card-details {
        padding: 0.875rem;
        padding-bottom: 1.5rem;
        border-top: 1px solid var(--border-color);
        overflow: visible;
        max-height: 2000px;
    }
    
    .employee-job-card-detail-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .employee-job-card-detail-row:last-of-type {
        border-bottom: none;
    }
    
    .employee-job-card-detail-label {
        font-size: 0.813rem;
        color: var(--text-secondary);
        font-weight: 500;
        flex-shrink: 0;
        min-width: 100px;
    }
    
    .employee-job-card-detail-value {
        font-size: 0.875rem;
        color: var(--text-primary);
        font-weight: 500;
        text-align: right;
        flex: 1;
        word-break: break-word;
    }
    
    .employee-job-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.75rem;
        margin-bottom: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }
    
    .employee-job-card-actions .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        font-size: 0.813rem;
        padding: 0.5rem;
    }
    
    .job-card {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 4px var(--shadow);
    }
    
    .job-card-header {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .job-card-thumb {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid var(--border-color);
        flex-shrink: 0;
    }
    
    .job-card-title-section {
        flex: 1;
        min-width: 0;
    }
    
    .job-card-title {
        font-size: 0.938rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
        word-break: break-word;
    }
    
    .job-card-status {
        display: inline-block;
        margin-top: 0.25rem;
    }
    
    .job-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .job-card-field {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .job-card-label {
        font-size: 0.75rem;
        color: var(--text-secondary);
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .job-card-value {
        font-size: 0.875rem;
        color: var(--text-primary);
        font-weight: 500;
    }
    
    .job-card-value.unpaid {
        color: var(--accent-red);
    }
    
    .job-card-value.paid {
        color: #4caf50;
    }
    
    .job-card-footer {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }
    
    .job-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .job-card-actions .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        font-size: 0.813rem;
        padding: 0.5rem;
    }
    
    /* Jobs Summary - Mobile */
    .jobs-summary {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .summary-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        border-radius: 6px;
        background: var(--bg-secondary);
    }
    
    .summary-label {
        font-size: 0.813rem;
        flex: 1;
    }
    
    .summary-value {
        font-size: 1rem;
        font-weight: 600;
        margin-left: 0.5rem;
    }
    
    /* Modals - Mobile Fullscreen */
    .modal {
        padding: 0;
        align-items: flex-start;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        padding: 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content.modal-large {
        max-width: 100%;
    }
    
    .modal .close {
        position: sticky;
        top: 30px;
        right: 0;
        background: var(--bg-card);
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1001;
        margin-bottom: 0.5rem;
        margin-left: auto;
    }
    
    /* Settings Modal - Mobile */
    .settings-container {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0;
        margin-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .settings-menu-item {
        flex-shrink: 0;
        padding: 0.75rem 1rem;
        white-space: nowrap;
        border-bottom: 2px solid transparent;
        margin-right: 0.5rem;
    }
    
    .settings-menu-item.active {
        border-bottom-color: var(--accent-red);
        background: transparent;
    }
    
    .settings-content {
        width: 100%;
    }
    
    /* Admin Employees Table - Mobile Card View */
    .employees-table-wrapper {
        overflow: visible;
    }
    
    #employeesTableContainer table {
        display: none !important;
    }
    
    #employeesTableContainer > #employeesTableContent {
        display: none !important;
    }
    
    .employees-table {
        display: none !important;
    }
    
    .employees-card-view {
        display: block !important;
        width: 100%;
    }
    
    /* Đảm bảo container vẫn hiển thị trên mobile */
    #employeesTableContainer {
        display: block !important;
        visibility: visible !important;
    }
    
    .employee-card {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 4px var(--shadow);
    }
    
    .employee-card-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .employee-card-avatar {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }
    
    .employee-card-info {
        flex: 1;
        min-width: 0;
    }
    
    .employee-card-name {
        font-size: 0.938rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
    }
    
    .employee-card-status {
        font-size: 0.75rem;
    }
    
    .employee-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .employee-card-field {
        font-size: 0.813rem;
    }
    
    .employee-card-label {
        color: var(--text-secondary);
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .employee-card-value {
        font-weight: 500;
        color: var(--text-primary);
    }
    
    .employee-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }
    
    .employee-card-actions .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        font-size: 0.813rem;
        padding: 0.5rem;
    }
    
    /* Forms - Mobile */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Tránh zoom trên iOS */
        padding: 0.75rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Buttons - Mobile */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px; /* Đảm bảo touch target đủ lớn */
        touch-action: manipulation;
    }
    
    .btn-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.813rem;
        min-height: 36px;
    }
    
    .btn-tiny {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        min-height: 32px;
    }
    
    /* Pagination - Mobile */
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        padding: 0.75rem 0.75rem 0.25rem;
        margin-bottom: 0;
        position: relative;
        z-index: 10;
        pointer-events: auto;
    }
    
    .admin-jobs-pagination {
        margin-top: 1rem;
        margin-bottom: 0;
        padding-top: 1rem;
        padding-bottom: 0;
    }
    
    .pagination button {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        position: relative;
        z-index: 11;
        pointer-events: auto;
    }
    
    /* Admin Jobs Filter - Mobile */
    .admin-jobs-filter {
        margin-bottom: 1rem;
    }
    
    .admin-jobs-filter label {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
    }
    
    .admin-jobs-filter select {
        width: 100%;
        font-size: 16px;
        padding: 0.75rem;
    }
    
    /* Jobs Summary Admin - Mobile */
    #adminJobsSummary {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    #bulkPaymentBtn {
        width: 100%;
        margin-top: 0.75rem;
        margin-bottom: 30px;
    }
    
    /* QR Code - Mobile */
    .qr-code-container {
        margin: 1rem 0;
    }
    
    .qr-code-container img {
        max-width: 100%;
        width: 100%;
        height: auto;
    }
    
    /* Chat Widget - Mobile */
    .chat-widget {
        width: 50px !important;
        height: 50px !important;
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .chat-widget svg {
        width: 24px;
        height: 24px;
    }
    
    /* Notification Panel - Mobile (tối ưu hóa) */
    .header-icon-container {
        position: relative !important;
    }
    
    .notification-panel {
        position: fixed !important;
        width: 90vw !important;
        max-width: 340px !important;
        left: 50% !important;
        right: auto !important;
        top: 60px !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
        border-radius: 12px !important;
        max-height: 70vh !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        z-index: 1001 !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
        background-color: var(--bg-card) !important;
        overflow: hidden !important;
        flex-direction: column !important;
    }
    
    .notification-panel.active {
        display: flex !important;
    }
    
    .notification-panel > div:first-child {
        flex-shrink: 0 !important;
    }
    
    .notification-panel #notificationList {
        max-height: calc(70vh - 80px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        touch-action: pan-y !important;
    }
    
    .notification-panel h3 {
        font-size: 0.813rem !important;
        padding: 0.75rem !important;
        font-weight: 600 !important;
    }
    
    .notification-panel #markAllReadBtn {
        font-size: 0.688rem !important;
        padding: 0.375rem 0.625rem !important;
        min-height: 32px !important;
        white-space: nowrap !important;
    }
    
    .notification-item {
        padding: 0.875rem 0.75rem !important;
        font-size: 0.813rem !important;
        line-height: 1.5 !important;
    }
    
    .notification-item:last-child {
        border-bottom: none !important;
    }
    
    /* Ticker Messages - Mobile */
    .ticker-message {
        font-size: 0.813rem;
        padding: 0.5rem;
    }
    
    /* Alert Messages - Mobile */
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }
}

/* Very Small Devices (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .main-header {
        padding: 0.5rem;
    }
    
    .header-left .app-title {
        font-size: 1.125rem;
    }
    
    /* Job Detail Modal - Small Mobile */
    .job-detail-title {
        font-size: 1.25rem;
    }
    
    .job-detail-image {
        min-height: 200px;
        max-height: 300px;
    }
    
    .job-detail-info {
        padding: 1rem;
        gap: 0.875rem;
    }
    
    .detail-row {
        gap: 0.375rem;
        font-size: 0.813rem;
    }
    
    .job-card-body,
    .employee-card-body {
        grid-template-columns: 1fr;
    }
    
    .job-card-actions .btn,
    .employee-card-actions .btn {
        min-width: 100%;
    }
    
    .summary-value {
        font-size: 0.938rem;
    }
    
    .modal-content {
        padding: 0.75rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 90vh;
    }
    
    .notification-panel {
        max-height: 70vh;
    }
}
