/* Đảm bảo select2 có chiều cao như input form-control */
.select2-container--default .select2-selection--single {
    height: 38px !important; /* chiều cao cho form-control tiêu chuẩn */
    padding: 4px 12px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 24px !important;
    font-size: 14px;
    padding-left: 0;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    right: 6px;
}

/* Style cho dropdown menu Select2 */
.select2-dropdown {
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.select2-search--dropdown {
    padding: 8px;
}
.select2-search--dropdown .select2-search__field {
    padding: 6px;
    border-radius: 4px;
}
.select2-results__option {
    padding: 0 8px !important;
    margin: 0 !important;
    color: #333 !important; /* Make text darker for better visibility */
}
.select2-results__option--highlighted[aria-selected] {
    background-color: #f8f9fa !important;
    color: #333 !important;
}

/* Thêm CSS cho loader */
.form-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(6px);
    border-radius: 0.375rem;
}

/* Dark mode support cho loader */
[data-bs-theme="dark"] .form-loader {
    background: rgba(33, 37, 41, 0.95);
}

.form-loader .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--bs-primary);
}

.form-loader .loading-text {
    margin-top: 1rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--bs-body-color);
    text-align: center;
}

/* Đảm bảo text hiển thị rõ trong cả light và dark mode */
[data-bs-theme="dark"] .form-loader .loading-text {
    color: #fff;
}

[data-bs-theme="light"] .form-loader .loading-text {
    color: #333;
}

.form-container {
    position: relative;
}

/* Custom giao diện cho quick-search-service */
.quick-service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 8px;
    font-size: 15px;
}
.quick-service-item .service-id {
    color: #007bff;
    font-weight: bold;
    margin-right: 8px;
    min-width: 60px;
    display: inline-block;
}
.quick-service-item .service-name {
    flex: 1;
    color: #222;
    font-weight: 500;
}
.quick-service-item .service-badges {
    margin-left: 8px;
}
.quick-service-item .service-price {
    color: #e53935;
    font-weight: bold;
    margin-left: 12px;
    min-width: 40px;
    text-align: right;
    display: inline-block;
}
.select2-results__option--highlighted[aria-selected] .quick-service-item {
    background: #f0f8ff;
}

/* CSS cho multi-order modal */
.multi-orders-list {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: white;
}

.multi-order-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.multi-order-item:last-child {
    border-bottom: none;
}

.multi-order-item.processing {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.multi-order-item.success {
    background-color: #d1e7dd;
    border-left: 4px solid #198754;
}

.multi-order-item.error {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

.multi-order-item.waiting {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.multi-order-link {
    font-weight: 500;
    color: #495057;
    text-decoration: none;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.multi-order-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.waiting {
    background-color: #e9ecef;
    color: #6c757d;
}

.status-badge.processing {
    background-color: #fff3cd;
    color: #664d03;
}

.status-badge.success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-badge.error {
    background-color: #f8d7da;
    color: #842029;
}

.order-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.multi-order-controls {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    margin: -15px -15px 0 -15px;
}

[data-bs-theme="dark"] .multi-orders-list {
    background: #2b3035;
    border-color: #495057;
}

[data-bs-theme="dark"] .multi-order-item {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .multi-order-item.waiting {
    background-color: #343a40;
}

[data-bs-theme="dark"] .multi-order-controls {
    background: #2b3035;
    border-top-color: #495057;
}

/* Styling cho multi-order pricing section */
.bg-gradient-light {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
}

[data-bs-theme="dark"] .bg-gradient-light {
    background: linear-gradient(135deg, #2b3035 0%, #343a40 100%);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-price-animation {
    transition: all 0.3s ease;
    animation: priceUpdate 0.5s ease-in-out;
}

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

.price-highlight {
    position: relative;
    overflow: hidden;
}

.price-highlight::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.price-highlight.animate::before {
    left: 100%;
}

/* Enhanced badge styling */
.badge.fs-6 {
    font-size: 0.9rem !important;
    font-weight: 600;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Enhanced card styling */
.card.border-0.shadow-sm {
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease;
}

.card.border-0.shadow-sm:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1) !important;
    transform: translateY(-1px);
}

/* Enhanced inner pricing card */
.border.rounded-3.p-3.bg-white.shadow-sm {
    border: 1px solid rgba(79, 70, 229, 0.1) !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.05) !important;
    transition: all 0.2s ease;
}

.border.rounded-3.p-3.bg-white.shadow-sm:hover {
    border-color: rgba(79, 70, 229, 0.2) !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1) !important;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .border.rounded-3.p-3.bg-white.shadow-sm {
    background-color: #2b3035 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .bg-light.bg-opacity-50 {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Select2 Dark Mode Styles */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single {
    background-color: #2b3035 !important;
    border: 1px solid #495057 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-container .select2-selection--single .select2-selection__rendered {
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-selection__rendered {
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #adb5bd transparent transparent transparent !important;
}

[data-bs-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #adb5bd transparent !important;
}

/* Select2 Dropdown Dark Mode */
[data-bs-theme="dark"] .select2-dropdown {
    background-color: #2b3035 !important;
    border: 1px solid #495057 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
}

[data-bs-theme="dark"] .select2-search--dropdown {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field {
    background-color: #343a40 !important;
    border: 1px solid #495057 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field::placeholder {
    color: #adb5bd !important;
}

/* Select2 Results Dark Mode */
[data-bs-theme="dark"] .select2-results {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .select2-results__option {
    background-color: #2b3035 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-results__option--highlighted[aria-selected] {
    background-color: #495057 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-results__option[aria-selected="true"] {
    background-color: #0d6efd !important;
    color: #fff !important;
}

/* Fix cho tất cả elements trong dropdown results */
[data-bs-theme="dark"] .select2-results__option,
[data-bs-theme="dark"] .select2-results__option * {
    background-color: #2b3035 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-results__option--highlighted,
[data-bs-theme="dark"] .select2-results__option--highlighted * {
    background-color: #495057 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-results__option[aria-selected="true"],
[data-bs-theme="dark"] .select2-results__option[aria-selected="true"] * {
    background-color: #0d6efd !important;
    color: #fff !important;
}

/* Override cho quick-service-item trong dropdown */
[data-bs-theme="dark"] .select2-results__option .quick-service-item {
    background-color: transparent !important;
}

[data-bs-theme="dark"] .select2-results__option--highlighted .quick-service-item {
    background-color: transparent !important;
}

/* Select2 Focus và Disabled States Dark Mode */
[data-bs-theme="dark"] .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

[data-bs-theme="dark"] .select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #343a40 !important;
    color: #6c757d !important;
    border-color: #495057 !important;
}

/* Select2 Quick Service Item Dark Mode */
[data-bs-theme="dark"] .quick-service-item .service-id {
    color: #86b7fe !important;
}

[data-bs-theme="dark"] .quick-service-item .service-name {
    color: #fff !important;
}

[data-bs-theme="dark"] .quick-service-item .service-price {
    color: #ff6b6b !important;
}

[data-bs-theme="dark"] .select2-results__option--highlighted[aria-selected] .quick-service-item {
    background: transparent !important;
}

/* Đảm bảo service item colors trong dropdown */
[data-bs-theme="dark"] .select2-results .quick-service-item .service-id {
    color: #86b7fe !important;
}

[data-bs-theme="dark"] .select2-results .quick-service-item .service-name {
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-results .quick-service-item .service-price {
    color: #ff6b6b !important;
}

/* Override mọi text color trong dropdown */
[data-bs-theme="dark"] .select2-dropdown .select2-results__option {
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-dropdown .select2-results__option * {
    color: inherit !important;
}

/* Select2 No Results Dark Mode */
[data-bs-theme="dark"] .select2-results__message {
    color: #adb5bd !important;
}

/* Select2 Loading Dark Mode */
[data-bs-theme="dark"] .select2-results__option[role="group"] {
    color: #adb5bd !important;
}

/* Select2 Clear Button Dark Mode */
[data-bs-theme="dark"] .select2-selection__clear {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .select2-selection__clear:hover {
    color: #fff !important;
}

/* Đảm bảo tất cả text trong select2 dark mode đều màu trắng */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default .select2-selection--single *,
[data-bs-theme="dark"] .select2-selection--single,
[data-bs-theme="dark"] .select2-selection--single * {
    color: #fff !important;
}

/* Riêng cho placeholder text */
[data-bs-theme="dark"] .select2-selection__placeholder {
    color: #adb5bd !important;
}

/* Override mọi CSS có thể ghi đè */
[data-bs-theme="dark"] span.select2-selection__rendered {
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-container span.select2-selection__rendered {
    color: #fff !important;
}









/* ==================== ORDER SYSTEM STYLES ==================== */

/* Service Option Styles */
.service-option-image {
    width: 25px;
    height: 25px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 8px;
}

.service-option-container {
    /* padding: 6px 12px; */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-option-content {
    flex-grow: 1;
}

.service-option-id {
    font-weight: bold;
    color: #0d6efd;
    margin-right: 8px;
    font-size: 13px;
}

.service-option-name {
    color: #333;
    font-size: 13px;
}

.service-option-price {
    margin-left: 12px;
    font-weight: bold;
    color: #dc3545;
    font-size: 13px;
    white-space: nowrap;
}

/* Service Badge Styles */
.service-badge-cancel,
.service-badge-warranty,
.service-badge-slowmode,
.service-badge-maintenance,
.service-badge-speed {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
    box-shadow: none;
}
.service-badge-cancel { color: #b42318; border: 1px solid #f3c2bd; background: #fff8f7; }
.service-badge-warranty { color: #067647; border: 1px solid #b7e4c7; background: #f6fbf8; }
.service-badge-slowmode { color: #b54708; border: 1px solid #f5d7a1; background: #fffaf3; }
.service-badge-maintenance { color: #b42318; border: 1px solid #f3c2bd; background: #fff8f7; }
.service-badge-speed { color: #0b6e99; border: 1px solid #b3e0f2; background: #f2fafd; }
.service-badge-cancel.simple,
.service-badge-warranty.simple,
.service-badge-slowmode.simple,
.service-badge-maintenance.simple,
.service-badge-speed.simple { margin-left: 4px; }
.service-badge-icon { font-size: 12px; line-height: 1; margin-right: 0; }

/* Service Description Card */
.service-description-card {
    border: 1px dashed #dee2e6;
    background-color: #f8f9fa;
}

/* Processing Warning Overlay */
.processing-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #ffc107 !important;
    animation: slideInRight 0.3s ease-out;
}

/* Modal Loading Overlay */
.modal-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-loading-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    margin: 20px;
}

.modal-loading-spinner {
    width: 3rem;
    height: 3rem;
}

/* Quick Service Item */
.quick-service-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-service-item .service-id {
    font-weight: bold;
    color: #0d6efd;
}

.quick-service-item .service-name {
    flex: 1;
    color: #333;
}

.quick-service-item .service-price {
    font-weight: bold;
    color: #dc3545;
    white-space: nowrap;
}

/* Multi Order Item */
.multi-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.multi-order-item.waiting {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.multi-order-item.processing {
    background: #fff3cd;
    border-color: #ffc107;
    animation: pulse 1.5s infinite;
}

.multi-order-item.success {
    background: #d1e7dd;
    border-color: #28a745;
}

.multi-order-item.error {
    background: #f8d7da;
    border-color: #dc3545;
}

.multi-order-link {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.status-badge.waiting {
    background: #e9ecef;
    color: #6c757d;
}

.status-badge.processing {
    background: #fff3cd;
    color: #856404;
}

.status-badge.success {
    background: #d1e7dd;
    color: #0f5132;
}

.status-badge.error {
    background: #f8d7da;
    color: #842029;
}

/* Order Spinner Animation */
.order-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #856404;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 4px;
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

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

/* Dark Mode Support */
[data-bs-theme="dark"] .service-option-name {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .service-description-card {
    border-color: #495057;
    background-color: #343a40;
}

[data-bs-theme="dark"] .modal-loading-content {
    background: #343a40;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .processing-warning {
    background: #343a40;
    border-left-color: #ffc107 !important;
}

[data-bs-theme="dark"] .quick-service-item .service-name {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .multi-order-item {
    border-color: #495057;
}

[data-bs-theme="dark"] .multi-order-item.waiting {
    background: #343a40;
    border-color: #495057;
}

[data-bs-theme="dark"] .multi-order-item.processing {
    background: #3d3629;
    border-color: #664d03;
}

[data-bs-theme="dark"] .multi-order-item.success {
    background: #262e24;
    border-color: #155724;
}

[data-bs-theme="dark"] .multi-order-item.error {
    background: #3d2426;
    border-color: #721c24;
}

[data-bs-theme="dark"] .status-badge.waiting {
    background: #495057;
    color: #adb5bd;
}

[data-bs-theme="dark"] .status-badge.processing {
    background: #3d3629;
    color: #ffda6a;
}

[data-bs-theme="dark"] .status-badge.success {
    background: #262e24;
    color: #75b798;
}

[data-bs-theme="dark"] .status-badge.error {
    background: #3d2426;
    color: #ea868f;
}

/* Service Loading Progress Styles */
#service-loading-progress {
    background: rgba(13, 110, 253, 0.05);
    border: 1px solid rgba(13, 110, 253, 0.15);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
    animation: fadeInUp 0.3s ease-out;
}

#service-loading-progress .progress {
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 0.25rem;
    overflow: hidden;
}

#service-loading-progress .progress-bar {
    background: linear-gradient(90deg, #0d6efd, #198754);
    transition: width 0.3s ease;
    border-radius: 0.25rem;
    position: relative;
    overflow: hidden;
}

#service-loading-progress .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

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

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

/* Lazy Loading Indicators */
.service-loading-placeholder {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(108, 117, 125, 0.05);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.service-loading-placeholder::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #dee2e6;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

.service-loading-placeholder::after {
    content: 'Đang tải dịch vụ...';
    color: #6c757d;
    font-size: 0.875rem;
}

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

/* Service Dropdown Optimizations */
#service option:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Loading States */
.form-loader {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

/* Cache Status Indicator */
.cache-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
    border: 1px solid rgba(25, 135, 84, 0.2);
}

.cache-status.loading {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.2);
}

.cache-status.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.2);
}

/* Service Count Badge */
.service-count-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    background: linear-gradient(135deg, #0d6efd, #198754);
    color: white;
    margin-left: 0.5rem;
}

/* Performance Optimizations */
.select2-results__option--disabled {
    display: none !important;
}

.select2-dropdown {
    border: 1px solid rgba(13, 110, 253, 0.25);
    box-shadow: 0 0.5rem 1rem rgba(13, 110, 253, 0.15);
}

.select2-results__option--highlighted {
    background-color: rgba(13, 110, 253, 0.1) !important;
    color: #0d6efd !important;
}

/* Chunk Loading Animation */
.chunk-loading {
    position: relative;
    overflow: hidden;
}

.chunk-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.1), transparent);
    animation: slideIn 1s infinite;
}

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

/* AI Modal Loading Overlay */
.ai-modal-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    border-radius: inherit;
}

.ai-modal-loading-overlay .spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

/* Modern Spinner Animation */
.ai-spinner {
    width: 80px;
    height: 80px;
    position: relative;
    animation: rotate 2s linear infinite;
}

.ai-spinner .circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.ai-spinner .circle-1 {
    border: 4px solid transparent;
    border-top-color: #667eea;
    animation: spin 1.5s ease-in-out infinite;
}

.ai-spinner .circle-2 {
    border: 4px solid transparent;
    border-right-color: #764ba2;
    animation: spin 2s ease-in-out infinite;
    animation-delay: 0.5s;
}

.ai-spinner .circle-3 {
    border: 4px solid transparent;
    border-bottom-color: #f093fb;
    animation: spin 1.8s ease-in-out infinite;
    animation-delay: 0.25s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Robot Icon Animation */
.ai-modal-loading-overlay .robot-icon {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
    animation: robotBounce 1s ease-in-out infinite;
}

@keyframes robotBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.1);
    }
}

.ai-modal-loading-overlay .loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.ai-modal-loading-overlay .loading-subtext {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    max-width: 250px;
}

/* Dots Animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Modal Body Blur When Loading */
#aiCommentModal.loading .modal-body form {
    filter: blur(2px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

#aiCommentModal.loading .modal-footer {
    pointer-events: none;
    opacity: 0.5;
}

/* ==================== DARK MODE STYLES ==================== */
[data-bs-theme="dark"] .ai-modal-loading-overlay {
    background: rgba(30, 30, 30, 0.95);
}

[data-bs-theme="dark"] .ai-modal-loading-overlay .loading-text {
    color: #e9ecef;
}

[data-bs-theme="dark"] .ai-modal-loading-overlay .loading-subtext {
    color: #adb5bd;
}

[data-bs-theme="dark"] .ai-modal-loading-overlay .robot-icon {
    color: #8b9ff7;
}

[data-bs-theme="dark"] .ai-spinner .circle-1 {
    border-top-color: #8b9ff7;
}

[data-bs-theme="dark"] .ai-spinner .circle-2 {
    border-right-color: #9f7aea;
}

[data-bs-theme="dark"] .ai-spinner .circle-3 {
    border-bottom-color: #f5a3ff;
}
/* Platform note card */
.platform-note-body {
    max-height: 220px;
    overflow-y: auto;
    line-height: 1.5;
    word-break: break-word;
}
.platform-note-body img {
    max-width: 100%;
    height: auto;
}
.platform-note-body p:last-child {
    margin-bottom: 0;
}

/* Order page — service radio list (compact, cân đối) */
.order-service-radio-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    padding: 2px;
}
.order-service-radio-item {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
    border: 1px solid #dbe7f3;
    border-radius: 7px;
    background: #fff;
    transition: border-color .15s ease, background-color .15s ease;
}
.order-service-radio-item:hover {
    border-color: #90cdf4;
}
.order-service-radio-item.is-selected {
    border-color: #63b3ed;
    background: #ebf8ff;
    box-shadow: none;
}
.order-service-radio-item.is-maintenance {
    opacity: 0.75;
    cursor: not-allowed;
    border-color: #fecaca;
    background: #fff5f5;
}
.order-service-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.order-service-radio-body {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
}
.order-service-radio-check {
    width: 14px;
    height: 14px;
    border: 2px solid #a0aec0;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    position: relative;
    transition: all .15s ease;
}
.order-service-radio-check::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3182ce;
    transform: scale(0);
    transition: transform .15s ease;
}
.order-service-radio-item.is-selected .order-service-radio-check {
    border-color: #3182ce;
    box-shadow: none;
}
.order-service-radio-item.is-selected .order-service-radio-check::after {
    transform: scale(1);
}
.order-service-radio-main {
    min-width: 0;
    flex: 1;
}
.order-service-radio-title {
    font-size: 12.5px;
    font-weight: 500;
    margin: 0;
    line-height: 1.35;
    color: #2d3748;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    min-width: 0;
}
.order-service-id-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    background: #edf2f7;
    color: #553c9a;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.order-service-name-text {
    color: #2d3748;
    font-weight: 500;
    font-size: 12.5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.order-service-sep {
    color: #718096;
    font-weight: 500;
    flex-shrink: 0;
    white-space: pre;
}
.order-service-radio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
    margin-top: 3px;
}
.order-service-radio-meta .badge {
    font-size: 10px;
    padding: 1px 6px;
}
.order-service-radio-price {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: #3182ce;
    white-space: nowrap;
    padding: 0;
    border-radius: 0;
    background: transparent;
}
[data-bs-theme="dark"] .order-service-radio-item {
    background: #1a202c;
    border-color: #2c5282;
}
[data-bs-theme="dark"] .order-service-radio-item.is-selected {
    background: rgba(49, 130, 206, 0.15);
    border-color: #3182ce;
}
[data-bs-theme="dark"] .order-service-radio-title,
[data-bs-theme="dark"] .order-service-name-text {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .order-service-id-badge {
    background: #2d3748;
    color: #c4b5fd;
}
[data-bs-theme="dark"] .order-service-radio-check {
    background: #1a202c;
    border-color: #63b3ed;
}
[data-bs-theme="dark"] .order-service-radio-item.is-maintenance {
    background: rgba(220, 53, 69, 0.1);
}

/* Order page — server + emotion picker */
.order-server-heading {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
    color: #2d3748;
}
.order-server-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.order-server-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #dbe7f3;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    transition: all .15s ease;
}
.order-server-card:hover {
    border-color: #90cdf4;
}
.order-server-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.order-server-radio {
    width: 14px;
    height: 14px;
    border: 2px solid #a0aec0;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    background: #fff;
}
.order-server-radio::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: #3182ce;
    transform: scale(0);
    transition: transform .15s ease;
}
.order-server-card.is-selected {
    border-color: #63b3ed;
    background: #ebf8ff;
    box-shadow: none;
}
.order-server-card.is-selected .order-server-radio {
    border-color: #3182ce;
}
.order-server-card.is-selected .order-server-radio::after {
    transform: scale(1);
}
.order-server-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.order-server-title {
    font-weight: 500;
    font-size: 12.5px;
    line-height: 1.35;
    color: #2d3748;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    min-width: 0;
}
.order-server-sub {
    font-size: 11px;
    color: #718096;
}
.order-server-price {
    flex-shrink: 0;
    background: transparent;
    color: #3182ce;
    border-radius: 0;
    padding: 0;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}
.order-emotion-section {
    margin-top: 6px;
}
.order-reaction-picker {
    display: block;
    padding: 2px 0 2px;
}
.order-reaction-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.order-reaction-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform .15s ease, box-shadow .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.order-reaction-btn:hover:not(:disabled) {
    transform: scale(1.12);
}
.order-reaction-btn.is-selected {
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.55), 0 0 10px rgba(24, 119, 242, 0.35);
    transform: scale(1.08);
}
.order-reaction-btn.is-maintenance,
.order-reaction-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.order-reaction-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
.order-reaction-emoji {
    font-size: 30px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.08));
}

/* Mobile — service / server / emotion */
@media (max-width: 767.98px) {
    .order-server-heading {
        font-size: 13px;
        margin-bottom: 8px;
    }
    .order-server-list,
    .order-service-radio-list {
        gap: 8px;
    }
    .order-service-radio-list {
        max-height: min(48vh, 360px);
        padding: 0 1px 4px;
        -webkit-overflow-scrolling: touch;
    }
    .order-server-card {
        align-items: flex-start;
        gap: 10px;
        padding: 11px 12px;
        border-radius: 10px;
        -webkit-tap-highlight-color: transparent;
    }
    .order-server-radio {
        width: 18px;
        height: 18px;
        margin-top: 2px;
    }
    .order-server-radio::after {
        inset: 3px;
    }
    .order-server-title,
    .order-service-radio-title {
        display: block;
        font-size: 13px;
        line-height: 1.45;
        word-break: break-word;
    }
    .order-service-id-badge {
        display: inline;
        padding: 1px 5px;
        font-size: 11px;
        vertical-align: baseline;
    }
    .order-service-sep {
        display: inline;
    }
    .order-service-name-text {
        display: inline;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: 13px;
        word-break: break-word;
    }
    .order-server-price,
    .order-service-radio-price {
        align-self: flex-start;
        font-size: 13px;
        line-height: 1.45;
        padding-top: 1px;
    }
    .order-service-radio-body {
        align-items: flex-start;
        gap: 10px;
        padding: 11px 12px;
    }
    .order-service-radio-item {
        border-radius: 10px;
        -webkit-tap-highlight-color: transparent;
    }
    .order-service-radio-check {
        width: 18px;
        height: 18px;
        margin-top: 2px;
    }
    .order-service-radio-check::after {
        width: 8px;
        height: 8px;
    }
    .order-service-radio-meta {
        margin-top: 6px;
        gap: 4px;
    }
    .order-service-radio-meta .badge {
        font-size: 10px;
        padding: 3px 7px;
    }
    .order-emotion-section {
        margin-top: 10px;
    }
    .order-reaction-list {
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding: 6px 4px 10px;
        margin: 0 -4px;
        scrollbar-width: none;
    }
    .order-reaction-list::-webkit-scrollbar {
        display: none;
    }
    .order-reaction-btn {
        width: 46px;
        height: 46px;
        flex-shrink: 0;
        scroll-snap-align: start;
    }
    .order-reaction-img {
        width: 38px;
        height: 38px;
    }
    .order-reaction-emoji {
        font-size: 28px;
    }
    .order-reaction-btn.is-selected {
        box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.55), 0 0 8px rgba(24, 119, 242, 0.3);
        transform: scale(1.06);
    }
}

@media (max-width: 399.98px) {
    .order-server-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "radio main"
            ". price";
        column-gap: 10px;
        row-gap: 4px;
    }
    .order-server-radio {
        grid-area: radio;
    }
    .order-server-main {
        grid-area: main;
    }
    .order-server-price {
        grid-area: price;
        justify-self: start;
        padding-top: 0;
    }
    .order-service-radio-body {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "check main"
            ". price";
        column-gap: 10px;
        row-gap: 4px;
    }
    .order-service-radio-check {
        grid-area: check;
    }
    .order-service-radio-main {
        grid-area: main;
    }
    .order-service-radio-price {
        grid-area: price;
        margin-left: 0;
        justify-self: start;
        padding-top: 0;
    }
    .order-reaction-btn {
        width: 42px;
        height: 42px;
    }
    .order-reaction-img {
        width: 34px;
        height: 34px;
    }
}

