/* --- CORE VARIABLES --- */
:root {
    /* Palette Xanh Doanh Nghiệp (Hiện đại hơn) */
    --primary-color: #2563eb;
    --primary-dark: #1e3a8a;
    --primary-light: rgba(37, 99, 235, 0.12);
    --accent-color: #3b82f6;

    /* Status Colors */
    --status-danger: #ef4444;
    --status-warning: #f59e0b;
    --status-success: #10b981;
    --status-info: #06b6d4;
    --status-purple: #8b5cf6;

    /* Backgrounds - LIGHT MODE */
    --bg-body: #eef4fb;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --bg-modal: rgba(255, 255, 255, 0.95);
    --bg-card-soft: rgba(248, 250, 252, 0.96);
    --bg-elevated: rgba(255, 255, 255, 0.92);
    --input-bg: rgba(255, 255, 255, 0.94);
    --table-head-bg: rgba(226, 232, 240, 0.72);
    --hover-bg: rgba(37, 99, 235, 0.06);
    --text-soft: #64748b;
    --bg-body-overlay:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 34%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.11), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.92), rgba(238,244,251,0.98));

    /* Text - LIGHT MODE (Tăng độ đậm) */
    --text-main: #0b1324;
    --text-sub: #334155;
    --border-color: #e2e8f0;

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 70px;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-neon: 0 0 15px rgba(37, 99, 235, 0.4);

    --sat: env(safe-area-inset-top);
    --sar: env(safe-area-inset-right);
    --sab: env(safe-area-inset-bottom);
    --sal: env(safe-area-inset-left);

    --heat-cao: #ef4444;
    --heat-tb: #f59e0b;
    --heat-thap: #10b981;

    /* OMEGA EDITION SPECIALS */
    --glass-bg: rgba(255, 255, 255, 0.85); /* Tăng độ mờ nền kính */
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --glass-blur: blur(20px);
    --gradient-sidebar: linear-gradient(180deg, #0f172a 0%, #172554 100%);
    --radius-card: 16px;
}

body.dark-mode {
    /* Backgrounds - DARK MODE */
    --bg-body: #020617;
    --bg-sidebar: #020617;
    --bg-card: #162235;
    --bg-modal: #162235;
    --bg-card-soft: rgba(15, 23, 42, 0.92);
    --bg-elevated: rgba(15, 23, 42, 0.88);
    --input-bg: rgba(15, 23, 42, 0.94);
    --table-head-bg: rgba(30, 41, 59, 0.92);
    --hover-bg: rgba(59, 130, 246, 0.14);
    --text-soft: #94a3b8;
    --bg-body-overlay:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 24%),
        linear-gradient(180deg, rgba(2,6,23,0.98), rgba(3,7,18,1));

    /* Text - DARK MODE (Điều chỉnh quan trọng) */
    --text-main: #f8fafc;
    --text-sub: #d7e0ee;
    --border-color: #334155;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-neon: 0 0 20px rgba(37, 99, 235, 0.6);

    --glass-bg: rgba(30, 41, 59, 0.85); /* Glass tối màu */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; outline: none; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    min-height: 100dvh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
    background-image: var(--bg-body-overlay);
    background-size: cover;
}

/* --- PRELOADER --- */
#manHinhCho {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-card); z-index: 99999;
    display: none; flex-direction: column; align-items: center; justify-content: center;
}
.vong-xoay {
    width: 60px; height: 60px; border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color); border-radius: 50%;
    animation: xoayVong 0.8s linear infinite; margin-bottom: 20px;
}
@keyframes xoayVong { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- LOGIN SCREEN --- */
#congDangNhap {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000;
    background-color: #000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    overflow: hidden;
}
#matrixBg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
    opacity: 0.25;
}
.hop-login {
    width: min(100%, 450px);
    background: rgba(255, 255, 255, 0.1);
    padding: clamp(30px, 5vw, 50px) clamp(20px, 4vw, 40px);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center; max-width: 100%; z-index: 2; position: relative;
}
body.dark-mode .hop-login { background-color: rgba(15, 23, 42, 0.8); }
.logo-login { width: 110px; height: 110px; margin: 0 auto 24px; animation: pulse 2s infinite; }
.logo-login img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; border: 3px solid rgba(255,255,255,0.2); }
@keyframes pulse { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); } 70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(37, 99, 235, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); } }

.tieu-de-login { font-size: 32px; font-weight: 800; color: #fff; margin-bottom: 8px; letter-spacing: -1px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.mo-ta-login { color: #cbd5e1; font-size: 15px; margin-bottom: 40px; font-weight: 300; }
.nhom-form { margin-bottom: 24px; text-align: left; }
.nhan-form {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-sub);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#congDangNhap .nhan-form {
    color: #e2e8f0;
}

body.dark-mode #congDangNhap .nhan-form {
    color: #dbeafe;
}
.input-form {
    width: 100%; padding: 16px; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px; font-size: 15px; background-color: rgba(0,0,0,0.3); transition: 0.3s; color: #fff;
    -webkit-appearance: none;
}
.input-form::placeholder { color: #94a3b8; }
.input-form:focus { border-color: var(--primary-color); background-color: rgba(0,0,0,0.5); box-shadow: 0 0 0 3px rgba(37,99,235,0.3); }
.nut-dang-nhap {
    width: 100%; padding: 16px; background: linear-gradient(135deg, var(--primary-color), #6366f1); color: #ffffff;
    border: 0; border-radius: 12px; font-weight: 700; font-size: 16px; cursor: pointer; margin-top: 10px; transition: 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); text-transform: uppercase; letter-spacing: 1px;
}
.nut-dang-nhap:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6); }
.nut-dang-nhap:disabled { opacity: 0.78; cursor: not-allowed; transform: none; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2); }
.login-account-samples {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.46);
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-align: left;
}
.login-account-samples__title {
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.login-account-samples__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.login-sample-chip {
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(37, 99, 235, 0.16);
    color: #dbeafe;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.login-sample-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(147, 197, 253, 0.5);
    background: rgba(37, 99, 235, 0.24);
}
.login-account-samples__hint {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #94a3b8;
}

/* --- SIDEBAR REFINED --- */
.sidebar {
    width: var(--sidebar-width); background: var(--gradient-sidebar); color: #ffffff;
    display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,0.05);
    z-index: 1000; transition: all 0.3s ease;
    padding-top: var(--sat); padding-bottom: var(--sab);
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    flex-shrink: 0;
}
.sidebar.thu-gon { width: 80px; }
.vung-thuong-hieu {
    height: 80px; display: flex; align-items: center; padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.icon-thuong-hieu {
    width: 42px; height: 42px; margin-right: 12px; flex-shrink: 0;
    background: #fff; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; padding: 2px;
    overflow: hidden; box-shadow: 0 0 15px rgba(255,255,255,0.1);
}
.icon-thuong-hieu img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.chu-thuong-hieu { font-size: 20px; font-weight: 800; color: #ffffff; white-space: nowrap; font-family: 'JetBrains Mono', monospace; letter-spacing: -0.5px; }
.sidebar.thu-gon .chu-thuong-hieu { display: none; }

.danh-sach-menu {
    flex-grow: 1; padding: 24px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}
.danh-sach-menu::-webkit-scrollbar {
    width: 8px;
}
.danh-sach-menu::-webkit-scrollbar-track {
    background: transparent;
}
.danh-sach-menu::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.38);
    border-radius: 999px;
}
.danh-sach-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.56);
}
.muc-menu {
    display: flex; align-items: center; padding: 14px 16px; color: #94a3b8;
    text-decoration: none; border-radius: 12px; margin-bottom: 6px; cursor: pointer; transition: 0.2s;
    font-weight: 500;
}
.muc-menu:hover { background-color: rgba(255, 255, 255, 0.08); color: #ffffff; transform: translateX(5px); }
.muc-menu.kich-hoat {
    background: linear-gradient(90deg, rgba(37,99,235,0.2), rgba(37,99,235,0.1));
    border-left: 4px solid var(--primary-color);
    color: #ffffff; font-weight: 700;
}
.muc-menu i { font-size: 20px; min-width: 30px; text-align: center; margin-right: 12px; }
.sidebar.thu-gon .muc-menu span { display: none; }
.sidebar.thu-gon .vung-thuong-hieu {
    justify-content: center;
    padding: 0;
}
.sidebar.thu-gon .icon-thuong-hieu {
    margin-right: 0;
}
.sidebar.thu-gon .danh-sach-menu {
    padding: 20px 10px;
}
.sidebar.thu-gon .danh-sach-menu > div:not(.muc-menu):not(.music-player-mini) {
    display: none !important;
}
.sidebar.thu-gon .muc-menu {
    justify-content: center;
    padding: 14px 10px;
    border-radius: 16px;
}
.sidebar.thu-gon .muc-menu.kich-hoat {
    border-left: none;
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.85);
}
.sidebar.thu-gon .muc-menu i {
    margin-right: 0;
    min-width: 0;
    font-size: 22px;
}

/* Sidebar Music Player */
.music-player-mini {
    margin: 10px 0; padding: 15px; background: rgba(0,0,0,0.3); border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05); backdrop-filter: blur(5px);
}
.sidebar.thu-gon .music-player-mini { display: none; }
.music-title { font-size: 12px; font-weight: 700; color: #fff; margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px;}
.music-controls { display: flex; justify-content: space-between; align-items: center; }
.music-btn { background: none; border: none; color: #cbd5e1; cursor: pointer; transition: 0.2s; font-size: 14px; }
.music-btn:hover { color: var(--primary-light); transform: scale(1.2); text-shadow: 0 0 10px var(--primary-color); }

.status-dot { width: 8px; height: 8px; background: var(--status-success); border-radius: 50%; margin-left: auto; box-shadow: 0 0 10px var(--status-success); animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.8); } }

/* --- MAIN CONTENT & HEADER --- */
.noi-dung-chinh {
    flex-grow: 1; display: flex; flex-direction: column; background-color: transparent;
    overflow: hidden; width: 100%; padding-top: var(--sat);
    min-width: 0; min-height: 0;
}
.header-chinh {
    position: relative;
    min-height: var(--header-height);
    height: auto;
    background: var(--glass-bg); backdrop-filter: var(--glass-blur);
    border-bottom: var(--glass-border);
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(300px, 460px) auto;
    align-items: center;
    padding: 14px 20px;
    gap: 12px 16px;
    z-index: 900; margin: 10px 20px; border-radius: 16px; box-shadow: var(--shadow-sm);
}
.tieu-de-trang {
    font-size: 20px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 15px;
    flex: 1 1 260px; min-width: 0; line-height: 1.2;
}
.nut-menu-mobile { cursor: pointer; color: var(--text-sub); font-size: 20px; display: none; }

.khu-vuc-tac-vu {
    display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
    justify-content: flex-end; min-width: 0;
}
.khu-vuc-tac-vu > div:not(.nut-tac-vu-header):not(.thong-tin-user):not(.dropdown-notify) {
    flex-shrink: 0;
}

/* Search Bar */
.header-search {
    position: relative; margin-right: 0; display: none;
    width: 100%; max-width: none; min-width: 220px;
}
@media(min-width: 992px) { .header-search { display: block; } }
.header-search input {
    padding: 12px 16px 12px 42px; border-radius: 14px; border: 1px solid var(--border-color);
    background: var(--bg-card); color: var(--text-main); width: 100%; transition: 0.3s; font-size: 13px;
}
.header-search input:focus { width: 100%; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.header-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-sub); font-size: 14px; }

.nut-tac-vu-header {
    width: 44px; height: 44px; border-radius: 12px; background: var(--bg-card);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--text-sub); border: 1px solid var(--border-color); position: relative;
    transition: all 0.2s;
}
.nut-tac-vu-header:hover { color: var(--primary-color); border-color: var(--primary-color); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cham-thong-bao { position: absolute; top: -2px; right: -2px; width: 12px; height: 12px; background: var(--status-danger); border-radius: 50%; border: 2px solid var(--bg-card); }
.password-reminder-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--status-warning);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.nut-doi-tai-khoan {
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}
.nut-doi-tai-khoan:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.18);
}
.nut-doi-tai-khoan span { white-space: nowrap; }
@media(max-width: 768px) {
    .nut-doi-tai-khoan {
        width: 44px;
        padding: 0;
        gap: 0;
    }
    .nut-doi-tai-khoan span { display: none; }
}

/* Notify Dropdown */
.dropdown-notify {
    position: absolute; top: calc(100% + 10px); right: 16px; width: min(320px, calc(100vw - 32px));
    background: var(--bg-card); border-radius: 16px; box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color); z-index: 2000; display: none;
    overflow: hidden; animation: fadeIn 0.2s;
}
.notify-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); font-weight: 700; font-size: 14px; background: var(--primary-light); color: var(--primary-dark); }
.notify-item { padding: 12px 20px; border-bottom: 1px solid var(--border-color); font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: 0.2s; color: var(--text-main); }
.notify-item:hover { background: var(--bg-body); }
.notify-item i { width: 18px; text-align: center; }
.notify-item-critical i { color: var(--status-danger); }
.notify-item-warning i { color: var(--status-warning); }
.notify-empty { padding: 18px 20px; color: var(--text-sub); font-size: 13px; }

.thong-tin-user { display: flex; align-items: center; gap: 15px; cursor: pointer; margin-left: auto; }
.thong-tin-user > div:first-child { display: block !important; text-align: right; }
.anh-dai-dien {
    width: 44px; height: 44px; background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4); font-size: 16px;
}

.driver-mode-bar {
    margin: 0 20px 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 34%),
        linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(14, 165, 233, 0.08)),
        var(--bg-card);
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 10px;
}

.driver-mode-bar[hidden],
.driver-mode-bar[aria-hidden="true"] {
    display: none !important;
}
.driver-mode-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.driver-mode-summary strong {
    display: block;
    font-size: 17px;
    color: var(--text-main);
    margin-top: 3px;
    line-height: 1.35;
}
.driver-mode-summary small {
    display: block;
    margin-top: 3px;
    color: var(--text-sub);
    line-height: 1.45;
    font-size: 13px;
}
.driver-mode-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-dark);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.driver-mode-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.driver-mode-metric {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.2);
    display: grid;
    gap: 4px;
}
.driver-mode-metric span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    text-transform: uppercase;
}
.driver-mode-metric strong {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.3;
}
.driver-mode-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    gap: 8px;
}
.driver-quick-btn {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    font-size: 13px;
}
.driver-quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.32);
}
.driver-quick-btn.is-current {
    border-color: rgba(37, 99, 235, 0.42);
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-dark);
}
.driver-quick-btn--primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}
.driver-quick-btn--ghost {
    min-width: 142px;
}

body.driver-mode .header-search,
body.driver-mode .music-player-mini,
body.driver-mode .muc-menu.driver-hidden,
body.driver-mode .sidebar .danh-sach-menu > div[data-driver-hidden="true"] {
    display: none !important;
}
body.driver-mode .header-chinh {
    grid-template-columns: minmax(180px, 1fr) auto;
}
body.driver-mode #khachhang .chia-cot-2-1 {
    grid-template-columns: 1fr;
}
body.driver-mode #khachhang .chia-cot-2-1 > .the-du-lieu:first-child {
    display: none;
}
body.driver-mode .route-planner-card {
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.08);
}

body.dark-mode .driver-mode-bar {
    border-color: rgba(59, 130, 246, 0.26);
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.14), transparent 34%),
        linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 233, 0.08)),
        rgba(15, 23, 42, 0.96);
}
body.dark-mode .driver-mode-kicker {
    background: rgba(37, 99, 235, 0.22);
    color: #bfdbfe;
}
body.dark-mode .driver-mode-metric,
body.dark-mode .driver-quick-btn {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(71, 85, 105, 0.48);
}
body.dark-mode .driver-quick-btn {
    color: #e2e8f0;
}
body.dark-mode .driver-quick-btn.is-current {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.42);
    color: #bfdbfe;
}
body.dark-mode .driver-quick-btn--primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
}

@media (max-width: 1180px) {
    .driver-mode-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .driver-mode-bar {
        margin: 0 14px 12px;
        padding: 12px;
    }
    .driver-mode-summary {
        flex-direction: column;
        align-items: stretch;
    }
    .driver-mode-summary strong {
        font-size: 16px;
    }
    .driver-mode-metrics {
        grid-template-columns: 1fr 1fr;
    }
    .driver-mode-actions {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .driver-mode-metrics,
    .driver-mode-actions {
        grid-template-columns: 1fr;
    }
}

.cuon-noi-dung {
    flex-grow: 1; padding: 12px clamp(16px, 2vw, 20px); overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(60px + var(--sab));
}
.phan-module { min-width: 0; }

/* --- CARDS & MODULES --- */
.hang-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 30px; }
.the-du-lieu {
    background-color: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 24px; border: var(--glass-border);
    display: flex; flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative; overflow: hidden;
}
.the-du-lieu:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,0.3); }
.the-du-lieu,
.route-planner-card,
.route-map-shell,
.route-result-shell,
.route-constraint-board,
.warehouse-summary-card,
.warehouse-sensor-card,
.finance-side-card,
.financial-card,
.service-center-kpi,
.service-center-section,
.service-center-side-block,
.profit-control-board,
.profit-control-kpi,
.profit-control-section,
.epod-verify-card,
.epod-proof-card,
.epod-timeline-item {
    color: var(--text-main);
}
.the-du-lieu::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: transparent; transition: 0.3s;
}
.the-du-lieu:hover::before { background: var(--primary-color); }

.tieu-de-kpi { font-size: 12px; font-weight: 600; color: var(--text-sub); text-transform: uppercase; margin-bottom: 12px; letter-spacing: 0.8px; display: flex; justify-content: space-between; }
/* Tăng cường hiển thị tiêu đề trong dark mode */
body.dark-mode .tieu-de-kpi { color: #94a3b8; }

.gia-tri-kpi { font-size: 36px; font-weight: 800; color: var(--text-main); margin-bottom: 8px; font-family: 'JetBrains Mono', monospace; letter-spacing: -1px; }
.phan-tram-tang { color: var(--status-success); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; background: rgba(16, 185, 129, 0.1); padding: 4px 8px; border-radius: 6px; width: fit-content; }
.phan-tram-giam { color: var(--status-danger); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; background: rgba(239, 68, 68, 0.1); padding: 4px 8px; border-radius: 6px; width: fit-content; }

.chia-cot-2-1 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 24px; margin-bottom: 30px; }
.tieu-de-khoi { font-size: 18px; font-weight: 700; color: var(--text-main); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; border-left: 4px solid var(--primary-color); padding-left: 10px; line-height: 1.2; }

/* --- TABLES & MAPS --- */
.bao-quanh-bang { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 16px; -webkit-overflow-scrolling: touch; background: var(--bg-card); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bao-quanh-bang table { min-width: 720px; }
th { text-align: left; padding: 18px 24px; background-color: var(--table-head-bg); color: var(--text-sub); font-weight: 700; border-bottom: 1px solid var(--border-color); white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
/* Fix màu chữ header bảng trong dark mode */
body.dark-mode th { color: #cbd5e1; font-weight: 700; }

td { padding: 18px 24px; border-bottom: 1px solid var(--border-color); color: var(--text-main); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: var(--hover-bg); }
.huy-hieu-xe { background-color: rgba(37, 99, 235, 0.1); color: var(--primary-color); padding: 6px 12px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-weight: 700; border: 1px solid rgba(37, 99, 235, 0.2); cursor: pointer; display: inline-block; transition: 0.2s; font-size: 13px; }
.huy-hieu-xe:hover { background-color: var(--primary-color); color: white; transform: scale(1.05); }
.huy-hieu-toi-uu { background-color: rgba(16, 185, 129, 0.1); color: var(--status-success); padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; border: 1px solid rgba(16, 185, 129, 0.2); }

.khung-ban-do { width: 100%; height: clamp(320px, 50vh, 500px); border-radius: 16px; border: 1px solid var(--border-color); z-index: 1; position: relative; overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,0.05); }

.chu-thich-nhiet {
    position: absolute; bottom: 20px; left: 20px; background: rgba(255,255,255,0.9);
    padding: 12px 16px; border-radius: 12px; z-index: 1000;
    box-shadow: var(--shadow-lg); font-size: 12px; border: 1px solid var(--border-color);
    color: #0f172a; /* Luôn giữ màu tối cho chú thích trên bản đồ nền sáng */
    backdrop-filter: blur(5px);
}
.thanh-mau { display: flex; align-items: center; gap: 15px; margin-top: 5px; }
.muc-mau { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.cham-mau { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 5px currentColor; }

.hang-nhap-lieu { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.thanh-loc-time { flex-wrap: wrap; }
.o-nhap-chinh, .chon-thoi-gian {
    width: 100%; padding: 14px 16px; border: 1px solid var(--border-color);
    border-radius: 12px; font-size: 14px; background-color: var(--input-bg);
    color: var(--text-main); -webkit-appearance: none; transition: 0.2s;
    font-family: inherit;
}
/* Fix cho dropdown option trong dark mode */
select option { background-color: var(--bg-card); color: var(--text-main); }

.o-nhap-chinh:focus { border-color: var(--primary-color); box-shadow: 0 0 0 4px var(--primary-light); }
body.dark-mode .o-nhap-chinh:focus { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2); }
.o-nhap-chinh::placeholder,
.nhap-lieu-editor::placeholder {
    color: var(--text-soft);
}
.nut-phu {
    background: var(--bg-card-soft);
}
.ghep-booking-cta {
    margin-top: 24px;
    padding: 12px;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.34);
    border-radius: 12px;
    text-align: center;
    color: #065f46;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.ghep-booking-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.16);
}
body.dark-mode .ghep-booking-cta {
    background: rgba(16,185,129,0.16);
    border-color: rgba(52, 211, 153, 0.3);
    color: #d1fae5;
}

.nut-tac-vu { padding: 14px 28px; background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: white; border: none; border-radius: 12px; font-weight: 600; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); letter-spacing: 0.5px; }
.nut-tac-vu:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5); }
.nut-tac-vu:active { transform: scale(0.98); }
.nut-phu { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color); box-shadow: none; }
.nut-phu:hover { background: var(--bg-body); border-color: var(--text-sub); transform: translateY(-2px); }

.nut-noi-bot {
    position: fixed;
    bottom: 50px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: linear-gradient(145deg, #2563eb, #6d28d9);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 5000;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    animation: float 3s ease-in-out infinite;
    overflow: hidden;
}
.nut-noi-bot::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.nut-noi-bot i {
    position: relative;
    z-index: 1;
}
.chat-launch-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid rgba(15, 23, 42, 0.9);
    z-index: 1;
}
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-8px); } 100% { transform: translateY(0px); } }
.nut-noi-bot:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 22px 46px rgba(37, 99, 235, 0.42); }

/* === AI OPS CHATBOX === */
.khung-chat {
    position: fixed;
    right: 24px;
    bottom: 118px;
    width: min(396px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: min(660px, calc(100vh - 132px));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 251, 0.98));
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.26);
    display: none;
    flex-direction: column;
    z-index: 5000;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.24);
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(18px);
    animation: slideInUp 0.32s cubic-bezier(0.165, 0.84, 0.44, 1);
}
body.dark-mode .khung-chat {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
    border-color: rgba(71, 85, 105, 0.5);
}
@keyframes slideInUp { from { transform: translateY(36px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.dau-khung-chat {
    padding: 18px 18px 14px;
    background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.28), transparent 45%), linear-gradient(135deg, #0f172a, #1d4ed8 55%, #312e81);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.chat-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.chat-header-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}
.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.chat-header-copy {
    min-width: 0;
}
.chat-header-copy strong {
    display: block;
    font-size: 22px;
    line-height: 1.08;
    font-weight: 800;
}
.chat-header-copy span {
    display: block;
    margin-top: 6px;
    max-width: 240px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.8);
}
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.chat-header-status-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.chat-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}
.chat-clear-btn,
.chat-close-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}
.chat-clear-btn:hover,
.chat-close-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.18);
}
.chat-summary-strip {
    padding: 14px 18px 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.chat-summary-card {
    min-width: 0;
    min-height: 92px;
    padding: 12px 13px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(241, 245, 249, 0.9));
    border: 1px solid rgba(203, 213, 225, 0.86);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    box-shadow: 0 10px 24px rgba(148, 163, 184, 0.08);
}
body.dark-mode .chat-summary-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
    border-color: rgba(71, 85, 105, 0.42);
}
.chat-summary-card span,
.chat-summary-card small {
    display: block;
}
.chat-summary-card span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-sub);
}
.chat-summary-card strong {
    display: block;
    font-size: 18px;
    line-height: 1.15;
    color: var(--text-main);
}
body.dark-mode .chat-summary-card strong {
    color: #e2e8f0;
}
.chat-summary-card small {
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chat-helper-line {
    margin: 12px 18px 0;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(191, 219, 254, 0.72);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-sub);
}
body.dark-mode .chat-helper-line {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(71, 85, 105, 0.42);
    color: #94a3b8;
}
.than-khung-chat {
    flex-grow: 1;
    min-height: 180px;
    padding: 16px 18px;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(244, 247, 251, 0.72), rgba(255, 255, 255, 0.94));
    display: flex;
    flex-direction: column;
    gap: 12px;
}
body.dark-mode .than-khung-chat {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.48), rgba(2, 6, 23, 0.72));
}
.chat-day-divider {
    align-self: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
body.dark-mode .chat-day-divider {
    background: rgba(37, 99, 235, 0.16);
    color: #bfdbfe;
}
.chan-khung-chat {
    padding: 16px 18px calc(18px + var(--sab));
    background: rgba(255, 255, 255, 0.86);
    border-top: 1px solid rgba(226, 232, 240, 0.92);
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(12px);
}
body.dark-mode .chan-khung-chat {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(71, 85, 105, 0.38);
}
.chat-shortcut-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
}
.chat-shortcut-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.chat-shortcut-head small {
    font-size: 11px;
    color: var(--text-soft);
}
.chat-suggestion-toggle {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(248, 250, 252, 0.92);
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.chat-suggestion-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.42);
}
.chat-suggestion-toggle i {
    transition: transform 0.2s ease;
}
body.dark-mode .chat-suggestion-toggle {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(71, 85, 105, 0.42);
    color: #cbd5e1;
}
.chat-suggestions-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chan-khung-chat.is-collapsed .chat-suggestions-body {
    display: none;
}
.chan-khung-chat.is-collapsed .chat-suggestion-toggle i {
    transform: rotate(180deg);
}
.chan-khung-chat.is-collapsed {
    gap: 10px;
}
.chat-mode-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.chat-mode-chip {
    min-height: 40px;
    padding: 0 10px;
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(248, 250, 252, 0.92);
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    text-align: center;
}
body.dark-mode .chat-mode-chip {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(71, 85, 105, 0.42);
    color: #cbd5e1;
}
.chat-mode-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.42);
}
.chat-mode-chip.is-active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}
.bong-chat {
    padding: 12px 14px;
    border-radius: 22px;
    font-size: 14px;
    max-width: 100%;
    line-height: 1.6;
    box-shadow: 0 12px 24px rgba(148, 163, 184, 0.08);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bong-chat-he-thong {
    max-width: 100%;
}
.bong-may {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.95);
    align-self: flex-start;
    color: #1e293b;
    border-bottom-left-radius: 10px;
}
body.dark-mode .bong-may {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(71, 85, 105, 0.52);
    color: #ffffff;
    box-shadow: none;
}
.bong-nguoi {
    background: linear-gradient(135deg, #2563eb, #4338ca);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 10px;
    box-shadow: 0 18px 30px rgba(37, 99, 235, 0.24);
}
.chat-message-meta {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-sub);
}
.bong-nguoi .chat-message-meta {
    color: rgba(255, 255, 255, 0.72);
}
.chat-message-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-message-body p,
.chat-message-body h4 {
    margin: 0;
}
.chat-rich-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.95);
}
body.dark-mode .chat-rich-card {
    background: rgba(2, 6, 23, 0.42);
    border-color: rgba(71, 85, 105, 0.45);
}
.chat-rich-card[data-tone="alert"] {
    border-color: rgba(239, 68, 68, 0.24);
    box-shadow: inset 0 0 0 1px rgba(254, 202, 202, 0.38);
}
.chat-rich-card[data-tone="success"] {
    border-color: rgba(16, 185, 129, 0.22);
    box-shadow: inset 0 0 0 1px rgba(167, 243, 208, 0.42);
}
.chat-rich-card[data-tone="info"] {
    border-color: rgba(37, 99, 235, 0.22);
}
.chat-rich-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
}
.chat-rich-card h4 {
    font-size: 16px;
    color: var(--text-main);
}
body.dark-mode .chat-rich-card h4 {
    color: #e2e8f0;
}
.chat-rich-card p {
    font-size: 13px;
    color: var(--text-sub);
}
.chat-rich-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.chat-rich-metric {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.92);
}
body.dark-mode .chat-rich-metric {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(71, 85, 105, 0.42);
}
.chat-rich-metric span,
.chat-rich-metric small {
    display: block;
}
.chat-rich-metric span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    margin-bottom: 4px;
}
.chat-rich-metric strong {
    display: block;
    font-size: 16px;
    color: var(--text-main);
}
body.dark-mode .chat-rich-metric strong {
    color: #e2e8f0;
}
.chat-rich-metric small {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-soft);
}
.chat-rich-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chat-action-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.chat-action-btn.is-secondary {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-dark);
    border: 1px solid rgba(96, 165, 250, 0.28);
}
body.dark-mode .chat-action-btn.is-secondary {
    background: rgba(30, 41, 59, 0.92);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.24);
}
.chat-action-btn:hover {
    transform: translateY(-1px);
}
.chat-rich-footer {
    font-size: 12px;
    color: var(--text-soft);
    border-top: 1px dashed rgba(148, 163, 184, 0.45);
    padding-top: 10px;
}
.vung-goi-y {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.chip-goi-y {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    background: rgba(37, 99, 235, 0.07);
    color: var(--primary-dark);
    border: 1px solid rgba(96, 165, 250, 0.26);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.35;
}
body.dark-mode .chip-goi-y {
    background: rgba(30, 41, 59, 0.88);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.22);
}
.chip-goi-y:hover {
    background: rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}
.chat-input-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 12px 12px 10px;
    border-radius: 20px;
    background: rgba(248, 250, 252, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
body.dark-mode .chat-input-shell {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(71, 85, 105, 0.42);
    box-shadow: none;
}
.chat-input-shell:focus-within {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.chat-input-stack {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-input-main {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    max-height: 132px;
    margin-bottom: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    resize: none;
    overflow-y: auto;
    line-height: 1.5;
    font-size: 15px;
    color: var(--text-main);
}
.chat-input-main:focus {
    box-shadow: none;
}
body.dark-mode .chat-input-main {
    color: #e2e8f0;
}
.chat-compose-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    color: var(--text-soft);
}
.chat-compose-meta strong {
    min-width: 0;
    font-size: 11px;
    color: var(--text-sub);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-compose-meta span {
    flex-shrink: 0;
}
.chat-send-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-self: flex-end;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}
.chat-send-btn:hover {
    transform: translateY(-1px);
}
.chat-send-btn:disabled,
.chat-clear-btn:disabled,
.chat-close-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.chat-input-hint {
    font-size: 11px;
    color: var(--text-soft);
}
@media (max-width: 640px) {
    .khung-chat,
    .khung-chat-thu-gon {
        left: 8px;
        right: 8px;
        bottom: calc(80px + var(--sab));
        width: auto;
        max-width: none;
        height: min(560px, calc(100dvh - 96px - var(--sab)));
        border-radius: 24px;
    }
    .dau-khung-chat {
        padding: 14px 14px 12px;
        gap: 10px;
    }
    .chat-header-copy strong {
        font-size: 18px;
    }
    .chat-header-copy span {
        max-width: none;
        font-size: 11px;
        margin-top: 4px;
    }
    .chat-summary-strip {
        display: none;
    }
    .chat-helper-line {
        margin: 8px 14px 0;
        padding: 8px 10px;
        font-size: 11px;
    }
    .than-khung-chat {
        min-height: 0;
        padding: 12px 14px;
        gap: 10px;
    }
    .bong-chat {
        padding: 10px 12px;
        border-radius: 18px;
        font-size: 13px;
        gap: 8px;
    }
    .chat-message-meta {
        font-size: 10px;
        letter-spacing: 0.06em;
    }
    .chat-message-body {
        gap: 8px;
    }
    .chat-message-body strong {
        font-size: 16px;
        line-height: 1.35;
    }
    .chat-message-body p {
        font-size: 13px;
        line-height: 1.5;
    }
    .chan-khung-chat {
        padding: 12px 14px calc(14px + var(--sab));
        gap: 10px;
    }
    .chat-shortcut-head {
        align-items: center;
        gap: 10px;
    }
    .chat-mode-strip {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .chat-mode-strip::-webkit-scrollbar {
        display: none;
    }
    .chat-mode-chip {
        flex: 0 0 auto;
        min-width: 92px;
        min-height: 38px;
        border-radius: 13px;
        padding: 0 12px;
        font-size: 11px;
    }
    .chip-goi-y {
        min-height: 40px;
        border-radius: 14px;
        padding: 0 12px;
        font-size: 11px;
    }
    .chat-input-shell {
        padding: 10px 10px 8px;
        border-radius: 18px;
        gap: 10px;
    }
    .chat-input-main {
        min-height: 44px;
        max-height: 112px;
        font-size: 14px;
    }
    .chat-compose-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .chat-compose-meta strong,
    .chat-compose-meta span,
    .chat-input-hint {
        font-size: 10px;
    }
}
.dang-go {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(248, 250, 252, 0.94);
    border-radius: 18px;
    width: fit-content;
    border: 1px solid rgba(226, 232, 240, 0.9);
}
body.dark-mode .dang-go {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(71, 85, 105, 0.42);
}
.dang-go span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-sub);
}
.cham {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: nhapNhay 1.4s infinite ease-in-out both;
}
.cham:nth-child(1) { animation-delay: -0.32s; }
.cham:nth-child(2) { animation-delay: -0.16s; }
@keyframes nhapNhay { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
@media (max-width: 560px) {
    .chat-rich-metrics {
        grid-template-columns: 1fr;
    }
    .chat-header-top {
        gap: 10px;
    }
    .chat-header-actions {
        gap: 6px;
    }
    .chat-status-pill {
        width: 100%;
        justify-content: center;
    }
    .chat-shortcut-head {
        flex-direction: row;
        align-items: center;
    }
    .chat-suggestion-toggle {
        width: auto;
        min-height: 36px;
        padding: 0 12px;
        justify-content: center;
    }
    .vung-goi-y {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .chat-send-btn {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }
}
@media (max-width: 480px) {
    .chat-header-top {
        flex-direction: column;
    }
    .chat-header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .chat-status-pill {
        min-height: 34px;
        padding: 0 12px;
    }
    .vung-goi-y {
        grid-template-columns: 1fr;
    }
}

/* --- MODAL --- */
#modalXe {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 9000; display: none;
    align-items: flex-start; justify-content: center; backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: clamp(10px, 2vh, 18px) clamp(8px, 2vw, 18px) calc(18px + var(--sab));
}
.hop-modal {
    width: 650px; max-width: 90%; background: var(--bg-card);
    border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg);
    animation: modalZoom 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    margin: auto;
    max-height: calc(100dvh - 24px - var(--sab));
}
.hop-modal * { pointer-events: auto; }
@keyframes modalZoom { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.header-modal { padding: 20px 30px; background: var(--bg-body); color: var(--text-main); display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 18px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.body-modal { padding: 30px; color: var(--text-main); overflow-y: auto; overflow-x: hidden; min-height: 0; }
.grid-thong-tin { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 24px; }
.nhan-modal { font-size: 12px; color: var(--text-sub); text-transform: uppercase; font-weight: 700; letter-spacing: 0.8px; margin-bottom: 6px; }
.gt-modal { font-size: 16px; font-weight: 600; color: var(--text-main); }

.modal-doi-mat-khau {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(6px);
}

.password-modal-shell {
    width: min(560px, calc(100vw - 24px));
}

.password-user-card {
    padding: 18px;
    border-radius: 18px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.password-user-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.password-hint {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.6;
}

.password-hint--warning {
    border-color: rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

body.dark-mode .password-hint--warning {
    color: #fde68a;
}

.password-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.password-field--full {
    grid-column: 1 / -1;
}

.password-inline-note {
    margin-top: 14px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.6;
}

.password-status {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card-soft);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}

.password-status[data-tone="success"] {
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.password-status[data-tone="warning"] {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

.password-status[data-tone="error"] {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

body.dark-mode .password-status[data-tone="success"] {
    color: #bbf7d0;
}

body.dark-mode .password-status[data-tone="warning"] {
    color: #fde68a;
}

body.dark-mode .password-status[data-tone="error"] {
    color: #fecaca;
}

.password-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.password-actions .nut-tac-vu {
    min-width: 190px;
}

/* --- TOAST --- */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 12px; }
.toast {
    background: var(--bg-card); color: var(--text-main); padding: 16px 24px;
    border-radius: 12px; box-shadow: var(--shadow-lg);
    border-left: 6px solid var(--primary-color); display: flex;
    align-items: center; gap: 16px; animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    font-weight: 500; font-size: 14px; backdrop-filter: blur(10px);
    min-width: 300px;
}
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media screen and (max-width: 1200px) {
    .header-chinh { padding: 14px 22px; margin: 10px 16px; }
    .header-search { flex-basis: 240px; max-width: 320px; }
    .hang-kpi,
    .commercial-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hang-kpi[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .chia-cot-2-1 { grid-template-columns: 1fr; }
    .the-du-lieu > div[style*="grid-template-columns: 2fr 1fr 1fr"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .the-du-lieu > div[style*="grid-template-columns: 2fr 1fr 1fr"] > :first-child {
        grid-column: 1 / -1;
    }
}

@media screen and (max-width: 768px) {
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%);
        width: 280px; box-shadow: 2px 0 10px rgba(0,0,0,0.5);
        padding-top: max(20px, var(--sat));
    }
    .sidebar.mobile-open { transform: translateX(0); }

    .noi-dung-chinh { width: 100%; margin-left: 0; }
    .header-chinh {
        padding: 14px; margin: 0 0 10px; border-radius: 0 0 18px 18px;
        gap: 12px; align-items: flex-start;
    }
    .tieu-de-trang { font-size: 17px; gap: 12px; }
    .nut-menu-mobile { display: block !important; margin-right: 15px; }
    .header-search { display: none !important; }
    .khu-vuc-tac-vu {
        width: 100%; flex-basis: 100%;
        justify-content: space-between; gap: 10px;
    }
    .khu-vuc-tac-vu > div:not(.nut-tac-vu-header):not(.thong-tin-user):not(.dropdown-notify) {
        display: none;
    }
    .thong-tin-user > div:first-child { display: none !important; }
    .dropdown-notify { right: 12px; width: min(320px, calc(100vw - 24px)); }

    .cuon-noi-dung { padding: 12px 14px; padding-bottom: calc(92px + var(--sab)); }
    .hang-kpi { grid-template-columns: repeat(1, 1fr); gap: 15px; }
    .hang-kpi[style] { grid-template-columns: repeat(1, 1fr) !important; }
    .commercial-kpi-grid { grid-template-columns: 1fr; }
    .chia-cot-2-1 { grid-template-columns: 1fr; gap: 15px; }
    .hang-nhap-lieu { grid-template-columns: 1fr; }
    .the-du-lieu { padding: 18px; border-radius: 18px; }
    .the-du-lieu > div[style*="grid-template-columns: 2fr 1fr 1fr"],
    .the-du-lieu > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    .thanh-loc-time { align-items: stretch !important; }
    .thanh-loc-time > * { flex: 1 1 100%; }
    .thanh-loc-time .chon-thoi-gian,
    .thanh-loc-time .nut-tac-vu { width: 100% !important; }
    .gia-tri-kpi { font-size: 30px; }
    th, td { padding: 14px 16px; }
    .bao-quanh-bang table { min-width: 640px; }

    .khung-chat {
        bottom: 0; right: 0; left: 0; width: 100%; height: 85vh;
        border-radius: 20px 20px 0 0; z-index: 9999;
    }
    .nut-noi-bot { bottom: 80px; right: 20px; }
    .khung-ban-do { height: clamp(280px, 42vh, 350px); }
    .hop-modal { max-width: calc(100vw - 20px); border-radius: 20px; }
    .header-modal,
    .body-modal { padding: 20px; }
    .password-user-grid,
    .password-modal-grid {
        grid-template-columns: 1fr;
    }
    .password-actions {
        flex-direction: column-reverse;
    }
    .password-actions .nut-tac-vu {
        width: 100%;
    }
    .toast {
        min-width: 0;
        max-width: calc(100vw - 20px);
        padding: 14px 16px;
    }
    .footer-monitor {
        height: auto;
        padding: 8px 14px calc(8px + var(--sab));
        gap: 6px 14px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .mon-item { margin-right: 0; }
    .invoice-paper {
        width: calc(100vw - 20px);
        padding: 22px 18px 28px;
    }
    .print-btn {
        position: static;
        width: 100%;
        margin-bottom: 16px;
    }
    .commercial-badge {
        left: 18px;
        top: 18px;
        transform: none;
    }
}

@media screen and (max-width: 520px) {
    #congDangNhap { padding: 14px; }
    .hop-login { border-radius: 20px; }
    .logo-login { width: 88px; height: 88px; margin-bottom: 18px; }
    .tieu-de-login { font-size: 26px; }
    .mo-ta-login { margin-bottom: 28px; font-size: 14px; }
    .login-account-samples__grid { grid-template-columns: 1fr; }
    .header-chinh { padding: 12px; }
    .tieu-de-trang { font-size: 16px; }
    .nut-tac-vu-header,
    .anh-dai-dien { width: 40px; height: 40px; }
    .footer-monitor { font-size: 10px; }
}

.an-di { display: none !important; }

/* Custom Map Icons */
.custom-icon-truck { background: transparent; text-align: center; color: #2563eb; font-size: 24px; text-shadow: 0 4px 8px rgba(0,0,0,0.2); transition: transform 0.3s; filter: drop-shadow(0 0 5px rgba(37,99,235,0.5)); }
.custom-icon-truck:hover { transform: scale(1.3); }
.custom-icon-depot { background: transparent; text-align: center; color: #ef4444; font-size: 30px; text-shadow: 0 4px 8px rgba(0,0,0,0.2); }
.route-stop-icon-wrap,
.heat-hotspot-icon-wrap { background: transparent; border: 0; }

.route-stop-marker {
    position: relative;
    display: block;
    width: 40px;
    height: 46px;
}

.route-stop-marker__pulse {
    position: absolute;
    inset: 8px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0) 70%);
    transform: scale(1.3);
    opacity: 0.85;
}

.route-stop-marker__pin {
    position: absolute;
    left: 50%;
    top: 0;
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 10px;
    transform: translateX(-50%) rotate(45deg);
    background: var(--route-stop-color, #1a73e8);
    border: 3px solid rgba(255,255,255,0.98);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.22);
}

.route-stop-marker__pin i {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    color: #ffffff;
    font-size: 11px;
}

.route-stop-marker__label {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    min-width: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
    color: #0f172a;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    line-height: 1;
}

.route-stop-marker--major {
    width: 50px;
    height: 56px;
}

.route-stop-marker--major .route-stop-marker__pin {
    width: 36px;
    height: 36px;
}

.route-stop-marker--major .route-stop-marker__pin i {
    font-size: 12px;
}

.route-stop-marker--major .route-stop-marker__label {
    min-width: 26px;
    padding: 4px 8px;
}

.route-stop-icon--muted .route-stop-marker {
    filter: saturate(0.35);
}

.route-stop-icon--muted .route-stop-marker__pulse {
    opacity: 0.45;
}

.heat-hotspot-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.heat-hotspot-chip::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--heat-color, #f59e0b);
    box-shadow: 0 0 14px var(--heat-color, #f59e0b);
}

.route-map-tooltip,
.route-stop-tooltip {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.22);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
}

.route-map-tooltip::before,
.route-stop-tooltip::before {
    border-top-color: rgba(15, 23, 42, 0.88) !important;
}

.route-map-popup .leaflet-popup-content-wrapper {
    border-radius: 16px;
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.2);
}

.route-map-popup .leaflet-popup-content {
    margin: 14px 16px;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.65;
}

.route-map-popup .leaflet-popup-tip {
    background: #ffffff;
}

/* Warehouse Grid */
.luoi-kho-bai {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin-top: 20px;
}
.o-ke-hang {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    color: var(--text-main);
}
.o-ke-hang:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}
.o-ke-hang.full { border-color: var(--status-danger); background: linear-gradient(135deg, rgba(239,68,68,0.05), rgba(239,68,68,0.1)); }
.o-ke-hang.empty { border-color: var(--status-success); background: linear-gradient(135deg, rgba(16,185,129,0.05), rgba(16,185,129,0.1)); }
.o-ke-hang.partial { border-color: var(--status-warning); background: linear-gradient(135deg, rgba(245,158,11,0.05), rgba(245,158,11,0.1)); }

.o-ke-hang .ma-ke { font-weight: 800; font-size: 14px; margin-bottom: 4px; font-family: 'JetBrains Mono'; }
.o-ke-hang .trang-thai-ke { font-size: 11px; color: var(--text-sub); }
.thanh-ti-le { height: 6px; width: 100%; background: #e2e8f0; margin-top: 8px; border-radius: 3px; overflow: hidden; }
.muc-ti-le { height: 100%; border-radius: 3px; transition: width 0.5s; }

/* Driver Cam AI */
.driver-cam-container {
    position: relative;
    width: 100%;
    height: 220px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}
.driver-cam-overlay {
    position: absolute; top:0; left:0; width:100%; height:100%;
    border: 2px solid rgba(16, 185, 129, 0.3);
    background: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(16, 185, 129, 0.1) 2px);
    pointer-events: none;
}
.quet-khuon-mat {
    position: absolute; top: 20%; left: 30%; width: 40%; height: 50%;
    border: 2px dashed #10b981;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(16,185,129,0.5);
}
.thong-so-ai {
    position: absolute; bottom: 15px; left: 15px;
    color: #10b981; font-family: 'JetBrains Mono', monospace; font-size: 12px;
    text-shadow: 0 0 4px #000; line-height: 1.4;
}
.canh-bao-ngu {
    position: absolute; top: 15px; right: 15px;
    background: rgba(239, 68, 68, 0.9); color: white;
    padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: bold;
    display: none; box-shadow: 0 0 10px #ef4444; animation: blink 0.5s infinite;
}
.driver-avatar-fake {
    font-size: 100px; color: #334155;
}

.badge-status { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.status-paid { background: rgba(16, 185, 129, 0.1); color: var(--status-success); border: 1px solid rgba(16, 185, 129, 0.2); }
.status-pending { background: rgba(245, 158, 11, 0.1); color: var(--status-warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.status-overdue { background: rgba(239, 68, 68, 0.1); color: var(--status-danger); border: 1px solid rgba(239, 68, 68, 0.2); }

.commercial-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 24px; }
.financial-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow-sm);
}
.financial-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--primary-color);
}
.financial-card-ar {
    background: linear-gradient(145deg, rgba(37,99,235,0.1), rgba(255,255,255,0.86));
}
.financial-card-cod {
    background: linear-gradient(145deg, rgba(16,185,129,0.1), rgba(255,255,255,0.88));
}
.financial-card-ap {
    background: linear-gradient(145deg, rgba(239,68,68,0.1), rgba(255,255,255,0.88));
}
.financial-card-label {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-sub);
}
.financial-card-value {
    margin-top: 12px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}
.financial-card-note {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-sub);
}

.route-control-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.route-planner-card,
.route-map-shell,
.route-result-shell {
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.88));
    box-shadow: var(--shadow-sm);
}

.route-planner-card {
    padding: 22px;
}

.route-planner-kicker {
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-sub);
}

.route-access-notice {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-main);
}

.route-access-notice strong {
    font-size: 13px;
    letter-spacing: 0.02em;
}

.route-access-notice span {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-sub);
}

.route-access-notice[data-tone="warning"] {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.12);
}

.route-access-notice[data-tone="success"] {
    border-color: rgba(16, 185, 129, 0.22);
    background: rgba(16, 185, 129, 0.11);
}

.route-access-notice[data-tone="info"] {
    border-color: rgba(59, 130, 246, 0.24);
    background: rgba(59, 130, 246, 0.09);
}

.route-field-stack {
    display: grid;
    gap: 14px;
}

.route-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-primary-cta {
    width: 100%;
    margin-top: 20px;
}

.route-support-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.route-support-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.route-selected-head {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 14px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.route-selected-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.route-selected-metric {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(37, 99, 235, 0.08);
}

.route-selected-metric span {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.route-selected-metric strong {
    display: block;
    font-size: 18px;
    line-height: 1.35;
    color: var(--text-main);
}

.route-selected-wide {
    grid-column: 1 / -1;
}

.route-action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.route-selected-stop-board {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.route-selected-stop-item,
.route-selected-stop-empty {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.08);
    background: rgba(255,255,255,0.76);
}

.route-selected-stop-item {
    display: grid;
    gap: 8px;
}

.route-selected-stop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.route-selected-stop-head strong {
    color: var(--text-main);
    font-size: 14px;
}

.route-selected-stop-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.route-selected-stop-meta {
    display: grid;
    gap: 6px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.6;
}

.route-result-shell {
    padding: 18px;
}

.route-empty-state,
.route-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 160px;
    text-align: center;
    color: var(--text-sub);
}

.route-empty-state i,
.route-loading-state i {
    font-size: 28px;
    color: var(--primary-color);
}

.route-empty-state strong,
.route-loading-state strong {
    font-size: 16px;
    color: var(--text-main);
}

.route-analysis-table-shell {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--bg-card);
}

.route-analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.route-analysis-table thead th {
    background: rgba(37, 99, 235, 0.06);
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.route-analysis-table th,
.route-analysis-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}

.route-analysis-table tbody tr:last-child td {
    border-bottom: none;
}

.route-analysis-table tbody tr.route-analysis-best {
    background: rgba(37,99,235,0.08);
}

.route-analysis-note {
    margin-top: 16px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.7;
}

.route-analysis-note strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 14px;
}

.route-analysis-note div + div {
    margin-top: 6px;
}

.route-constraint-board {
    margin-top: 16px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.88));
    box-shadow: var(--shadow-sm);
}

.route-constraint-empty {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    color: var(--text-sub);
}

.route-constraint-empty i {
    font-size: 28px;
    color: var(--primary-color);
}

.route-constraint-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.route-constraint-card {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.08);
    background: rgba(255,255,255,0.76);
}

.route-constraint-card span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.route-constraint-card strong {
    display: block;
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.route-constraint-card small {
    color: var(--text-sub);
    line-height: 1.5;
}

.route-plan-list {
    display: grid;
    gap: 12px;
}

.route-plan-item {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255,255,255,0.82);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.route-plan-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.route-plan-item[data-active="true"] {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.12);
}

.route-plan-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.route-plan-title {
    display: grid;
    gap: 4px;
}

.route-plan-title strong {
    font-size: 15px;
    color: var(--text-main);
}

.route-plan-title span {
    font-size: 12px;
    color: var(--text-sub);
}

.route-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-dark);
}

.route-plan-badge[data-tone="risk"] {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.route-plan-badge[data-tone="warning"] {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.route-plan-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.route-plan-metric {
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.03);
}

.route-plan-metric span {
    display: block;
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.route-plan-metric strong {
    font-size: 15px;
    color: var(--text-main);
}

.route-plan-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.6;
}

.route-map-shell {
    display: grid;
    gap: 18px;
    align-content: start;
    padding: 18px;
}

.route-map-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.route-map-kicker {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.route-map-head strong {
    display: block;
    font-size: 18px;
}

.route-map-note {
    max-width: 240px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-sub);
    text-align: right;
}

.route-map-board {
    min-height: clamp(420px, 56vh, 680px);
}

.warehouse-card-main,
.warehouse-side-card {
    position: relative;
}

.warehouse-live-chip {
    margin-left: auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
}

.warehouse-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.warehouse-summary-card {
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(241,245,249,0.92));
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.warehouse-summary-card span,
.warehouse-sensor-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
}

.warehouse-summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
    line-height: 1.1;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

.warehouse-summary-card small {
    display: block;
    margin-top: 8px;
    color: var(--text-sub);
    line-height: 1.6;
}

.warehouse-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.warehouse-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
}

.warehouse-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.warehouse-dot-empty { background: #10b981; }
.warehouse-dot-partial { background: #f59e0b; }
.warehouse-dot-full { background: #ef4444; }

.warehouse-chart-shell {
    height: 250px;
}

.warehouse-sensor-shell {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.warehouse-sensor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.warehouse-sensor-card {
    padding: 16px;
    border-radius: 16px;
    text-align: center;
    background: var(--bg-body);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.warehouse-sensor-value {
    margin-top: 8px;
    font-size: 26px;
    font-weight: 800;
}

.warehouse-sensor-hot { color: #ef4444; }
.warehouse-sensor-cool { color: #3b82f6; }

.warehouse-sensor-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.06);
    color: var(--text-sub);
    line-height: 1.6;
}

.finance-header-actions {
    margin-left: auto;
}

.finance-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
    gap: 18px;
    margin-top: 30px;
    align-items: start;
}

.finance-table-shell {
    margin-top: 0 !important;
}

.finance-side-stack {
    display: grid;
    gap: 14px;
}

.finance-side-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(241,245,249,0.92));
    box-shadow: var(--shadow-sm);
}

.finance-side-kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.finance-side-card strong {
    display: block;
    font-size: 18px;
    line-height: 1.45;
    color: var(--text-main);
}

.finance-side-card small {
    display: block;
    margin-top: 8px;
    color: var(--text-sub);
    line-height: 1.6;
}

/* --- MODULE UPGRADE BOARDS --- */
.module-upgrade-board {
    margin-bottom: 18px;
}

.module-upgrade-shell {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92)),
        linear-gradient(135deg, rgba(37,99,235,0.05), rgba(16,185,129,0.04));
    box-shadow: var(--shadow-sm);
}

.module-upgrade-shell[data-tone="fleet"] {
    border-color: rgba(37, 99, 235, 0.2);
}

.module-upgrade-shell[data-tone="market"] {
    border-color: rgba(16, 185, 129, 0.18);
}

.module-upgrade-shell[data-tone="route"] {
    border-color: rgba(99, 102, 241, 0.18);
}

.module-upgrade-shell[data-tone="warehouse"] {
    border-color: rgba(245, 158, 11, 0.2);
}

.module-upgrade-shell[data-tone="finance"] {
    border-color: rgba(14, 165, 233, 0.2);
}

.module-upgrade-shell[data-tone="customer"] {
    border-color: rgba(168, 85, 247, 0.18);
}

.module-upgrade-shell[data-tone="epod"] {
    border-color: rgba(16, 185, 129, 0.2);
}

.module-upgrade-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.module-upgrade-kicker {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color);
}

.module-upgrade-head strong {
    display: block;
    font-size: 18px;
    color: var(--text-main);
}

.module-upgrade-head p {
    margin: 8px 0 0;
    color: var(--text-sub);
    line-height: 1.6;
    font-size: 13px;
}

.module-upgrade-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.module-upgrade-card,
.module-upgrade-item {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.84);
}

.module-upgrade-card {
    padding: 14px 16px;
}

.module-upgrade-card span,
.module-upgrade-item small,
.module-upgrade-item p {
    color: var(--text-sub);
}

.module-upgrade-card span {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.module-upgrade-card strong {
    display: block;
    font-size: 22px;
    color: var(--text-main);
}

.module-upgrade-card small {
    display: block;
    margin-top: 8px;
    line-height: 1.6;
}

.module-upgrade-list {
    display: grid;
    gap: 10px;
}

.module-upgrade-item {
    padding: 14px 16px;
    display: grid;
    gap: 10px;
}

.module-upgrade-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.module-upgrade-item strong {
    display: block;
    color: var(--text-main);
    line-height: 1.5;
}

.module-upgrade-item p {
    margin: 0;
    line-height: 1.7;
    font-size: 13px;
}

.module-upgrade-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.module-upgrade-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.module-upgrade-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 700;
}

.module-upgrade-empty {
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    background: var(--bg-card-soft);
    color: var(--text-sub);
    text-align: center;
    line-height: 1.7;
}

body.dark-mode .module-upgrade-shell,
body.dark-mode .module-upgrade-card,
body.dark-mode .module-upgrade-item,
body.dark-mode .module-upgrade-empty {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(71, 85, 105, 0.42);
}

body.dark-mode .module-upgrade-chip {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.18);
    color: var(--text-sub);
}

.alert-risk-box { background: linear-gradient(90deg, rgba(239,68,68,0.05) 0%, rgba(239,68,68,0) 100%); border-left: 4px solid var(--status-danger); border-radius: 8px; padding: 20px; margin-bottom: 24px; }
.risk-title { color: var(--status-danger); font-weight: 800; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }

.nut-chon-pa {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.nut-chon-pa:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.ghi-chu-thoi-gian {
    font-size: 11px;
    color: var(--text-sub);
    display: block;
    margin-top: 4px;
    font-style: italic;
}

/* NEW STYLES FOR DRIVER PANEL */
.panel-driver-action {
    margin-top: 20px;
    padding: 24px;
    background-color: var(--primary-light);
    border: 1px solid var(--primary-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    display: none; /* Initially hidden */
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.btn-driver-action {
    width: 100%; margin-top: 12px; padding: 14px; border-radius: 10px; font-weight: 700; cursor: pointer; border: none; transition: 0.2s;
}
.btn-select-route { background: var(--status-success); color: white; box-shadow: 0 4px 10px rgba(16,185,129,0.4); }
.btn-select-route:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(16,185,129,0.5); }
.btn-open-navigation { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: white; box-shadow: 0 4px 12px rgba(37,99,235,0.32); }
.btn-open-navigation:hover { transform: translateY(-2px); box-shadow: 0 10px 18px rgba(37,99,235,0.38); }
.btn-report-issue { background: var(--bg-card); color: var(--status-danger); border: 1px solid var(--status-danger); }
.btn-report-issue:hover { background: rgba(239,68,68,0.05); }

/* NEW: Footer System Monitor */
.footer-monitor {
    position: fixed; bottom: 0; left: 0; right: 0;
    min-height: 32px; height: auto; background: #0f172a; color: #94a3b8;
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 24px calc(8px + var(--sab)); font-family: 'JetBrains Mono', monospace; font-size: 11px;
    z-index: 9999; border-top: 1px solid #334155;
    letter-spacing: 0.5px; gap: 8px 18px; flex-wrap: wrap;
}
.mon-item { margin-right: 0; display: flex; align-items: center; gap: 8px; }
.mon-val { color: #10b981; font-weight: 700; }

/* === COMMERCIAL UPGRADE STYLES === */
.invoice-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 10000;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.invoice-paper {
    background: #fff; width: 850px; padding: 50px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    font-family: 'Times New Roman', serif;
    color: #000;
    position: relative;
    max-height: 95vh; overflow-y: auto;
    border-radius: 4px;
}
.invoice-header { text-align: center; margin-bottom: 40px; border-bottom: 2px solid #000; padding-bottom: 20px; }
.invoice-title { font-size: 28px; font-weight: bold; text-transform: uppercase; margin-bottom: 10px; color: #1a1a1a; }
.invoice-table { width: 100%; border-collapse: collapse; margin-top: 30px; }
.invoice-table th, .invoice-table td { border: 1px solid #000; padding: 10px 12px; text-align: left; font-size: 15px; }
.invoice-table th { background: #f5f5f5; font-weight: bold; text-align: center; color: #000; }
.print-btn {
    position: absolute; top: 30px; right: 30px;
    background: #2563eb; color: white; border: none; padding: 10px 24px;
    cursor: pointer; font-family: 'Inter', sans-serif; font-weight: bold;
    border-radius: 6px; box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}
.commercial-badge {
    position: absolute; top: 15px; left: 50px;
    background: linear-gradient(90deg, #FFD700, #DAA520);
    color: #000; padding: 6px 12px; font-weight: bold;
    font-size: 11px; border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-family: 'Inter', sans-serif; letter-spacing: 1px;
    transform: rotate(-5deg);
}

/* --- DATA INPUT HUB --- */
.nhap-lieu-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
    gap: 24px;
    align-items: start;
}
.nhap-lieu-card { min-height: 100%; }
.nhap-lieu-mo-ta {
    color: var(--text-sub);
    margin-bottom: 18px;
    font-size: 14px;
}
.nhap-lieu-toolbar,
.nhap-lieu-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.nhap-lieu-toolbar { margin-bottom: 18px; }
.nhap-lieu-footer { margin-top: 18px; }
.nhap-lieu-editor {
    width: 100%;
    min-height: 420px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    padding: 18px;
    resize: vertical;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
}
.nhap-lieu-editor:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.nhap-lieu-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.nhap-lieu-field label {
    display: block;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.nhap-lieu-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.nhap-lieu-stat {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
}
.nhap-lieu-stat span {
    display: block;
    color: var(--text-sub);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.nhap-lieu-stat strong {
    font-size: 24px;
    color: var(--text-main);
}
.nhap-lieu-preview {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}
.nhap-lieu-preview-item {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
}
.nhap-lieu-preview-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}
.nhap-lieu-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nhap-lieu-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
}
.nhap-lieu-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-sub);
    font-size: 13px;
}
.nhap-lieu-row:last-child { border-bottom: none; }
.nhap-lieu-row strong {
    color: var(--text-main);
    font-size: 12px;
}
.nhap-lieu-status {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.18);
    color: var(--text-main);
    font-size: 13px;
}
.nhap-lieu-empty {
    color: var(--text-sub);
    font-size: 13px;
}
.nhap-lieu-guide-grid,
.nhap-lieu-checklist {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}
.nhap-lieu-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.nhap-lieu-guide-card,
.nhap-lieu-check-card {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card-soft);
}
.nhap-lieu-guide-card strong,
.nhap-lieu-check-card strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 14px;
}
.nhap-lieu-guide-card p,
.nhap-lieu-check-card p {
    margin: 0;
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.7;
}
.nhap-lieu-guide-card code {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}
.nhap-lieu-download-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.nhap-lieu-side-note {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(16, 185, 129, 0.18);
    background: rgba(16, 185, 129, 0.08);
    color: var(--text-main);
    line-height: 1.7;
    font-size: 13px;
}
.nhap-lieu-side-note strong {
    display: block;
    margin-bottom: 6px;
}
.nhap-lieu-sheet-meta {
    margin-top: 12px;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.6;
}
body.dark-mode .nhap-lieu-guide-card,
body.dark-mode .nhap-lieu-check-card,
body.dark-mode .nhap-lieu-side-note {
    background: rgba(15, 23, 42, 0.86);
    border-color: rgba(71, 85, 105, 0.42);
}
body.dark-mode .nhap-lieu-guide-card code {
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
}

/* --- OPERATIONS DECK --- */
.ops-header-ribbon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 12px;
}
.ops-header-pill {
    min-width: 118px;
    padding: 9px 12px;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.65)),
        linear-gradient(135deg, rgba(37,99,235,0.08), rgba(14,165,233,0.12));
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.ops-header-pill span {
    display: block;
    color: var(--text-sub);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.ops-header-pill strong {
    display: block;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 800;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ops-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    border-radius: 28px;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 38%),
        radial-gradient(circle at 85% 20%, rgba(245, 158, 11, 0.24), transparent 32%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.28);
}
.ops-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255,255,255,0.06) 0%, transparent 30%, transparent 70%, rgba(255,255,255,0.04) 100%);
    pointer-events: none;
}
.ops-hero-main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 26px;
    align-items: start;
}
.ops-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.ops-hero-copy h2 {
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.05;
    color: #f8fafc;
    margin-bottom: 14px;
    max-width: 12ch;
}
.ops-hero-copy p {
    color: rgba(226, 232, 240, 0.88);
    max-width: 60ch;
    margin-bottom: 20px;
    font-size: 14px;
}
.ops-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.ops-quick-btn {
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.24);
}
.ops-quick-btn-secondary {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: none;
}
.ops-hero-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.ops-mini-stat {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
}
.ops-mini-stat span {
    display: block;
    color: rgba(226, 232, 240, 0.7);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.ops-mini-stat strong {
    color: #fff;
    font-size: 24px;
    font-family: 'JetBrains Mono', monospace;
}
.ops-hero-strip {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.ops-strip-card {
    border-radius: 18px;
    padding: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
}
.ops-strip-card span {
    display: block;
    color: rgba(226, 232, 240, 0.7);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
}
.ops-strip-card strong {
    color: #fff;
    font-size: 14px;
    word-break: break-word;
}
.fleet-telemetry-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.fleet-telemetry-card {
    padding: 18px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.72)),
        linear-gradient(135deg, rgba(14,165,233,0.08), rgba(37,99,235,0.1));
    border: 1px solid rgba(37, 99, 235, 0.12);
}
.fleet-telemetry-card span {
    display: block;
    color: var(--text-sub);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.fleet-telemetry-card strong {
    display: block;
    color: var(--text-main);
    font-size: 22px;
    margin-bottom: 8px;
}
.fleet-telemetry-card small {
    color: var(--text-sub);
    font-size: 12px;
}

.service-board {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 22px;
    background: var(--glass-bg);
    border: var(--glass-border);
    box-shadow: var(--shadow-sm);
    backdrop-filter: var(--glass-blur);
}

.service-board-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.service-board-kicker {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.service-board-head h3 {
    font-size: 20px;
    line-height: 1.2;
    color: var(--text-main);
}

.service-refresh-btn {
    white-space: nowrap;
}

.service-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.service-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.68));
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
}

.service-card[data-tone="online"] {
    border-color: rgba(16, 185, 129, 0.28);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(236, 253, 245, 0.76));
}

.service-card[data-tone="warning"] {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 251, 235, 0.8));
}

.service-card[data-tone="offline"] {
    border-color: rgba(239, 68, 68, 0.28);
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.98), rgba(254, 242, 242, 0.82));
}

.service-card[data-tone="neutral"] {
    border-color: rgba(148, 163, 184, 0.18);
}

.service-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.service-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 20px;
    line-height: 1.25;
}

.service-card small {
    display: block;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.5;
}

.ops-alert-center {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78)),
        linear-gradient(135deg, rgba(239,68,68,0.05), rgba(37,99,235,0.06));
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: var(--shadow-sm);
}

.ops-alert-caption {
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
}

.ops-alert-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.ops-alert-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 12px;
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255,255,255,0.78);
}

.ops-alert-item[data-level="critical"] {
    border-color: rgba(239, 68, 68, 0.22);
    background: linear-gradient(180deg, rgba(254,242,242,0.98), rgba(255,255,255,0.86));
}

.ops-alert-item[data-level="warning"] {
    border-color: rgba(245, 158, 11, 0.22);
    background: linear-gradient(180deg, rgba(255,251,235,0.98), rgba(255,255,255,0.86));
}

.ops-alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
}

.ops-alert-item[data-level="critical"] .ops-alert-icon {
    background: rgba(239, 68, 68, 0.12);
    color: var(--status-danger);
}

.ops-alert-item[data-level="warning"] .ops-alert-icon {
    background: rgba(245, 158, 11, 0.12);
    color: var(--status-warning);
}

.ops-alert-copy strong {
    display: block;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.ops-alert-copy span {
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.55;
}

.ops-alert-item time {
    color: var(--text-sub);
    font-size: 11px;
    white-space: nowrap;
    font-weight: 700;
}

.ops-alert-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-radius: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    color: var(--text-sub);
    background: rgba(255,255,255,0.6);
}

body.dark-mode .ops-header-pill {
    background:
        linear-gradient(180deg, rgba(30,41,59,0.95), rgba(15,23,42,0.9)),
        linear-gradient(135deg, rgba(37,99,235,0.18), rgba(14,165,233,0.14));
    border-color: rgba(148, 163, 184, 0.16);
}
body.dark-mode .fleet-telemetry-card {
    background:
        linear-gradient(180deg, rgba(30,41,59,0.95), rgba(15,23,42,0.88)),
        linear-gradient(135deg, rgba(14,165,233,0.12), rgba(37,99,235,0.14));
    border-color: rgba(148, 163, 184, 0.14);
}
body.dark-mode .service-card {
    background: linear-gradient(180deg, rgba(30,41,59,0.96), rgba(15,23,42,0.9));
    border-color: rgba(148, 163, 184, 0.16);
}
body.dark-mode .service-card[data-tone="online"] {
    border-color: rgba(16, 185, 129, 0.28);
    background: linear-gradient(180deg, rgba(6, 78, 59, 0.34), rgba(15, 23, 42, 0.92));
}
body.dark-mode .service-card[data-tone="warning"] {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.32), rgba(15, 23, 42, 0.92));
}
body.dark-mode .service-card[data-tone="offline"] {
    border-color: rgba(239, 68, 68, 0.28);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.34), rgba(15, 23, 42, 0.92));
}
body.dark-mode .ops-alert-center {
    background:
        linear-gradient(180deg, rgba(30,41,59,0.96), rgba(15,23,42,0.92)),
        linear-gradient(135deg, rgba(239,68,68,0.08), rgba(37,99,235,0.08));
    border-color: rgba(148, 163, 184, 0.16);
}
body.dark-mode .ops-alert-item,
body.dark-mode .ops-alert-empty {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.16);
}
body.dark-mode .ops-alert-item[data-level="critical"] {
    background: linear-gradient(180deg, rgba(127,29,29,0.30), rgba(15,23,42,0.92));
}
body.dark-mode .ops-alert-item[data-level="warning"] {
    background: linear-gradient(180deg, rgba(120,53,15,0.30), rgba(15,23,42,0.92));
}

@media (max-width: 1200px) {
    .nhap-lieu-grid { grid-template-columns: 1fr; }
    .nhap-lieu-guide-grid,
    .module-upgrade-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ops-header-ribbon { display: none; }
    .ops-hero-main {
        grid-template-columns: 1fr;
    }
    .ops-hero-strip,
    .fleet-telemetry-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .nhap-lieu-meta,
    .nhap-lieu-stats {
        grid-template-columns: 1fr;
    }
    .nhap-lieu-guide-grid,
    .module-upgrade-grid {
        grid-template-columns: 1fr;
    }
    .nhap-lieu-toolbar,
    .nhap-lieu-footer,
    .nhap-lieu-download-strip,
    .module-upgrade-head,
    .module-upgrade-item-footer {
        flex-direction: column;
    }
    .nhap-lieu-toolbar .nut-tac-vu,
    .nhap-lieu-footer .nut-tac-vu,
    .nhap-lieu-download-strip .nut-tac-vu {
        width: 100%;
    }
    .service-board {
        padding: 18px;
        border-radius: 18px;
    }
    .service-board-head {
        flex-direction: column;
        align-items: stretch;
    }
    .ops-hero {
        padding: 22px 18px;
        border-radius: 22px;
    }
    .ops-hero-side,
    .ops-hero-strip,
    .fleet-telemetry-panel,
    .ops-alert-list {
        grid-template-columns: 1fr;
    }
    .ops-hero-actions { flex-direction: column; }
    .ops-quick-btn { width: 100%; justify-content: center; }
    .ops-hero-copy h2 { max-width: none; }
    .nhap-lieu-editor { min-height: 300px; }
}

/* --- LAYOUT CLEANUP OVERRIDES --- */
.header-weather {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 600;
    background: rgba(37, 99, 235, 0.08);
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.music-player-mini,
.footer-monitor {
    display: none !important;
}

.nut-chat-thu-gon {
    width: 58px;
    height: 58px;
    right: 22px;
    bottom: 72px;
    font-size: 22px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
}

.khung-chat-thu-gon {
    width: min(410px, calc(100vw - 24px));
    height: min(690px, calc(100vh - 120px));
}

.thong-tin-user-meta {
    text-align: right;
    display: block !important;
}

.dashboard-toolbar {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px !important;
    margin-bottom: 18px !important;
}

.dashboard-toolbar .chon-thoi-gian {
    width: auto !important;
    min-width: 160px;
}

.dashboard-toolbar .nut-tac-vu {
    margin-left: auto;
}

.vehicle-class-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.fleet-action-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.8fr) repeat(2, minmax(170px, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
    align-items: center;
}

.route-layout {
    display: grid !important;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) !important;
    gap: 20px !important;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

#lotrinh > .the-du-lieu {
    display: block;
    width: 100%;
}

#lotrinh .route-layout {
    grid-template-columns: minmax(380px, 0.92fr) minmax(0, 1.4fr) !important;
}

#lotrinh .route-layout > *,
#lotrinh .route-control-stack,
#lotrinh .route-map-shell,
#lotrinh .route-result-shell,
#lotrinh .route-constraint-board {
    min-width: 0;
    width: 100%;
}

.alert-risk-box {
    padding: 16px 18px;
    border-radius: 16px;
}

.ops-header-ribbon {
    gap: 8px;
    margin-right: auto;
    flex-wrap: wrap;
}

.ops-header-pill {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 12px;
    box-shadow: none;
}

.ops-header-pill span { font-size: 9px; }
.ops-header-pill strong {
    font-size: 11px;
    max-width: 168px;
}

.ops-hero {
    margin-bottom: 18px;
    padding: 22px;
    border-radius: 22px;
}

.ops-hero-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
}

.ops-hero-copy h2 {
    font-size: clamp(24px, 2.4vw, 32px);
    max-width: 18ch;
    margin-bottom: 10px;
}

.ops-hero-copy p {
    margin-bottom: 0;
    max-width: 56ch;
}

.ops-hero-actions {
    justify-content: flex-end;
    align-items: stretch;
    gap: 10px;
}

.ops-quick-btn {
    padding: 11px 14px;
    border-radius: 12px;
    box-shadow: none;
}

.ops-hero-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.ops-strip-card {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
}

.ops-strip-card strong {
    font-size: 18px;
    line-height: 1.25;
}

.ops-strip-card small {
    display: block;
    color: rgba(226, 232, 240, 0.72);
    font-size: 11px;
    line-height: 1.45;
}

.fleet-telemetry-panel {
    gap: 12px;
    margin-bottom: 16px;
}

.fleet-telemetry-card {
    padding: 16px;
    border-radius: 16px;
    box-shadow: none;
}

@media (max-width: 1180px) {
    .ops-hero-main { grid-template-columns: 1fr; align-items: start; }
    .ops-hero-actions { justify-content: flex-start; }
    .service-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-hero-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fleet-action-grid,
    .route-layout { grid-template-columns: 1fr !important; }
    .vehicle-class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .finance-shell { grid-template-columns: 1fr; }
    .route-map-note { max-width: none; text-align: left; }
}

@media (max-width: 768px) {
    .header-weather,
    .thong-tin-user-meta {
        display: none !important;
    }
    .dashboard-toolbar .chon-thoi-gian,
    .dashboard-toolbar .nut-tac-vu {
        width: 100% !important;
        min-width: 0;
        margin-left: 0;
    }
    .vehicle-class-grid,
    .service-status-grid,
    .ops-hero-strip,
    .fleet-action-grid,
    .route-layout {
        grid-template-columns: 1fr !important;
    }
    .warehouse-summary-strip,
    .warehouse-sensor-grid,
    .route-selected-grid,
    .route-action-buttons,
    .finance-kpi-grid {
        grid-template-columns: 1fr !important;
    }
    .route-map-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .route-map-board {
        min-height: 420px;
    }
    .ops-header-ribbon {
        width: 100%;
        order: 3;
        margin-right: 0;
    }
    .ops-header-pill { flex: 1 1 120px; }
    .ops-hero { padding: 18px; }
    .ops-hero-actions {
        width: 100%;
        flex-direction: column;
    }
    .ops-strip-card {
        min-height: 0;
    }
    .nut-chat-thu-gon {
        width: 52px;
        height: 52px;
        right: 16px;
        bottom: 84px;
    }
    .route-planner-card,
    .route-map-shell,
    .route-result-shell,
    .warehouse-summary-card,
    .finance-side-card {
        padding: 16px;
    }
}
.service-card-interactive {
    cursor: pointer;
}
.service-card-interactive:hover {
    border-color: rgba(37, 99, 235, 0.22);
}

.camera-ai-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
    gap: 20px;
}

.camera-ai-stage-card,
.camera-ai-feed-card {
    min-height: 100%;
}

.camera-ai-stage {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.camera-ai-stage-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.camera-ai-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.camera-ai-stage-top h3 {
    font-size: 26px;
    line-height: 1.1;
    color: var(--text-main);
    margin-bottom: 8px;
}

.camera-ai-stage-top p {
    color: var(--text-sub);
    font-size: 14px;
    max-width: 56ch;
}

.camera-ai-state-badge {
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-sub);
}

.camera-ai-state-badge[data-state="online"] {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.camera-ai-state-badge[data-state="alert"] {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.camera-ai-screen {
    position: relative;
    min-height: 360px;
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(14,165,233,0.18), transparent 36%),
        radial-gradient(circle at bottom right, rgba(249,115,22,0.18), transparent 30%),
        linear-gradient(145deg, #0f172a, #1e293b);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.camera-ai-screen-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: 0.28;
}

.camera-ai-screen-overlay {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    gap: 16px;
}

.camera-ai-overlay-chip {
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.88);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.camera-ai-overlay-copy strong {
    display: block;
    font-size: 24px;
    color: #fff;
    margin-bottom: 8px;
}

.camera-ai-overlay-copy span {
    display: block;
    color: rgba(226, 232, 240, 0.85);
    font-size: 14px;
    line-height: 1.6;
    max-width: 60ch;
}

.camera-ai-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.camera-ai-metric,
.camera-ai-summary-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.68));
}

.camera-ai-metric span,
.camera-ai-summary-card span {
    display: block;
    color: var(--text-sub);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
}

.camera-ai-metric strong,
.camera-ai-summary-card strong {
    display: block;
    color: var(--text-main);
    font-size: 22px;
}

.camera-ai-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.camera-ai-feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.camera-ai-feed-item {
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255,255,255,0.7);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.camera-ai-feed-item:hover,
.camera-ai-feed-item.is-active {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(239, 246, 255, 0.88);
}

.camera-ai-feed-top,
.camera-ai-feed-foot,
.camera-ai-feed-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.camera-ai-feed-top {
    margin-bottom: 10px;
}

.camera-ai-feed-top strong {
    display: block;
    color: var(--text-main);
    font-size: 15px;
    margin-bottom: 4px;
}

.camera-ai-feed-top span,
.camera-ai-feed-foot span,
.camera-ai-feed-foot time,
.camera-ai-feed-meta span {
    color: var(--text-sub);
    font-size: 12px;
}

.camera-ai-feed-state {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px !important;
    font-weight: 800;
    white-space: nowrap;
    background: rgba(148, 163, 184, 0.14);
}

.camera-ai-feed-state[data-state="online"] {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.camera-ai-feed-state[data-state="alert"] {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.camera-ai-feed-meta {
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.camera-ai-feed-foot {
    margin-top: 10px;
}

body.dark-mode .camera-ai-metric,
body.dark-mode .camera-ai-summary-card,
body.dark-mode .camera-ai-feed-item {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.16);
}
body.dark-mode .camera-ai-feed-item.is-active {
    background: rgba(30, 41, 59, 0.92);
}

/* --- FLEET CONTROL CENTER --- */
.header-chinh {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(280px, 460px) auto;
    align-items: center;
    gap: 12px 16px;
    padding: 14px 20px;
}

.header-search {
    display: block;
    width: 100%;
    max-width: none;
}

.khu-vuc-tac-vu {
    flex-wrap: nowrap;
    gap: 10px;
}

.header-weather {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-header-ribbon {
    display: none !important;
}

.fleet-monitor-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.65fr);
    gap: 18px;
    margin-top: 24px;
    align-items: start;
}

.fleet-main-stack {
    display: grid;
    gap: 18px;
    align-content: start;
    min-width: 0;
}

.fleet-route-card {
    margin-top: 0;
}

.fleet-route-card strong {
    display: block;
    font-size: 18px;
    line-height: 1.45;
    color: var(--text-main);
}

.fleet-live-map {
    margin-top: 0 !important;
    min-height: clamp(360px, 50vh, 520px);
}

.fleet-monitor-sidebar {
    display: grid;
    gap: 16px;
    align-content: start;
}

.fleet-monitor-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.72));
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    padding: 18px;
}

.fleet-monitor-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 800;
}

.fleet-monitor-empty,
.fleet-monitor-alert {
    border-radius: 16px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.fleet-monitor-empty {
    background: rgba(248, 250, 252, 0.9);
    border: 1px dashed rgba(148, 163, 184, 0.24);
    color: var(--text-sub);
}

.fleet-monitor-alert {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 251, 235, 0.86);
    border: 1px solid rgba(245, 158, 11, 0.22);
}

.fleet-monitor-alert-critical {
    background: rgba(254, 242, 242, 0.9);
    border-color: rgba(239, 68, 68, 0.22);
}

.fleet-monitor-plate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.fleet-monitor-plate-row strong {
    display: block;
    font-size: 30px;
    line-height: 1;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 6px;
}

.fleet-monitor-plate-row span {
    color: var(--text-sub);
    font-size: 13px;
}

.fleet-monitor-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.fleet-monitor-metric {
    padding: 14px;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.fleet-monitor-metric span {
    display: block;
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.fleet-monitor-metric strong {
    color: var(--text-main);
    font-size: 18px;
}

.fleet-monitor-address {
    margin-top: 10px;
    color: var(--text-sub);
    line-height: 1.7;
}

.camera-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.camera-pill-online {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.camera-pill-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.2);
}

.camera-pill-alert {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.fleet-row-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fleet-route-progress {
    margin-top: 8px;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.9);
    overflow: hidden;
}

.fleet-route-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #10b981);
}

body.dark-mode .fleet-monitor-card,
body.dark-mode .fleet-monitor-metric {
    background: rgba(15, 23, 42, 0.84);
    border-color: rgba(148, 163, 184, 0.16);
}

body.dark-mode .fleet-monitor-empty {
    background: rgba(15, 23, 42, 0.84);
    border-color: rgba(148, 163, 184, 0.2);
}

body.dark-mode .fleet-monitor-alert {
    background: rgba(120, 53, 15, 0.22);
}

body.dark-mode .fleet-monitor-alert-critical {
    background: rgba(127, 29, 29, 0.28);
}

@media (max-width: 1180px) {
    .header-chinh {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .header-search {
        grid-column: 1 / -1;
        order: 3;
    }
    .fleet-monitor-shell,
    .camera-ai-layout {
        grid-template-columns: 1fr;
    }
    .camera-ai-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .header-chinh {
        grid-template-columns: 1fr auto;
        padding: 12px 14px;
        margin: 10px 14px;
    }
    .header-search {
        grid-column: 1 / -1;
    }
    .header-weather,
    .thong-tin-user-meta {
        display: none !important;
    }
    .fleet-monitor-metrics,
    .camera-ai-summary,
    .camera-ai-metrics {
        grid-template-columns: 1fr;
    }
    .fleet-row-actions {
        flex-direction: column;
    }
    .fleet-row-actions .nut-chon-pa {
        width: 100%;
    }
    .fleet-live-map {
        min-height: 340px;
    }
    .camera-ai-stage-top {
        flex-direction: column;
    }
    .camera-ai-screen {
        min-height: 280px;
    }
}

/* --- FLEET UX REFINEMENT --- */
.header-chinh {
    grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1fr) auto;
    margin: 14px 18px 0;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 26px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
}

.tieu-de-trang,
.header-search,
.khu-vuc-tac-vu {
    min-width: 0;
}

.khu-vuc-tac-vu {
    justify-self: end;
}

.thong-tin-user {
    flex-shrink: 0;
}

#hamdoi .the-du-lieu.fleet-board-card {
    display: grid;
    gap: 20px;
}

#hamdoi .the-du-lieu.fleet-board-card > .tieu-de-khoi {
    margin-bottom: 0;
}

.fleet-telemetry-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.fleet-telemetry-card {
    padding: 20px 20px 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.9));
}

.fleet-telemetry-card:nth-child(1) {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.92));
}

.fleet-telemetry-card:nth-child(2) {
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.92));
}

.fleet-telemetry-card:nth-child(3) {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.92));
}

.fleet-telemetry-card:nth-child(4) {
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.96), rgba(255, 255, 255, 0.92));
}

.fleet-telemetry-card span {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.fleet-telemetry-card strong {
    display: block;
    font-size: 22px;
    line-height: 1.15;
    color: var(--text-main);
}

.fleet-telemetry-card small {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-sub);
}

.fleet-toolbar {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    margin: 0 !important;
}

.fleet-search-input {
    min-height: 54px;
    border-radius: 18px;
    font-size: 16px;
    font-weight: 600;
}

.fleet-toolbar .nut-tac-vu,
.fleet-toolbar .nut-phu {
    min-height: 54px;
    border-radius: 18px;
    padding: 0 24px;
}

.fleet-workspace {
    display: grid;
    gap: 20px;
}

.fleet-table-wrap {
    margin: 0;
    border-radius: 22px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.fleet-table {
    min-width: 1080px;
}

.fleet-table thead th {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fleet-table td {
    vertical-align: middle;
}

#thanBangHamDoi tr[data-active="true"] {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.05));
}

#thanBangHamDoi tr[data-active="true"] td {
    background: transparent;
}

#thanBangHamDoi td strong {
    display: block;
    line-height: 1.55;
}

#thanBangHamDoi td .ghi-chu-thoi-gian {
    margin-top: 3px;
    font-style: normal;
    line-height: 1.5;
}

.fleet-monitor-shell {
    margin-top: 0;
}

.fleet-monitor-card strong {
    display: block;
}

.fleet-monitor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.fleet-monitor-actions .nut-chon-pa {
    flex: 1 1 140px;
}

#modalXe .hop-modal {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100dvh - 24px - var(--sab));
}

#modalXe .body-modal {
    padding: 28px;
}

#modalXe .grid-thong-tin {
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

#modalXe .driver-cam-container {
    min-height: clamp(180px, 28vh, 236px);
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.18), 0 18px 30px rgba(15, 23, 42, 0.12);
}

#modalXe .gt-modal {
    line-height: 1.5;
}

body.dark-mode .header-chinh {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .fleet-telemetry-card {
    background: rgba(15, 23, 42, 0.86);
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode #thanBangHamDoi tr[data-active="true"] {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.16), rgba(16, 185, 129, 0.1));
}

@media (max-width: 1180px) {
    .fleet-telemetry-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fleet-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fleet-toolbar > :first-child {
        grid-column: 1 / -1;
    }

    .fleet-monitor-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-chinh {
        margin: 0 0 12px;
        padding: 14px;
        border-radius: 0 0 22px 22px;
    }

    .fleet-telemetry-panel,
    .fleet-toolbar {
        grid-template-columns: 1fr;
    }

    .fleet-monitor-actions {
        flex-direction: column;
    }

    .fleet-monitor-actions .nut-chon-pa {
        width: 100%;
    }

    #modalXe .hop-modal {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 12px - var(--sab));
    }
}

/* --- SERVICE CENTER --- */
.service-board-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.service-center-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.72fr);
    gap: 24px;
    align-items: start;
}

.service-center-main,
.service-center-side {
    display: grid;
    gap: 20px;
}

.service-center-copy {
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.8;
}

.service-center-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.service-center-kpi {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.service-center-kpi span {
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-sub);
    margin-bottom: 10px;
}

.service-center-kpi strong {
    display: block;
    font-size: 24px;
    color: var(--text-main);
}

.service-center-kpi small {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-sub);
}

.service-center-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.service-center-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.service-mini-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(248, 250, 252, 0.92);
}

.service-mini-card span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.service-mini-card strong {
    display: block;
    font-size: 18px;
    color: var(--text-main);
}

.service-mini-card small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-sub);
}

.service-mini-card[data-tone="online"] {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255,255,255,0.9));
}

.service-mini-card[data-tone="warning"] {
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255,255,255,0.9));
}

.service-mini-card[data-tone="critical"] {
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(255,255,255,0.9));
}

.service-center-section,
.service-center-side-block {
    padding: 20px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.88);
}

.service-center-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.service-center-section-head span {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.service-center-section-head small {
    color: var(--text-sub);
}

.service-recommend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.service-recommend-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(248, 250, 252, 0.9);
    display: grid;
    gap: 12px;
}

.service-recommend-card[data-priority="critical"] {
    background: rgba(254, 242, 242, 0.94);
    border-color: rgba(239, 68, 68, 0.18);
}

.service-recommend-card[data-priority="warning"] {
    background: rgba(255, 247, 237, 0.94);
    border-color: rgba(245, 158, 11, 0.18);
}

.service-recommend-card p {
    margin: 0;
    color: var(--text-sub);
    line-height: 1.7;
    font-size: 14px;
}

.service-tone-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}

.service-tone-online {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.18);
}

.service-tone-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.18);
}

.service-tone-critical {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.18);
}

.service-tone-neutral {
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.16);
}

.service-center-table-wrap {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    overflow: auto;
    background: var(--bg-card);
}

.service-center-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.service-center-table th,
.service-center-table td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    vertical-align: middle;
}

.service-center-table th {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-sub);
    background: rgba(248, 250, 252, 0.9);
}

.service-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.service-incident-list,
.service-event-list {
    display: grid;
    gap: 14px;
}

.service-incident-item,
.service-event-item {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(248, 250, 252, 0.92);
    padding: 16px;
}

.service-incident-item[data-level="critical"] {
    background: rgba(254, 242, 242, 0.94);
}

.service-incident-item[data-level="warning"] {
    background: rgba(255, 247, 237, 0.94);
}

.service-incident-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.service-incident-item strong,
.service-event-item strong {
    display: block;
    color: var(--text-main);
}

.service-incident-item p,
.service-event-item p {
    margin: 8px 0 0;
    color: var(--text-sub);
    line-height: 1.7;
    font-size: 14px;
}

.service-event-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 12px;
}

.service-event-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-top: 4px;
    background: linear-gradient(180deg, #2563eb, #10b981);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.service-event-item[data-level="critical"] .service-event-dot {
    background: linear-gradient(180deg, #ef4444, #f97316);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.service-event-item[data-level="warning"] .service-event-dot {
    background: linear-gradient(180deg, #f59e0b, #fb923c);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.service-event-item small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-sub);
}

.service-empty-state {
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.22);
    background: rgba(248, 250, 252, 0.72);
    color: var(--text-sub);
    text-align: center;
}

body.dark-mode .service-center-kpi,
body.dark-mode .service-mini-card,
body.dark-mode .service-center-section,
body.dark-mode .service-center-side-block,
body.dark-mode .service-incident-item,
body.dark-mode .service-event-item {
    background: rgba(15, 23, 42, 0.84);
    border-color: rgba(148, 163, 184, 0.16);
}

body.dark-mode .service-center-table-wrap {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.16);
}

body.dark-mode .service-center-table th {
    background: rgba(15, 23, 42, 0.92);
}

@media (max-width: 1280px) {
    .service-center-grid {
        grid-template-columns: 1fr;
    }

    .service-center-summary,
    .service-center-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .service-board-actions,
    .service-center-toolbar,
    .service-table-actions {
        flex-direction: column;
    }

    .service-center-summary,
    .service-center-strip,
    .service-recommend-grid {
        grid-template-columns: 1fr;
    }

    .service-center-table {
        min-width: 760px;
    }
}

/* --- LIVE ROUTE DETAIL --- */
.fleet-monitor-address {
    white-space: pre-line;
}

.route-live-panel {
    margin-top: 0;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.92));
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.08);
    display: grid;
    gap: 16px;
}

.route-live-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.route-live-kicker {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.route-live-head strong {
    display: block;
    font-size: 24px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.route-live-head small {
    display: block;
    color: var(--text-sub);
    line-height: 1.6;
}

.route-live-state-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.route-live-state-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
}

.route-live-state-pill[data-state="moving"] {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

.route-live-state-pill[data-state="stopped"] {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.route-live-state-pill[data-state="waiting"] {
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
}

.route-live-speed {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

.route-live-address {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(248, 250, 252, 0.94);
    color: var(--text-main);
    line-height: 1.8;
    font-size: 14px;
}

.route-live-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.route-live-meta-card {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.86);
}

.route-live-meta-card span {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-sub);
}

.route-live-meta-card strong {
    display: block;
    color: var(--text-main);
    line-height: 1.6;
}

.route-live-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body.dark-mode .route-planner-card,
body.dark-mode .route-map-shell,
body.dark-mode .route-result-shell,
body.dark-mode .warehouse-summary-card,
body.dark-mode .warehouse-sensor-card,
body.dark-mode .finance-side-card,
body.dark-mode .financial-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.92), rgba(30,41,59,0.9));
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .route-selected-metric,
body.dark-mode .route-analysis-table-shell,
body.dark-mode .route-analysis-note,
body.dark-mode .warehouse-live-chip,
body.dark-mode .warehouse-legend-item,
body.dark-mode .warehouse-sensor-note {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .route-analysis-table thead th {
    background: rgba(37, 99, 235, 0.16);
    color: #bfdbfe;
}

body.dark-mode .route-selected-head,
body.dark-mode .route-support-chip {
    color: #bfdbfe;
}

body.dark-mode .route-support-chip {
    background: rgba(37, 99, 235, 0.18);
}

body.dark-mode .warehouse-live-chip,
body.dark-mode .warehouse-legend-item {
    color: var(--text-main);
}

body.dark-mode .route-live-panel,
body.dark-mode .route-live-address,
body.dark-mode .route-live-meta-card {
    background: rgba(15, 23, 42, 0.86);
    border-color: rgba(148, 163, 184, 0.16);
}

body.dark-mode .route-selected-stop-item,
body.dark-mode .route-selected-stop-empty,
body.dark-mode .route-constraint-board,
body.dark-mode .route-constraint-card,
body.dark-mode .route-plan-item,
body.dark-mode .route-plan-metric {
    background: rgba(15, 23, 42, 0.86);
    border-color: rgba(148, 163, 184, 0.16);
}

@media (max-width: 768px) {
    .route-live-head,
    .route-live-state-row,
    .route-live-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .route-live-meta-grid {
        grid-template-columns: 1fr;
    }

    .route-action-buttons,
    .route-constraint-grid,
    .route-plan-metrics {
        grid-template-columns: 1fr;
    }
}

/* --- RESPONSIVE OVERFLOW HARDENING --- */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
canvas,
iframe {
    max-width: 100%;
}

.sidebar,
.noi-dung-chinh,
.cuon-noi-dung,
.phan-module,
.the-du-lieu,
.bao-quanh-bang,
.khung-ban-do,
.fleet-workspace,
.fleet-monitor-shell,
.route-layout,
.camera-ai-layout,
.service-center-grid,
.service-center-main,
.service-center-side,
.finance-shell {
    min-width: 0;
    max-width: 100%;
}

.cuon-noi-dung {
    overflow-x: hidden;
}

.header-chinh {
    width: auto;
    max-width: calc(100% - 36px);
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr) auto;
}

.header-search,
.tieu-de-trang,
.khu-vuc-tac-vu,
.thong-tin-user,
.ops-header-ribbon,
.ops-hero-main,
.ops-hero-actions,
.service-board-actions,
.service-center-toolbar {
    min-width: 0;
}

.khu-vuc-tac-vu {
    flex-wrap: wrap;
    row-gap: 8px;
}

.bao-quanh-bang,
.fleet-table-wrap,
.service-center-table-wrap {
    max-width: 100%;
}

.bao-quanh-bang table {
    min-width: 680px;
}

.fleet-table {
    min-width: 960px;
}

.service-center-table {
    min-width: 840px;
}

.fleet-toolbar {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, max-content));
}

.khung-chat {
    width: min(396px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: min(660px, calc(100vh - 140px));
}

.toast {
    width: min(360px, calc(100vw - 20px));
    min-width: 0;
    max-width: calc(100vw - 20px);
}

.route-map-board,
.fleet-live-map {
    min-height: clamp(300px, 46vh, 680px);
}

.ops-header-pill,
.route-map-note,
.fleet-monitor-address,
.route-live-address,
.service-center-copy,
.service-incident-item p,
.service-event-item p,
.financial-card-value,
.fleet-telemetry-card strong,
.service-center-kpi strong,
.service-mini-card strong,
.route-live-head strong,
.ops-strip-card strong {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 1280px) {
    .header-chinh {
        max-width: calc(100% - 28px);
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .header-search {
        grid-column: 1 / -1;
        order: 3;
    }

    .ops-header-ribbon {
        width: 100%;
        order: 3;
        margin-right: 0;
    }

    .ops-header-pill {
        flex: 1 1 180px;
    }

    .fleet-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fleet-toolbar > :first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 992px) {
    .header-chinh {
        grid-template-columns: 1fr;
        max-width: calc(100% - 24px);
    }

    .khu-vuc-tac-vu {
        justify-content: space-between;
    }

    .chia-cot-2-1,
    .camera-ai-layout,
    .service-center-grid,
    .finance-shell,
    .route-layout,
    .fleet-monitor-shell {
        grid-template-columns: 1fr !important;
    }

    .fleet-telemetry-panel,
    .warehouse-summary-strip,
    .service-center-summary,
    .service-center-strip,
    .ops-hero-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        min-height: 100dvh;
        height: auto;
    }

    .header-chinh {
        margin: 0 0 12px;
        max-width: 100%;
        border-radius: 0 0 20px 20px;
    }

    .cuon-noi-dung {
        padding-left: 12px;
        padding-right: 12px;
    }

    .fleet-telemetry-panel,
    .warehouse-summary-strip,
    .warehouse-sensor-grid,
    .finance-kpi-grid,
    .route-selected-grid,
    .route-action-buttons,
    .camera-ai-summary,
    .camera-ai-metrics,
    .service-center-summary,
    .service-center-strip,
    .service-recommend-grid {
        grid-template-columns: 1fr !important;
    }

    .route-map-board,
    .fleet-live-map,
    .khung-ban-do {
        min-height: 280px;
        height: clamp(280px, 38vh, 360px);
    }

    .bao-quanh-bang table {
        min-width: 600px;
    }

    .fleet-table {
        min-width: 820px;
    }

    .service-center-table {
        min-width: 680px;
    }

    .ops-header-pill,
    .service-board-actions > *,
    .service-center-toolbar > * {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .the-du-lieu,
    .route-planner-card,
    .route-map-shell,
    .route-result-shell,
    .service-center-section,
    .service-center-side-block,
    .finance-side-card {
        padding: 16px;
    }

    th,
    td {
        padding: 12px 14px;
    }

    .hop-modal,
    #modalXe .hop-modal {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
    }

    #modalXe .body-modal {
        padding: 18px 16px 20px;
    }

    #modalXe .driver-cam-container {
        min-height: 170px;
    }

    .khung-chat {
        left: 5px;
        right: 5px;
        width: calc(100vw - 10px);
        max-width: calc(100vw - 10px);
    }
}

/* --- SERVICE & ROUTE REBALANCE --- */
.service-center-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.service-center-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.service-center-side-block {
    min-height: 100%;
}

@media (max-width: 1500px) {
    .header-chinh {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px 14px;
    }

    .header-search {
        grid-column: 1 / -1;
        order: 3;
    }

    #lotrinh .route-layout {
        grid-template-columns: 1fr !important;
    }

    #lotrinh .route-map-shell {
        gap: 14px;
    }

    #lotrinh .route-map-head {
        align-items: flex-start;
    }

    #lotrinh .route-map-note {
        max-width: none;
        text-align: left;
    }

    #lotrinh .route-map-board {
        min-height: clamp(340px, 44vh, 560px);
    }
}

@media (min-width: 1361px) {
    #lotrinh .route-layout {
        grid-template-columns: minmax(380px, 0.92fr) minmax(0, 1.4fr) !important;
    }
}

@media (max-width: 1360px) {
    #lotrinh .route-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 1200px) {
    .service-center-side {
        grid-template-columns: 1fr;
    }
}

/* --- BACKHAUL MARKETPLACE --- */
.ghep-support-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.ghep-support-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.ghep-summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.ghep-summary-card,
.ghep-recommend-board,
.ghep-market-item {
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.94);
    background: rgba(248, 250, 252, 0.98);
}

.ghep-summary-card {
    padding: 14px 16px;
}

.ghep-summary-card span,
.ghep-summary-card small,
.ghep-table-meta,
.ghep-market-item small,
.ghep-recommend-metric small {
    color: var(--text-sub);
}

.ghep-summary-card span,
.ghep-board-kicker {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.ghep-summary-card strong,
.ghep-recommend-top strong,
.ghep-market-item strong,
.ghep-recommend-metric strong {
    display: block;
    color: var(--text-main);
}

.ghep-summary-card strong {
    font-size: 22px;
}

.ghep-summary-card small {
    display: block;
    margin-top: 6px;
    line-height: 1.5;
}

.ghep-recommend-board {
    margin-top: 18px;
    padding: 18px;
}

.ghep-recommend-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.ghep-recommend-top p {
    margin: 8px 0 0;
    color: var(--text-sub);
    line-height: 1.6;
}

.ghep-score-badge,
.ghep-score-pill,
.ghep-source-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.ghep-score-badge {
    min-width: 74px;
    font-size: 14px;
}

.ghep-score-badge[data-tone="hot"],
.ghep-score-pill[data-tone="hot"] {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.ghep-score-badge[data-tone="warm"],
.ghep-score-pill[data-tone="warm"] {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.ghep-score-badge[data-tone="good"],
.ghep-score-pill[data-tone="good"] {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.ghep-score-badge[data-tone="neutral"],
.ghep-score-pill[data-tone="neutral"] {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

.ghep-source-pill {
    margin-top: 8px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-sub);
    border: 1px solid rgba(148, 163, 184, 0.26);
}

.ghep-recommend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.ghep-recommend-metric {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.ghep-recommend-metric span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.ghep-recommend-actions,
.ghep-table-actions {
    display: flex;
    gap: 8px;
}

.ghep-recommend-actions {
    margin-top: 16px;
    flex-wrap: wrap;
}

.ghep-market-board {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.ghep-market-item {
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ghep-market-item span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    margin-bottom: 5px;
}

.ghep-market-item strong {
    font-size: 15px;
    margin-bottom: 4px;
}

.ghep-market-item[data-tone="hot"] {
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(236, 253, 245, 0.9);
}

.ghep-market-item[data-tone="warm"] {
    border-color: rgba(245, 158, 11, 0.26);
    background: rgba(255, 251, 235, 0.9);
}

.ghep-market-item[data-tone="good"] {
    border-color: rgba(37, 99, 235, 0.24);
    background: rgba(239, 246, 255, 0.92);
}

.ghep-market-price {
    text-align: right;
}

.ghep-result-table {
    min-width: 980px;
}

#bangGhepXe tr[data-selected="true"] {
    background: rgba(37, 99, 235, 0.06);
}

.ghep-table-meta {
    display: block;
    margin-top: 4px;
    line-height: 1.5;
    font-size: 11px;
}

.ghep-table-actions {
    flex-direction: column;
    align-items: stretch;
}

.ghep-btn-secondary {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-dark);
    border: 1px solid rgba(96, 165, 250, 0.22);
}

.ghep-empty-state {
    padding: 18px;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.96);
    border: 1px dashed rgba(148, 163, 184, 0.4);
    color: var(--text-sub);
    text-align: center;
    line-height: 1.7;
}

body.dark-mode .ghep-support-chip,
body.dark-mode .ghep-summary-card,
body.dark-mode .ghep-recommend-board,
body.dark-mode .ghep-recommend-metric,
body.dark-mode .ghep-market-item,
body.dark-mode .ghep-empty-state {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(71, 85, 105, 0.42);
}

body.dark-mode .ghep-support-chip {
    color: #bfdbfe;
}

body.dark-mode .ghep-score-badge[data-tone="hot"],
body.dark-mode .ghep-score-pill[data-tone="hot"] {
    color: #6ee7b7;
}

body.dark-mode .ghep-score-badge[data-tone="warm"],
body.dark-mode .ghep-score-pill[data-tone="warm"] {
    color: #fcd34d;
}

body.dark-mode .ghep-score-badge[data-tone="good"],
body.dark-mode .ghep-score-pill[data-tone="good"] {
    color: #93c5fd;
}

body.dark-mode .ghep-score-badge[data-tone="neutral"],
body.dark-mode .ghep-score-pill[data-tone="neutral"] {
    color: #cbd5e1;
}

@media (max-width: 1200px) {
    .ghep-summary-strip,
    .ghep-recommend-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ghep-recommend-top,
    .ghep-market-item,
    .ghep-recommend-actions {
        flex-direction: column;
    }

    .ghep-market-price {
        text-align: left;
    }
}

@media (max-height: 820px) {
    #modalXe {
        padding-top: 8px;
        padding-bottom: calc(8px + var(--sab));
    }

    #modalXe .body-modal {
        padding: 20px 20px 22px;
    }

    #modalXe .driver-cam-container {
        min-height: 168px;
    }
}

/* --- PROFIT CONTROL --- */
.profit-control-board {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.88)),
        linear-gradient(135deg, rgba(16,185,129,0.06), rgba(37,99,235,0.05));
    border: 1px solid rgba(16, 185, 129, 0.16);
    box-shadow: var(--shadow-sm);
}

.profit-control-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.profit-control-kpi,
.profit-control-section,
.profit-decision-item,
.profit-trust-item {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255,255,255,0.84);
}

.profit-control-kpi {
    padding: 16px;
}

.profit-control-kpi span,
.profit-control-section-head span,
.profit-decision-metrics span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-sub);
}

.profit-control-kpi strong {
    display: block;
    margin-top: 10px;
    font-size: 24px;
    color: var(--text-main);
}

.profit-control-kpi small,
.profit-control-section-head small,
.profit-decision-item p,
.profit-trust-item p,
.profit-trust-item small {
    display: block;
    margin-top: 8px;
    color: var(--text-sub);
    line-height: 1.6;
}

.profit-control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
    gap: 16px;
}

.profit-control-section {
    padding: 16px;
}

.profit-control-section-head {
    margin-bottom: 12px;
}

.profit-decision-list,
.profit-trust-list {
    display: grid;
    gap: 12px;
}

.profit-decision-item,
.profit-trust-item {
    padding: 14px 16px;
}

.profit-decision-item[data-priority="critical"] {
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(254, 242, 242, 0.92);
}

.profit-decision-item[data-priority="warning"] {
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(255, 247, 237, 0.92);
}

.profit-decision-top,
.profit-trust-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.profit-decision-top span,
.profit-trust-head span {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 700;
}

.profit-decision-item strong,
.profit-trust-head strong {
    display: block;
    color: var(--text-main);
}

.profit-decision-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 12px 0;
}

.profit-decision-metrics span {
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
}

.profit-decision-metrics b {
    color: var(--text-main);
}

.profit-trust-item[data-tone="critical"] {
    border-color: rgba(239, 68, 68, 0.22);
}

.profit-trust-item[data-tone="warning"] {
    border-color: rgba(245, 158, 11, 0.22);
}

.profit-trust-item[data-tone="online"] {
    border-color: rgba(16, 185, 129, 0.22);
}

body.dark-mode .profit-control-board,
body.dark-mode .profit-control-kpi,
body.dark-mode .profit-control-section,
body.dark-mode .profit-decision-item,
body.dark-mode .profit-trust-item {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(71, 85, 105, 0.42);
}

body.dark-mode .profit-decision-item[data-priority="critical"] {
    background: rgba(127, 29, 29, 0.28);
}

body.dark-mode .profit-decision-item[data-priority="warning"] {
    background: rgba(120, 53, 15, 0.28);
}

body.dark-mode .profit-decision-metrics span {
    background: rgba(148, 163, 184, 0.12);
}

@media (max-width: 1200px) {
    .profit-control-kpi-grid,
    .profit-control-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .profit-control-kpi-grid,
    .profit-control-grid {
        grid-template-columns: 1fr;
    }

    .profit-decision-top,
    .profit-trust-head,
    .profit-decision-metrics {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- EPOD RUNTIME --- */
.epod-shell {
    display: grid;
    gap: 16px;
}

.epod-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.epod-verify-card {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.92);
}

.epod-qr-frame {
    display: grid;
    place-items: center;
    min-height: 160px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.epod-qr-frame img {
    width: 132px;
    height: 132px;
    object-fit: contain;
}

.epod-verify-copy strong {
    display: block;
    font-size: 20px;
    color: var(--text-main);
}

.epod-kicker {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    margin-bottom: 6px;
    font-weight: 700;
}

.epod-verify-copy p {
    margin: 8px 0 0;
    color: var(--text-sub);
    line-height: 1.6;
}

.epod-proof-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.epod-proof-card,
.epod-timeline-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.92);
}

.epod-proof-card span,
.epod-proof-card small,
.epod-timeline-item span,
.epod-timeline-item small {
    display: block;
    color: var(--text-sub);
}

.epod-proof-card span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 6px;
}

.epod-proof-card strong,
.epod-timeline-item strong {
    display: block;
    color: var(--text-main);
}

.epod-proof-card strong {
    font-size: 16px;
}

.epod-timeline {
    display: grid;
    gap: 10px;
}

.epod-timeline-item strong {
    margin-bottom: 4px;
}

.epod-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.dark-mode .epod-verify-card,
body.dark-mode .epod-proof-card,
body.dark-mode .epod-timeline-item {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(71, 85, 105, 0.42);
}

body.dark-mode .epod-qr-frame {
    background: rgba(255, 255, 255, 0.98);
}

@media (max-width: 768px) {
    .epod-toolbar,
    .epod-verify-card,
    .epod-proof-grid {
        grid-template-columns: 1fr;
    }

    .epod-actions {
        flex-direction: column;
    }
}

.login-account-samples {
    padding: 0;
    overflow: hidden;
}

.login-account-samples__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    cursor: pointer;
}

.login-account-samples__summary::-webkit-details-marker {
    display: none;
}

.login-account-samples__summary-text {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #94a3b8;
}

.login-account-samples__toggle::after {
    content: 'Mở nhanh';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    background: rgba(37, 99, 235, 0.12);
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.login-account-samples[open] .login-account-samples__toggle::after {
    content: 'Thu gọn';
}

.login-account-samples__body {
    padding: 0 14px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.login-account-samples__body .login-account-samples__grid {
    margin-top: 12px;
}

.login-sample-chip {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta-block {
    display: block !important;
    min-width: min(220px, 24vw);
    max-width: min(260px, 28vw);
    padding: 8px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
    text-align: left !important;
}

.user-meta-block[data-mode="driver"] {
    border-color: rgba(37, 99, 235, 0.22);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(224, 242, 254, 0.96));
}

.user-meta-block[data-mode="marketplace"] {
    border-color: rgba(245, 158, 11, 0.24);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(254, 243, 199, 0.96));
}

.user-meta-block__top,
.user-meta-block__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-meta-block__name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.2;
}

.user-meta-block__identity {
    min-width: 0;
}

.user-meta-block__handle {
    margin-top: 2px;
    font-size: 10px;
    color: var(--text-sub);
    font-family: 'JetBrains Mono', monospace;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #1e3a8a;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.user-access-scope {
    display: none;
}

.user-access-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.user-access-chip--muted {
    background: rgba(148, 163, 184, 0.14);
    color: #64748b;
}

.user-access-chip--tenant {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.user-access-chip--license {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.user-meta-block__footer {
    margin-top: 4px;
    padding-top: 0;
    align-items: center;
    flex-wrap: nowrap;
    font-size: 10px;
    color: var(--text-sub);
    border-top: 0;
}

.user-meta-block__footer > span:first-child {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta-block__footer #dongHo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .user-meta-block {
        min-width: 0;
        max-width: 220px;
    }

    .user-meta-block__footer {
        margin-top: 6px;
    }
}

/* --- APP CLEANUP 2026 --- */
.header-chinh {
    grid-template-columns: minmax(240px, 1fr) minmax(200px, 300px) auto;
    align-items: center;
    padding: 12px 16px;
    gap: 10px 12px;
}

.khu-vuc-tac-vu {
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

#headerSyncPill {
    max-width: 210px;
    min-height: 40px;
    margin-right: 4px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thong-tin-user {
    gap: 10px;
    align-items: center;
    margin-left: 4px;
    min-width: 0;
}

.anh-dai-dien {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 15px;
}

.driver-mode-bar {
    gap: 8px;
    padding: 10px 12px;
    border-radius: 18px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.driver-mode-summary {
    align-items: flex-start;
}

.driver-mode-summary strong {
    font-size: 15px;
    margin-top: 4px;
}

.driver-mode-summary small {
    font-size: 12px;
    line-height: 1.4;
}

.driver-mode-kicker {
    padding: 4px 9px;
}

.driver-mode-metrics {
    gap: 6px;
}

.driver-mode-metric {
    padding: 9px 10px;
    border-radius: 14px;
}

.driver-mode-metric strong {
    font-size: 13px;
}

.driver-mode-actions {
    gap: 6px;
}

.driver-quick-btn {
    min-height: 40px;
    border-radius: 14px;
    padding: 0 10px;
    font-size: 12px;
}

.driver-quick-btn--ghost {
    min-width: 128px;
}

@media (min-width: 1180px) {
    .driver-mode-bar {
        grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.95fr);
        grid-template-areas:
            "summary actions"
            "metrics actions";
        align-items: start;
        column-gap: 12px;
    }

    .driver-mode-summary {
        grid-area: summary;
    }

    .driver-mode-metrics {
        grid-area: metrics;
    }

    .driver-mode-actions {
        grid-area: actions;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
    }
}

@media (max-width: 1280px) {
    #headerSyncPill {
        max-width: 180px;
    }
}

@media (max-width: 992px) {
    #headerSyncPill {
        max-width: none;
        width: 100%;
        margin-right: 0 !important;
    }
}

@media (max-width: 768px) {
    .login-account-samples__summary {
        padding: 12px;
    }

    .login-account-samples__body {
        padding: 0 12px 12px;
    }
}

/* --- LOGIN REFRESH 2026 --- */
#congDangNhap {
    --login-accent: #38bdf8;
    --login-accent-strong: #0f766e;
    --login-warm: #f59e0b;
    --login-ink: #0f172a;
    --login-muted: #475569;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 2vw, 24px);
    overflow: auto;
    background:
        radial-gradient(circle at 10% 14%, rgba(56, 189, 248, 0.18), transparent 24%),
        radial-gradient(circle at 86% 12%, rgba(245, 158, 11, 0.14), transparent 18%),
        radial-gradient(circle at 50% 110%, rgba(20, 184, 166, 0.16), transparent 28%),
        linear-gradient(145deg, #08111c 0%, #0d2032 45%, #14293d 100%);
    font-family: "Aptos", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
}

#congDangNhap::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 78%);
    opacity: 0.32;
    pointer-events: none;
}

#matrixBg {
    opacity: 0.04;
    filter: saturate(0.62) blur(1.3px);
    mix-blend-mode: screen;
}

.login-ambient {
    position: absolute;
    width: 28vw;
    height: 28vw;
    border-radius: 999px;
    filter: blur(100px);
    opacity: 0.14;
    z-index: 1;
    pointer-events: none;
}

.login-ambient--blue {
    top: -8vw;
    right: 6vw;
    background: rgba(14, 165, 233, 0.45);
}

.login-ambient--amber {
    bottom: -14vw;
    left: 8vw;
    background: rgba(245, 158, 11, 0.28);
}

.login-shell {
    position: relative;
    z-index: 2;
    width: min(930px, 100%);
    margin: auto;
    display: grid;
    grid-template-columns: minmax(258px, 0.76fr) minmax(392px, 1fr);
    gap: 18px;
    align-items: center;
}

.login-shell::before {
    content: '';
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: calc(31% + 9px);
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(125, 211, 252, 0.22), rgba(245, 158, 11, 0.18), transparent);
    pointer-events: none;
    opacity: 0.9;
}

.login-showcase,
#congDangNhap .hop-login {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 28px;
    box-shadow: 0 30px 60px rgba(2, 6, 23, 0.28);
}

.login-showcase {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    min-height: 0;
    padding: clamp(20px, 2.6vw, 28px);
    background:
        linear-gradient(165deg, rgba(10, 30, 49, 0.98) 0%, rgba(9, 22, 38, 0.98) 52%, rgba(7, 15, 26, 0.98) 100%);
    box-shadow:
        0 28px 56px rgba(2, 6, 23, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-showcase::before,
#congDangNhap .hop-login::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-showcase::before {
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.1), transparent 24%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 26%);
}

.login-showcase::after {
    content: '';
    position: absolute;
    right: -52px;
    bottom: -58px;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(56, 189, 248, 0.28), rgba(56, 189, 248, 0.04) 55%, transparent 72%);
    filter: blur(14px);
    pointer-events: none;
}

#congDangNhap .hop-login {
    width: auto;
    margin: 0;
    padding: clamp(20px, 2.5vw, 28px);
    text-align: left;
    background:
        linear-gradient(180deg, rgba(255, 251, 245, 0.98) 0%, rgba(246, 240, 229, 0.98) 100%);
    border-color: rgba(222, 212, 196, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow:
        0 30px 60px rgba(4, 12, 26, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

#congDangNhap .hop-login::before {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 22%),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.1), transparent 24%);
}

#congDangNhap .hop-login::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.78) 0%, rgba(15, 118, 110, 0.7) 52%, rgba(245, 158, 11, 0.7) 100%);
    opacity: 0.85;
}

.login-showcase__brand,
.login-form-head,
.login-role-rail {
    position: relative;
    z-index: 1;
}

.login-showcase__brand {
    display: grid;
    gap: 12px;
    max-width: 320px;
}

.login-role-rail {
    display: grid;
    gap: 10px;
}

.login-value-grid,
.login-platform-note {
    display: none;
}

#congDangNhap .logo-login {
    position: relative;
    width: clamp(76px, 8vw, 94px);
    height: clamp(76px, 8vw, 94px);
    margin: 0;
    animation: none;
    padding: 7px;
    border-radius: 24px;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(191, 219, 254, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 22px 36px rgba(2, 6, 23, 0.18);
}

#congDangNhap .logo-login::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(245, 158, 11, 0.08));
    filter: blur(18px);
    opacity: 0.6;
    z-index: -1;
}

#congDangNhap .logo-login img {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 16px 28px rgba(2, 6, 23, 0.24);
}

.login-kicker,
.login-form-head__eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.login-kicker {
    color: #fde68a;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(253, 224, 71, 0.2);
}

.login-form-head {
    display: grid;
    gap: 9px;
    margin-bottom: 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.55);
}

.login-form-head__eyebrow {
    color: #0f4c81;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(245, 158, 11, 0.12));
    border: 1px solid rgba(56, 189, 248, 0.18);
}

#congDangNhap .tieu-de-login {
    margin: 0;
    font-family: "Aptos Display", "Segoe UI Variable Display", "Franklin Gothic Medium", sans-serif;
    font-size: clamp(30px, 3.3vw, 42px);
    line-height: 0.96;
    letter-spacing: -0.055em;
    color: #f8fafc;
    text-shadow: 0 14px 30px rgba(2, 6, 23, 0.22);
}

#congDangNhap .mo-ta-login {
    margin: 0;
    color: rgba(226, 232, 240, 0.8);
    font-size: 12px;
    line-height: 1.55;
    font-weight: 400;
    max-width: 22rem;
}

.login-role-pill {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 11px 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.login-role-pill::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.8), transparent 88%);
}

.login-role-pill:nth-child(2)::before {
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.8), transparent 88%);
}

.login-role-pill:nth-child(3)::before {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.8), transparent 88%);
}

.login-role-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(125, 211, 252, 0.2);
}

.login-role-pill i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.24), rgba(59, 130, 246, 0.1));
    color: #e0f2fe;
    font-size: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-role-pill:nth-child(2) i {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.24), rgba(56, 189, 248, 0.08));
}

.login-role-pill:nth-child(3) i {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(251, 191, 36, 0.08));
}

.login-role-pill strong {
    display: block;
    color: #f8fafc;
    font-size: 12px;
}

.login-role-pill small {
    display: block;
    margin-top: 2px;
    color: rgba(191, 219, 254, 0.74);
    font-size: 10px;
    line-height: 1.35;
}

.login-form-head__title {
    color: var(--login-ink);
    font-family: "Aptos Display", "Segoe UI Variable Display", "Franklin Gothic Medium", sans-serif;
    font-size: clamp(25px, 2.8vw, 31px);
    line-height: 1.04;
    letter-spacing: -0.05em;
}

.login-form-head__subtitle {
    color: var(--login-muted);
    font-size: 12px;
    line-height: 1.5;
}

#congDangNhap .nhom-form {
    margin-bottom: 12px;
}

#congDangNhap .nhan-form {
    display: inline-block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 800;
}

.login-input-shell {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid rgba(203, 213, 225, 0.92);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        0 8px 16px rgba(15, 23, 42, 0.04);
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.login-input-shell i {
    color: #7c8ca0;
    font-size: 15px;
    transition: color 0.22s ease;
}

.login-input-shell:focus-within {
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow:
        0 0 0 4px rgba(56, 189, 248, 0.12),
        0 16px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.login-input-shell:focus-within i {
    color: var(--login-accent-strong);
}

#congDangNhap .input-form {
    padding: 0;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    color: var(--login-ink);
}

#congDangNhap .input-form:focus {
    box-shadow: none;
    background: transparent;
}

#congDangNhap .input-form::placeholder {
    color: #94a3b8;
}

#congDangNhap .nut-dang-nhap {
    position: relative;
    overflow: hidden;
    min-height: 46px;
    margin-top: 6px;
    border-radius: 16px;
    font-size: 12px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #1456a4 0%, #0f766e 58%, #0b8ab5 100%);
    color: #f8fafc;
    box-shadow:
        0 16px 28px rgba(15, 76, 129, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#congDangNhap .nut-dang-nhap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.18) 36%, transparent 60%);
    transform: translateX(-130%);
    transition: transform 0.5s ease;
}

#congDangNhap .nut-dang-nhap:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 32px rgba(15, 76, 129, 0.24);
}

#congDangNhap .nut-dang-nhap:hover::before {
    transform: translateX(130%);
}

#congDangNhap .nut-dang-nhap--secondary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(241, 245, 249, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: var(--login-ink);
    box-shadow: none;
}

#congDangNhap .nut-dang-nhap--secondary:hover {
    background: linear-gradient(180deg, rgba(226, 232, 240, 0.72), rgba(240, 249, 255, 0.94));
    box-shadow: none;
}

#congDangNhap .nut-dang-nhap--ghost {
    background: transparent;
    border: 1px dashed rgba(148, 163, 184, 0.48);
    color: #475569;
    box-shadow: none;
}

.login-divider-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0 4px;
}

.login-divider-row::before {
    content: '';
    position: absolute;
    inset: 50% 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.42), transparent);
}

#loginDivider {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0 12px;
    background: rgba(252, 249, 243, 0.98);
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

#congDangNhap .login-account-samples {
    margin-top: 10px;
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.8);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(247, 250, 252, 0.72));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

#congDangNhap .login-account-samples__summary,
#congDangNhap .login-account-samples__body {
    padding-left: 16px;
    padding-right: 16px;
}

#congDangNhap .login-account-samples__summary {
    align-items: center;
    padding-top: 14px;
    padding-bottom: 14px;
}

#congDangNhap .login-account-samples__title {
    margin-bottom: 2px;
    color: var(--login-ink);
    font-size: 13px;
    font-weight: 800;
}

#congDangNhap .login-account-samples__summary-text,
#congDangNhap .login-account-samples__hint {
    color: #64748b;
}

#congDangNhap .login-account-samples__toggle::after {
    border-color: rgba(15, 118, 110, 0.16);
    background: rgba(15, 118, 110, 0.08);
    color: #115e59;
}

#congDangNhap .login-sample-chip {
    min-height: 40px;
    border-radius: 13px;
    border: 1px solid rgba(186, 230, 253, 0.76);
    background: linear-gradient(180deg, rgba(240, 249, 255, 0.98), rgba(224, 242, 254, 0.92));
    color: var(--login-ink);
    box-shadow: 0 8px 14px rgba(56, 189, 248, 0.08);
}

#congDangNhap .login-sample-chip:hover {
    background: linear-gradient(180deg, rgba(224, 242, 254, 0.98), rgba(186, 230, 253, 0.92));
    border-color: rgba(14, 165, 233, 0.34);
    transform: translateY(-1px);
}

#congDangNhap .login-status-stack {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.login-inline-status,
.login-helper-note,
.login-error-note {
    margin: 0;
    padding: 9px 11px;
    border-radius: 14px;
    font-size: 10px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.login-inline-status,
.login-helper-note {
    border: 1px solid rgba(203, 213, 225, 0.88);
    background: rgba(255, 255, 255, 0.64);
    color: #475569;
}

.login-error-note {
    display: none;
    border: 1px solid rgba(248, 113, 113, 0.28);
    background: rgba(254, 226, 226, 0.78);
    color: #b91c1c;
    font-weight: 700;
}

@media (max-width: 920px) {
    #congDangNhap {
        padding: 12px;
        overflow: auto;
    }

    .login-shell::before {
        display: none;
    }

    .login-shell {
        display: flex;
        flex-direction: column;
        width: min(620px, 100%);
        gap: 12px;
    }

    #congDangNhap .hop-login {
        order: 1;
        width: 100%;
        padding: 20px;
    }

    .login-showcase {
        order: 2;
        padding: 18px;
    }

    .login-role-rail {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .login-role-rail::-webkit-scrollbar {
        display: none;
    }

    .login-role-pill {
        min-width: 210px;
        flex: 0 0 210px;
    }

    #congDangNhap .mo-ta-login,
    .login-form-head__subtitle {
        display: none;
    }

    .login-inline-status,
    .login-helper-note,
    .login-error-note {
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 620px) {
    #congDangNhap::before {
        opacity: 0.18;
    }

    .login-kicker,
    .login-form-head__eyebrow {
        font-size: 10px;
        letter-spacing: 0.1em;
    }

    #congDangNhap .tieu-de-login {
        font-size: 28px;
    }

    .login-form-head__title {
        font-size: 22px;
    }

    #congDangNhap .logo-login {
        width: 70px;
        height: 70px;
        padding: 6px;
        border-radius: 18px;
    }

    .login-input-shell {
        min-height: 48px;
        padding: 0 14px;
    }

    #congDangNhap .nut-dang-nhap {
        min-height: 46px;
        font-size: 12px;
    }

    #congDangNhap .login-account-samples__summary-text,
    .login-helper-note {
        display: none;
    }

    #congDangNhap .login-account-samples__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #congDangNhap {
        align-items: flex-start;
        justify-content: center;
        padding:
            max(12px, calc(var(--sat) + 12px))
            max(12px, calc(var(--sar) + 12px))
            max(14px, calc(var(--sab) + 14px))
            max(12px, calc(var(--sal) + 12px));
        overscroll-behavior: contain;
    }

    #matrixBg {
        opacity: 0.07;
        filter: saturate(0.7) blur(1px);
    }

    .login-ambient {
        width: 52vw;
        height: 52vw;
        filter: blur(76px);
        opacity: 0.2;
    }

    .login-ambient--blue {
        top: -10vw;
        right: -6vw;
    }

    .login-ambient--amber {
        left: -8vw;
        bottom: -10vw;
    }

    .login-shell {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
        max-width: 470px;
        min-height: auto;
        margin: 0 auto;
    }

    .login-shell::before {
        display: none;
    }

    .login-showcase {
        display: grid !important;
        gap: 14px;
        min-height: auto;
        padding: 16px;
        border-radius: 24px;
    }

    .login-showcase__brand {
        max-width: none;
        gap: 10px;
    }

    .login-role-rail {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 2px 2px 4px;
        margin: 0 -2px;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .login-role-rail::-webkit-scrollbar {
        display: none;
    }

    .login-role-pill {
        flex: 0 0 194px;
        min-width: 194px;
        scroll-snap-align: start;
    }

    #congDangNhap .hop-login {
        width: 100%;
        min-height: auto;
        justify-content: flex-start;
        padding: 18px 16px 16px;
        border-radius: 24px;
        box-shadow:
            0 24px 48px rgba(4, 12, 26, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.82);
    }

    #congDangNhap .hop-login::after {
        height: 3px;
    }

    .login-form-head {
        gap: 8px;
        margin-bottom: 8px;
        padding-bottom: 12px;
    }

    .login-form-head__eyebrow {
        padding: 8px 12px;
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .login-form-head__title {
        font-size: clamp(26px, 8vw, 34px);
        line-height: 1.02;
        text-wrap: balance;
    }

    .login-form-head__subtitle {
        display: block;
        font-size: 13px;
        line-height: 1.45;
        max-width: none;
    }

    #congDangNhap .logo-login {
        width: 68px;
        height: 68px;
        padding: 6px;
        border-radius: 18px;
    }

    #congDangNhap .tieu-de-login {
        font-size: clamp(26px, 8vw, 34px);
    }

    #congDangNhap .mo-ta-login {
        max-width: none;
        font-size: 12px;
    }

    #congDangNhap .nhom-form {
        margin-bottom: 14px;
    }

    #congDangNhap .nhan-form {
        margin-bottom: 9px;
        font-size: 11px;
        letter-spacing: 0.14em;
    }

    .login-input-shell {
        min-height: 58px;
        gap: 14px;
        padding: 0 18px;
        border-radius: 20px;
    }

    .login-input-shell i {
        font-size: 17px;
    }

    #congDangNhap .input-form {
        font-size: 16px;
    }

    #congDangNhap .nut-dang-nhap {
        min-height: 54px;
        margin-top: 8px;
        border-radius: 18px;
        font-size: 13px;
        letter-spacing: 0.06em;
    }

    .login-divider-row {
        margin: 10px 0 6px;
    }

    #loginDivider {
        font-size: 12px;
    }

    #congDangNhap .login-account-samples {
        margin-top: 12px;
        border-radius: 20px;
    }

    #congDangNhap .login-account-samples__summary,
    #congDangNhap .login-account-samples__body {
        padding-left: 15px;
        padding-right: 15px;
    }

    #congDangNhap .login-account-samples__summary {
        gap: 10px;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    #congDangNhap .login-account-samples__title {
        font-size: 14px;
    }

    #congDangNhap .login-account-samples__summary-text {
        display: none;
    }

    #congDangNhap .login-account-samples__toggle::after {
        padding: 8px 12px;
        font-size: 12px;
    }

    #congDangNhap .login-account-samples__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    #congDangNhap .login-sample-chip {
        min-height: 44px;
        font-size: 13px;
    }

    #congDangNhap .login-status-stack {
        gap: 8px;
        margin-top: 12px;
    }

    .login-inline-status,
    .login-helper-note,
    .login-error-note {
        padding: 11px 13px;
        border-radius: 16px;
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .login-helper-note {
        display: none;
    }
}

@media (max-width: 480px) {
    #congDangNhap {
        padding:
            max(8px, calc(var(--sat) + 8px))
            max(8px, calc(var(--sar) + 8px))
            max(8px, calc(var(--sab) + 8px))
            max(8px, calc(var(--sal) + 8px));
    }

    .login-shell {
        gap: 10px;
        max-width: 100%;
        min-height: auto;
    }

    .login-showcase {
        padding: 14px;
        border-radius: 22px;
        gap: 12px;
    }

    .login-role-rail {
        gap: 8px;
    }

    .login-role-pill {
        flex-basis: 176px;
        min-width: 176px;
    }

    #congDangNhap .hop-login {
        min-height: auto;
        padding: 15px 14px 14px;
        border-radius: 22px;
    }

    .login-form-head {
        padding-bottom: 10px;
    }

    .login-form-head__eyebrow {
        font-size: 10px;
    }

    .login-form-head__title {
        font-size: clamp(22px, 8.6vw, 30px);
    }

    .login-form-head__subtitle {
        display: block;
        font-size: 12px;
    }

    .login-input-shell {
        min-height: 54px;
        padding: 0 16px;
        border-radius: 18px;
    }

    #congDangNhap .nut-dang-nhap {
        min-height: 52px;
        font-size: 12px;
    }

    #congDangNhap .mo-ta-login {
        font-size: 11px;
    }

    #congDangNhap .login-account-samples__grid {
        grid-template-columns: 1fr;
    }

    .login-inline-status,
    .login-helper-note,
    .login-error-note {
        font-size: 11px;
    }
}

@media (max-height: 780px) and (min-width: 921px) {
    #congDangNhap {
        padding: 10px 16px;
    }

    .login-showcase {
        padding: 16px 18px;
        gap: 12px;
    }

    #congDangNhap .hop-login {
        padding: 16px 18px;
    }

    .login-shell::before {
        top: 8%;
        bottom: 8%;
    }

    #congDangNhap .logo-login {
        width: 68px;
        height: 68px;
        padding: 6px;
    }

    #congDangNhap .mo-ta-login,
    .login-form-head__subtitle {
        display: none;
    }

    .login-role-pill small,
    .login-inline-status,
    .login-helper-note {
        display: none;
    }
}
