/* ==========================================================================
   1. NHÚNG FONT INTER TỪ GOOGLE FONTS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   2. KHAI BÁO BIẾN TOÀN CỤC (DESIGN TOKENS)
   ========================================================================== */
:root {
    /* Font chữ mặc định */
    /* Khai báo Inter và dàn Backup xịn xò nhất hiện nay */
    --font-primary: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Hệ thống Kích thước (Quy đổi: 1rem = 16px) */
    --text-xs: 0.75rem;    /* 12px - Dùng cho tag, huy hiệu */
    --text-sm: 0.875rem;   /* 14px - Dùng cho ghi chú, menu phụ */
    --text-base: 1rem;     /* 16px - Chữ nội dung chuẩn */
    --text-lg: 1.125rem;   /* 18px - Tiêu đề khối (Card) */
    --text-xl: 1.25rem;    /* 20px - Tiêu đề phụ */
    --text-2xl: 1.5rem;    /* 24px - Tiêu đề trang */

    /* Hệ thống Độ đậm */
    --font-regular: 400;   /* Chữ thường */
    --font-medium: 500;    /* Chữ nút bấm, menu */
    --font-semibold: 600;  /* Tiêu đề */
    --font-bold: 700;      /* Nhấn mạnh tuyệt đối */

    /* Hệ thống Màu sắc (Xám lạnh, hiện đại) */
    --text-main: #111827;  /* Xám cực đậm - Đọc không mỏi mắt */
    --text-muted: #6B7280; /* Xám trung tính - Cho thông tin phụ */
    --bg-body: #F3F4F6;    /* Nền trang xám nhạt */
    --border-color: #E5E7EB; /* Màu viền */
    --primary-color: #2563EB; /* Xanh dương chủ đạo cho Logistics */
}
/* ============================================================
   1. RESET & LAYOUT CHUẨN (DÙNG FONT INTER)
   ============================================================ */
body { 
    margin: 0; 
    padding: 0; 
    /* Dùng biến font-primary bạn đã khai báo */
    font-family: var(--font-primary); 
    font-size: var(--text-base);
    background: var(--bg-body); 
    color: var(--text-main); 
    overflow: hidden; 
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* ============================================================
   2. SIDEBAR (FONT INTER + MODERN LOOK)
   ============================================================ */
.sidebar { 
    width: 250px; 
    background: #1f2937; /* Đổi sang màu xám đậm cùng tone với Inter */
    color: #f9fafb; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    flex-shrink: 0; 
    position: fixed; 
    top: 0; left: 0; z-index: 1001; 
    box-shadow: 2px 0 10px rgba(0,0,0,0.1); 
}

.sidebar-brand { 
    height: 60px; 
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-lg); /* 18px */
    font-weight: var(--font-bold); /* 700 */
    background: #111827; 
    border-bottom: 1px solid #374151;
}

.sidebar-menu li a { 
    display: flex; align-items: center; padding: 12px 20px; 
    color: #d1d5db; text-decoration: none; 
    font-size: var(--text-sm); /* 14px cho menu là chuẩn nhất */
    font-weight: var(--font-medium); /* 500 */
    transition: 0.2s; 
}
.sidebar-menu li a:hover { background: #374151; color: #fff; }
.sidebar-menu li a.active { 
    background: var(--primary-color); 
    color: #fff; 
    font-weight: var(--font-semibold); 
}

/* ============================================================
   3. TOP HEADER
   ============================================================ */
.top-header {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: fixed; top: 0; left: 250px; right: 0; z-index: 1000;
}

.header-page-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-muted);
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

/* ============================================================
   4. MAIN WRAPPER & TRANG ĐIỀU PHỐI (NO-SIDEBAR)
   ============================================================ */
.main-wrapper { 
    flex: 1; 
    margin-left: 250px; 
    margin-top: 60px; 
    height: calc(100vh - 60px); 
    overflow-y: auto; 
    padding: 24px;
    box-sizing: border-box;
}

/* Khi không có Sidebar (Trang điều phối) */
.no-sidebar .sidebar { display: none !important; }
.no-sidebar .top-header { left: 0 !important; width: 100% !important; }
.no-sidebar .main-wrapper { 
    margin-left: 0 !important; 
    width: 100% !important; 
    padding: 0; /* Thường trang điều phối sẽ tràn viền */
}
/* ==========================================================================
   3. RESET VÀ THIẾT LẬP NỀN TẢNG (BASE)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
/*  ÉP FONT CHO NÚT BẤM VÀ FORM */
button, input, select, textarea {
    font-family: inherit; /* Bắt buộc kế thừa font từ thẻ cha (body) */
    font-size: inherit;   /* Kế thừa luôn cả kích thước cho đồng bộ */
}
body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.5;
    
    /* Bí quyết giúp font Inter sắc nét, "mượt" như ứng dụng Mac/iOS */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   4. THIẾT LẬP TIÊU ĐỀ (TYPOGRAPHY HIERARCHY)
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.02em; /* Ép chữ lại một xíu cho gọn gàng */
    margin-bottom: 0.5em;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

/* ==========================================================================
   5. CÁC LỚP TIỆN ÍCH (UTILITY CLASSES) ĐỂ DÙNG NHANH
   ========================================================================== */
.text-muted { color: var(--text-muted); }
.text-small { font-size: var(--text-sm); }
.font-medium { font-weight: var(--font-medium); }
/* ==========================================================================
   6. BẢNG DỮ LIỆU HIỆN ĐẠI (DATA TABLES)
   ========================================================================== */
.table-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden; /* Giúp bo góc cho cả bảng */
    border: 1px solid var(--border-color);
    margin-top: 15px;
}

.table {
    width: 100%;
    border-collapse: collapse; !important;
    text-align: left;
}

/* Tiêu đề cột */
.table th {
    background-color: var(--bg-body);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Ô dữ liệu */
.table td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: none !important;
    font-size: var(--text-base);
    color: var(--text-main);
    transition: background-color 0.2s ease;
}
/* Kẻ MỘT đường viền duy nhất cho cả HÀNG (Row) */
.table tr {
    border-bottom: 1px solid var(--border-color);
}
.table tr:last-child {
    border-bottom: none;
}
/* Ẩn viền của hàng cuối cùng */
.table tbody tr:last-child td {
    border-bottom: none;
}

/* Màu nền xen kẽ (Zebra striping) cho dễ dò dòng */
.table tbody tr:nth-child(even) {
    background-color: #FAFAFA;
}

/* Hiệu ứng HOVER: Dòng sẽ sáng lên khi di chuột qua */
.table tbody tr:hover td {
    background-color: #F3F4F6; /* Xám siêu nhạt */
}

/* ==========================================================================
   7. CÁC COMPONENT BÊN TRONG BẢNG (TIỆN ÍCH)
   ========================================================================== */
/* Tên/Mã xe nổi bật */
.main-code {
    color: var(--primary-color);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    display: block;
    margin-bottom: 0px;
}

/* Nhãn cảnh báo (Badge) */
.badge-warning {
    color: #B45309; /* Cam đậm */
    background-color: #FEF3C7; /* Vàng nhạt */
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 3px 8px;
    border-radius: 9999px; /* Tròn xoe như viên thuốc */
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* Nhóm liên hệ nhanh (Call/Zalo) */
.quick-contact-group {
    display: flex;
    gap: 8px;
    margin-top: 0px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
}

.contact-btn:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.call-btn { background-color: #10B981; } /* Xanh lá */
.zalo-btn { background-color: #0068FF; } /* Xanh Zalo */

/* Select Box chọn Trạng thái */
.status-picker {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    outline: none;
    background-color: white;
    transition: all 0.2s;
	line-height: normal; /* Thêm dòng này để nhả không gian cho dấu tiếng Việt */
}

.status-picker:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Nút bấm thao tác (Action Button) */
.btn-action {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: background-color 0.2s, transform 0.1s;
}

.btn-action:hover {
    background-color: #1D4ED8; /* Xanh đậm hơn */
}
.btn-action:active {
    transform: translateY(1px);
}
/* ==========================================================================
   8. HỆ THỐNG NÚT BẤM (BUTTON SYSTEM)
   ========================================================================== */
/* Nền tảng chung cho mọi nút bấm */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Khoảng cách giữa icon và chữ */
    padding: 8px 16px;
    border-radius: 8px; /* Bo góc hiện đại 8px */
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    outline: none;
    text-decoration: none;
}

/* Nút hành động chính (Ví dụ: Nút GÁN đơn, XÁC NHẬN) */
.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.15);
}
.btn-primary:hover {
    background-color: #1D4ED8; /* Đậm hơn khi hover */
    transform: translateY(-1px); /* Hơi nảy lên */
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

/* Nút phụ / Viền xám (Ví dụ: Hủy, Đóng, Chỉnh sửa) */
.btn-outline {
    background-color: #ffffff;
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn-outline:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
}

/* Nút "Tải thêm" (Rộng 100%, viền đứt quãng nhìn tinh tế) */
.btn-load-more {
    width: 100%;
    padding: 12px;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px dashed #D1D5DB;
    border-radius: 8px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: all 0.3s;
}
.btn-load-more:hover {
    background-color: #F3F4F6;
    color: var(--text-main);
    border-color: #9CA3AF;
}
/* Nút bấm cỡ nhỏ (Dành riêng cho Table hoặc không gian hẹp) */
.btn-sm {
    padding: 5px 10px;        /* Ép nhỏ khoảng cách trên dưới và 2 bên */
    font-size: 12px !important; /* Hạ size chữ xuống để vừa vặn với bảng */
    border-radius: 6px;       /* Bo góc nhỏ hơn một chút cho cân đối */
    gap: 5px;                 /* Khoảng cách giữa icon và chữ ngắn lại */
    height: 30px;             /* Cố định chiều cao tránh làm phình hàng (row) */
}

/* Hiệu ứng nhấp nháy/nhấn mạnh nhẹ cho nút Gán (Tùy chọn cho sinh động) */
.btn-pulse {
    animation: pulse-soft 2s infinite;
}

@keyframes pulse-soft {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
/* Nút bấm tràn viền (Dành cho các nút ở dưới cùng của Form hoặc Card) */
.btn-block {
    width: 200px;
    padding: 12px 20px; /* To hơn nút thường một chút để dễ bấm */
    font-size: var(--text-base); /* Size 16px chuẩn */
    justify-content: center; /* Đảm bảo chữ và icon luôn ở giữa */
	margin-left:auto;
	margin-right: auto; 
}

/* Nút Khẩn cấp / Ưu tiên (Màu Vàng Cam hiện đại thay vì xanh lá cũ) */
.btn-urgent {
    background-color: #1976d2; /* Amber 500 của Tailwind */
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.25);
}
.btn-urgent:hover {
    background-color: #D97706; /* Amber 600 */
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
}
/* ==========================================================================
   9. GIAO DIỆN POPUP THÔNG BÁO (TOAST/UNDO)
   ========================================================================== */
.toast-container {
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    background: #1F2937; /* Xám đen sang trọng */
    color: #ffffff; 
    padding: 16px 24px; 
    border-radius: 12px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex; 
    align-items: center; 
    gap: 20px; 
    z-index: 10000;
    border-left: 4px solid #10B981; /* Vạch xanh báo thành công */
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-btn-undo {
    background: rgba(255, 255, 255, 0.1);
    color: #FBBF24; /* Vàng hổ phách */
    padding: 6px 14px; 
    border-radius: 6px; 
    text-decoration: none; 
    font-size: var(--text-sm); 
    font-weight: var(--font-semibold);
    transition: all 0.2s;
}
.toast-btn-undo:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FCD34D;
}

@keyframes slideInUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
/* 1. Ép bảng phải dính chặt các đường kẻ vào nhau (Khắc phục lỗi đứt gãy dòng kẻ) */
.table {
    width: 100%;
    border-collapse: collapse !important; /* Thêm !important để ghi đè các CSS cũ */
    border-spacing: 0;
}

/* 2. Triệt tiêu mọi margin tàng hình của form/chữ bên trong ô */
.table td form, 
.table td p {
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. Căn giữa tuyệt đối cho Select box Trạng thái */
.status-picker {
    margin: 0 !important;
    display: inline-block;
    vertical-align: middle; /* Ép nó nằm giữa dòng kẻ */
    /* Giữ nguyên các thuộc tính padding, border cũ của bạn ở đây... */
}

/* Đảm bảo tất cả các cột đều gióng hàng ở giữa */
.table td {
    vertical-align: middle !important; 
}
/* ==========================================================================
   10. COMPONENT ĐƠN HÀNG (ORDER CARDS & BADGES)
   ========================================================================== */
/* Mã đơn hàng (Tạo background xám nhẹ như các app hiện đại) */
.order-code {
    font-family: var(--font-primary);
    color: var(--text-main);
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    background-color: #F3F4F6;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

/* Khối hiển thị Điểm lấy - Điểm giao */
.route-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.route-point {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.4;
}

/* Cố định icon để chữ thẳng hàng nhau */
.route-point i {
    width: 16px;
    text-align: center;
    margin-top: 3px;
}
.point-start i { color: #3B82F6; } /* Điểm lấy: Xanh dương */
.point-end i { color: #10B981; }   /* Điểm giao: Xanh lá */

/* ==========================================================================
   11. HỆ THỐNG NHÃN TRẠNG THÁI (STATUS BADGES)
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px; /* Bo tròn hoàn toàn */
    font-size: 0.7rem;
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Chờ xử lý / Đang tìm xe */
.badge-pending {
    background-color: #FEF3C7;
    color: #D97706; /* Tone Vàng Cam */
}

/* Đang vận chuyển */
.badge-shipping {
    background-color: #DBEAFE;
    color: #1D4ED8; /* Tone Xanh Dương */
}

/* Hoàn thành */
.badge-completed {
    background-color: #D1FAE5;
    color: #047857; /* Tone Xanh Lá */
}

/* Hủy / Lỗi */
.badge-canceled {
    background-color: #FEE2E2;
    color: #B91C1C; /* Tone Đỏ */
}

/* bên dưới là các CSS cũ - bên trên là css tối ưu V1 -> Gmn
/* =========================================
   1. TỔNG THỂ & BẢNG (Layout & Table)
   ========================================= */

h1 { color: #263238; border-bottom: 2px solid #cfd8dc; padding-bottom: 10px; }

.card { background: #f9f9f9; padding: 20px; margin-bottom: 10px;  border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.card h2 { margin-top: 0; font-size: 1.2rem; color: #546e7a; text-transform: uppercase; letter-spacing: 1px; }



/* =========================================
   2. TRẠNG THÁI & SELECTOR (Status & Pickers)
   ========================================= */
.badge { padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }

/* Màu cho Badge tĩnh */
.status-available { background: #e8f5e9; color: #2e7d32; }
.status-running { background: #fffde7; color: #f9a825; }
.status-issue { background: #ffebee; color: #c62828; }

/* Style cho Dropdown Select */
select.status-picker {
    width: 120px; padding: 5px 3px; font-size: 0.85rem; font-weight: 600;
    border-radius: 4px; border: 1px solid rgba(0,0,0,0.1); cursor: pointer;
    text-align: left; text-align-last: left; transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
select.status-picker:hover { filter: brightness(0.95); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }

/* Màu sắc ưu tiên cho Select Option */
select.status-available { background-color: #3FDA9E !important; color: #fafafa !important; }
select.status-running   { background-color: #FFCE6A !important; color: #fafafa !important; }
select.status-issue     { background-color: #FF9494 !important; color: #fafafa !important; }

/* =========================================
   3. TOOLTIP & MÃ XE (Vehicle Code & Tooltip)
   ========================================= */
.v-code-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: help;
    color: #1976d2;
}

.v-tooltip {
    visibility: hidden; opacity: 0;
    position: absolute; bottom: 145%; left: -10px;
    width: 240px; padding: 12px;
    background: #ffffff; color: #333; /* Chuyển sang nền sáng để chuyên nghiệp hơn */
    border-radius: 6px; border: 1px solid #ddd;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 9999; text-align: left; font-size: 0.8rem; line-height: 1.5;
    transition: all 0.2s ease; pointer-events: auto;
}

/* Mũi tên Tooltip */
.v-tooltip::after {
    content: ""; position: absolute; top: 100%; left: 30px;
    border-width: 6px; border-style: solid;
    border-color: #fff transparent transparent transparent;
}
/* CLASS ĐẶC BIỆT CHO XE ĐẦU TIÊN (XỔ XUỐNG DƯỚI) */
.v-tooltip.v-tooltip-down {
    bottom: auto; 
    top: 145%; /* Ép tooltip xổ xuống dưới */
}

/* Đảo ngược mũi tên chĩa lên trên */
.v-tooltip.v-tooltip-down::after {
    top: auto;
    bottom: 100%; /* Đưa mũi tên lên nóc tooltip */
    border-color: transparent transparent #fff transparent; /* Tam giác chĩa lên */
}

.v-code-wrapper.active .v-tooltip {
    visibility: visible !important; 
    opacity: 1 !important;
    z-index: 99999 !important; /* Đẩy lên lớp cao nhất, không bao giờ bị đè */
    pointer-events: auto;
}

/* =========================================
   4. NÚT LIÊN HỆ & GÁN NHANH (Actions)
   ========================================= */
.quick-contact-group { display: flex; gap: 4px; opacity: 0.3; transition: opacity 0.2s ease; }
.v-code-wrapper:hover .quick-contact-group { opacity: 1; }

.contact-btn {
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; text-decoration: none; font-size: 10px; font-weight: bold;
    transition: transform 0.1s ease;
}
.contact-btn:hover { transform: scale(1.2); }
.call-btn { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.zalo-btn { background: #e3f2fd; color: #1976d2; border: 1px solid #bbdefb; }

/* Menu gán nhanh */
.quick-assign-menu {
    background: white; border: 1px solid #ccc; border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 1000; min-width: 200px;
}
.quick-assign-menu .menu-item { padding: 8px 12px; cursor: pointer; font-size: 0.9rem; border-bottom: 1px solid #f0f0f0; }
.quick-assign-menu .menu-item:hover { background-color: #e3f2fd; color: #1565c0; }

/* Nút chọn xe 1 chạm */
.vehicle-item-btn {
    width: 100%; text-align: left; background: white; border: 1px solid #e9ecef;
    padding: 10px 12px; margin-bottom: 6px; border-radius: 6px; cursor: pointer;
    font-weight: 600; color: #2c3e50; display: flex; justify-content: space-between;
    align-items: center; transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; overflow: hidden;
}
.vehicle-item-btn:hover {
    background-color: #ebf5fb; border-color: #3498db;
    transform: translateX(5px); color: #2980b9;
}
.vehicle-item-btn:hover::after {
    content: "GÁN NGAY"; font-size: 0.65rem; font-weight: bold; color: #27ae60;
    position: absolute; right: 35px; animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes slideInUp {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    .toast-container {
        position: fixed; bottom: 30px; right: 30px; 
        background: #333; color: #fff; padding: 15px 25px; 
        border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.3);
        display: flex; align-items: center; gap: 15px; z-index: 10000;
        border-left: 5px solid #2ecc71;
        animation: slideInUp 0.5s ease-out;
    }
	/* --- CSS CHO TOOLTIP ĐỊA CHỈ KHO (BẢN FIX ĐẢO CHIỀU XUỐNG DƯỚI) --- */
.wh-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    border-bottom: 1px dashed #7f8c8d; 
}

.wh-tooltip .wh-tooltiptext {
    visibility: hidden;
    width: max-content;
    max-width: 250px;
    background-color: #34495e;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 9999; /* Đẩy ưu tiên lên mức cao nhất */
    
    /* ĐẢO CHIỀU: Nằm phía dưới chữ thay vì phía trên */
    top: 130%; 
    left: 0; 
    
    opacity: 0;
    transition: all 0.2s ease-in-out;
    font-size: 12px;
    font-weight: normal;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    line-height: 1.4;
}

/* ĐẢO CHIỀU MŨI TÊN: Chỉ lên trên bong bóng */
.wh-tooltip .wh-tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 100%; /* Nằm sát mép trên của bong bóng */
    left: 20px;
    border-width: 5px;
    border-style: solid;
    /* Trỏ mũi tên lên trên */
    border-color: transparent transparent #34495e transparent; 
}

/* Hiệu ứng trượt mượt mà từ dưới lên một chút */
.wh-tooltip:hover .wh-tooltiptext {
    visibility: visible;
    opacity: 1;
    top: 115%; 
}
/* HIGHLIGHT XE CHƯA CÓ TÀI XẾ */
.row-no-driver {
    background-color: #fffde7 !important; /* Màu nền vàng rất nhạt, dịu mắt */
    transition: background-color 0.3s;
}
.row-no-driver:hover {
    background-color: #fff9c4 !important; /* Đậm hơn một xíu khi di chuột vào */
}
.driver-warning {
    color: #d35400; /* Màu cam đậm */
    font-weight: bold;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}
 /* Chỉnh Select2 cho đẹp và đồng bộ với giao diện */
    .select2-container .select2-selection--single {
        height: 35px !important;
        border: 1px solid #ccc !important;
        border-radius: 4px !important;
    }
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 35px !important;
        font-size: 13px;
    }
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 33px !important;
    }
    .select2-container--open {
        z-index: 9999999 !important; /* Đảm bảo ô tìm kiếm luôn nổi lên trên cùng */
    }
	/* TÙY CHỈNH LẠI FONT SIZE CỦA DANH SÁCH SELECT2 CHO ĐỒNG BỘ */

/* 1. Chữ bên trong danh sách tài xế */
.select2-results__option {
    font-size: 12px !important; /* Chỉnh lại bằng size mặc định của site bạn */
    padding: 5px 10px !important; /* Thu gọn khoảng cách trên dưới cho đỡ rối */
}

/* 2. Ô nhập chữ tìm kiếm */
.select2-search__field {
    font-size: 12px !important;
}

/* 3. Tiêu đề của các nhóm (VD: Tài xế CÓ THỂ GÁN) */
.select2-results__group {
    font-size: 11px !important;
    background-color: #f8f9fa;
    color: #7f8c8d !important;
    padding: 4px 10px !important;
}
	/* Khóa cứng Tooltip không cho ẩn khi đang dùng Select2 */
.v-tooltip.force-keep-open {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}
  /* 1. KHUNG CHỨA (Container) */
.search-box-container {
    position: relative; /* Bắt buộc để làm gốc tọa độ cho icon */
    margin-bottom: 15px;
    width: 100%;
    display: block; /* Ép về block để không bị lỗi Flexbox làm sai chiều cao */
}

/* 2. Ô NHẬP LIỆU (Input) */
.search-box-container input {
    width: 100%;
    height: 40px; /* Chốt cứng chiều cao để icon làm chuẩn */
    padding: 10px 15px 10px 40px; /* Dành đúng 40px bên trái cho icon đứng */
    border: 1px solid rgb(237, 239, 241);
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #ffffff;
    line-height: normal; /* Chống lệch chữ bên trong */
}

.search-box-container input:focus {
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
    border-color: #3498db;
}

/* 3. ICON KÍNH LÚP (Được căn giữa tuyệt đối) */
.search-box-container i {
    position: absolute;
    left: 30px; /* 13px là vị trí vàng (nằm giữa khoảng padding 40px) */
    top: 50%; /* Nhảy xuống giữa khung */
    transform: translateY(-50%); /* Kéo ngược lên chính xác bằng nửa thân nó */
    color: #95a5a6;
    font-size: 14px;
    pointer-events: none; /* Cho phép click xuyên qua để gõ chữ */
    z-index: 10;
    margin: 0; /* Xóa mọi margin ẩn làm lệch icon */
    padding: 0; /* Xóa mọi padding ẩn */
    line-height: 1; /* Chống lỗi icon bị đẩy lên do chiều cao dòng */
}
	/* Trang trí khung xe */
.v-code-wrapper {
    position: relative; /* Giữ nguyên để tooltip không bị lệch */
    background: #ffffff;
    border: 1px solid #e2e8f0; /* Viền xám cực nhạt */
    border-radius: 8px; /* Bo góc hiện đại */
    padding: 8px 12px; /* Tạo không gian thở cho chữ */
    box-shadow: 0 2px 6px rgba(0,0,0,0.03); /* Bóng đổ siêu mờ */
    transition: all 0.25s ease;
    border-left: 4px solid #3498db; /* Vệt màu nhấn mặc định bên trái */
}

/* Hiệu ứng khi rê chuột vào khung xe */
.v-code-wrapper:hover {
    box-shadow: 0 6px 15px rgba(0,0,0,0.08); /* Bóng in đậm hơn khi hover */
    transform: translateY(-2px); /* Hiệu ứng nhấc nhẹ lên */
    border-color: #cbd5e1;
}

/* HIỆU ỨNG XOAY MŨI TÊN KHI BẤM MỞ FORM */
.v-code-wrapper.active .fa-chevron-down {
    transform: rotate(180deg);
    color: #1976d2 !important;
}

/* Tùy chọn: Đổi màu vệt viền trái theo trạng thái xe */
.v-code-wrapper.status-running { border-left-color: #f1c40f; } /* Vàng */
.v-code-wrapper.status-issue { border-left-color: #e74c3c; } /* Đỏ */

/* Trạng thái bình thường của Card đơn hàng */
.order-action-card {
    background: #ffffff;
    border-radius: 12px; /* Bo góc 12px nhìn hiện đại, thân thiện hơn 8px */
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #f1f5f9; /* Thêm một đường viền siêu nhạt để tách biệt với nền */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03); /* Bóng đổ cực mờ và êm */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Hiệu ứng chuyển động mượt như bơ */
    position: relative;
}

/* Hiệu ứng khi rê chuột (Hover) */
.order-action-card:hover {
    transform: translateY(-3px); /* Nhấc bổng card lên 3 pixel */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08); /* Bóng đổ lan rộng ra và đậm hơn một chút */
    border-color: #e2e8f0; /* Viền đậm lên nhẹ nhàng */
    background: #fafbfc; /* Nền đổi màu cực kỳ nhẹ để tạo cảm giác focus */
}

/* Tùy chọn: Làm mượt thanh màu bên trái (Status Indicator) */
.order-action-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
/* =======================================================
   CHUYỂN ĐỔI TOOLTIP TỪ "BAY LƠ LỬNG" SANG "THẺ MỞ RỘNG"
   ======================================================= */

/* 1. Hủy bỏ thuộc tính lơ lửng, biến thành khối nằm gọn bên trong */
.v-tooltip {
    position: relative !important; 
    bottom: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 300px !important;      /* Khóa chiều rộng cố định */
    min-width: 300px !important;  /* Đảm bảo không bị co lại */
    box-sizing: border-box;       /* Đảm bảo padding không làm tăng thêm 300px */
    position: relative;           /* Theo cấu trúc Accordion chúng ta đã làm */
    margin-top: 10px;
    z-index: 99;
    box-shadow: none !important; /* Bỏ bóng đổ bay lơ lửng */
    border: 1px dashed #cbd5e1 !important; /* Viền đứt quãng thanh lịch */
    background: #f8fafc !important; /* Nền xám pastel phân biệt với nền trắng của xe */
    display: none !important; /* Mặc định giấu đi */
    transform: none !important; /* Hủy hiệu ứng dịch chuyển cũ */
    padding: 12px !important;
    border-radius: 8px !important;
	margin-left: auto;
    margin-right: auto;
}
.v-tooltip .select2-container {
    width: 100% !important;
}
/* 2. Ẩn cái mũi tên tam giác chĩa lên/xuống (vì không cần thiết nữa) */
.v-tooltip::after {
    display: none !important;
}

/* 3. Hiệu ứng thả Form xuống khi Click (Class active) */
.v-code-wrapper.active .v-tooltip {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: slideDownForm 0.3s ease forwards; /* Thêm hiệu ứng trượt mượt mà */
}

/* 4. Đảm bảo khung xe có thể tự do phình to ra */
.v-code-wrapper {
    height: auto !important;
    overflow: visible !important;
    flex-direction: column; /* Ép nội dung xếp dọc: Tên xe ở trên, Form ở dưới */

}

/* (Tùy chọn) Hiệu ứng trượt xuống cực xịn */
@keyframes slideDownForm {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Hiệu ứng hover cho khối trạng thái bên trong */
.status-badge-hover {
    padding: 6px 10px; /* Tạo không gian thở xung quanh chữ */
    border-radius: 8px; /* Bo góc hiện đại */
    transition: all 0.2s ease;
    display: inline-flex; /* Chặn khối div không bị kéo dài hết chiều ngang ô */
}

.status-badge-hover:hover {
    background-color: #e2e8f0; /* Màu xám sáng báo hiệu đang được trỏ chuột */
    transform: translateY(-1px); /* Nhấc nhẹ lên 1 pixel cực mượt */
}
.app-main-wrapper { 
        display: flex; 
        width: 100%; 
        min-height: 100vh; 
        margin: 0; 
        padding: 0; 
    }
	/* ============================================================
  /* ============================================================
   1. RESET & KHUNG BỐ CỤC CHUNG (LAYOUT)
   ============================================================ */
/* ============================================================
   1. RESET & BỐ CỤC KHUNG CHUẨN (DÙNG BIẾN TOÀN CỤC)
   ============================================================ */
body { 
    margin: 0; 
    padding: 0; 
    
    /* Tự động gọi font Inter và các font dự phòng */
    font-family: var(--font-primary); 
    
    /* Đồng bộ màu nền và màu chữ từ hệ thống biến */
    background: var(--bg-body); 
    color: var(--text-main); 
    
    /* Ép nét chữ hiển thị sắc nét trên màn hình */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* RẤT QUAN TRỌNG: Giữ cố định khung ứng dụng, không cho cuộn toàn trang */
    overflow: hidden; 
}

/* Container chứa toàn bộ ứng dụng (Giữ nguyên cấu trúc Flexbox) */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh; /* Chiếm trọn 100% chiều cao màn hình */
}
/* ============================================================
   2. SIDEBAR (CỐ ĐỊNH BÊN TRÁI)
   ============================================================ */
.sidebar { 
    width: 250px; 
    background: #2c3e50; 
    color: #ecf0f1; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    flex-shrink: 0; 
    position: fixed; 
    top: 0;
    left: 0;
    z-index: 1001; 
    box-shadow: 2px 0 10px rgba(0,0,0,0.1); 
    transition: all 0.3s ease;
}

.sidebar-brand { 
    height: 60px; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px; 
    font-weight: bold; 
    background: #1a252f; 
    color: #fff; 
    letter-spacing: 1px; 
    border-bottom: 1px solid #34495e;
    flex-shrink: 0;
}

.sidebar-menu { list-style: none; padding: 15px 0; margin: 0; flex: 1; overflow-y: auto; }
.sidebar-menu li a { display: flex; align-items: center; padding: 12px 20px; color: #bdc3c7; text-decoration: none; font-size: 14.5px; transition: all 0.2s ease; }
.sidebar-menu li a i { width: 25px; font-size: 16px; text-align: center; margin-right: 10px; }
.sidebar-menu li a:hover { background: #34495e; color: #fff; }
.sidebar-menu li a.active { background: #3498db; color: #fff; border-left: 4px solid #fff; padding-left: 16px; font-weight: 600; }
.sidebar-divider { height: 1px; background: #34495e; margin: 10px 20px; }

/* ============================================================
   3. TOP HEADER (THANH NGANG)
   ============================================================ */
.top-header {
    height: 50px;
    background: #ffffff;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    position: fixed;
    top: 0;
    left: 250px; /* Bám mép Sidebar */
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-left { display: flex; align-items: center; gap: 20px; }
.header-page-title {
    font-size: 14px;
    font-weight: 600;
    color: #34495e;
    border-left: 2px solid #ecf0f1;
    padding-left: 20px;
    text-transform: uppercase;
}

/* ============================================================
   4. NỘI DUNG CHÍNH (MAIN WRAPPER)
   ============================================================ */
.main-wrapper { 
    flex: 1; 
    margin-left: 250px; /* Chừa chỗ cho Sidebar */
    margin-top: 60px;  /* Chừa chỗ cho Header */
    height: calc(100vh - 60px); 
    overflow-y: auto; 
    position: relative; 
    padding: 20px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* ============================================================
   5. CÁC THÀNH PHẦN CHỨC NĂNG (GIỮ NGUYÊN CLASS CŨ)
   ============================================================ */
.header-right { display: flex; align-items: center; gap: 15px; }

.header-dropdown { position: relative; display: inline-block; }
.header-dropdown::after { content: ""; position: absolute; top: 100%; left: 0; width: 100%; height: 10px; background: transparent; z-index: 1000; }
.dropdown-toggle { background: none; border: none; padding: 6px 12px; cursor: pointer; font-size: 13.5px; color: #34495e; font-weight: 600; display: flex; align-items: center; gap: 6px; border-radius: 4px; }
.dropdown-toggle:hover { background: #f1f2f6; }
.dropdown-menu { display: none; position: absolute; top: 100%; right: 0; background: #fff; min-width: 200px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); border-radius: 6px; border: 1px solid #eee; z-index: 1001; margin-top: 5px; overflow: hidden; }
.header-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: flex; align-items: center; gap: 12px; padding: 10px 15px; color: #2c3e50; text-decoration: none; font-size: 13px; transition: 0.2s; }
.dropdown-menu a:hover { background: #f8f9fa; color: #3498db; }

.notif-btn { position: relative; background: none; border: none; font-size: 18px; color: #7f8c8d; cursor: pointer; padding: 5px; }
.notif-badge { position: absolute; top: -2px; right: -2px; background: #e74c3c; color: #fff; font-size: 9px; font-weight: bold; border-radius: 50%; width: 15px; height: 15px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }

/* ============================================================
   6. HỖ TRỢ TRANG KHÔNG CÓ SIDEBAR (VD: ĐIỀU PHỐI)
   ============================================================ */

/* ẨN SIDEBAR VÀ ĐẨY NỘI DUNG RA SÁT MÉP TRÁI */
.no-sidebar .sidebar { 
    display: none !important; 
}

.no-sidebar .top-header { 
    left: 0 !important; 
    width: 100% !important; 
}

.no-sidebar .main-wrapper { 
    margin-left: 0 !important; 
    width: 100% !important; 
    height: 100vh; /* Lấy toàn bộ chiều cao */
    display: flex;
    flex-direction: column;
    padding: 0; /* Trang điều phối thường cần tràn viền */
    overflow: hidden; 
}

/* Vùng cuộn nội dung cho trang không sidebar */
.no-sidebar .content-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.no-sidebar footer {
    margin-top: auto; 
    padding: 20px 0;
    text-align: center;
}
/* ============================================================
   BỘ SỬA LỖI: CƯỠNG ÉP TRÀN VIỀN CHO TRANG ĐIỀU PHỐI
   ============================================================ */

/* 1. Đảm bảo khung cha luôn lấy hết chiều ngang màn hình */
.no-sidebar .app-container {
    width: 100vw !important;
    max-width: 100vw !important;
    display: flex !important;
}

/* 2. Ép Main Wrapper chiếm toàn bộ không gian còn lại (100%) */
.no-sidebar .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important; /* Xoá bỏ mọi giới hạn chiều rộng cũ */
    flex: 1 1 auto !important;   /* Ép giãn nở mức tối đa */
    display: flex !important;
    flex-direction: column !important;
}

/* 3. Ép Header và Vùng nội dung bên trong cũng phải rộng 100% */
.no-sidebar .top-header,
.no-sidebar .content-scroll-area,
.no-sidebar .main-content {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 4. KIỂM TRA: Nếu bạn có dùng class "container" của Bootstrap 
   trong nội dung, nó sẽ bị bóp hẹp. Lệnh này sẽ mở khoá nó: */
.no-sidebar .container, 
.no-sidebar .container-fluid {
    max-width: none !important;
    width: 100% !important;
    padding-left: 20px;
    padding-right: 20px;
}
/* CƯỠNG ÉP TRÀN VIỀN KHI KHÔNG CÓ SIDEBAR */
.no-sidebar .app-body {
    width: 100% !important;
    display: flex !important;
    flex: 1 !important;
}

.no-sidebar .main-wrapper {
    width: 100% !important;
    max-width: 100% !important; /* Xoá bỏ mọi giới hạn chiều rộng nếu có */
    margin-left: 0 !important;   /* Đảm bảo không bị dính lề trái của sidebar */
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.no-sidebar .content-scroll-area {
    width: 100% !important;
    flex: 1 !important;
}

/* Nếu bạn có dùng các class container của Bootstrap, thẻ này sẽ giúp nó bung ra */
.no-sidebar .container {
    max-width: none !important;
    width: 100% !important;
}
/* =========================================
   FOOTER (CHÂN TRANG)
   ========================================= */
.app-footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0 10px 0;
    color: #94a3b8; /* Màu xám nhạt dịu mắt */
    font-size: 0.85rem;
    border-top: 1px dashed #e2e8f0; /* Đường viền đứt nét mờ phân cách nội dung */
    background: transparent;
    width: 100%;
}

.app-footer strong {
    color: #475569; /* Chữ đậm màu tối hơn một chút */
    font-weight: 600;
}

/* Hiệu ứng hover cho vui mắt (không bắt buộc) */
.app-footer:hover {
    color: #64748b;
    transition: color 0.3s ease;
}