/* ══════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR (mobile only)
   ══════════════════════════════════════════════════════════════ */

/* Ẩn trên desktop — chỉ hiện trên mobile qua media query */
.vcna-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Hiện bottom nav trên mobile */
    .vcna-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        z-index: 200;
        align-items: stretch;
        justify-content: space-around;
        padding: 0;
        box-shadow: 0 -2px 12px rgba(0,0,0,.08);
    }

    /* Thêm padding-bottom cho main content để không bị bottom nav che */
    .vcna-main {
        padding-bottom: 60px;
    }
}

/* Nav item (link + button) */
.vcna-bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    color: var(--color-text-3);
    text-decoration: none;
    font-size: 10px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0 2px;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.vcna-bnav-item.active { color: var(--color-primary); }
.vcna-bnav-item:hover  { color: var(--color-primary); }

/* SVG icon size */
.vcna-bnav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke: currentColor;
}

/* Label */
.vcna-bnav-label {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

/* FAB wrapper — chiếm cùng flex slot */
.vcna-bnav-fab-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    position: relative;
}

/* FAB button — nổi lên trên bottom nav */
.vcna-bnav-fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    position: absolute;
    top: -16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.vcna-bnav-fab:hover,
.vcna-bnav-fab:active {
    transform: scale(1.08);
    box-shadow: 0 5px 16px rgba(0,0,0,.3);
}

/* ─── RICH TEXT EDITOR ─── */
.vcna-richtext-wrap {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}
.vcna-richtext-wrap:focus-within { border-color: var(--color-primary); }
.vcna-rt-toolbar {
    display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
    padding: 5px 8px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
}
.vcna-rt-btn {
    width: 28px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; border-radius: 4px;
    background: none; cursor: pointer; font-size: 13px;
    color: var(--color-text-2);
    transition: background var(--transition);
}
.vcna-rt-btn:hover { background: #fff; border-color: var(--color-border); }
.vcna-rt-sep { width: 1px; height: 18px; background: var(--color-border-light); margin: 0 4px; }
/* Nút xoá toàn bộ nội dung — đẩy sang lề phải toolbar, tô đỏ khi hover để phân
   biệt với các nút định dạng khác (hành động phá huỷ, không phải toggle). */
.vcna-rt-btn-clear { margin-left: auto; }
.vcna-rt-btn-clear:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.vcna-rt-body {
    min-height: 80px; max-height: 260px;
    padding: 10px 12px;
    font-size: 13px; line-height: 1.6;
    color: var(--color-text-1);
    overflow-y: auto;
    outline: none;
}
.vcna-rt-body:empty::before {
    content: attr(data-placeholder);
    color: #bbb; pointer-events: none;
}
.vcna-rt-body b, .vcna-rt-body strong { font-weight: 700; }
.vcna-rt-body ul { padding-left: 18px; margin: 4px 0; }
.vcna-rt-body ol { padding-left: 18px; margin: 4px 0; }
.vcna-rt-body li { margin: 2px 0; }
.vcna-rt-body h1, .vcna-rt-body h2, .vcna-rt-body h3 { margin: 8px 0 4px; line-height: 1.3; }
.vcna-rt-body h1 { font-size: 20px; } .vcna-rt-body h2 { font-size: 17px; } .vcna-rt-body h3 { font-size: 15px; }
.vcna-rt-body blockquote { border-left: 3px solid var(--color-border); margin: 6px 0; padding: 2px 10px; color: var(--color-text-muted); }
.vcna-rt-body a { color: var(--color-primary); text-decoration: underline; }
.vcna-rt-body hr { border: none; border-top: 1px solid var(--color-border-light); margin: 8px 0; }
.vcna-rt-body table { border-collapse: collapse; margin: 6px 0; width: 100%; }
.vcna-rt-body table td, .vcna-rt-body table th {
    border: 1px solid var(--color-border); padding: 4px 8px; font-size: 12.5px;
}

/* ── Toolbar: dropdown chọn heading / màu chữ / màu nền ─────────────── */
.vcna-rt-dd { position: relative; }
.vcna-rt-dd-panel {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 210;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm); box-shadow: 0 4px 16px rgba(0,0,0,.12);
    padding: 6px; min-width: 130px;
}
.vcna-rt-dd-opt {
    padding: 6px 8px; font-size: 12.5px; cursor: pointer; border-radius: 4px; white-space: nowrap;
}
.vcna-rt-dd-opt:hover { background: var(--color-bg); }
.vcna-rt-color-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.vcna-rt-color-swatch {
    width: 20px; height: 20px; border-radius: 4px; cursor: pointer;
    border: 1px solid rgba(0,0,0,.12);
}

/* ─── MONEY INPUT ─── */
.vcna-money-input { text-align: right; font-family: 'Courier New', monospace; letter-spacing: .5px; }

/* ─── MULTI SELECT ─── */
.vcna-multisel { position: relative; }
.vcna-multisel-box {
    min-height: 38px; padding: 4px 30px 4px 8px;
    border: 1px solid var(--color-border); border-radius: var(--border-radius-sm);
    background: var(--color-surface); cursor: pointer;
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    position: relative; transition: border-color var(--transition);
}
.vcna-multisel-box:hover { border-color: var(--color-primary); }
.vcna-multisel-placeholder { font-size: 13px; color: #bbb; }
/* Ô gõ tìm-kiếm ngay trong khung "Chọn lưu ý" (thay cho ô tìm kiếm riêng bên trong
   dropdown trước đây — gộp lại 1 lớp cho gọn). Nằm chung hàng với các tag đã chọn. */
.vcna-multisel-search-input {
    flex: 1; min-width: 60px; border: none; outline: none; background: none;
    padding: 4px 2px; margin: 0; font: inherit; color: var(--color-text-1);
    cursor: text;
}
.vcna-multisel-search-input::placeholder { color: #bbb; }
.vcna-multisel-arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #999; font-size: 11px; pointer-events: none; }
.vcna-multisel-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm); box-shadow: 0 4px 16px rgba(0,0,0,.12);
    max-height: 200px; overflow-y: auto;
}
.vcna-multisel-opt {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer; font-size: 13px;
    transition: background var(--transition);
}
.vcna-multisel-opt:hover { background: var(--color-bg); }
.vcna-multisel-opt input { cursor: pointer; }
.vcna-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--color-primary-light); color: var(--color-primary-dark);
    border-radius: 20px; padding: 2px 8px 2px 10px;
    font-size: 12px; font-weight: 600;
}
.vcna-tag-remove {
    background: none; border: none; cursor: pointer; color: var(--color-primary);
    font-size: 12px; padding: 0; line-height: 1;
    opacity: .7;
}
.vcna-tag-remove:hover { opacity: 1; }

/* ─── CHECKBOXES (lưu ý) ─── */
.vcna-checkboxes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.vcna-checkbox-label {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border: 1px solid var(--color-border);
    border-radius: 20px; cursor: pointer; font-size: 12px; font-weight: 500;
    transition: all var(--transition); user-select: none;
}
.vcna-checkbox-label:hover { border-color: var(--color-primary); color: var(--color-primary); }
.vcna-checkbox-label.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.vcna-checkbox-label input { display: none; }

/* ─── INLINE ADD CUSTOMER ─── */
.vcna-inline-kh {
    margin-top: 8px; padding: 12px; background: var(--color-bg);
    border-radius: var(--border-radius-sm); border: 1px dashed var(--color-border);
}

/* ─── IMAGE UPLOAD ─── */
.vcna-upload-area {
    border: 2px dashed var(--color-border); border-radius: var(--border-radius);
    padding: 20px; text-align: center; cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    margin-bottom: 12px;
}
.vcna-upload-area:hover { border-color: var(--color-primary); background: #fff8f0; }
.vcna-image-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
    margin-bottom: 12px;
}
.vcna-image-thumb {
    position: relative; aspect-ratio: 1;
    border-radius: 6px; overflow: hidden;
    border: 2px solid var(--color-border);
}
.vcna-image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vcna-image-thumb.uploading { opacity: .7; }
.vcna-image-thumb.done { border-color: #4caf50; }
.vcna-thumb-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.3);
}
.vcna-thumb-status { font-size: 18px; }
.vcna-thumb-remove {
    position: absolute; top: 3px; right: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(0,0,0,.6); color: #fff; border: none;
    font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.vcna-thumb-remove:hover { background: #f44336; }

@media (max-width: 768px) {
    .vcna-image-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Lưu Ý: collapsible section toggle ─────────────────────── */
.vcna-section-toggle {
    cursor: pointer;
    user-select: none;
}
.vcna-section-toggle:hover {
    opacity: .85;
}
.vcna-section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary, #f97316);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Lưu Ý: enum list (scrollable checkbox list) ────────────── */
.vcna-enum-list {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
    background: #fff;
}
.vcna-enum-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    transition: background .12s;
}
.vcna-enum-item:last-child {
    border-bottom: none;
}
.vcna-enum-item:hover {
    background: var(--color-bg-alt, #f9fafb);
}
.vcna-enum-item.active {
    background: #fff7ed;
    color: var(--color-primary, #f97316);
    font-weight: 600;
}
.vcna-enum-item input[type="checkbox"] {
    display: none;
}
.vcna-enum-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border, #d1d5db);
    border-radius: 4px;
    flex-shrink: 0;
    font-size: 11px;
    transition: border-color .12s, background .12s;
}
.vcna-enum-item.active .vcna-enum-check {
    border-color: var(--color-primary, #f97316);
    background: var(--color-primary, #f97316);
    color: #fff;
}

/* ── Form Tạo Đơn (nhanh): chip gợi ý "Dùng lại tuyến gần nhất" ───────
   Xem template-don-hang.php (khối Khách hàng) + app.js loadSuggestedRoute()/
   applySuggestedRoute(). */
.vcna-suggest-chip {
    display: flex; align-items: center; gap: 8px;
    width: 100%; text-align: left;
    padding: 9px 12px; margin: 6px 0 4px;
    border: 1px solid #bfdbfe; border-radius: 8px;
    background: #eff6ff; color: #1d4ed8;
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
}
.vcna-suggest-chip:hover { background: #dbeafe; }
.vcna-suggest-chip-icon { flex-shrink: 0; font-size: 14px; }
.vcna-suggest-chip-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcna-suggest-chip-arrow { flex-shrink: 0; opacity: .7; }

/* "Xem thêm lịch sử" — mở list vài đơn gần đây khác của cùng khách hàng, phòng khi
   đơn gần nhất không đúng tuyến muốn dùng lại. */
.vcna-suggest-history-toggle {
    display: flex; align-items: center; gap: 4px;
    background: none; border: none; cursor: pointer;
    font-size: 12px; font-weight: 600; color: #1d4ed8;
    padding: 2px 2px 4px; margin-left: 2px;
}
.vcna-suggest-history-toggle:hover { text-decoration: underline; }
.vcna-suggest-history-list {
    border: 1px solid #bfdbfe; border-radius: 8px; overflow: hidden;
    margin-bottom: 4px;
}
.vcna-suggest-history-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; text-align: left; background: #fff; border: none;
    border-bottom: 1px solid #eff6ff; cursor: pointer;
    padding: 8px 12px; font-size: 12.5px; color: var(--color-text-1);
}
.vcna-suggest-history-item:last-child { border-bottom: none; }
.vcna-suggest-history-item:hover { background: #eff6ff; }
.vcna-suggest-history-route { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcna-suggest-history-date { flex-shrink: 0; color: var(--color-text-muted); font-size: 11.5px; }

/* ── Form Tạo Đơn (nhanh): accordion Điểm lấy/Điểm giao (thu gọn) ─────
   Bọc thành 1 khung bo góc có viền (giống input box) — icon + nhãn IN HOA bên
   trái, trạng thái/mũi tên bên phải, tất cả cùng 1 hàng — thay vì hàng chữ
   trần trước đây. */
.vcna-point-collapse-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; margin-bottom: 4px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-surface);
    cursor: pointer; user-select: none;
    transition: border-color var(--transition);
}
.vcna-point-collapse-head:hover { border-color: var(--color-primary); }
.vcna-point-collapse-icon { flex-shrink: 0; font-size: 14px; }
.vcna-point-collapse-label {
    flex-shrink: 0; font-size: 12px; font-weight: 700; letter-spacing: .3px;
    text-transform: uppercase; color: var(--color-text-1); white-space: nowrap;
}
.vcna-point-collapse-summary {
    flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 13px; color: var(--color-text-1); margin-left: 6px;
}
.vcna-point-collapse-summary.placeholder { color: var(--color-text-muted); }
.vcna-point-collapse-arrow { flex-shrink: 0; font-size: 11px; color: var(--color-text-muted); margin-left: 4px; }

/* Nút hoán đổi Điểm lấy ↔ Điểm giao */
.vcna-swap-btn-row { display: flex; justify-content: center; margin: -2px 0; position: relative; z-index: 1; }
.vcna-swap-btn {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid var(--color-border-light); background: #fff;
    color: var(--color-text-muted); cursor: pointer; font-size: 14px;
}
.vcna-swap-btn:hover { color: var(--color-primary, #f97316); border-color: var(--color-primary, #f97316); }

/* ── Form Tạo Đơn (nhanh): "Thông tin bổ sung" — danh sách hàng gọn ─── */
.vcna-bs-list { border: 1px solid var(--color-border-light); border-radius: 8px; overflow: hidden; }
.vcna-bs-row {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; cursor: pointer; user-select: none;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 13px;
}
.vcna-bs-row:last-child { border-bottom: none; }
.vcna-bs-row:hover { background: var(--color-bg-2, #f9fafb); }
.vcna-bs-row-icon { flex-shrink: 0; font-size: 15px; }
.vcna-bs-row-label { font-weight: 600; color: var(--color-text-1); }
.vcna-bs-row-status { margin-left: auto; font-size: 12px; color: var(--color-text-muted); }
.vcna-bs-row-status.filled { color: var(--color-primary, #f97316); font-weight: 600; }
.vcna-bs-row-arrow { flex-shrink: 0; font-size: 11px; color: var(--color-text-muted); transition: transform .15s; }
.vcna-bs-row.open .vcna-bs-row-arrow { transform: rotate(90deg); }
.vcna-bs-row-body { padding: 4px 12px 14px; border-bottom: 1px solid var(--color-border-light); }
.vcna-bs-row-body:last-child { border-bottom: none; }

/* ── Detail panel: 2-col row ───────────────────────────────── */
.vcna-detail-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    margin-bottom: 0;
}
.vcna-detail-row-2 .vcna-detail-item {
    border-bottom: none;
    padding: 12px 16px;
}
.vcna-detail-row-2 + .vcna-detail-row-2 {
    border-top: none;
}

/* ── HTML content (nội dung hàng, ghi chú) ─────────────────── */
.vcna-html-content {
    line-height: 1.6;
}
.vcna-html-content b, .vcna-html-content strong { font-weight: 700; }
.vcna-html-content i, .vcna-html-content em     { font-style: italic; }
.vcna-html-content u                            { text-decoration: underline; }
.vcna-html-content s, .vcna-html-content strike { text-decoration: line-through; }
.vcna-html-content ul { padding-left: 18px; margin: 4px 0; list-style: disc; }
.vcna-html-content div { min-height: 1em; }

/* ── Status update UI ──────────────────────────────────────── */
.vcna-status-update {
    display: flex;
    gap: 8px;
    align-items: center;
}
.vcna-status-update .vcna-input {
    flex: 1;
}
.vcna-status-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--color-text-muted, #6b7280);
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 6px 10px;
}
.vcna-status-arrow {
    color: var(--color-primary, #f97316);
    font-weight: 700;
}
.vcna-status-preview strong {
    color: var(--color-primary, #f97316);
}

/* ── Scrollable timeline ───────────────────────────────────── */
.vcna-timeline-scroll {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.vcna-timeline-scroll::-webkit-scrollbar { width: 4px; }
.vcna-timeline-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ── Định Vị Google Maps ───────────────────────────────────── */
.vcna-dinh-vi-group {
    margin-bottom: 14px;
}
.vcna-dinh-vi-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.vcna-dinh-vi-row .vcna-input {
    flex: 1;
    font-size: 12px;
}
.vcna-map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: #f9fafb;
    font-size: 18px;
    cursor: default;
    opacity: .4;
    flex-shrink: 0;
    text-decoration: none;
    transition: opacity .15s, background .15s, border-color .15s;
}
.vcna-map-btn.active {
    opacity: 1;
    cursor: pointer;
    background: #f0fdf4;
    border-color: #86efac;
}
.vcna-map-btn.active:hover {
    background: #dcfce7;
}

/* ── Map link trong detail panel ───────────────────────────── */
.vcna-map-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 400;
    color: #16a34a;
    text-decoration: none;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 4px;
    padding: 1px 6px;
    transition: background .12s;
}
.vcna-map-link:hover {
    background: #dcfce7;
    text-decoration: none;
}

/* ── Multi-point (điểm lấy / giao) ────────────────────────── */
.vcna-point-group-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}
.vcna-point-card {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.vcna-point-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.vcna-point-num {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.vcna-point-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #e57373;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}
.vcna-point-remove:hover { background: #fee2e2; }

.vcna-point-addr-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.vcna-point-addr { flex: 1; }

.vcna-point-lh {
    font-size: 13px;
    color: var(--color-text-muted, #6b7280);
}
.vcna-point-dv {
    font-size: 12px;
    color: #9ca3af;
    background: #f9fafb;
}

.vcna-add-point-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary, #f97316);
    background: none;
    border: 1px dashed var(--color-primary, #f97316);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background .12s;
}
.vcna-add-point-btn:hover { background: #fff7ed; }

/* ══════════════════════════════════════════════════════════════
   DETAIL PANEL — Redesign
   ══════════════════════════════════════════════════════════════ */

/* ── Header ─────────────────────────────────────────────────── */
.vcna-detail-header {
    padding: 20px 20px 14px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    background: #fff;
    flex-shrink: 0;   /* không bị nén bởi flex panel — body mới scroll */
    position: sticky;
    top: 0;
    z-index: 2;
}
.vcna-detail-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Hàng nút back + edit ở đầu panel chi tiết Tài Xế — cùng phong cách với
   Đối Tác/Khách Hàng (.vcna-kh-back / .vcna-kh-edit-btn) */
.vcna-tx-detail-hdr-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.vcna-tx-detail-hdr-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.vcna-tx-detail-hdr-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-1, #111827);
}
.vcna-detail-ma-don {
    font-size: 18px;
    font-weight: 800;
    font-family: monospace;
    letter-spacing: .5px;
    color: var(--color-text, #111827);
    margin: 0;
}
.vcna-detail-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Info bar (KH + Ngày) ───────────────────────────────────── */
.vcna-detail-infobar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.vcna-detail-infobar-item {
    padding: 12px 20px;
}
.vcna-detail-infobar-item + .vcna-detail-infobar-item {
    border-left: 1px solid var(--color-border, #e5e7eb);
}

/* ── Tuyến đường: collapsible toggle ──────────────────────────  */
.vcna-detail-route-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    font-weight: 600;
    font-size: 13px;
    user-select: none;
    transition: background .12s;
}
.vcna-detail-route-toggle:hover { background: #f9fafb; }
.vcna-detail-route-summary {
    flex: 1;
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vcna-detail-route-chevron {
    font-size: 11px;
    color: var(--color-text-muted, #9ca3af);
    margin-left: auto;
}

/* ── Itinerary route display ────────────────────────────────── */
.vcna-itinerary {
    padding: 16px 20px 8px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    background: #fafafa;
}
.vcna-itin-stop {
    display: flex;
    gap: 14px;
    min-height: 56px;
}
.vcna-itin-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 24px;
    padding-top: 2px;
}
/* Vòng tròn đánh số thứ tự LIÊN TỤC qua tất cả điểm (thay cho chấm tròn trơn cũ) —
   xanh cho điểm lấy, đỏ cho điểm giao, giữ đúng quy ước màu cũ. */
.vcna-itin-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    line-height: 1;
}
.vcna-itin-num-green { background: #16a34a; }
.vcna-itin-num-red   { background: #dc2626; }
.vcna-itin-line {
    width: 2px;
    flex: 1;
    background: repeating-linear-gradient(
        to bottom,
        #d1d5db 0px, #d1d5db 5px,
        transparent 5px, transparent 10px
    );
    margin-top: 4px;
    min-height: 20px;
}
.vcna-itin-content {
    flex: 1;
    padding-bottom: 16px;
    padding-top: 2px;
}
.vcna-itin-addr {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #111827);
    line-height: 1.3;
}
.vcna-itin-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--color-text-muted, #6b7280);
    margin-top: 6px;
}
.vcna-itin-phone {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--color-text-2, #374151);
}
.vcna-itin-phone-ico { font-size: 12px; }
/* Nút "Gọi" dạng icon tròn — gọn hơn pill full-text cũ, khớp mẫu thiết kế mới. */
.vcna-itin-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    text-decoration: none;
    font-size: 13px;
    flex-shrink: 0;
}
.vcna-itin-call-btn:hover { background: #d1fae5; }
/* Nút "Bản Đồ" — pill vàng nhạt, chữ in hoa, đồng bộ vị trí với Gọi/Zalo (trước đây
   nằm riêng ở hàng nhãn LẤY/GIAO phía trên, giờ gộp chung 1 hàng liên hệ). */
.vcna-map-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde68a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.vcna-map-pill:hover { background: #fef3c7; }

/* ── Cargo section (full width) ─────────────────────────────── */
.vcna-detail-cargo {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.vcna-detail-cargo-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--color-text-muted, #6b7280);
    margin-bottom: 10px;
}
.vcna-detail-cargo-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text, #111827);
    background: #f9fafb;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 12px 14px;
}

/* ── Giá cước / COD / Tài xế (3 cột) ───────────────────────── */
.vcna-detail-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.vcna-detail-row-3 .vcna-detail-item {
    padding: 12px 20px;
    border-bottom: none;
}
.vcna-detail-row-3 .vcna-detail-item + .vcna-detail-item {
    border-left: 1px solid var(--color-border, #e5e7eb);
}

/* ── Panel body padding reset (dùng section tự padding) ─────── */
.vcna-panel-wide .vcna-panel-body {
    padding: 0;
}
/* vcna-detail-section: see bottom of file */
.vcna-detail-note {
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    margin: 0;
}

/* ── BSX tag trong detail ───────────────────────────────────── */
.vcna-bsx-tag {
    display: inline-block;
    font-family: monospace;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 2px 8px;
    color: #1e293b;
}

/* ── Hình ảnh trong detail ──────────────────────────────────── */
.vcna-detail-images {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.vcna-detail-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.vcna-detail-img-thumb {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border, #e5e7eb);
    aspect-ratio: 1;
    background: #f3f4f6;
    transition: opacity .15s;
}
.vcna-detail-img-thumb:hover { opacity: .85; }
.vcna-detail-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Lưu ý badge trong detail ──────────────────────────────── */
.vcna-luu-y-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
     border-radius: 20px;
    padding: 3px 10px;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE DISPATCHER — Order Cards & Filter Pills
   ══════════════════════════════════════════════════════════════ */

/* ── Desktop-only: ẩn trên mobile ──────────────────────────── */
.vcna-desktop-only { display: block; }

/* ── Loại pills: ẩn trên desktop, hiện trên mobile ─────────── */
.vcna-loai-pills { display: none; }

.vcna-loai-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-2);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.vcna-loai-pill.active {
    border-color: #9ca3af;
    color: var(--color-text-1);
    background: var(--color-bg);
}
.vcna-loai-pill--taxi.active  { background: #fff7ed; border-color: #f59e0b; color: #c2410c; }
.vcna-loai-pill--ghep.active  { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }

/* ── Card list container: ẩn desktop, hiện mobile ────────────  */
.vcna-order-cards-mobile { display: none; }

/* ── Card wrapper ───────────────────────────────────────────── */
.vcna-ocard {
    display: flex;
    align-items: stretch;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: border-color var(--transition);
}
.vcna-ocard:active { border-color: var(--color-primary); }

/* ── Cột trái: loại đơn ───────────────────────────────────── */
.vcna-ocard-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 9px;
    min-width: 50px;
    flex-shrink: 0;
    background: #f9fafb;
    border-right: 1px solid var(--color-border);
    box-sizing: border-box;
}
.vcna-ocard-type.taxi-tai  { background: #fff7ed; border-right-color: #fed7aa; }
.vcna-ocard-type.hang-ghep { background: #eff6ff; border-right-color: #bfdbfe; }
.vcna-ocard-type-icon  { font-size: 18px; line-height: 1; }
.vcna-ocard-type-label { font-size: 9px; font-weight: 700; letter-spacing: .05em; }
.vcna-ocard-type.taxi-tai  .vcna-ocard-type-label { color: #c2410c; }
.vcna-ocard-type.hang-ghep .vcna-ocard-type-label { color: #1d4ed8; }

/* ── Body: flex column, PHẢI overflow:hidden để clip text ───── */
.vcna-ocard-body {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;                /* << KEY: clip tất cả text bên trong */
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 9px 10px;
    box-sizing: border-box;
}

/* ── Dòng 1: BSX + tài xế bên trái, badge bên phải ─────────── */
.vcna-ocard-r1 {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    /* KHÔNG overflow:hidden ở đây — badge phải được nhìn thấy */
}
/* Driver area: flex:1 + min-width:0 + overflow:hidden = clip nội dung */
.vcna-ocard-driver {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 5px;
}
.vcna-ocard-bsx {
    flex-shrink: 0;
    white-space: nowrap;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-2);
    font-family: 'Courier New', monospace;
    letter-spacing: .03em;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vcna-ocard-bsx--empty {
    background: transparent;
    border-color: transparent;
    font-family: inherit;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--color-text-muted);
    font-style: italic;
}
.vcna-ocard-dname {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-1);
}
/* Badge: KHÔNG shrink, gắn chặt bên phải */
.vcna-ocard .vcna-badge {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 10px;
    padding: 2px 7px;
    align-self: center;
}

/* ── Dòng 2: Tuyến đường ───────────────────────────────────── */
.vcna-ocard-route {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    font-size: 11.5px;
    color: var(--color-text-2);
}
.vcna-ocard-addr {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vcna-ocard-arrow {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 10px;
}

/* ── Dòng 3: Khách + Ngày + Giá ────────────────────────────── */
.vcna-ocard-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    color: var(--color-text-muted);
}
.vcna-ocard-kh {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vcna-ocard-date { flex-shrink: 0; white-space: nowrap; }
.vcna-ocard-price {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-primary);
    margin-left: auto;
}

/* ── Mũi tên phải ─────────────────────────────────────────── */
.vcna-ocard-chev {
    display: flex;
    align-items: center;
    padding: 0 8px 0 4px;
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 20px;
    line-height: 1;
}

/* BSX empty state */
.vcna-ocard-bsx--empty {
    background: transparent !important;
    border-color: transparent !important;
    font-family: inherit !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    font-style: italic !important;
}

/* ══ RESPONSIVE: mobile ══════════════════════════════════════ */
@media (max-width: 768px) {
    /* Ẩn table, hiện cards */
    .vcna-order-table-desktop { display: none !important; }
    .vcna-order-cards-mobile  { display: block; padding: 10px 0; box-sizing: border-box; }
    /* Ẩn desktop-only elements */
    .vcna-desktop-only        { display: none !important; }
    /* Hiện pills */
    .vcna-loai-pills {
        display: flex;
        gap: 6px;
        padding: 6px 12px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .vcna-loai-pills::-webkit-scrollbar { display: none; }
    /* Sidebar ẩn trên mobile */
    .vcna-topbar { left: 0 !important; }
    .vcna-main   { margin-left: 0 !important; }
}

/* ══ GRID FIX: dùng CSS Grid thay flex cho mỗi row ══════════
   CSS Grid tracks (1fr) = minmax(0,1fr) → KHÔNG bao giờ overflow
   Khác với flex items (min-width:auto mặc định → có thể overflow)
  */

